Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.

Commit 4d24161

Browse files
committed
Add help command to CLI
Resolves #25
1 parent b6336e4 commit 4d24161

File tree

3 files changed

+82
-1
lines changed

3 files changed

+82
-1
lines changed

data/json/commands.json

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"data": [
3+
{
4+
"cmd": "back",
5+
"desc": "Change the context of the session back to it was before loading the current module."
6+
},
7+
{
8+
"cmd": "check",
9+
"desc": "Check if the currently loaded module can be used against the specified target."
10+
},
11+
{
12+
"cmd": "clear",
13+
"desc": "Clear the screen."
14+
},
15+
{
16+
"cmd": "gset [option] [value]",
17+
"desc": "Set the [value] of [option] globally, so it is used by the current and future modules."
18+
},
19+
{
20+
"cmd": "gunset [option]",
21+
"desc": "Unset a global [option] set with the gset command."
22+
},
23+
{
24+
"cmd": "help",
25+
"desc": "Shows this information."
26+
},
27+
{
28+
"cmd": "info",
29+
"desc": "Display information about the currently loaded module."
30+
},
31+
{
32+
"cmd": "quit",
33+
"desc": "Exit the WordPress Exploit Framework prompt."
34+
},
35+
{
36+
"cmd": "run",
37+
"desc": "Run the currently loaded module."
38+
},
39+
{
40+
"cmd": "set [option] [value]",
41+
"desc": "Set the [value] of [option] for the currently loaded module."
42+
},
43+
{
44+
"cmd": "search [keywords]",
45+
"desc": "Search for modules that contain one or more of the specified [keywords]"
46+
},
47+
{
48+
"cmd": "show advanced",
49+
"desc": "Show the advanced options of the currently loaded module."
50+
},
51+
{
52+
"cmd": "show auxiliary",
53+
"desc": "Show the list of available auxiliary modules."
54+
},
55+
{
56+
"cmd": "show exploits",
57+
"desc": "Show the list of available exploits."
58+
},
59+
{
60+
"cmd": "show options",
61+
"desc": "Show the basic options of the currently loaded module."
62+
},
63+
{
64+
"cmd": "unset [option]",
65+
"desc": "Unset an [option] set with the set command."
66+
},
67+
{
68+
"cmd": "use [module_path]",
69+
"desc": "Loads the specified module into the current context."
70+
}
71+
]
72+
}

lib/cli/console.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def commands_without_output
2626

2727
def permitted_commands
2828
%w(use back set show quit run unset check info gset gunset search clear
29-
reload)
29+
reload help)
3030
end
3131

3232
def initialize

lib/cli/help.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ def show_advanced_options
5252
end
5353
end
5454

55+
def help
56+
commands_file = Wpxf::DataFile.new('json', 'commands.json')
57+
data = JSON.parse(commands_file.content)['data']
58+
data.unshift('cmd' => 'Command', 'desc' => 'Description')
59+
indent_cursor 2 do
60+
print_table data
61+
end
62+
end
63+
5564
def show_exploits
5665
results = search_modules(['exploit/'])
5766
print_good "#{results.length} Exploits"

0 commit comments

Comments
 (0)