-
Notifications
You must be signed in to change notification settings - Fork 0
/
FrameworkBrowse.py
115 lines (93 loc) · 2.79 KB
/
FrameworkBrowse.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
#import dependencies
import os
from urllib.request import urlopen
from subprocess import run
from subprocess import CREATE_NO_WINDOW as HIDDEN
from time import sleep as wait
from datetime import datetime
#initialize required variables
terminate = False
error = False
to_exec = ''
tmp_arg_txt = ''
args = []
#define all functions before running main method
def terminate_hard():
terminate = True
def parse_cmd(cmd):
global to_exec
global args
tmp_reading_switch = False
tmp_reading_cmd = True
cmd = cmd+' '
args = []
tmp_arg_txt = ''
to_exec = ''
tmp_reading_switch = False
tmp_reading_cmd = True
for letter in cmd:
if tmp_reading_cmd:
if letter==' ':
tmp_reading_cmd = False
continue
else:
to_exec = to_exec+letter
if tmp_reading_switch:
if letter==' ':
tmp_reading_switch = False
args.append(tmp_arg_txt)
tmp_arg_txt=''
continue
else:
tmp_arg_txt = tmp_arg_txt + letter
continue
if not tmp_reading_switch:
if letter == '-':
tmp_reading_switch = True
continue
if letter==' ':
continue
project_names = []
project_paths = []
for root, directory, files in os.walk(os.getcwd()):
for file in files:
if '.' in file:
if '.exe' in file or '.bat' in file or '.py' in file:
project_names.append(file)
project_paths.append(os.path.join(root, file))
passwords = []
flags = []
files = [f for f in os.listdir('.') if os.path.isfile(f)]
for file in files:
if '#' in file:
flags.append(file.replace('#', ''))
print('Initiating command line.')
debug = 'debug' in flags
with open('wordlist_url', 'r') as url:
cont_raw = urlopen(url.read().strip())
for item in cont_raw:
passwords.append(item.decode().strip())
print('CLI Initiated.')
if debug:
print('~'*30+'DEBUG'+'~'*30)
print(f'Passwords retrieved: {len(passwords)}')
with open('wordlist_url', 'r') as url:
print(f'Wordlist URL: {url.read()}')
print(f'Operating system: {os.name.upper()}')
print(f"Time: {datetime.now().isoformat(sep=' ')}")
if os.name == 'nt':
print(run('tasklist', capture_output=True, creationflags=HIDDEN).stdout.decode())
else:
print('POSIX OS not supported')
input()
terminate_hard()
print('='*25+'FRAMEWORK v1.0'+'='*25)
try:
while True:
if terminate:
raise SystemExit
cmd = input()
parse_cmd(cmd)
match
except:
pass