Lateral Movement

Lateral Movement and Pivoting

Lateral movement is where an attacker moves within a network to gain access to additional systems. This type of attack is commonly referred to as “pivoting” because the attacker “pivots” from one system to another. The purpose of lateral movement is to gain access to additional systems and data, or to use the compromised systems as a way to launch further attacks.

The two primary methods of lateral movement are credential-based and non-credential-based. In credential-based lateral movement, the attacker uses valid credentials to move from one system to another. This type of attack is often used to gain access to additional systems that the attacker would not have been able to access otherwise.

Non-credential-based lateral movement does not require the attacker to use valid credentials. Instead, the attacker uses methods such as exploiting vulnerabilities, using exploits, or scanning for open ports to gain access to the target system.

Port Forwarding/Tunneling

Port forwarding, also known as tunneling, is a technique used to redirect incoming data traffic to a specific port or port range on a computer or network device. It is commonly used to allow remote users to access services on a local network, such as a web server, mail server, or other application.

The process involves recieving network traffic on one port, and redirecting it out another. This allows traffic that might be restricted or blocked over one port, to be allowed to pass over another.

Pivoting Tools

  • Powershell Empire tools

    • inveigh_relay - SMB relay function

    • invoke_executemsbuild - executes a powershell command on local/remote host using MSBuild.exe and an inline task.

    • invoke_psremoting - executes a stager on remote hostss using PSRemoting. Victim must have PSRemoting enabled.

    • invoke_sqloscmd - executes a command or stager on remote hosts using xp_cmdshell

    • invoke_wmi - execute a stager on remote hosts via WMI

    • jenkins_script_console - Deploys an empire agent against a Jenkins server with unauthed access to script console.

    • invoke_dcom - invoke commands on remote hosts using MMC20.Application COM object over DCOM.

    • invoke_psexec 0 executes a stager on remote host using PsExec type functionality. Oldy but a goodie

    • invoke_smbexec - using samba tools

    • invoke_sshcommand - executes a command on a remote host via SSH

    • Invoke_wmi_debugger - uses WMI to set the debugger for a target binary on a remote hosts to be cmd.exe or a stager

    • new_gpo_immediate_task - Builds and immediate schtask to push through a specified GPO. mist have access to modify GPOs

    • PTFM: Empire Admin Tools - pg. 52

Pivoting Techniques

https://www.offensive-security.com/metasploit-unleashed/psexec-pass-hash/

  • Some DPI devices only allow specific protocols, like no SSH

  • HTTPTunnel

    • # apt-cache search httptunnel

    • # sudo apt install httptunnel

    • # hts --forward-port localhost:8888 1234 (Server-linux target) 0

  • Set up server to listen on port 1234 and redirect to local 8888

    • # htc --forward-port 8080 10.11.0.128:1234 (Client-kali)

  • Set up client to send it to the listening server.

Last updated