Web_Recon
First Manually Walking Through the Target
Try to uncover every feature in the application that users can access by browsing through every page and clicking every link. Access the functionalities that you donβt usually use.
Google Dorking
Google can be a means of discovering valuable information such as hidden admin portals, unlocked password files, and leaked authentication keys like (inurl
, site
, intitle
, link
, filetype
, Wildcard (*)
, Quotes (" ")
, Or (|)
, Minus (-)
).
look for all of a companyβs subdomains by:
site:*.example.com
A compromised Kibana instance can allow attackers to collect extensive information about a siteβs operation. Many Kibana dashboards run under the path
app/kibana
, so this query will reveal whether the target has a Kibana dashboard. You can then try to access the dashboard to see if itβs unprotected: site:example.cominurl:app/kibana
Google can find company resources hosted by a third party online, such as Amazon S3 buckets :
site:s3.amazonaws.com COMPANY_NAME
Look for special extensions that could indicate a sensitive file:
site:example.com ext: (php | log | jsp | asp | log)
use google hacking database It contains many search queries that could be helpful to you during the recon process.
WHOIS and Reverse WHOIS
You might be able to find the associated contact information, such as an email, name, address, or phone number: $ whois facebook.com
Find the IP address of a domain you know by running the nslookup command:
$ nslookup facebook.com
Reverse IP lookup and IP ranges (CIDRs) and also run
whois
on the IP, Reverse IP searches look for domains hosted on the same server:
Autonomous system numbers (ASNs) identify the owners of these networks. By checking if two IP addresses share an ASN:
run several IP-to ASN translations to see if the IP addresses map to a single ASN. If many addresses within a range belong to the same ASN, the organization might have a dedicated IP range
Subdomain Enumeration
After finding as many domains on the target as possible, locate as many subdomains on those domains as you can. Each subdomain represents a new angle for attacking the network, good tool for that is subfinderYou can find some good wordlists made by other hackers online SecLists use a wordlist generation tool like Commonspeak2 to generate wordlists based on the most current internet data. You can find subdomains of subdomains by running enumeration tools recursively: add the results of your first run to your Known Domains list and run the tool again.
Service Enumeration
it can be done in two ways first is active scan using nmap
or masscan
or Passive using shodan , Censys, Project Sonar it gives a lot of valuable info so itβs so important
Directory Brute-Forcing
The next thing you can do to discover more of the siteβs attack surface is brute-force the directories of the web servers youβve found. you might discover (hidden admin panels, configuration files, password files, outdated function alities, database copies, and source code files). Directory brute-forcing can sometimes allow you to directly take over a server! You can use Dirsearch
or Gobuster
for directory brute-forcing. Gobuster
βs Dir mode is used to find additional content on a specific domain or subdomain. This includes hidden directories and files.
use a screenshot tool like EyeWitness or Snapper to automatically verify that a page is hosted on each location. EyeWitness accepts a list of URLs and takes screenshots of each page.
Spidering the Site
Another way of discovering directories and paths is through Web Spidering, or web crawling, a process used to identify all pages on a site. A web spider tool starts with a page to visit. It then identifies all the URLs embedded on the page and visits them. By recursively visiting all URLs found on all pages of a site, the web spider can uncover many hidden endpoints in an application. OWASP Zed Attack Proxy (ZAP) has a built-in web spider you can use Access its spider tool by opening ZAP and choosing Tools Spider. OR using Command Line Tool like Katana from Project Discovery
Third-Party Hosting
Organizations can pay to store resources in buckets to serve in their web applications, or they can use S3 buckets as a backup or storage location Most buckets use the URL format
BUCKET.s3.amazonaws.com
orhttp://s3.amazonaws.com/BUCKET
, so the following search terms are likely to find results:(site:s3.amazonaws.com COMPANY_NAME
,site:amazonaws.com COMPANY_NAME
)Companies often still place keywords like
aws
ands3
in their custom bucket URLs, so try these searches: (amazonaws s3 COMPANY_NAME
,amazonaws bucket COMPANY_NAME
,amazonaws COMPANY_NAME
,s3 COMPANY_NAME
)GrayhatWarfare is an online search engine you can use to find publicly exposed S3 buckets
Another good tool is Bucket Stream, which parses certificates belonging to an organization and finds S3 buckets based on permutations of the domain names found on the certificates. it also automatically checks whether the bucket is accessible, so it saves you time use the AWS command line tool to see if u can access one. Install the tool by using the following command:
pip install awscli
configure it to workβ https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html
GitHub Recon
Start by finding the GitHub usernames relevant to your target by searching product names via GitHubβs search bar, When youβve found usernames visit their pages. Find repositories related to the projects youβre testing and record them, along with the usernames of the organizationβs top contributors
For each repository, pay special attention to the Issues and Commits sections. These sections are full of potential info leaks: unresolved bugs, Recent code changes that havenβt stood the test of time are more likely to contain bugs
Look at any protection mechanisms implemented to see if you can bypass them
search the Code section for potentially vulnerable code snippets.
Once youβve found a file of interest, check the Blame and History sections at the top-right corner of the fileβs page to see how it was developed
look for hardcoded secrets such as API keys, encryption keys, and database passwords. Search the organizationβs repositories for terms like: (key, secret, and password) to locate hardcoded user credentials that you can use to access internal systems.
After youβve found leaked credentials, you can use KeyHacks to check if the credentials are valid and learn how to use them to access the targetβs services.
See if any of the source code deals with important functions such as authentication, password reset, state-changing actions, or private info reads. Pay attention to code that deals with user input, such as HTTP request parameters, HTTP headers, HTTP request paths, database entries, file reads, and file uploads
Look for any configuration files, Also search for old endpoints and S3 bucket URLs that you can attack. Record these files for further review in the future.
Pay attention to dependencies and imports being used and go through the versions list to see if theyβre outdated and record them. You can use this information later to look for publicly disclosed vulnerabilities that would work on your target.
Tools like Gitrob locates potentially sensitive files pushed to public repositories and TruffleHog specializes in finding secrets in repositories by conducting regex searches and scanning for high-entropy strings, These tools can automate the GitHub recon process.
Creating Your own Scripts
Take a look at [[Bash_Scripting]]
Summary
Here you can find an extensive summary of all the tools mentioned in this article and the whole process
Scope Discovery
WHOIS looks for the owner of a domain or IP.
ViewDNS.info Reverse WHOIS is a tool that searches for reverse WHOIS data by using a keyword.
nslookup queries internet name servers for IP information about a host.
ViewDNS reverse IP looks for domains hosted on the same server, given an IP or domain.
crt.sh, Censys, and Cert Spotter are platforms you can use to find certificate information about a domain.
Daniel Miesslerβs SecLists is a list of keywords that can be used during recon and hacking. ex (brute-force subdomains and filepaths).
Commonspeak2 generates lists that can be used to brute-force subdomains and filepaths using publicly available data.
Altdns brute-forces subdomains by using permutations of common subdomain names.
Shodan, Censys, and Project Sonar can be used to find services on targets without actively scanning them.
Dirsearch and Gobuster are directory brute-forcers used to find hidden filepaths. EyeWitness and Snapper grab screenshots of a list of URLs, They can be used to quickly scan for interesting pages among a list of enumerated paths
OWASP ZAP is a security tool that includes a scanner, proxy, and much more. Its web spider can be used to discover content on a web server.
GrayhatWarfare is an online search engine you can use to find public Amazon S3 buckets.
Lazys3 and Bucket Stream brute-force buckets by using keywords.
OSINT
The Google Hacking Database contains useful Google search terms that frequently reveal vulnerabilities or sensitive files.
KeyHacks helps you determine whether a set of credentials is valid and learn how to use them to access the targetβs services.
Gitrob finds potentially sensitive files that are pushed to public repositories on GitHub.
TruffleHog specializes in finding secrets in public GitHub repositories by searching for string patterns and high-entropy strings.
PasteHunter scans online paste sites for sensitive information.
Wayback Machine is a digital archive of internet content, You can use it to find old versions of sites and their files.
Waybackurls fetches URLs from the Wayback Machine
Tech Stack Fingerprinting
Wappalyzer identifies content management systems, frameworks, and programming languages used on a site.
The CVE database contains publicly disclosed vulnerabilities, You can use its website to search for vulnerabilities that might affect your target.
BuiltWith is a website that shows you which web technologies a website is built with
StackShare is an online platform that allows developers to share the tech they use, You can use it to collect information about your target.
Retire.js detects outdated JavaScript libraries and Node.js packages
Automation
Once you have a solid understanding of how to conduct recon on a target, you can try to leverage recon platforms like [Nuclei](https://github.com/projectdiscovery/ nuclei/) or Intrigue Core to make your recon process more efficient. But when youβre starting out, I recommend that you do recon manually with individual tools or write your own automated recon scripts to learn about the process for Bash Script tutorial visit Bash_Scripting
Last updated