@@ -36,18 +36,29 @@ def __init__(self):
36
36
37
37
@with_category (CMD_CORE )
38
38
def do_banner (self , args ):
39
+ """Print WebPocket banner"""
39
40
ascii_text = text2art ("WebPocket" , "rand" )
40
41
self .poutput ("\n \n " )
41
42
self .poutput (ascii_text , '\n \n ' , color = Fore .LIGHTCYAN_EX )
42
43
self .poutput ("{art} WebPocket has {count} modules" .format (art = art ("inlove" ), count = self .get_module_count ()), "\n \n " , color = Fore .MAGENTA )
43
44
44
45
@with_category (CMD_MODULE )
45
46
def do_list (self , args ):
47
+ """List all modules"""
46
48
local_modules = module .get_local_modules ()
47
49
self ._print_modules (local_modules , "Module List:" )
48
50
49
51
@with_category (CMD_MODULE )
50
52
def do_search (self , args ):
53
+ """
54
+ Search modules
55
+
56
+ Support fields:
57
+ name, module_name, description, author, disclosure_date, service_name, service_version, check
58
+ Eg:
59
+ search redis
60
+ search service_name=phpcms service_version=9.6.0
61
+ """
51
62
search_conditions = args .split (" " )
52
63
db_conditions = {}
53
64
for condition in search_conditions :
@@ -83,6 +94,7 @@ def complete_set(self, text, line, begidx, endidx):
83
94
@with_argparser (set_parser )
84
95
@with_category (CMD_MODULE )
85
96
def do_set (self , args ):
97
+ """Set module option value/ set program config"""
86
98
if args .name == 'debug' :
87
99
self .debug = args .value
88
100
return None
@@ -113,6 +125,7 @@ def complete_use(self, text, line, begidx, endidx):
113
125
114
126
@with_category (CMD_MODULE )
115
127
def do_use (self , module_name , module_reload = False ):
128
+ """Chose a module"""
116
129
module_file = module .name_convert (module_name )
117
130
module_type = module_name .split ("/" )[0 ]
118
131
@@ -129,6 +142,7 @@ def do_use(self, module_name, module_reload=False):
129
142
130
143
@with_category (CMD_MODULE )
131
144
def do_back (self , args ):
145
+ """Clear module that chose"""
132
146
self .module_name = None
133
147
self .module_instance = None
134
148
self .prompt = self .console_prompt + self .console_prompt_end
@@ -142,6 +156,14 @@ def complete_show(self, text, line, begidx, endidx):
142
156
143
157
@with_category (CMD_MODULE )
144
158
def do_show (self , content ):
159
+ """
160
+ Display module information
161
+
162
+ Eg:
163
+ show info
164
+ show options
165
+ show missing
166
+ """
145
167
if not self .module_instance :
146
168
raise ModuleNotUseException ()
147
169
@@ -196,6 +218,7 @@ def do_show(self, content):
196
218
197
219
@with_category (CMD_MODULE )
198
220
def do_run (self , args ):
221
+ """alias to exploit"""
199
222
self .do_exploit (args = args )
200
223
201
224
def exploit_thread (self , target , target_type , thread_queue ):
@@ -225,6 +248,7 @@ def exploit_thread(self, target, target_type, thread_queue):
225
248
226
249
@with_category (CMD_MODULE )
227
250
def do_exploit (self , args ):
251
+ """Execute module exploit"""
228
252
if not self .module_instance :
229
253
raise ModuleNotUseException ()
230
254
@@ -331,6 +355,7 @@ def check_thread(self, target, target_type, thread_queue):
331
355
332
356
@with_category (CMD_MODULE )
333
357
def do_check (self , args ):
358
+ """Execute module check"""
334
359
if not self .module_instance :
335
360
raise ModuleNotUseException ()
336
361
@@ -419,11 +444,13 @@ def do_check(self, args):
419
444
420
445
@with_category (CMD_CORE )
421
446
def do_db_rebuild (self , args ):
447
+ """Rebuild database for search"""
422
448
self .db_rebuild ()
423
449
self .poutput ("Database rebuild done." , color = Fore .GREEN )
424
450
425
451
@with_category (CMD_MODULE )
426
452
def do_reload (self , args ):
453
+ """reload the chose module"""
427
454
self .do_use (self .module_name , module_reload = True )
428
455
429
456
def set_prompt (self , module_type , module_name ):
0 commit comments