Skip to content

Commit 03abc32

Browse files
committed
docs: add comment for Pocket.py
1 parent 1cff92f commit 03abc32

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

lib/Pocket.py

+27
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,29 @@ def __init__(self):
3636

3737
@with_category(CMD_CORE)
3838
def do_banner(self, args):
39+
"""Print WebPocket banner"""
3940
ascii_text = text2art("WebPocket", "rand")
4041
self.poutput("\n\n")
4142
self.poutput(ascii_text, '\n\n', color=Fore.LIGHTCYAN_EX)
4243
self.poutput("{art} WebPocket has {count} modules".format(art=art("inlove"), count=self.get_module_count()), "\n\n", color=Fore.MAGENTA)
4344

4445
@with_category(CMD_MODULE)
4546
def do_list(self, args):
47+
"""List all modules"""
4648
local_modules = module.get_local_modules()
4749
self._print_modules(local_modules, "Module List:")
4850

4951
@with_category(CMD_MODULE)
5052
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+
"""
5162
search_conditions = args.split(" ")
5263
db_conditions = {}
5364
for condition in search_conditions:
@@ -83,6 +94,7 @@ def complete_set(self, text, line, begidx, endidx):
8394
@with_argparser(set_parser)
8495
@with_category(CMD_MODULE)
8596
def do_set(self, args):
97+
"""Set module option value/ set program config"""
8698
if args.name == 'debug':
8799
self.debug = args.value
88100
return None
@@ -113,6 +125,7 @@ def complete_use(self, text, line, begidx, endidx):
113125

114126
@with_category(CMD_MODULE)
115127
def do_use(self, module_name, module_reload=False):
128+
"""Chose a module"""
116129
module_file = module.name_convert(module_name)
117130
module_type = module_name.split("/")[0]
118131

@@ -129,6 +142,7 @@ def do_use(self, module_name, module_reload=False):
129142

130143
@with_category(CMD_MODULE)
131144
def do_back(self, args):
145+
"""Clear module that chose"""
132146
self.module_name = None
133147
self.module_instance = None
134148
self.prompt = self.console_prompt + self.console_prompt_end
@@ -142,6 +156,14 @@ def complete_show(self, text, line, begidx, endidx):
142156

143157
@with_category(CMD_MODULE)
144158
def do_show(self, content):
159+
"""
160+
Display module information
161+
162+
Eg:
163+
show info
164+
show options
165+
show missing
166+
"""
145167
if not self.module_instance:
146168
raise ModuleNotUseException()
147169

@@ -196,6 +218,7 @@ def do_show(self, content):
196218

197219
@with_category(CMD_MODULE)
198220
def do_run(self, args):
221+
"""alias to exploit"""
199222
self.do_exploit(args=args)
200223

201224
def exploit_thread(self, target, target_type, thread_queue):
@@ -225,6 +248,7 @@ def exploit_thread(self, target, target_type, thread_queue):
225248

226249
@with_category(CMD_MODULE)
227250
def do_exploit(self, args):
251+
"""Execute module exploit"""
228252
if not self.module_instance:
229253
raise ModuleNotUseException()
230254

@@ -331,6 +355,7 @@ def check_thread(self, target, target_type, thread_queue):
331355

332356
@with_category(CMD_MODULE)
333357
def do_check(self, args):
358+
"""Execute module check"""
334359
if not self.module_instance:
335360
raise ModuleNotUseException()
336361

@@ -419,11 +444,13 @@ def do_check(self, args):
419444

420445
@with_category(CMD_CORE)
421446
def do_db_rebuild(self, args):
447+
"""Rebuild database for search"""
422448
self.db_rebuild()
423449
self.poutput("Database rebuild done.", color=Fore.GREEN)
424450

425451
@with_category(CMD_MODULE)
426452
def do_reload(self, args):
453+
"""reload the chose module"""
427454
self.do_use(self.module_name, module_reload=True)
428455

429456
def set_prompt(self, module_type, module_name):

0 commit comments

Comments
 (0)