Recon: Finding Hidden Pages
Chapters and transcript
Recon Before testing anything, good testers collect information. This is called reconnaissance, or recon. Every website has pages you can see. But many also have forgotten pages that nobody was supposed to find. In real penetration tests, good recon often finds the most serious problems.
Passive and active There are two kinds of recon. Passive recon uses public information, and never touches the target. Think search engines, old copies of the site on archive dot org, job posts and public code on GitHub. Active recon talks to the target directly: browsing every page, scanning ports and guessing file names. On a real system, active recon needs permission.
Passive and active Watch the difference. A passive tester searches public places, like search engines, and reads old copies of the site. The target sees nothing. An active tester sends requests straight to the target, and the target can see them. That is why active recon needs permission.
robots.txt Now our practice site. I type robots dot t x t after the site name. This file tells search engines which pages to skip. See the two Disallow lines: admin panel and backup. Search engines follow it, but attackers read it, because it lists what the owner wants to hide. I open the admin panel, and it has no login at all.
Where to look Here are the places that reveal hidden pages. Robots dot t x t, which you just saw. Sitemap dot x m l, a list of the site's pages, made for search engines. JavaScript files, which often hold paths to APIs and admin features. Comments in the HTML, with forgotten notes. And common names, guessed from a wordlist.
HTML comments Let me show you a comment. I open View page source on the practice site and read through the HTML. Here, a developer left a note: old login, slash test-login. Notes like this can reveal pages that nobody was supposed to see.
Guessing names Testers also guess common names. A wordlist holds paths like admin, backup, old, dot git and phpinfo. Tools such as ffuf and Gobuster try each one, and show which pages exist. Only do this on systems you are allowed to test, like our practice labs.
Why it matters Why does this matter? Forgotten pages are dangerous because nobody maintains them. They often have no login, and run old, vulnerable code. A visitor who finds the URL walks straight in. The fix is to put a login check in front of every sensitive page. Now the same visitor is stopped.
Quick check Quick check. A company hides its admin page at a secret address, and does not add a login. Is that enough? Think about the places you just learned, then choose.
How to defend So how do you defend? Protect every sensitive page with authentication and authorisation. A hidden URL is not a security control. Delete old files, backups and test pages from production servers. Do not list sensitive paths in robots dot t x t. And keep an inventory of everything you have online.
Putting it together Let us put it together. Recon means collecting information before you test. Passive recon uses public sources. Active recon touches the target and needs permission. Robots dot t x t, sitemaps, JavaScript files, comments and wordlists reveal hidden pages. A hidden URL is not security: every sensitive page needs a login. Now read the lesson below, and try the lab.
Reconnaissance (recon) means collecting information before you attack. In real penetration tests, good recon often finds the most serious problems.
Passive and active recon
- Passive recon uses public information and never touches the target. Examples: search engines, old copies of the site on archive.org, job posts that mention the company's software, and public code on GitHub.
- Active recon interacts with the target directly. Examples: browsing every page, scanning ports, and guessing file names.
Active recon on a real system needs permission, just like any other testing.
Places that reveal hidden pages
robots.txt: a file at the root of a site, such as example.com/robots.txt, that tells search engines which pages to skip:
User-agent: *
Disallow: /admin-panel/
Disallow: /backup/
Search engines follow it. Attackers read it, because it can be a list of exactly what the owner wants to hide.
sitemap.xml: a list of a site's pages, made for search engines.
JavaScript files: front-end code often contains paths to API endpoints and admin features.
Comments in the HTML: forgotten notes such as <!-- old login: /test-login -->.
Common names: testers use wordlists to check paths like /admin, /backup, /old, /.git/ and /phpinfo.php. Tools such as ffuf and Gobuster automate this.
Why this matters
Forgotten pages are dangerous because nobody maintains them. Old admin panels, test pages and backup files are often:
- Not protected by a login
- Running old, vulnerable code
- Full of real data
How to defend
- Protect every sensitive page with authentication and authorisation. A hidden URL is not a security control.
- Delete old files, backups and test pages from production servers
- Do not list sensitive paths in robots.txt
- Keep an inventory of everything you have online
In the lab, you will use robots.txt to find a page ChaiCorp forgot about.
HANDS-ON LAB
Robots Recon
robots.txt tells search engines what to skip. Attackers read it too.
Check your understanding
Answer every question correctly to complete this lesson. If you miss one, try the quiz again.
1. What is robots.txt for?
2. Why is hiding an admin page at a secret URL not enough?
3. Which is a passive recon method that does not touch the target?
Locked: answer every quiz question above correctly to complete this lesson.
Spotted a mistake or something unclear? Report a mistake