SlideShare uma empresa Scribd logo
1 de 13
Scripting with Tshark (2) June 2009
This months topic ,[object Object],[object Object],[object Object],[object Object]
Situation ,[object Object],[object Object],[object Object],[object Object],[object Object]
Steps to take ,[object Object],[object Object],[object Object],[object Object]
"Prerequisites" ,[object Object],[object Object],[object Object],[object Object],[object Object]
1: Select packets with searchdata $  tshark -r sharkfest-1.cap -R "http.request and http.cookie contains amp;quot;PHPSESSID=c0bb9d04cebbc765bc9bc366f663fcafamp;quot;" 66 352.849802 192.168.1.30 -> 194.134.109.48 HTTP GET /styles/ ... 90 352.943964 192.168.1.30 -> 194.134.109.48 HTTP GET /styles/ ... 101 352.995346 192.168.1.30 -> 194.134.109.48 HTTP GET /javascr ... 115 353.051093 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 118 353.055001 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 139 353.131598 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 142 353.132616 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 161 353.191958 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 165 353.200628 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 182 353.493676 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 185 353.503053 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 205 353.553385 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 209 353.557910 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 225 353.607322 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 229 353.619819 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 245 353.669407 192.168.1.30 -> 194.134.109.48 HTTP GET /javascr ... 249 353.681990 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... [...] $
2: Print only source ip and port $  tshark -r sharkfest-1.cap -R "http.request and http.cookie contains amp;quot;PHPSESSID=c0bb9d04cebbc765bc9bc366f663fcafamp;quot;"  -T fields -e ip.src -e tcp.srcport | sort | uniq 192.168.1.30  3981 192.168.1.30  3982 192.168.1.30  3983 192.168.1.30  3984 192.168.1.30  3985 192.168.1.30  3986 192.168.1.30  3987 192.168.1.30  3988 192.168.1.30  3989 192.168.1.30  3991 192.168.1.30  3992 192.168.1.30  3993 192.168.1.30  3994 192.168.1.30  3996 192.168.1.30  3997 192.168.1.30  3998 [...] $
3: Create new display filter (1) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
3: Create new display filter (2) $  tshark -r sharkfest-1.cap -R "http.request and http.cookie contains amp;quot;PHPSESSID=c0bb9d04cebbc765bc9bc366f663fcafamp;quot;" -T fields -e ip.src -e tcp.srcport | sort | uniq  | awk '{printf("%s(ip.addr==%s&&tcp.port==%s)",sep,$1,$2);sep="||"}' (ip.addr==192.168.1.30&&tcp.port==3981)||(ip.addr==192.168.1.30&& tcp.port==3982)||(ip.addr==192.168.1.30&&tcp.port==3983)||(ip.add r==192.168.1.30&&tcp.port==3984)||(ip.addr==192.168.1.30&&tcp.por t==3985)||(ip.addr==192.168.1.30&&tcp.port==3986)||(ip.addr==192. 168.1.30&&tcp.port==3987)||(ip.addr==192.168.1.30&&tcp.port==3988 )||(ip.addr==192.168.1.30&&tcp.port==3989)||(ip.addr==192.168.1.3 0&&tcp.port==3991)||(ip.addr==192.168.1.30&&tcp.port==3992)||(ip. addr==192.168.1.30&&tcp.port==3993)||(ip.addr==192.168.1.30&&tcp. port==3994)||(ip.addr==192.168.1.30&&tcp.port==3996)||(ip.addr==1 92.168.1.30&&tcp.port==3997)||(ip.addr==192.168.1.30&&tcp.port==3 998)||(ip.addr==192.168.1.30&&tcp.port==3999)||(ip.addr==192.168. 1.30&&tcp.port==4000)||(ip.addr==192.168.1.30&&tcp.port==4001)||( ip.addr==192.168.1.30&&tcp.port==4002)||(ip.addr==192.168.1.30&&t cp.port==4003)||(ip.addr==192.168.1.30&&tcp.port==4004)||(ip.addr ==192.168.1.30&&tcp.port==4006)||(ip.addr==192.168.1.30&&tcp.port ==4007)|| [...] ||(ip.addr==192.168.1.30&&tcp.port==4126) $
4: extract the tcp sessions $   tshark -r sharkfest-1.cap -R $( tshark -r sharkfest-1.cap -R "http.request and http.cookie contains amp;quot;PHPSESSID=c0bb9d04cebbc765bc9bc366f663fcafamp;quot;" -T fields -e ip.src -e tcp.srcport | sort | uniq | awk '{printf("%s(ip.addr==%s&&tcp.port==%s)",sep,$1,$2); sep="||"}' ) -w cookie.cap $ $ tshark -r cookie.cap  1  0.000000 192.168.1.30 -> 194.134.109.48 TCP starfish > http [SYN] Seq=0 Win=655… 2  0.010379 194.134.109.48 -> 192.168.1.30 TCP http > starfish [SYN, ACK] Seq=0 Ac… 3  0.010456 192.168.1.30 -> 194.134.109.48 TCP starfish > http [ACK] Seq=1 Ack=1 W… 4  0.010692 192.168.1.30 -> 194.134.109.48 HTTP GET /styles/scherm.css HTTP/1.1  5  0.026023 194.134.109.48 -> 192.168.1.30 TCP http > starfish [ACK] Seq=1 Ack=384… 6  0.034230 194.134.109.48 -> 192.168.1.30 TCP [TCP segment of a reassembled PDU] 7  0.038617 194.134.109.48 -> 192.168.1.30 TCP [TCP segment of a reassembled PDU] 8  0.038683 192.168.1.30 -> 194.134.109.48 TCP starfish > http [ACK] Seq=384 Ack=29… 9  0.043327 194.134.109.48 -> 192.168.1.30 TCP [TCP segment of a reassembled PDU] 10  0.050840 194.134.109.48 -> 192.168.1.30 TCP [TCP segment of a reassembled PDU] 11  0.050899 192.168.1.30 -> 194.134.109.48 TCP starfish > http [ACK] Seq=384 Ack=58… 12  0.055159 194.134.109.48 -> 192.168.1.30 TCP [TCP segment of a reassembled PDU] 13  0.059893 194.134.109.48 -> 192.168.1.30 TCP [TCP segment of a reassembled PDU] [...] $
TIPS ,[object Object],[object Object]
That's all folks! ,[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object]

