Learn about active recon, web app attacks and privilege escalation.
Reconnaissance
- scan ports
nmap -sV <ip>
PORT STATE SERVICE VERSION
21/tcp open ftp vsftpd 3.0.3
22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.7 (Ubuntu Linux; protocol 2.0)
139/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
445/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
3128/tcp open http-proxy Squid http proxy 3.5.12
3333/tcp open http Apache httpd 2.4.18 ((Ubuntu))
Locating directories using Gobuster
using fast discovery tool gobuster, locate a directory and upload a shell
- scan for directories
gobuster dir -u <ip>:<port> -w <path to wordlist>
-e
print full urls-u
target url-w
path to wordlist-U
and-P
username and password for basic auth-p
proxy for requests-c
cookie for simulating auth
/images (Status: 301)
/css (Status: 301)
/js (Status: 301)
/internal (Status: 301)
Compromise the Webserver
- fuzz form to find blocked file extensions, based on what server is running, e.g. php
- use burp suite with wordlist containing extensions
.phtml
is not being blocked- get
.phtml
reverse shell - run netcat as listener
nc -lvnp 1234
Privilege Escalation
- get e.g. linpeas onto target
- scan for possibilities
- use gtfo bins
- …