Post

Hacker101 - Postbook

Hacker101 - Postbook

This CTF are provider by Hacker101 with easy difficulty. It have 7 flags to find.

Reconnaissance

As we redirect to the page, it show a simple web site with just “Sign in” and “Sign up” features.

ctf_postbook_image

The first method I try was unauthorized access with SQL injection on sign in page.

ctf_postbook_image

But it seem like it have protection on it.

ctf_postbook_image

Next I sign up a account with admin as username with weak password.

ctf_postbook_image

I able to log in with my account.

ctf_postbook_image

Flag 1

I click one of the post from “Post timeline”.

ctf_postbook_image

And found id=3 from the URL.

ctf_postbook_image

I try to input different id into the URL and found the flag in id 2.

ctf_postbook_image

Flag2

Now let turn on Burp Suite and play on the POST request. We are able to create new post from the home page.

ctf_postbook_image

Let turn on the intercept and create a new post.

ctf_postbook_image

After I study the POST request, it put the user_id as part of the request to indicate who are the owner of this post. Let change to other user id and forward the request.

ctf_postbook_image

The flag will show on home page.

ctf_postbook_image

Flag 4

Let do the same thing for post edit request. First we create a post.

ctf_postbook_image

After created the post, we will able to see edit button on the post.

ctf_postbook_image

Click the button to edit the post.

ctf_postbook_image

Before you click the “Save post” button, turn on Burp Suite and intercept the POST request. We can see that the id are not in the request payload but in the URL request. Modify the id to other id and forward the request.

ctf_postbook_image

The flag will show on the page.

ctf_postbook_image

Flag 0

From the hint provided by Hacker101, this flag is related to a account name as “user”.

ctf_postbook_image

This hint state that the account have a weak password. I decide to manually test some of the password before I use any tools too brute force it.

After few try with the top 10 popular weak password, I successfully login as “user.” And the flag is in the home page.

ctf_postbook_image

Flag 3

From this hint provided by Hacker101, we will get a number of 945.

ctf_postbook_image

We will able to get the flag by search post related id 945.

ctf_postbook_image

Flag 5 & Flag 6

From the hint provided by Hacker101, it seem like related to section id store in cookie.

ctf_postbook_image

When we login into the web site, the server will assign a section id for us. And after some research, this section id is the user id hashed with MD5.

ctf_postbook_image

To log in as user with ID 1, we need to generate MD5 hash for digital 1 and replace the cookie in our browser.

We can use CyberChef to generate the MD5 hash.

ctf_postbook_image

And replace the cookie in browser on developer tools.

ctf_postbook_image

Flag 5 will show in home page.

ctf_postbook_image

Flag 6 also the same, but you need to use your own account to delete other post that own by other user.

The post id had been MD5 hashed, you need to replace with the MD5 hashed post id you want to delete.

ctf_postbook_image

References

This post is licensed under CC BY 4.0 by the author.