Hacker101 - Cody's First Blog
This CTF are provided by Hacker101 with moderate difficulty. It have 3 flags to find.
Reconnaissance
It will redirect to a page with one comments box in the page. We can know that this web site was develop with PHP.
When we inspect the HTML element, we able to get the URL for admin login.
Flag 0
I tried to inject JavaScript into the comment, but nothing happen.
It seem like this comment need to be approval from the owner.
But how about PHP code?
It also require approval from owner, but we get the flag by injecting PHP code.
Flag 1
Let analyze the admin login page.
I try some simple SQL injection on it, but it doesn’t work.
I refer to the hints from Hacker101, but not much useful information.
I also tried to access the admin page directly feed in “admin” to the page param, but it said unable to find that file.
After some of the research from Internet, I realize the login page name is “admin.auth.inc”. I able to access the admin page without login by remove the auth from the path.
The flag is at the bottom of the page.
Flag 2
From the hints provided by Hacker101, this flag related to file inclusion vulnerability.
But we need to know what file or URL to apply file inclusion vulnerability.
First I apply “index” into the URL, but it return exhausted memory size error.
Next, I tried navigate index page via localhost and it getting interesting. It execute the echo 'hi' in the command I submitted before (I did approved the comment when I accessed to the admin page).
I form a PHP code to read the content of index.php and put into comment.
Then I approve the comment in the admin page and refresh the page again.
We can see it added a new command with the flag on it, but the flag is belong to flag 1.
Then I inspect the HTML elements and the content of index.php is showing. The flag is inside the contents.















