This repository has been archived by the owner on Mar 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpayload.py
80 lines (70 loc) · 2.04 KB
/
payload.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
from __main__ import myprint
import importlib
from inputer import pll as payloadlist
payload = False
def flist():
for pld in payloadlist:
print(pld)
def finfo(query=False):
if query:
query = query[0]
if query not in payloadlist:
myprint('Нагрузка не найдена!', error=True)
return
module = importlib.import_module('payloads.'+query)
print('-'*80)
print(module.__doc__)
print('-'*80)
else:
print('-'*80)
print(payload.__doc__)
print('-'*80)
fshow()
def fshow():
if not payload:
myprint('Не выбрана нагрузка!', error=True)
return
if 'varlist' not in payload.__dir__():
print('Нагрузка не содержит переменных!')
return
kw = max([len(str(i)) for i in payload.varlist.keys()])
vw = max([len(str(i)) for i in payload.varlist.values()])
print('┌', '─'*kw, '┬', '─'*vw, '┐', sep='')
for k, v in payload.varlist.items():
print(('│{:'+str(kw)+'}│{:'+str(vw)+'}│{}').format(k, v, payload.descr[k]))
print('└', '─'*kw, '┴', '─'*vw, '┘', sep='')
def fuse(query):
global payload
query = query[0]
if query not in payloadlist:
myprint('Нагрузка не найдена!', error=True)
return
payload = importlib.import_module('payloads.'+query)
print('Нагрузка успешно подключена')
print(payload.__doc__)
fshow()
def fset(var, *vals):
if not payload:
myprint('Не выбрана нагрузка!', error=True)
return
if var not in payload.varlist:
myprint('Переменная не найдена!', error=True)
return
if len(vals) == 1:
if vals[0].isdigit():
payload.varlist[var] = int(vals[0])
else:
payload.varlist[var] = vals[0]
else:
payload.varlist[var] = vals
print('Переменная', var, 'успешно установлена.')
def fstart():
if not payload:
myprint('Не выбрана нагрузка!', error=True)
return
try:
payload.start()
except KeyboardInterrupt:
myprint('Payload has stoped!', error=True)
#except Exception as e:
# myprint(e, error=True)