Insecure Protocols
Conversations about the Network
James Feister openjaf@gmail.com
Computer Security
Reconnaissance
“Tap all the Things” (Liam Randall : BRO IDS)
Tools and Viz
What to look for
Preparing the interface
$ for i in rx tx sg tso ufo gso gro lro; do ethtool -K interface_name $i off; done
tcpdump, used to capture data
$> tcpdump -s0 -i interface -vvv
$> tcpdump -s0 -i interface -w file.pcap
$> tcpdump -s0 -i interface port 21
$> tcpdump -s0 -I -i interface
ngrep
$> ngrep -I telnet.pcap -W byline port 23
$> ngrep -I smtp.pcap -W byline port 25
$> ngrep -I ftp.pcap -W byline port 21
$> ngrep -I ftp.pcap -W byline port 20
ettercap
$> ettercap -r ftp.pcap -Tzq //21
$> ettercap -r ftp.pcap -Tzq //21
$> ettercap -Tzq -i interface_name
Type ‘h’ for help menu
FTP - What does this get us?
FTP - examples
$ ettercap -r ctp.pcap -Tzq //21
ettercap NG-0.7.3 copyright 2001-2004 ALoR & NaGA
Reading from ftp.pcap... (Ethernet)
28 plugins
39 protocol dissectors
53 ports monitored
7587 mac vendor fingerprint
1698 tcp OS fingerprint
2183 known services
Starting Unified sniffing...
FTP : 192.168.9.1:21 -> USER: thickeners PASS: ennobling
FTP : 192.168.9.3:21 -> USER: cabbage PASS: hydrodynamic
FTP : 192.168.9.4:21 -> USER: housetops PASS: statements
FTP : 192.168.9.5:21 -> USER: worrying PASS: cottoned
End of dump file...
Terminating ettercap...
$ ngrep -I ctp.pcap -W byline port 21
input: ctp.pcap
filter: (ip or ip6) and ( port 21 )
###
#
T 192.168.9.1:21 -> 192.168.9.3:49433 [AP]
220 This is the system banner Do not login..
#
.. Username and Password exchange Cut out ..
T 192.168.9.3:49433 -> 192.168.9.1:21 [AP]
STOR qrcode170.png.
#
T 192.168.9.1:21-> 192.168.9.3:49433 [AP]
150 Connection accepted.
......
exit
file operation
got creds?
TELNET
TELNET - example
$ ngrep -I ctp.pcap -W byline port 23
input: ctp.pcap
filter: (ip or ip6) and ( port 23 )
#
T 192.168.9.1:23 -> 192.168.9.2:49265 [AP]
Linux 2.6.31 (rox) (1).
rox login:
#
T 192.168.9.2:49265 -> 192.168.9.1:23 [AP]
roger
#
T 143.84.99.216:23 -> 192.168.9.2:49265 [AP]
Password:
#
T 192.168.9.2:49265 -> 192.168.9.1:23 [AP]
nothing
#
T 192.168.9.2:49265 -> 192.168.9.1:23 [AP]
export TERM=vt220
ls
exit
Commands Executed
Login Section
SMTP
SMTP example
$ tcpdump -tnAK -s0 -r ctp.pcap port 25
IP 192.168.1.3.smtp > 192.168.1.2.50289: Flags [P.], seq 1:17, ack 1, win 256, length 16
E..8,<@......Tc..Tc....q..\L....P...}@..220 MAIL ESMTP
IP 192.168.1.2.50289 > 192.168.1.3.smtp: Flags [P.], seq 1:21, ack 17, win 256, length 20
E..<.'@......Tc..Tc..q........\\P.......ehlo [143.84.99.2]
IP 192.168.1.3.smtp > 192.168.1.2.50289: Flags [P.], seq 17:62, ack 21, win 256, length 45
E..U,=@......Tc..Tc....q..\\....P...cO..250-MAIL
250-SIZE 20480000
250 AUTH LOGIN
IP 192.168.1.2.50289 > 192.168.1.3.smtp: Flags [P.], seq 21:46, ack 62, win 256, length 25
E..A.(@......Tc..Tc..q........\.P.......AUTH LOGIN YmlydGhkYXlz
IP 192.168.13.smtp > 192.168.1.2.50289: Flags [P.], seq 62:80, ack 46, win 256, length 18
E..:,>@......Tc..Tc....q..\.....P....4..334 UGFzc3dvcmQ6
IP 192.168.1.2.50289 > 192.168.1.3.smtp: Flags [P.], seq 46:60, ack 80, win 256, length 14
E..6.)@......Tc..Tc..q........\.P.......cGFyb2xpbmc=
IP 192.168.1.3.smtp > 192.168.1.2.50289: Flags [P.], seq 80:100, ack 60, win 256, length 20
E..<,?@......Tc..Tc....q..\.....P....v..235 authenticated.
Username, Base64 encoded
$ echo "YmlydGhkYXlz" | base64 -d
birthdays
Password Request, Base64 encoded
$ echo "UGFzc3dvcmQ6" | base64 -d
Password:
Password, Base64 encoded
$ echo "cGFyb2xpbmc=" | base64 -d
paroling
SNMP
References
todo
IGMP, SMB, NFS: discussion and examples
SNMP: examples