# WireShark [TOC] # Basic Concept ## Pcap Property ![圖片](https://hackmd.io/_uploads/S12qxT67C.png) ![圖片](https://hackmd.io/_uploads/Hk9JZ6T7R.png) ![圖片](https://hackmd.io/_uploads/H1KrZTpQC.png) ## Protocol Hierarchy ![圖片](https://hackmd.io/_uploads/SJ5r8n6mC.png) ![圖片](https://hackmd.io/_uploads/H1wKLnpmC.png) HTTP (Analysis Web Attack) ### Analysis HTTP Data ![圖片](https://hackmd.io/_uploads/H163ZpaXC.png) ![圖片](https://hackmd.io/_uploads/HJLJG66XR.png) ### Analysis Reverse shell ``` tcp.port == 4444 ``` ![圖片](https://hackmd.io/_uploads/ryeNEpTQ0.png) ![圖片](https://hackmd.io/_uploads/rJAAQpT70.png) ### HTTP Stream Follow HTTP stream ![圖片](https://hackmd.io/_uploads/rJTzG66QA.png) ![圖片](https://hackmd.io/_uploads/r1sLzap7C.png) ## Export (HTTP Analysis) Export we interesting Protocol e.g. HTTP ! ![圖片](https://hackmd.io/_uploads/B12zvn6XC.png) ![圖片](https://hackmd.io/_uploads/SyE-_nTmC.png) ## Export (FTP file) ![圖片](https://hackmd.io/_uploads/HJ2JEX0Q0.png) ![圖片](https://hackmd.io/_uploads/Hyl-VQRXR.png) ## Identify Attacker IP and Victims IP Statistics > Endpoints. ![圖片](https://hackmd.io/_uploads/SkZHpnamA.png) ## Decode As If some Server is not run in stander Port we can use decode as to specify packet Protocol Internal FTP ![圖片](https://hackmd.io/_uploads/HkuAOQRm0.png) Due to the FTP is not run on Stander port, export object can't recognize it we have to manual identify it and set it as FTP packet ![圖片](https://hackmd.io/_uploads/Hkhnc7RXA.png) ![圖片](https://hackmd.io/_uploads/ByewoXRQR.png) ![圖片](https://hackmd.io/_uploads/By0xiQR7R.png) ## Filter Setting (Interesting Packet) ### Filtering Operators - and - operator: and / && - or - operator: or / || - equals - operator: eq / == - not equal - operator: ne / != - greater than - operator: gt /  > - less than - operator: lt / < Reference https://www.wireshark.org/docs/wsug_html_chunked/ChWorkBuildDisplayFilterSection.html ## Recover Doc File we have to find Transfer Doc stream, and flow the string ![圖片](https://hackmd.io/_uploads/B1n29VCmC.png) ![圖片](https://hackmd.io/_uploads/rJuWjN0mC.png) ![圖片](https://hackmd.io/_uploads/By9Bi40mA.png) ## Searching Interest Packets ### IP Address ``` ip.addr == <IPaddress> ip.src == <packet source> ip.des == <packe destination> ``` ### Port ``` tcp.port == <port number> tcp.port eq <port number> or <protocol> ``` e.g. ``` tcp.port == 80 || udp.port == 80 ``` ### TCP ``` tcp.flags.syn == 1 #SYN Flag tcp.flags.ack == 1 #ACK Flag tcp.seq == 0 #Scaning Attack tcp.seq == 1 #Service Replay ``` ### info column ``` http contains "string" frame contains "string" (if you don't care if the string is inside HTTP packets) ``` ### FTP ``` ftp || ftp-data ``` # HTTPS Decrypt (Need Private key) Security Tunnel ![](https://i.imgur.com/zmqJPdi.png) TLS ![圖片](https://hackmd.io/_uploads/H1LIypa7A.png) ![](https://i.imgur.com/1VYlwcH.png) ## Load RSA key (Private Key) Edit > Preferences > Protocols > TLS >  \[+\] . ![](https://i.imgur.com/FVfFqx7.png) IP Address: 127.0.0.1 Port: start_tls Protocol: http Keyfile: RSA key location ![](https://i.imgur.com/CYRL6DF.png) Now, we could know this is a Get request packet Export Objects > HTTP ![](https://i.imgur.com/jylDA5E.png)