Perl Script Injection

Collecting Information

Global structure

The first thing we have to do is to get as much information as we can about this portal. We immediately notice that the portal is based on a frameset with:

  • controller
  •<something>: page that is called from the controller

Read files

In addition, by clicking on student work > Joey Simons > Sign my guestbook, we see a form. Here is the source code


<body bgcolor=”#ffffff” text=”#000000″>

<form action=”../cgi-bin/”>

<input type=”hidden” name=”action” value=”write”>


<input type=”text” name=”text” size=50>

<input type=”submit” value=”submit”>



We notice that:

  • form action is “../cgi-bin/”, a perl script inside cgi-bin/
  • there is a hidden field named action, which value is “write”. We suppose that it exists a value “read” to read files.

Access hard drive

The main controller ( is not protected. Indeed, it is possible to request the hard drive content by injecting “file://” instead of “http://”. We discover a new form, named “heartlandadminpanel.html” in C:\WEB\HTML:1

Here is what it looks like (

By viewing the source code of this page, we notice that the form action is


Our first mission is to find valid credential to access the protected content.

Step 1: Find valid credential

Using our *fake* file editor, we are going to view the content of cgi-bin/ file. To do so, we are going to enter this address in our URL bar:

  • action=read is our supposition, since there is a “write” method, “read” is likely to work
  • we are going to suppose that there is a “file” parameter. Since the script is already hosted in the cgi-bin/ directory, we can directly request file

Here is what it produces:


The source code of the page gives us the information we are looking for:4

Step 2: Delete list

Access this page:

And log in with:

  • username: jbardus
  • password: heartlandnetworkadministrator


Click on “clear all” button and you’re done!

About the Author

Aloha, I'm Amit Ghosh, a web entrepreneur and avid blogger. Bitten by entrepreneurial bug, I got kicked out from college and ended up being millionaire and running a digital media company named Aeron7 headquartered at Lithuania.

Related Posts

Basic Mission 3   Have a look at the source code of that page and have you noticed the form section?...

Basic Mission 1   I can call you a pretty dumb as per you are now viewing the walkthrough for...

Basic Mission 2   I can again call you a pretty dumb as per you are now again viewing the walk...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.