Tcpdump
Nah ini dia salah satu sniffer terkenal di linux Untuk memantau aktivitas paket di jaringan.
Untuk menginstall tcpdump:
Code:
Untuk menginstall tcpdump:
Code:
sudo apt-get install tcpdump
Untuk mulai menjalankan tcpdump ketikkan:
Code:
Code:
tcpdump
Sebelum mulai melakukan sniffing, kita lihat dulu network interface yang bisa kita capture
dengan: tcpdump -D
contoh:
Code:
contoh:
Code:
bt ~ # tcpdump -D
1.eth0
2.any (Pseudo-device that captures on all interfaces)
3.lo
bt ~ #
1.eth0
2.any (Pseudo-device that captures on all interfaces)
3.lo
bt ~ #
Ok mari kita langsung aja praktek dengan mengcapture paket 2 via interface lo.
Sebelum mulai tcpdump kita coba dulu bind port dan listen dengan netcat untuk contoh, misal kita
Sebelum mulai tcpdump kita coba dulu bind port dan listen dengan netcat untuk contoh, misal kita
buka port 3333:
Code:
Code:
bt lampp # nc -l -p 3335 -vv
listening on [any] 3335 …
listening on [any] 3335 …
Selanjutnya kita coba jalankan tcpdump untuk capture lalu lintas di port 3335 secara lokal
(loopback address dengan interface lo):
Code:
Code:
tcpdump -vv -x -X -s 1500 -i lo ‘port 3335′
Ok, selanjutnya untuk eksperimen kita coba koneksi ke localhost di port 3335:
Code:
Code:
bt network # telnet localhost 3335
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
ketikkan string misalnya: hacked by (nama-anda)
Ok mari kita lihat plain text : “hacked by mywisdom” tadi tercapture via tcpdump :
Code:
bt ~ # tcpdump -vv -x -X -s 1500 -i lo ‘port 3335′
tcpdump: listening on lo, link-type EN10MB (Ethernet), capture size 1500 bytes
23:32:27.414840 IP (tos 0×0, ttl 64, id 62383, offset 0, flags [DF], proto TCP (6), length 71)
bt ~ # tcpdump -vv -x -X -s 1500 -i lo ‘port 3335′
tcpdump: listening on lo, link-type EN10MB (Ethernet), capture size 1500 bytes
23:32:27.414840 IP (tos 0×0, ttl 64, id 62383, offset 0, flags [DF], proto TCP (6), length 71)
localhost.3335 > localhost.55714: P, cksum 0xfe3b (incorrect (-> 0xa241), 628168326:628168345(19)
ack 622312675 win 1024
0×0000: 4500 0047 f3af 4000 4006 48ff 7f00 0001 E..G..@.@.H…..
0×0010: 7f00 0001 0d07 d9a2 2571 1686 2517 bce3 ……..%q..%…
0×0020: 8018 0400 fe3b 0000 0101 080a 0024 21cc …..;…….$!.
0×0030: 0024 0f46 6861 636b 6564 2062 7920 6d79 .$.Fhacked.by.my
0×0040: 7769 7364 6f6d 0a wisdom.
23:32:27.414860 IP (tos 0×10, ttl 64, id 22880, offset 0, flags [DF], proto TCP (6), length 52)
0×0000: 4500 0047 f3af 4000 4006 48ff 7f00 0001 E..G..@.@.H…..
0×0010: 7f00 0001 0d07 d9a2 2571 1686 2517 bce3 ……..%q..%…
0×0020: 8018 0400 fe3b 0000 0101 080a 0024 21cc …..;…….$!.
0×0030: 0024 0f46 6861 636b 6564 2062 7920 6d79 .$.Fhacked.by.my
0×0040: 7769 7364 6f6d 0a wisdom.
23:32:27.414860 IP (tos 0×10, ttl 64, id 22880, offset 0, flags [DF], proto TCP (6), length 52)
localhost.55714 > localhost.3335: ., cksum 0x2c2b (correct), 1:1(0) ack 19 win 1025
0×0000: 4510 0034 5960 4000 4006 e351 7f00 0001 E..4Y`@.@..Q….
0×0010: 7f00 0001 d9a2 0d07 2517 bce3 2571 1699 ……..%…%q..
0×0020: 8010 0401 2c2b 0000 0101 080a 0024 21cc ….,+…….$!.
0×0030: 0024 21cc .$!.
0×0000: 4510 0034 5960 4000 4006 e351 7f00 0001 E..4Y`@.@..Q….
0×0010: 7f00 0001 d9a2 0d07 2517 bce3 2571 1699 ……..%…%q..
0×0020: 8010 0401 2c2b 0000 0101 080a 0024 21cc ….,+…….$!.
0×0030: 0024 21cc .$!.