tcp foo - hackpgh · 2010-10-19 · netcat the tcp/ip swiss army knife a unix utility which reads...

37
TCP Foo NetCat and NMAP too A presentation by Alex Meyers and Chris Teodorski

Upload: others

Post on 05-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

TCP FooNetCat and NMAP too

A presentation by Alex Meyers and Chris Teodorski

Page 2: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

Nmap too.

Page 3: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

Sorry, wrong nmap.

Page 4: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

A how-to on some scan foo...To make the most doesn't require verbose.

Page 5: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

Don't miss, make a list. -sL

Page 6: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be
Page 7: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

64.13.134.48-53

Page 8: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

Nmap 64.13.134.48-53Nmap 10.116.0-255.1-127Nmap 192.168.1.1/24Nmap *41.24-33.*.1-254

Enter the scanman

Page 9: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

--top-ports 5

One of my favorite new switches. It saves you

stitches when hiding from snitches, bitches.

Page 10: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

I meant sneeches.

Page 11: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

Technique and more switches.

--top-ports 5--reason--sA (Ack scan)

Page 12: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be
Page 13: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

Here is your TCP foo.

Tcp full-connect*No-response (The firewall disregards)

Syn-ack (The dude obliges)

Ack-scanReset (ZOMGWTF! RFC793)

Page 14: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be
Page 15: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

No Response (This is a state-full firewall.)

Page 16: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be
Page 17: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

Closed ports tend to reply to your FIN with a RST. Open ports tend to ignore the packet in question.

Page 18: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

Except for windows machines.Open or closed, they RST.

Page 19: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be
Page 20: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

A normal, actual closed port.

Page 21: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be
Page 22: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

-sV -O -sC

More (built in) Fingerprinting

Page 23: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

Or simply...

-A-A

Page 24: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be
Page 25: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be
Page 26: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

Not often remembered.

- - interactive

Page 27: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be
Page 28: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

Summary:

nmap -sT -A --osscan-limit -T5 --min-hostgroup 100 --max-retries 2 --top-ports 10 --reason -vv -iL DailyScan.txt -oA $(DATE)scan

Page 29: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

This page intentionally blank

Page 30: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

NetCatthe TCP/IP swiss army knife

● A Unix utility which reads and writes data across network connections, using TCP or UDP

● It is designed to be a reliable "back-end" tool that can be used directly or easily driven by other programs and scripts.

Page 31: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

Caveat

netcat-openbsd

is not

netcat-tradtional

Page 32: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

So boring, I'm snoring● Direct connect

● nc -nvlp 8080 (server)● nc <server> 8080 (client)

● Stupid Chat

Page 33: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

● Getting Shell● -e ● AV and Me

● File Transfer● nc -nvlp 8080 > poopypants.txt (server)● nc <server> 8080 < poopypants.txt (client)

Page 34: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

Don't be at a loss, NetCat really is pure awesome sauce

● Reverse Connect – The Firewall Killer● nc -nvlp 8080 (client)● nc <server> 8080 (server)

● Port Scanning with NetCat (okay, it's no nmap)

● nc -v -n -w 2 -z <target>

Page 35: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

● Banner grabbing● nc -v <target host> <target port>

● PHUKD + Netcat

Props to Ed Skoudis for this

Page 36: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be

Still more you can do, once you master NCat too.

● Ncat is NetCat for the 21st century● -k keep the connection open for more than one

client● --broker allow mutiple connections and allow

communication between the clients● -ssl encrypt your foo● --telnet accept telnet negotiations

Page 37: TCP Foo - HackPGH · 2010-10-19 · NetCat the TCP/IP swiss army knife A Unix utility which reads and writes data across network connections, using TCP or UDP It is designed to be