Using bash, create the file test.pl, and write a simple CGI script which outputs, “It works!”.
echo -e '#!/usr/bin/perl\nprint "Content-type: text/plain\\n\\n";\nprint "It works!\\n";'|sudo tee /usr/lib/cgi-bin/test.pl
Give the new file correct permissions sudo chmod 755 /usr/lib/cgi-bin/test.pl
Send a get request to the script, by piping the request to the netcat.
echo -e "GET /cgi-bin/test.pl HTTP/1.0\n"|nc -q 1 127.0.0.1 80```
Website Last Updated on 4 Oct 2024 (CC BY-SA 4.0)
This site uses JQuery and nanogallery2 hosted by jsdelivr.net
for the Flickr photo feed and GoatCounter for user insights.