More Related Content
a little more about CaptureFilter IPv6冗長で差をつけよう 2011年夏の思い出作り VRRP編 Maria X MIT presentation slides Packet と向き合う夏 VRRP Advertisement編 Sara portfolio april 2011 cput 2nd yr It fin analyse_slideshare_20110915 超簡単!? Punycode 変換 ~国際化・日本語ドメイン~ Viewers also liked (20)
DNS64 (El capitan and unbound-1.5.1) raspi + soracom #pakeana33 how to defend DNS authoritative server against DNS WaterTorture BPF - All your packets belong to me Data Integrity Techniques: Aviation Best Practices for CRC & Checksum Error D... Network traffic analysis course Packet capture in network security Poor Rich (Poor Rich.Pps) Similar to how to GET GET (20)
Hokkaido.cap#2 一般的なプロトコルのパケットを覗いてみよう tcpdumpとtcpreplayとtcprewriteと他。 Hokkaido.cap #osc11do Wiresharkを使いこなそう! Scapy presentation Remake(訂正) 法政大学情報科学部 2012年度コンピュータネットワーク-第8回授業-Web公開用 Wiresharkで検出できないチャットプログラム 法政大学情報科学部 2012年度コンピュータネットワーク-第12回授業-Web公開用 Hokkaido.cap#1 Wiresharkの使い方(基礎編) Programming under capability mode More from @ otsuka752 (18)
NS & NSID of Amazon Route 53 OLD_Lt traffic analyse_OLD reusable delegation set のススメ (Route53) how to decrypt SSL/TLS without PrivateKey of servers Measurement of Maximum new NAT-sessionsper second / How to send packets 毎日 dig ったら分かったこと ~新 gTLD~ パケットが教えてくれた ルートサーバが 13個の理由 IPv6冗長で差をつけよう 2011年夏の思い出作り HSRP編 how to GET GET
- 3. about me
• @twovs
• ネコ2人+奥さん1人+可愛い娘
• 無線LAN装置の開発(1999~2004)• 無線LAN装置の開発(1999~2004)
• オンラインゲームのシステム管理者(2004~)
• ただし,ゲームには全く興味無し
• ZFS 最高 !!! beadm 便利 !!!
- 5. 実行例
# cat filter
tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420
# tcpdump -n -t -X -i lo -F filter
tcpdump: listening on lo
127.0.0.1.38968 > 127.0.0.1.http: P 1871129285:1871129296(11) ack 1861065890 win
32767 <nop,nop,timestamp 9709988 9709773> (DF) [tos 0x10]
0x0000 4510 003f 020b 4000 4006 3a9c 7f00 0001 E..?..@.@.:.....
0x0010 7f00 0001 9838 0050 6f87 2ac5 6eed 9ca2 .....8.Po.*.n...
0x0020 8018 7fff bd67 0000 0101 080a 0094 29a4 .....g........).
0x0030 0094 28cd 4745 5420 2f68 6f67 650d 0a ..(.GET./hoge..
• GET /hoge だけが dump される
• 3-way-handshake など他のパケットは無視
- 9. Memo.3
TCP のヘッダ長は 32 bit-word(4 Byte-word)
offset の bit を 4倍すればヘッダ長[Byte]に
offset は 4[bit](0000 - 1111)
‘0001’-> 4[Byte]
‘0010’-> 8[Byte]
…
‘0101’-> 20[Byte]
…
‘1111’-> 60[Byte]
(つまり,TCPヘッダは最大でも 60[Byte])
- 12. #1
tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420
12[Byte] offset 後の 1[Byte] == 8[bit] を取得
ただし下 4[bit]の余計な bit も含んでいる
12[Byte]
8[bit]
- 14. #3
tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420
右に 4[bit] シフトすることで 4bit 分のヘッダ長[bit]が
左に 2[bit] シフトする得られたヘッダ長[bit]を 4倍できる
トータルで右に 2[bit] シフトするとヘッダ長[Byte]を得るトータルで右に 2[bit] シフトするとヘッダ長[Byte]を得る