githubEdit

Exploitation Basics

Reverse shell vs Bind shell

netcat

➡️ netcatarrow-up-right

Reverse shell - the victim/target connects back to the attacker

  • Attack machine - listening on a port

  • Target machine - connect to the attacker machine listening port

Netcat Reverse Shell - hackingtutorials.org
Reverse shell

Bind shell - the attacker opens a port on the target (via exploitation) and connects to it

  • Attack machine - exploits target and opens port listening on target and connects to it

  • Target machine - listens for the attacker connection

Netcat Bind Shell - hackingtutorials.org
  • Specially used on external assessment

Bind shell

Staged vs Non-Staged payloads

Non-Staged payload - sends exploit shellcode all at once, larger in size and won't always work

  • Metasploit e.g. payload/windows/meterpreter_reverse_tcp

Staged payload - sends payload in stages, less stable

  • Metasploit e.g. payload/windows/meterpreter/reverse_tcp


Metasploit (SMB attack)

searchsploit samba 2.2
  • This does not work, since it is using the linux/x86/meterpreter/reverse_tcp staged payload.

  • Try with another payload

root on Kioptrix VM
  • Gained reverse shell via Metasploit


Manual exploitation

Use OpenLuckarrow-up-right to exploit CVE-2002-0082arrow-up-right - Apache mod_ssl < 2.8.7 OpenSSL - Remote Buffer Overflowarrow-up-right

  • Follow usage instruction to compile the exploit and run it against the target machine


Brute force attacks

  • Brute-force attack SSH with weak/default credentials

hydra

➡️ hydraarrow-up-right

  • Use the same with Metasploit


Credential stuffing and Password spraying

Credential stuffingarrow-up-right - injecting breached account credentials (leaks, etc) in hopes of account takeover

Password sprayingarrow-up-right - brute forcing logins based on a list of usernames with default passwords

  • Setup FoxyProxy in the browser and start BurpSuite.

  • Use local vulnerable webapp like dvwaarrow-up-right

BurpSuite

  • Turn intercept ON and send the login request to intruder

  • Highlight the username and password values, and add them to the payload positions

  • Attack type - Pitchfork

  • Payloads

    • for each payload set, paste the usernames list and password

    • Start the attack

      • check the response for Status change and Length


Last updated