-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathmouse
259 lines (236 loc) · 9.13 KB
/
mouse
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
#!/usr/bin/env python3
# ---------------------------------------------------
# Mouse Framework
# ---------------------------------------------------
# Copyright (C) <2019-2020> <Entynetproject>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
os.system("printf '\033]2;Mouse Framework\a'")
import core.server as server
import core.helper as h
import sys
import platform
import time
def show_graphic():
print(h.WHITE+"-"*20)
print("")
print(h.GREEN_THIN+" 1"+h.ENDC+") Start listener")
print(h.GREEN_THIN+" 2"+h.ENDC+") MultiHandler")
print(h.GREEN_THIN+" 3"+h.ENDC+") Create payload")
print(h.GREEN_THIN+" 4"+h.ENDC+") Update Mouse")
print(h.GREEN_THIN+" 5"+h.ENDC+") Exit Mouse")
print("")
class mouse:
def __init__(self):
h.generate_keys()
self.server = server.Server()
if len(sys.argv) == 2 and sys.argv[1] == "debug":
self.server.debug = True
else:
self.server.debug = False
self.payloads = self.import_payloads()
self.banner_text = h.ENDC+"""
_ __,..---""-._ ';-,
, _/_),-"` '-. `\\\\
\|.-"` -_) '. ||
/` a , \ .'/
'.___,__/ .-' \_ _.-'.'
|\ \ \ /` _`------`_.-'
_/;--._, > | --.__/ `------`
(((-' __//`'-......-;\ )
(((-' __// '--. /
(((-' __//
(((-'
"""+h.WHITE+"Mouse Framework"+h.GREEN_THIN+" v6.0"+h.WHITE+"\n"+h.ENDC
# Actions
def print_payload(self,payload,number_option):
print(h.GREEN_THIN+" " + str(number_option) +h.ENDC+") "+ payload.name)
def start_single_server(self):
os.system("clear")
print(h.ENDC+"""
_ __,..---""-._ ';-,
, _/_),-"` '-. `\\\\
\|.-"` -_) '. ||
/` a , \ .'/
'.___,__/ .-' \_ _.-'.'
|\ \ \ /` _`------`_.-'
_/;--._, > | --.__/ `------`
(((-' __//`'-......-;\ )
(((-' __// '--. /
(((-' __//
(((-'
"""+h.WHITE+"Mouse Framework"+h.GREEN_THIN+" v6.0"+h.WHITE+""+h.ENDC)
print(h.WHITE+"-"*20)
print("")
if not self.server.set_host_port():
return
self.server.start_single_handler()
def start_multi_handler(self):
os.system("clear")
print(h.ENDC+"""
_ __,..---""-._ ';-,
, _/_),-"` '-. `\\\\
\|.-"` -_) '. ||
/` a , \ .'/
'.___,__/ .-' \_ _.-'.'
|\ \ \ /` _`------`_.-'
_/;--._, > | --.__/ `------`
(((-' __//`'-......-;\ )
(((-' __// '--. /
(((-' __//
(((-'
"""+h.WHITE+"Mouse Framework"+h.GREEN_THIN+" v6.0"+h.WHITE+""+h.ENDC)
print(h.WHITE+"-"*20)
print("")
if not self.server.set_host_port():
return
self.server.start_multi_handler()
def prompt_run_server(self):
if os.path.exists(".nopayload"):
os.system("rm .nopayload")
return
else:
if input(h.WW+"[?]"+h.WHITE+" Start listener? (y/n): "+h.ENDC).strip(" ") == "y":
if input(h.WW+"[?]"+h.WHITE+" MultiHandler? (y/n): "+h.ENDC).strip(" ") == "y":
self.server.start_multi_handler()
else:
self.server.start_single_handler()
else:
return
def import_payloads(self):
path = "core/payloads"
sys.path.append(path)
modules = dict()
for mod in os.listdir(path):
if mod == '__init__.py' or mod[-3:] != '.py':
continue
else:
m = __import__(mod[:-3]).payload()
modules[m.name] = m
return modules
def exit_menu(self):
os.system("clear")
print(h.ENDC+"""
_ __,..---""-._ ';-,
, _/_),-"` '-. `\\\\
\|.-"` -_) '. ||
/` a , \ .'/
'.___,__/ .-' \_ _.-'.'
|\ \ \ /` _`------`_.-'
_/;--._, > | --.__/ `------`
(((-' __//`'-......-;\ )
(((-' __// '--. /
(((-' __//
(((-'
"""+h.WHITE+"Mouse Framework"+h.GREEN_THIN+" v6.0"+h.WHITE+""+h.ENDC)
print(h.WHITE+"-"*20)
print("")
exit()
def update_mouse(self):
os.system("clear")
print(h.ENDC+"""
_ __,..---""-._ ';-,
, _/_),-"` '-. `\\\\
\|.-"` -_) '. ||
/` a , \ .'/
'.___,__/ .-' \_ _.-'.'
|\ \ \ /` _`------`_.-'
_/;--._, > | --.__/ `------`
(((-' __//`'-......-;\ )
(((-' __// '--. /
(((-' __//
(((-'
"""+h.WHITE+"Mouse Framework"+h.GREEN_THIN+" v6.0"+h.WHITE+""+h.ENDC)
print(h.WHITE+"-"*20)
print("")
os.system("chmod +x etc/update.sh && etc/update.sh")
input("Press enter to continue...").strip(" ")
def choose_payload(self):
os.system("clear")
print(h.ENDC+"""
_ __,..---""-._ ';-,
, _/_),-"` '-. `\\\\
\|.-"` -_) '. ||
/` a , \ .'/
'.___,__/ .-' \_ _.-'.'
|\ \ \ /` _`------`_.-'
_/;--._, > | --.__/ `------`
(((-' __//`'-......-;\ )
(((-' __// '--. /
(((-' __//
(((-'
"""+h.WHITE+"Mouse Framework"+h.GREEN_THIN+" v6.0"+h.WHITE+""+h.ENDC)
print(h.WHITE+"-"*20)
print("")
number_option = 1
for key in self.payloads:
payload = self.payloads[key]
self.print_payload(payload,number_option)
number_option += 1
print("")
while 1:
try:
# choose payload
option = input(h.info_general_raw("Mouse payload: ")).strip(" ")
if not option:
continue
selected_payload = self.payloads[list(self.payloads.keys())[int(option) - 1]]
# set host and port
self.server.set_host_port()
# generate payload
selected_payload.run(self.server)
#run
self.prompt_run_server()
break
except KeyboardInterrupt:
break
except Exception as e:
h.info_error(e)
input("Press enter to continue...").strip(" ")
break
def menu(self,err=""):
while 1:
try:
h.clear()
if err:
h.info_error(err)
if self.server.debug:
print("Debug Mode: on")
sys.stdout.write(self.banner_text)
show_graphic()
option = input(h.NES).strip(" ")
choose = {
"1" : self.start_single_server,
"2" : self.start_multi_handler,
"3" : self.choose_payload,
"4" : self.update_mouse,
"5" : self.exit_menu
}
try:
choose[option]()
self.menu()
except KeyError:
if option:
self.menu()
else:
self.menu()
except KeyboardInterrupt:
continue
# TODO: quit socket listener
except KeyboardInterrupt:
exit()
if __name__ == "__main__":
mouse = mouse()
mouse.menu()