forked from laudarch/Shellsploit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshellsploit.py
More file actions
191 lines (159 loc) · 5.4 KB
/
Copy pathshellsploit.py
File metadata and controls
191 lines (159 loc) · 5.4 KB
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
191
#!/usr/bin/env python
#------------------Bombermans Team---------------------------------#
#Author : B3mB4m
#Concat : [email protected]
#Project : https://github.com/b3mb4m/Shellsploit
#LICENSE : https://github.com/b3mb4m/Shellsploit/blob/master/LICENSE
#------------------------------------------------------------------#
import sys
import os
name = os.sep.join([x for x in os.getcwd().split(os.sep) if x != os.getcwd().split(os.sep)[-1]])
sys.path.append(name)
if sys.version_info.major == 3:
raw_input = input
from .control import *
from .core.logo.logo import banner
#from .core.logo.counter import * #- Will be improved(buggy)
#Dynamic counter for shellcodes,injectors etc..
from .core.Comp import tab
shellcodeModules = {
"linux86":
["binsh_spawn","read","exec","chmod","tcp_bind","reverse_tcp","download&exec"],
"linux64":
["read","binsh_spawn","tcp_bind","reverse_tcp"],
"linux":
["binsh_spawn","tcp_bind","reverse_tcp","read"],
"osx86":
["tcp_bind","binsh_spawn","reverse_tcp"],
"osx64":
["reverse_tcp","tcp_bind","binsh_spawn"],
"FreeBSDx86":
["binsh_spawn","reverse_tcp2","reverse_tcp","read","exec","tcp_bind"],
"FreeBSDx64":
["binsh_spawn","tcp_bind","reverse_tcp","exec"],
"linux_arm":
["binsh_spawn","chmod","reverse_tcp","exec"],
"linux_mips":
["binsh_spawn","chmod","reverse_tcp","tcp_bind"],
"windows":
["messagebox","download&execute","exec", "reverse_tcp", "tcp_bind"],
"solarisx86":
["binsh_spawn","read","reverse_tcp","tcp_bind"],
"injectors":
["Linux86/ptrace","Linux64/ptrace","Windowsx86/tLsInjectorDLL",
"Windowsx86/CodecaveInjector","Windows/Dllinjector",
#Dllinjector is still passive.
],
"backdoors":
["linux86/reverse_tcp","linux64/reverse_tcp","osx86/reverse_tcp",
"unix/python/reverse_tcp","unix/perl/reverse_tcp",
"unix/bash/reverse_tcp","unix/ruby/reverse_tcp"]
}
tab.start(1)
#db = B3mB4mLogo().start()
def start():
print (banner( "49", "12", "2", "4"))
shellsploit()
def shellsploit():
try:
bash = bcolors.OKBLUE + bcolors.UNDERLINE + "ssf" + bcolors.ENDC
bash += bcolors.OKBLUE + " > "+ bcolors.ENDC
terminal = raw_input(bash)
if terminal[:4] == "help":
from .core.help import mainhelp
mainhelp()
shellsploit()
elif terminal[:14] == "show backdoors":
from .core.backdoors import backdoorlist
backdoorlist()
shellsploit()
elif terminal[:2] == "os":
from .core.commands import oscommand
oscommand( terminal[3:])
shellsploit()
elif terminal[:6] == "banner":
print (banner( "47", "12", "2", "4"))
shellsploit()
elif terminal[:3] == "use":
all_sc_modules = []
for platforms in shellcodeModules.keys():
for shellcodeType in shellcodeModules[platforms]:
all_sc_modules.append("{}/{}".format(platforms,shellcodeType))
if terminal.split()[1] in all_sc_modules:
for shellcode in all_sc_modules:
if terminal.split()[1] == shellcode:
B3mB4m().control(shellcode)
shellsploit()
else:
print ("\nModule not avaible !\n")
shellsploit()
elif terminal[:14] == "show injectors":
from .core.lists import injectorlist
injectorlist()
shellsploit()
elif terminal[:5] == "clear":
from .core.commands import clean
clean()
shellsploit()
elif terminal[:12] == "show modules":
from .core.shellcodes import shellcodelist
shellcodelist()
shellsploit()
elif terminal[:4] == "exit":
sys.exit("\nThanks for using shellsploit !\n")
else:
if terminal == "":
shellsploit()
else:
print (bcolors.RED + bcolors.BOLD + "[-] Unknown command: %s" % terminal + bcolors.ENDC)
shellsploit()
except(KeyboardInterrupt):
print("\n[*] (Ctrl + C ) Detected, Trying To Exit ...")
from sys import exit
sys.exit()
def main():
import optparse
parser = optparse.OptionParser()
parser.add_option('-p', '--payload', action="store")
parser.add_option('-e', '--encoder', action="store", default="False")
parser.add_option('-o', '--output', action="store", default=True)
parser.add_option('-l','--list', action="store", default=True)
parser.add_option('-n','--nc', action="store", default=True)
parser.add_option('--host', action="store")
parser.add_option('--port', action="store")
(options, args) = parser.parse_args()
if options.list == "backdoors":
from .core.backdoors import backdoorlist
backdoorlist( require=False)
sys.exit()
if options.list == "encoders":
from .core.backdoors import encoderlist
encoderlist( require=False)
sys.exit()
elif options.nc == "netcat" or options.nc == "nc":
from .Session.netcat import nc
if options.port:
nc( PORT)
else:
nc()
sys.exit()
else:
if options.payload:
if options.host and options.port:
from .core.backdoors import backdoorlist
from .core.backdoors import encoderlist
if options.payload in backdoorlist( require=True):
from .Session.generator import process
if "py" in options.encoder and "python" not in options.payload:
sys.exit("\nThis encoder can not use with that payload\n")
if options.output:
process( options.payload, options.host, options.port, options.encoder, options.output)
else:
process( options.payload, options.host, options.port, options.encoder,True)
#Default, file will be create with random name.
else:
sys.exit("\npython shellsploit -p PAYLOAD -e ENCODER --host IP --port P0RT\n")
else:
sys.exit("\npython shellsploit -p PAYLOAD -e ENCODER --host IP --port P0RT\n")
else:
start()