Enumeration
Scans
Initial scan
Kali
Longer scan
Kali
Even longer scan
Kali
Scan for vulnerabilities
Change ports to the ports found from previous scans
Kali
Ports
TCP/21 - FTP
Common Credentials
Usernames
Passwords
Access FTP
Kali
List files
Kali(ftp)
List files (using Curl)
Kali
Download files
Change to Binary mode & passive (an important setting if you're uploading/downloading binary files like pictures and/or executables!).
Kali(ftp)
Kali(ftp)
Download all files
Kali(ftp)
Download all files to the current directory (using Wget)
Kali
Upload files
If there is also a website being hosted and you can see the try adding a webshell and going to it from the browser.
Kali(ftp)
TCP/22 - SSH
SSH into host
Kali
Check this page for cracking examples
TCP/25 - SMTP
Kali
Kali
Kali
Kali
Check for vulnerabilities
Kali
Check this page for cracking examples
UDP/53 - DNS
Find subdomains
Example
Kali
TCP/80:443 - HTTP(s)
Web Enumeration
Useful info on how to run a lot of the tools in this section.
Info gathering info
Check if any pages are listed
Check certificate for hostname. Then add to hosts file.
Examples
Create wordlist
Creating a wordlist from this site based off of what is on the website.
Examples
Kali
Find Directories
Kali
Kali
Find Pages
Kali
Kali
Kali
Kali
Find pages with certain extensions
Examples
Kali
web-extensions.txt
Kali
Find pages and exclude certain extensions
Example
Kali
Using filters
Example
By adding -fc 403
(filter code) we'll hide from the output all 403 HTTP status codes.
Kali
Use -mc 200
(match code) instead of having a long list of filtered codes.
Kali
We can use a regexp to match all files beginning with a dot.
Kali
Fuzzing parameters
Example
ffuf allows you to put the keyword anywhere we can use it to fuzz for parameters.
Kali
Find Vulnerabilities
Nikto Tuning (-T) Options
Scan for misconfigurations
Scan for SQL injection vulnerabilities.
Authenticated nikito scan
Examples
Kali
Check for Shellshock
Check for Heartbleed
Fuzzing Subdomains
Example
Kali
Example
Kali
Example
Kali
Proxifying ffuf traffic
Example
Kali
It's also possible to send only matches to your proxy for replaying:
Kali
SQLMap
Get information
Can be used to get things like usernames and passwords or other information in the tables.
Example
Kali
Get Databases
Examples
First capture the request of the page with Burp
Kali
Get tables
Kali
Get fields for specified table
Kali
Get values of specific fields
Kali
Rescan SQLMap
SQLMap will just give you the same results if you keep trying the same command, even if things have changed. Remove the cache to resolve this.
Kali
Cookies
Example
Get the flag with developer console by checking the cookie.
HTTP Headers
Example
Run Web server
Kali
Wordpress
Scan wordpress site
Examples
Kali
Enumerate wordpress site
Examples
RetroWordpress: CVE-2021-29447
Kali
Bruteforce admin page
Kali
.git folder found
Examples
Kali
Jenkins
Reverse Shell
Examples
UDP/88 - Kerberos
Username Enumeration
Finds valid users
Examples
Get Ticket
Examples
The hash type is Kerberos 5 etype 23 AS-REP.
TCP/110 - POP3
Logging in with credentials
Examples
Check this page for cracking examples
TCP/135 - RPC
Kali
Login with credentials
Examples
Kali
TCP/139 - NetBIOS
Examples
Enumerate SMB
Kali
Examples
Kali
Examples
Kali
UDP/161 - SNMP
Collect Information
Examples
Kali
TCP/389 - LDAP
Enumerating Active Directory
Examples
Breaching Active Directory
Examples
Exploiting Active Directory
Examples
Persisting Active Directory
Examples
TCP/445 - SMB
Scanning
Examples
Kali
Common Credentials
Usernames
List Shares
Option #1
Examples
GatekeeperAttacktive DirectoryBasic Pentesting
Kali
Option #2
Examples
Victim
Download files
Option #1
Kali
Option #2
Kali
Option #3
Kali
Upload files
Option #1
Kali
Detect Vulnerabilities
TCP/667 - IRC
TCP/873 - RSYNC
Check Modules
List files
Example
Transfer files
Example
TCP/2049 - NFS
Mount drive
Examples
Upload ID_RSA key to login
Create mount
Interesting loot to look for
Privilege Escalation
Example of how you can get root shell. All commands except the last one are run on our Kali machine where we can control the permissions fully. Then we just run the exploit as the normal user we already have access to.
TCP/3306 - SQL
examples
Kali(mysql)
TCP/3389 - RDP
Scan
Kali
Login to host
Kali
Kali
Examples
Kali
Kali
TCP/5000 - Docker Registry
Add repositories
Example
Kali
daemon.json
Kali
Wait 30 seconds
Kali
List repositories
Example
Kali
Get tags of a repository
Example
Kali
Get manifests
Example
Inside the manifest we can find potential credentials
Kali
Download the Docker image to find info
Example
Kali
Enter image
Example
Kali
Uploading Malicious Docker Images
Example
Kali
Docker file example
RCE via Exposed Docker Daemon
Example
Escape via Exposed Docker Daemon
Example
Shared Namespaces
Example
Misconfigured Privileges
Example
Privilege Escalation with 2 shells and host mount
Example
If you have access as root inside a container that has some folder from the host mounted and you have escaped as a non privileged user to the host and have read access over the mounted folder. You can create a bash suid file in the mounted folder inside the container and execute it from the host to privesc.
Victim(root)
Victim(claire-r)
TCP/5327 - Postgres
TCP/5985 - WinRM or wsman
See TCP/5986 - WinRM for WinRM information
TCP/5986 - WinRM
Dump Hashes
Dump hashes of other users if the user you have access to has the privilege's to do so. If it does we can potentially use these hashes with evil-winrm to login as these other users.
Examples
Kali
Login with found username and password
Examples
Login with found username and hash
Examples
Attacktive DirectoryWindows Local Persistence
TCP/6379 - Redis
Example
Get Users hash
Example
Kali(redis-cli)
Kali
(You can write anything in place of share, the share does not need to exist)
Kali(redis-cli)
TCP/7070 - AnyConnect
Example
Exploit: https://www.exploit-db.com/raw/49613
For code above and just had to change the shellcode and ip variable.
Kali
Kali
TCP/11211 - Memcache
Dump cache
Example
Victim
TCP/27017 - MongoDB
Example
Find Info in DB
Victim
Victim(mongo)
Knock
Example
Usually used in CTFs. Knock on certain ports in a certain pattern to open up more ports.
Kali
Last updated