Mais conteúdo relacionado

Mais de Denny K

5:7:2024 - Fourth Noble Truth • Mindfulness Meditation and Dharma Talk with V...
5:7:2024 - Fourth Noble Truth • Mindfulness Meditation and Dharma Talk with V...5:7:2024 - Fourth Noble Truth • Mindfulness Meditation and Dharma Talk with V...
5:7:2024 - Fourth Noble Truth • Mindfulness Meditation and Dharma Talk with V...Denny K
 
4/30/2024「同心共善」善心法師網上禪修班 (粵語) ..........
4/30/2024「同心共善」善心法師網上禪修班 (粵語) ..........4/30/2024「同心共善」善心法師網上禪修班 (粵語) ..........
4/30/2024「同心共善」善心法師網上禪修班 (粵語) ..........Denny K
 
4/23/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
4/23/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..4/23/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
4/23/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..Denny K
 
4/16/2024「同心共善」善心法師網上禪修班 (粵語) ..........
4/16/2024「同心共善」善心法師網上禪修班 (粵語) ..........4/16/2024「同心共善」善心法師網上禪修班 (粵語) ..........
4/16/2024「同心共善」善心法師網上禪修班 (粵語) ..........Denny K
 
4/2/2024 - Fourth Noble Truth • Mindfulness Meditation and Dharma Talk with V...
4/2/2024 - Fourth Noble Truth • Mindfulness Meditation and Dharma Talk with V...4/2/2024 - Fourth Noble Truth • Mindfulness Meditation and Dharma Talk with V...
4/2/2024 - Fourth Noble Truth • Mindfulness Meditation and Dharma Talk with V...Denny K
 
3/26/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
3/26/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..3/26/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
3/26/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..Denny K
 
3/19/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
3/19/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..3/19/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
3/19/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..Denny K
 
3/12/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
3/12/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..3/12/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
3/12/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..Denny K
 
3:5:2024 - Third Noble Truth • Mindfulness Meditation and Dharma Talk with Ve...
3:5:2024 - Third Noble Truth • Mindfulness Meditation and Dharma Talk with Ve...3:5:2024 - Third Noble Truth • Mindfulness Meditation and Dharma Talk with Ve...
3:5:2024 - Third Noble Truth • Mindfulness Meditation and Dharma Talk with Ve...Denny K
 
2/27/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
2/27/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..2/27/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
2/27/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..Denny K
 
2/20/2024「同心共善」善心法師網上禪修班 (粵語) ..........
2/20/2024「同心共善」善心法師網上禪修班 (粵語) ..........2/20/2024「同心共善」善心法師網上禪修班 (粵語) ..........
2/20/2024「同心共善」善心法師網上禪修班 (粵語) ..........Denny K
 
