Recon
Copy nmap -p 80,443,8000,8080,8180,8888,1000 --open -oA web_discovery -iL scope_list
EyeWitness or Aquatone - See Information Gathering
Common files
robots.txt
.git
.svn
.DS_Store
Copy # python ds_store_exp.py http://10.13.X.X/.DS_Store
[200] http://10.13.X.X/.DS_Store
[200] http://10.13.X.X/JS/.DS_Store
[200] http://10.13.X.X/Images/.DS_Store
[200] http://10.13.X.X/dev/.DS_Store
<--SNIP-->
Misconfigurations on popular third-party services
Git Exposed
Nuclei Template: https://github.com/coffinxp/priv8-Nuclei/blob/main/git-exposed.yaml
Copy id : git-exposed
info :
name : Exposed Git Repository
author : kaks3c
severity : medium
description : |
Checks for exposed Git repositories by making requests to potential Git repository paths.
tags : p3,logs,git
http :
- raw :
- |
GET {{BaseURL}}{{path}} HTTP/1.1
Host: {{Hostname}}
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:119.0) Gecko/20100101 Firefox/119.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Connection: close
attack : pitchfork
payloads :
path :
- /.git/
- /.git/HEAD
- /.git/config
- /.git/logs/HEAD
- /.git/logs/
- /.git/description
- /.git/refs/heads/
- /.git/refs/remotes/
- /.git/objects/
matchers-condition : or
matchers :
- type : word
words :
- "commit (initial): Initial commit" #/.git/logs/HEAD
- "ref: refs/heads/" #/.git/HEAD
- "logallrefupdates = true" #/.git/config
- "repositoryformatversion = 0" #/.git/config
- "Index of /" #/.git/
- "You do not have permission to access /.git/" #403_/.git
- "Unnamed repository; edit this file 'description' to name the repository" #/.git/description
- type : regex
regex :
- "info/\\s+\\d{4}-\\d{2}-\\d{2}\\s+\\d{2}:\\d{2}" #/.git/objects/
- "pack/\\s+\\d{4}-\\d{2}-\\d{2}\\s+\\d{2}:\\d{2}" #/.git/objects/
- "master/\\s+\\d{4}-\\d{2}-\\d{2}\\s+\\d{2}:\\d{2}" #/.git/refs/heads/
- "origin/\\s+\\d{4}-\\d{2}-\\d{2}\\s+\\d{2}:\\d{2}" #/.git/refs/remotes/
- "refs/\\s+\\d{4}-\\d{2}-\\d{2}\\s+\\d{2}:\\d{2}" #/.git/logs/
stop-at-first-match : true
.git
found => download the target .git
folder
After that, search for creds, etc:
Credentials in git repos SVN Expoxed
Copy ./svn-extractor.py --url http://url.com --match database.php
PHPMyAdmin
target[.]com/phpmyadmin/setup/index.php
==> 301 to login page
target[.]com/phpMyAdmin/setup/index.php
==> 200 to phpmyadmin setup
OWASP Noir
Copy $ noir -b . -u http://example.com
$ noir -b . -u http://example.com --passive-scan
Extract URLs and paths from web pages
Manually
Copy javascript:(function(){var scripts=document.getElementsByTagName("script"),regex=/(?<=(\"|\'|\`))\/[a-zA-Z0-9_?&=\/\-\#\.]*(?=(\"|\'|\`))/g;const results=new Set;for(var i=0;i<scripts.length;i++){var t=scripts[i].src;""!=t&&fetch(t).then(function(t){return t.text()}).then(function(t){var e=t.matchAll(regex);for(let r of e)results.add(r[0])}).catch(function(t){console.log("An error occurred: ",t)})}var pageContent=document.documentElement.outerHTML,matches=pageContent.matchAll(regex);for(const match of matches)results.add(match[0]);function writeResults(){results.forEach(function(t){document.write(t+"<br>")})}setTimeout(writeResults,3e3);})();
Open Console (ctrl + shift + i) + Allow pasting
("autoriser le collage
") + copy paste JS code + click on bookmark
Source: NahamCon2024: .js Files Are Your Friends | @zseano https://www.youtube.com/watch?v=fQoxjBwQZUA
Gourlex
Copy gourlex -t domain.com
Katana
Copy katana -u https://tesla.com
GetAllURL - gau
Copy gau https://target.com
LinkFinder
Copy python3 linkfinder.py -i https://example.com/app.js
LazyEgg
ReconSpider
See Fingerprinting / Crawling
JS Files
Source: NahamCon2024: .js Files Are Your Friends | @zseano https://www.youtube.com/watch?v=fQoxjBwQZUA
Javascript Deobfuscator
API Endpoint in JS File
Copy cat file.js | grep -aoP "(?<=(\"|\'|\`))\/[a-zA-Z0-9_?&=\/\-\#\.]*(?=(\"|\'|\`))" | sort -u
JSNinja
JS Link Finder
Jsluice
API Sensitive data in JS Files
Sensitive Data (API Key, JWT token, etc.) Exposed JS Miner - Burp Extension
X-Keys - Burp Extension
jsluice++ - Burp Extension
SecretFinder
Mantra
Parameters fuzzing
Arjun
Parmahunter
Wordlists
Fuzzing Common extensions: raft-[ small | medium | large ]-extensions.txt
from SecList Web-Content
Copy cewl -m5 --lowercase -w wordlist.txt http://192.168.10.10
Amin interfaces
Backups
Config files
SQL files
Vulnerability Assessment
Vulnerability Scanners Port Scan
Copy sudo nmap 10.129.2.28 -p 80 -sV --script vuln
Nmap scan report for 10.129.2.28
Host is up (0.036s latency).
PORT STATE SERVICE VERSION
80/tcp open http Apache httpd 2.4.29 ((Ubuntu))
| http-enum:
| /wp-login.php: Possible admin folder
| /readme.html: Wordpress version: 2
| /: WordPress version: 5.3.4
| /wp-includes/images/rss.png: Wordpress version 2.2 found.
| /wp-includes/js/jquery/suggest.js: Wordpress version 2.5 found.
| /wp-includes/images/blank.gif: Wordpress version 2.6 found.
| /wp-includes/js/comment-reply.js: Wordpress version 2.7 found.
| /wp-login.php: Wordpress login page.
| /wp-admin/upgrade.php: Wordpress login page.
|_ /readme.html: Interesting, a readme.
|_http-server-header: Apache/2.4.29 (Ubuntu)
|_http-stored-xss: Couldn't find any stored XSS vulnerabilities.
| http-wordpress-users:
| Username found: admin
|_Search stopped at ID #25. Increase the upper limit if necessary with 'http-wordpress-users.limit'
| vulners:
| cpe:/a:apache:http_server:2.4.29:
| CVE-2019-0211 7.2 https://vulners.com/cve/CVE-2019-0211
| CVE-2018-1312 6.8 https://vulners.com/cve/CVE-2018-1312
| CVE-2017-15715 6.8 https://vulners.com/cve/CVE-2017-15715
Admin interface
Password lists CMS
CMS Crawling
Gospider
Hakrawler
With Burp
With Zap
Copy sudo snap install zaproxy --classic
Fuzz
Wordlists
Fuzzing
Copy gobuster dir -u http://10.10.10.121/ -w /usr/share/dirb/wordlists/common.txt
Copy ffuf -recursion -recursion-depth 1 -u http://192.168.10.10/FUZZ -w /opt/useful/SecLists/Discovery/Web-Content/raft-small-directories-lowercase.txt
Copy ffuf -w ./folders.txt:FOLDERS,./wordlist.txt:WORDLIST,./extensions.txt:EXTENSIONS -u http://192.168.10.10/FOLDERS/WORDLISTEXTENSIONS
Banner grabbing
Copy curl -IL https://www.inlanefreight.com
Tool: https://github.com/FortyNorthSecurity/EyeWitness ; or Aquatone
Information Gathering
Copy whatweb 10.10.10.121
whatweb --no-errors 10.10.10.0/24
DNS Subdomain Enumeration
DNS Subdomain Enumeration Cloudflare Bypass for Web Scraping