Ideas and Tools for Information Gathering#
==========
-
Reference Links:
-
Overall Approach:
- Subdomain -> IP -> Full Ports -> http, https -> Asset Acquisition -> Fingerprinting
- Mini Programs, Official Accounts, Apps
- Non-web assets identified through port scanning -> such as databases: first perform bulk weak password detection, then construct a dictionary based on the obtained information for brute-forcing
-
Internal Network Information Gathering Approach (Do not start with fscan scanning)
- First, on the compromised machine, check the network card information,
history
command history,netstat
port information,arp
table,ps
processes, configuration files, etc., to collect information about other internal network segments accessible from the compromised machine. - Check domain information in threat intelligence communities like Weibu Online.
- If there is no resolved IP, it may be a domain accessible only from the internal network; try
ping
the domain on the compromised machine to get the internal network address. - If there is an internet-resolved IP, you can also try
ping
the domain on the compromised machine to get the internal network address.
- If there is no resolved IP, it may be a domain accessible only from the internal network; try
- Sometimes, on websites on the internet side, there may be redirects to internal systems, such as OA systems or unified identity authentication systems, which can redirect to the internal network, thereby obtaining internal network address information.
- Through successful exploitation -> for example, Fanwei -> check the Fanwei configuration files, such as database configuration files; the database system may be on another internal network server, thus confirming the existence of the internal network.
- More techniques can be found in this article: How to Determine the Existence of an Internal Network
- First, on the compromised machine, check the network card information,
Comprehensive Use of Tools#
- ShuiZe - Information Gathering Automation Tool
- SRC Subdomain Asset Monitoring
- ARL (Asset Reconnaissance Lighthouse) System
- Goby
- Xray
- Nuclei
- fscan
Company Name Asset Collection#
- Tianyancha
- Xiaolanben
- Aiqicha
- Qichacha
- Yingtu
- 360 Threat Intelligence Center
- ENScan_GO
- Can query company assets with specified shareholding ratios
Subdomain Collection#
-
Enumeration, Third-party Aggregation Services
-
Search Engines
- Google or Baidu
site:xxx.com
- fofa
domain="xxx.com"
- Google or Baidu
-
Certificate Transparency Information
- Certificate Transparency (CT) is a public project by Google that aims to correct certificate-based threats by allowing domain owners, CAs, and domain users to audit the issuance and existence of SSL certificates. Since it is an open public framework, anyone can build or access the basic components that drive certificate transparency. CA certificates contain sensitive information such as domain names, subdomains, and email addresses, which pose certain security risks.
- To collect domain information using certificate transparency, generally use CT log search engines for domain information collection, such as online sites:
CDN#
CDN Detection#
- Use different hosts to ping the domain to determine if there is a CDN
- Ping from Multiple Locations
- ipip
- Global Ping Test
- Aizhan Ping Detection
- Use ping to determine if there is a CDN
- Directly use ping to check the echo address for judgment; for example, if the echo shows cname.vercel-dns.com, it is evident that CDN technology is used.
- Image from mathwizard
- Directly use ping to check the echo address for judgment; for example, if the echo shows cname.vercel-dns.com, it is evident that CDN technology is used.
- Use nslookup to resolve the domain to determine
- If the Name field points to something like cname.vercel-dns.com, it indicates that CDN technology is used.
- 🌰 www.baidu.com, where the Address field points to two different IPs, indicates that www.baidu.com may be using CDN.
Bypassing CDN to Obtain Real IP#
-
Resolve subdomain IP
- Using CDN incurs costs, so many websites only apply CDN acceleration to the main site, while subdomains may not. Subdomains may be on the same server or the same Class C network as the main site, so querying the IP information of subdomains can help determine the real IP information of the main site.
-
Query Historical DNS Records
-
Querying historical records of DNS and IP bindings may reveal previous real IP information
-
-
Use foreign hosts to request the domain
- Some domestic CDN acceleration service providers only apply CDN acceleration to domestic lines, but not to foreign lines, allowing real IP information to be detected through foreign hosts. You can use your own foreign host or select foreign detection nodes from Global Ping Test to determine real IP information.
-
Email Information
- Email systems are generally internal and not resolved through CDN. By utilizing the target website's email registration, password recovery, or RSS subscription features to send emails, you can check the source of the reply email to obtain the target's real IP.
- Image from mathwizard
-
Information Leakage
- Utilize sensitive information and files exposed through information leakage (such as phpinfo pages, website source code (backup) files, information leaked on GitHub, etc.) to obtain real IP information.
- The
SERVER_ADDR
field of the phpinfo page will display the real IP of the host.
- The
- Utilize sensitive information and files exposed through information leakage (such as phpinfo pages, website source code (backup) files, information leaked on GitHub, etc.) to obtain real IP information.
-
Target Website APP Applications
- If the target website has its own App, you can try to use traffic capture tools like Burp Suite to capture requests from the App, which may reveal the target's real IP.
IP Reverse Lookup for Domain (Side Station Query)#
- 360 IP Reverse Lookup
- Weibu Online
- Website Query with Same IP
- webscan
- Yunxi
- dnsgrep IP Reverse Lookup
- bugscaner IP Reverse Lookup
- Bing
https://cn.bing.com/search?q=ip:x.x.x.x
- Fofa
ip="x.x.x.x"
Fingerprinting#
- Browser Plugin: Wappalyzer
- Tide - Online Fingerprinting
- bugscaner - Online Fingerprinting
- EHole - Red Team Key Attack System Fingerprint Detection Tool
- Yunxi - Online Fingerprinting
- what web - Online Fingerprinting
JS and Interface Information#
- JSFinder: https://github.com/Threezh1/JSFinder
- URLFinder: https://github.com/pingc0y/URLFinder
- Can be considered a new version of JSFinder
- LinkFinder: https://github.com/GerbenJavado/LinkFinder
- Packer-Fuzzer: https://github.com/rtcatc/Packer-Fuzzer (webpack)
- Search for Key Interfaces
- config/api
- method:"get"
- http.get("
- method:"post"
- http.post("
- $.ajax
- service.httppost
- service.httpget
- path
- api
- When xxx.js.map file exists
- Search for axios keywords to find routes
APP#
Email Collection#
WAF Detection#
Sensitive Information#
Cloud Storage Engine#
Google Hack Syntax#
- Backend Address
- site.com intitle: Management | Backend | Login | Administrator | System | Internal
- site.com inurl|admin|system|guanli|denglu|manage|admin_login|auth|dev
- Sensitive Files
- site.com (filetype OR filetype OR filetype OR filetype OR filetype OR filetype OR filetype OR filetype OR filetype OR --filetype OR filetype OR filetype OR filetype OR filetype OR filetype OR filetype OR filetype OR filetype OR filetype OR filetype OR filetype OR filetype OR filetype OR filetype OR filetype)
- Test Environment
- site.com inurl|ceshi
- site.com intitle: Test
- Email
- site.com (intitle:"Outlook Web App" OR intitle:"Email" OR inurl:"email" OR inurl:"webmail")
- Others
- site.com inurl|uid=|id=|userid=|token|session
- site.com intitle.of "server at"
- Google Syntax Generator
- Online Version: http://www.php1nf0.top/google/google.php
- Offline Version: Get it here
Information Gathering for Penetration Testing#
* Information Gathering for Penetration Testing
* Open Source Intelligence Gathering (OSINT)
* GitHub
* Whois Query / Registrant Reverse Lookup / Email Reverse Lookup / Related Assets
* Google Hacking
* Create Company Password Dictionary
* Subdomain Acquisition
* Dictionary List
* Email List Acquisition
* Leaked Password Query
* Collect external information related to the company Open Source Intelligence Gathering (OSINT)
* GitHub
* Github_Nuggests (automatically crawls sensitive information leaks on GitHub): https://github.com/az0ne/Github_Nuggests
* GSIL (can achieve near real-time (within 15 minutes) discovery of leaked information on GitHub): https://github.com/FeeiCN/GSIL
* x-patrol (Xiaomi team's): https://github.com/MiSecurity/x-patrol Whois Query / Registrant Reverse Lookup / Email Reverse Lookup / Related Assets
* Webmaster Home: http://whois.chinaz.com/?DomainName=target.com&ws=
* Aizhan: https://whois.aizhan.com/target.com/
* Weibu Online: https://x.threatbook.cn/
* IP Reverse Lookup: https://dns.aizhan.com/
* Tianyancha: https://www.tianyancha.com/
* Huma Check: http://www.whomx.com/
* Historical Vulnerability Query:
* Online Query: http://wy.zone.ci/
* Self-built: https://github.com/hanc00l/wooyun_publi/ Google Hacking
* Create Company Password Dictionary Dictionary List passwordlist: https://github.com/lavalamp-/password-lists
- Piggy Dictionary: https://pan.baidu.com/s/1dFJyedzBlasting_dictionary (share and collect various dictionaries, including weak passwords, common passwords, directory brute force, database brute force, editor brute force, backend brute force, etc.) For specific vendors, focus on constructing dictionaries related to vendor domains ['%pwd%123','%user%123','%user%521','%user%2017','%pwd%321','%pwd%521','%user%321','%pwd%123!','%pwd%123!@#','%pwd%1234','%user%2016','%user%123$%^','%user%123!@#','%pwd%2016','%pwd%2017','%pwd%1!','%pwd%2@','%pwd%3#','%pwd%123#@!','%pwd%12345','%pwd%123$%^','%pwd%!@#456','%pwd%123qwe','%pwd%qwe123','%pwd%qwe','%pwd%123456','%user%123#@!','%user%!@#456','%user%1234','%user%12345','%user%123456','%user%123!']
- Password Generation GenpAss (Chinese-style weak password generator: https://github.com/RicterZ/genpAss/
- passmaker (customizable password dictionary generator): https://github.com/bit4woo/passmaker
- pydictor (powerful password generator): https://github.com/LandGrey/pydictor
- Email List Acquisition theHarvester: https://github.com/laramies/theHarvester * After obtaining an email, export the address book LinkedInt: https://github.com/mdsecactivebreach/LinkedInt
- Mailget: https://github.com/Ridter/Mailget
- Leaked Password Query ghostproject: https://ghostproject.fr/
- pwndb: https://pwndb2am4tzkvold.onion.to/
- Collect external information related to the company Subdomain Acquisition
-
Layer Subdomain Excavator 4.2 Commemorative Edition subDomainsBrute: https://github.com/lijiejie/subDomainsBrute
- wydomain: https://github.com/ring04h/wydomain
- Sublist3r: https://github.com/aboul3la/Sublist3r
- site.com: https://www.google.com GitHub Code Repository
-
Capture and analyze request return values (redirects/file uploads/app/api interfaces, etc.)
- Webmaster Helper links and other online query websites
Domain Transfer Vulnerability Linux dig @ns.example.com example=.com AXFR Windows nslookup -type=ns xxx.yyy.cn #Query the DNS server for a certain domain name nslookup #Enter nslookup interactive mode server dns.domian.com #Specify DNS server ls xxx.yyy.cn #List domain information
- GetDomainsBySSL.py: https://note.youdao.com/ynoteshare1/index.h tml?id=247d97fc1d98b122ef9804906356d47a&type=note#/
- censys.io certificate: https://censys.io/certificates?q=target.com crt.sh
- Certificate Query: https://crt.sh/?q=%25.target.com
- shadon: https://www.shodan.io/
- zoomeye: https://www.zoomeye.org/ fofa: https://fofa.so/
- censys: https://censys.io/
- dnsdb.io: https://dnsdb.io/zh-cn/search?q=target.com
- api.hackertarget.com: http://api.hackertarget.com/reversedns/?q =target.com
- community.riskiq.com: https://community.riskiq.com/Search/targe t.com
- subdomain3: https://github.com/yanxiu0614/subdomain3
- FuzzDomain: https://github.com/Chora10/FuzzDomain dnsdumpster.com: https://dnsdumpster.com/
- phpinfo.me: https://phpinfo.me/domain/
- DNS Open Data Interface: https://dns.bufferover.run/dns?q=baidu.com
GitHub#
- @xxx.com password/secret/credentials/token/config/pass/login/ftp/ssh/pwd
- @xxx.com security_credentials/connetionstring/JDBC/ssh2_auth_password/send_keys