2/13/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
2/13/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..2/13/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
2/13/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..Denny K
 
2/6/2023 - Second Noble Truth • Mindfulness Meditation and Dharma Talk with V...
2/6/2023 - Second Noble Truth • Mindfulness Meditation and Dharma Talk with V...2/6/2023 - Second Noble Truth • Mindfulness Meditation and Dharma Talk with V...
2/6/2023 - Second Noble Truth • Mindfulness Meditation and Dharma Talk with V...Denny K
 
1/30/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
1/30/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..1/30/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
1/30/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..Denny K
 
1/23/2024「同心共善」善心法師網上禪修班 (粵語) ..........
1/23/2024「同心共善」善心法師網上禪修班 (粵語) ..........1/23/2024「同心共善」善心法師網上禪修班 (粵語) ..........
1/23/2024「同心共善」善心法師網上禪修班 (粵語) ..........Denny K
 
1/16/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
1/16/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..1/16/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
1/16/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..Denny K
 
1/9/2024「同心共善」善心法師網上禪修班 (粵語) ………………………..
1/9/2024「同心共善」善心法師網上禪修班 (粵語) ………………………..1/9/2024「同心共善」善心法師網上禪修班 (粵語) ………………………..
1/9/2024「同心共善」善心法師網上禪修班 (粵語) ………………………..Denny K
 
1/2/2023 - Mindfulness Meditation and Dharma Talk with Venerable De Hong
1/2/2023 - Mindfulness Meditation and Dharma Talk with Venerable De Hong1/2/2023 - Mindfulness Meditation and Dharma Talk with Venerable De Hong
1/2/2023 - Mindfulness Meditation and Dharma Talk with Venerable De HongDenny K
 
12/27/2023「同心共善」善心法師網上禪修班 (粵語) …………………..
12/27/2023「同心共善」善心法師網上禪修班 (粵語) …………………..12/27/2023「同心共善」善心法師網上禪修班 (粵語) …………………..
12/27/2023「同心共善」善心法師網上禪修班 (粵語) …………………..Denny K
 
12/20/2023「同心共善」善心法師網上禪修班 (粵語) …………………..
12/20/2023「同心共善」善心法師網上禪修班 (粵語) …………………..12/20/2023「同心共善」善心法師網上禪修班 (粵語) …………………..
12/20/2023「同心共善」善心法師網上禪修班 (粵語) …………………..Denny K
 

Mais de Denny K (20)

5:7:2024 - Fourth Noble Truth • Mindfulness Meditation and Dharma Talk with V...
5:7:2024 - Fourth Noble Truth • Mindfulness Meditation and Dharma Talk with V...5:7:2024 - Fourth Noble Truth • Mindfulness Meditation and Dharma Talk with V...
5:7:2024 - Fourth Noble Truth • Mindfulness Meditation and Dharma Talk with V...
 
4/30/2024「同心共善」善心法師網上禪修班 (粵語) ..........
4/30/2024「同心共善」善心法師網上禪修班 (粵語) ..........4/30/2024「同心共善」善心法師網上禪修班 (粵語) ..........
4/30/2024「同心共善」善心法師網上禪修班 (粵語) ..........
 
4/23/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
4/23/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..4/23/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
4/23/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
 
4/16/2024「同心共善」善心法師網上禪修班 (粵語) ..........
4/16/2024「同心共善」善心法師網上禪修班 (粵語) ..........4/16/2024「同心共善」善心法師網上禪修班 (粵語) ..........
4/16/2024「同心共善」善心法師網上禪修班 (粵語) ..........
 
4/2/2024 - Fourth Noble Truth • Mindfulness Meditation and Dharma Talk with V...
4/2/2024 - Fourth Noble Truth • Mindfulness Meditation and Dharma Talk with V...4/2/2024 - Fourth Noble Truth • Mindfulness Meditation and Dharma Talk with V...
4/2/2024 - Fourth Noble Truth • Mindfulness Meditation and Dharma Talk with V...
 
3/26/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
3/26/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..3/26/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
3/26/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
 
3/19/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
3/19/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..3/19/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
3/19/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
 
3/12/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
3/12/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..3/12/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
3/12/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
 
3:5:2024 - Third Noble Truth • Mindfulness Meditation and Dharma Talk with Ve...
3:5:2024 - Third Noble Truth • Mindfulness Meditation and Dharma Talk with Ve...3:5:2024 - Third Noble Truth • Mindfulness Meditation and Dharma Talk with Ve...
3:5:2024 - Third Noble Truth • Mindfulness Meditation and Dharma Talk with Ve...
 
