File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed
lib/msf/ui/console/command_dispatcher Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ def name
37
37
def cmd_resource_help
38
38
print_line "Usage: resource path1 [path2 ...]"
39
39
print_line
40
- print_line "Run the commands stored in the supplied files. Resource files may also contain "
41
- print_line "ruby code between <ruby></ruby> tags."
40
+ print_line "Run the commands stored in the supplied files (- for stdin). "
41
+ print_line "Resource files may also contain ERB or Ruby code between <ruby></ruby> tags."
42
42
print_line
43
43
print_line "See also: makerc"
44
44
print_line
@@ -52,21 +52,23 @@ def cmd_resource(*args)
52
52
53
53
args . each do |res |
54
54
good_res = nil
55
- if ::File . exist? ( res )
55
+ if res == '-'
56
+ good_res = res
57
+ elsif ::File . exist? ( res )
56
58
good_res = res
57
59
elsif
58
60
# let's check to see if it's in the scripts/resource dir (like when tab completed)
59
- [
60
- ::Msf ::Config . script_directory + ::File ::SEPARATOR + "resource" ,
61
- ::Msf ::Config . user_script_directory + ::File ::SEPARATOR + "resource"
62
- ] . each do |dir |
63
- res_path = dir + ::File ::SEPARATOR + res
64
- if ::File . exist? ( res_path )
65
- good_res = res_path
66
- break
61
+ [
62
+ ::Msf ::Config . script_directory + ::File ::SEPARATOR + "resource" ,
63
+ ::Msf ::Config . user_script_directory + ::File ::SEPARATOR + "resource"
64
+ ] . each do |dir |
65
+ res_path = dir + ::File ::SEPARATOR + res
66
+ if ::File . exist? ( res_path )
67
+ good_res = res_path
68
+ break
69
+ end
67
70
end
68
71
end
69
- end
70
72
if good_res
71
73
driver . load_resource ( good_res )
72
74
else
You can’t perform that action at this time.
0 commit comments