2/27/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
2/27/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..2/27/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
2/27/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
 
2/20/2024「同心共善」善心法師網上禪修班 (粵語) ..........
2/20/2024「同心共善」善心法師網上禪修班 (粵語) ..........2/20/2024「同心共善」善心法師網上禪修班 (粵語) ..........
2/20/2024「同心共善」善心法師網上禪修班 (粵語) ..........
 
2/13/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
2/13/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..2/13/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
2/13/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
 
2/6/2023 - Second Noble Truth • Mindfulness Meditation and Dharma Talk with V...
2/6/2023 - Second Noble Truth • Mindfulness Meditation and Dharma Talk with V...2/6/2023 - Second Noble Truth • Mindfulness Meditation and Dharma Talk with V...
2/6/2023 - Second Noble Truth • Mindfulness Meditation and Dharma Talk with V...
 
1/30/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
1/30/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..1/30/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
1/30/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
 
1/23/2024「同心共善」善心法師網上禪修班 (粵語) ..........
1/23/2024「同心共善」善心法師網上禪修班 (粵語) ..........1/23/2024「同心共善」善心法師網上禪修班 (粵語) ..........
1/23/2024「同心共善」善心法師網上禪修班 (粵語) ..........
 
1/16/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
1/16/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..1/16/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
1/16/2024「同心共善」善心法師網上禪修班 (粵語) ……………………..
 
1/9/2024「同心共善」善心法師網上禪修班 (粵語) ………………………..
1/9/2024「同心共善」善心法師網上禪修班 (粵語) ………………………..1/9/2024「同心共善」善心法師網上禪修班 (粵語) ………………………..
1/9/2024「同心共善」善心法師網上禪修班 (粵語) ………………………..
 
1/2/2023 - Mindfulness Meditation and Dharma Talk with Venerable De Hong
1/2/2023 - Mindfulness Meditation and Dharma Talk with Venerable De Hong1/2/2023 - Mindfulness Meditation and Dharma Talk with Venerable De Hong
1/2/2023 - Mindfulness Meditation and Dharma Talk with Venerable De Hong
 
12/27/2023「同心共善」善心法師網上禪修班 (粵語) …………………..
12/27/2023「同心共善」善心法師網上禪修班 (粵語) …………………..12/27/2023「同心共善」善心法師網上禪修班 (粵語) …………………..
12/27/2023「同心共善」善心法師網上禪修班 (粵語) …………………..
 
12/20/2023「同心共善」善心法師網上禪修班 (粵語) …………………..
12/20/2023「同心共善」善心法師網上禪修班 (粵語) …………………..12/20/2023「同心共善」善心法師網上禪修班 (粵語) …………………..
12/20/2023「同心共善」善心法師網上禪修班 (粵語) …………………..
 

Último

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 

Último (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

OSTU - Sake Blok on Scripting with TShark (Part 2)

  • 1. Scripting with Tshark (2) June 2009
  • 2.
  • 3.
  • 4.
  • 5.
  • 6. 1: Select packets with searchdata $ tshark -r sharkfest-1.cap -R "http.request and http.cookie contains amp;quot;PHPSESSID=c0bb9d04cebbc765bc9bc366f663fcafamp;quot;" 66 352.849802 192.168.1.30 -> 194.134.109.48 HTTP GET /styles/ ... 90 352.943964 192.168.1.30 -> 194.134.109.48 HTTP GET /styles/ ... 101 352.995346 192.168.1.30 -> 194.134.109.48 HTTP GET /javascr ... 115 353.051093 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 118 353.055001 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 139 353.131598 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 142 353.132616 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 161 353.191958 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 165 353.200628 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 182 353.493676 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 185 353.503053 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 205 353.553385 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 209 353.557910 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 225 353.607322 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 229 353.619819 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... 245 353.669407 192.168.1.30 -> 194.134.109.48 HTTP GET /javascr ... 249 353.681990 192.168.1.30 -> 194.134.109.48 HTTP GET /images/ ... [...] $
  • 7. 2: Print only source ip and port $ tshark -r sharkfest-1.cap -R "http.request and http.cookie contains amp;quot;PHPSESSID=c0bb9d04cebbc765bc9bc366f663fcafamp;quot;" -T fields -e ip.src -e tcp.srcport | sort | uniq 192.168.1.30 3981 192.168.1.30 3982 192.168.1.30 3983 192.168.1.30 3984 192.168.1.30 3985 192.168.1.30 3986 192.168.1.30 3987 192.168.1.30 3988 192.168.1.30 3989 192.168.1.30 3991 192.168.1.30 3992 192.168.1.30 3993 192.168.1.30 3994 192.168.1.30 3996 192.168.1.30 3997 192.168.1.30 3998 [...] $
  • 8.
  • 9. 3: Create new display filter (2) $ tshark -r sharkfest-1.cap -R "http.request and http.cookie contains amp;quot;PHPSESSID=c0bb9d04cebbc765bc9bc366f663fcafamp;quot;" -T fields -e ip.src -e tcp.srcport | sort | uniq | awk '{printf("%s(ip.addr==%s&&tcp.port==%s)",sep,$1,$2);sep="||"}' (ip.addr==192.168.1.30&&tcp.port==3981)||(ip.addr==192.168.1.30&& tcp.port==3982)||(ip.addr==192.168.1.30&&tcp.port==3983)||(ip.add r==192.168.1.30&&tcp.port==3984)||(ip.addr==192.168.1.30&&tcp.por t==3985)||(ip.addr==192.168.1.30&&tcp.port==3986)||(ip.addr==192. 168.1.30&&tcp.port==3987)||(ip.addr==192.168.1.30&&tcp.port==3988 )||(ip.addr==192.168.1.30&&tcp.port==3989)||(ip.addr==192.168.1.3 0&&tcp.port==3991)||(ip.addr==192.168.1.30&&tcp.port==3992)||(ip. addr==192.168.1.30&&tcp.port==3993)||(ip.addr==192.168.1.30&&tcp. port==3994)||(ip.addr==192.168.1.30&&tcp.port==3996)||(ip.addr==1 92.168.1.30&&tcp.port==3997)||(ip.addr==192.168.1.30&&tcp.port==3 998)||(ip.addr==192.168.1.30&&tcp.port==3999)||(ip.addr==192.168. 1.30&&tcp.port==4000)||(ip.addr==192.168.1.30&&tcp.port==4001)||( ip.addr==192.168.1.30&&tcp.port==4002)||(ip.addr==192.168.1.30&&t cp.port==4003)||(ip.addr==192.168.1.30&&tcp.port==4004)||(ip.addr ==192.168.1.30&&tcp.port==4006)||(ip.addr==192.168.1.30&&tcp.port ==4007)|| [...] ||(ip.addr==192.168.1.30&&tcp.port==4126) $
  • 10. 4: extract the tcp sessions $ tshark -r sharkfest-1.cap -R $( tshark -r sharkfest-1.cap -R "http.request and http.cookie contains amp;quot;PHPSESSID=c0bb9d04cebbc765bc9bc366f663fcafamp;quot;" -T fields -e ip.src -e tcp.srcport | sort | uniq | awk '{printf("%s(ip.addr==%s&&tcp.port==%s)",sep,$1,$2); sep="||"}' ) -w cookie.cap $ $ tshark -r cookie.cap 1 0.000000 192.168.1.30 -> 194.134.109.48 TCP starfish > http [SYN] Seq=0 Win=655… 2 0.010379 194.134.109.48 -> 192.168.1.30 TCP http > starfish [SYN, ACK] Seq=0 Ac… 3 0.010456 192.168.1.30 -> 194.134.109.48 TCP starfish > http [ACK] Seq=1 Ack=1 W… 4 0.010692 192.168.1.30 -> 194.134.109.48 HTTP GET /styles/scherm.css HTTP/1.1 5 0.026023 194.134.109.48 -> 192.168.1.30 TCP http > starfish [ACK] Seq=1 Ack=384… 6 0.034230 194.134.109.48 -> 192.168.1.30 TCP [TCP segment of a reassembled PDU] 7 0.038617 194.134.109.48 -> 192.168.1.30 TCP [TCP segment of a reassembled PDU] 8 0.038683 192.168.1.30 -> 194.134.109.48 TCP starfish > http [ACK] Seq=384 Ack=29… 9 0.043327 194.134.109.48 -> 192.168.1.30 TCP [TCP segment of a reassembled PDU] 10 0.050840 194.134.109.48 -> 192.168.1.30 TCP [TCP segment of a reassembled PDU] 11 0.050899 192.168.1.30 -> 194.134.109.48 TCP starfish > http [ACK] Seq=384 Ack=58… 12 0.055159 194.134.109.48 -> 192.168.1.30 TCP [TCP segment of a reassembled PDU] 13 0.059893 194.134.109.48 -> 192.168.1.30 TCP [TCP segment of a reassembled PDU] [...] $
  • 11.
  • 12.
  • 13.