Sitemap

[Wireshark]Cyber security analysis and identify common cyber network attacks

overview

8 min readJan 15, 2022

--

We will cover the basics of Wireshark first, then you’ll gain the ability to threat hunt at the packet level.

capture traffic and examine the packet

  • open Wireshark and choose Ethernet
Press enter or click to view image in full size
  • you can check capture options
Press enter or click to view image in full size
  • let’s generate some traffic
  • Use filter to find the related IP address
ip.addr == 1.1.1.1 (target IP)
Press enter or click to view image in full size
/%ifconfigen0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=50b<RXCSUM,TXCSUM,VLAN_HWTAGGING,AV,CHANNEL_IO>
ether 14:9d:99:81:0a:c9
inet6 fe80::10c2:5ce7:5c47:1822%en0 prefixlen 64 secured scopeid 0x4
inet 192.168.3.9 netmask 0xffffff00 broadcast 192.168.3.255

you can see the traffic from my IP (192.168.3.9) to 1.1.1.1 and reply from 1.1.1.1 as well

they show the send and reply conversation
Press enter or click to view image in full size
  • you can see four sections
Press enter or click to view image in full size
  • frame section shows the entire message
Press enter or click to view image in full size
  • Ethernet section shows specific ethernet header
  • shows specific IPv4 info
  • specific to ICMP info
  • hexadecimal values
  • In the bottom, the detail info about packet

Examine the frame dissector

  • start capturing
  • Open Firefox and press shift + command + p to open private browser
Press enter or click to view image in full size
Press enter or click to view image in full size

once you open it, close it and stop capturing. Let’s filter now!!

frame contains veronica

This filters every packet containing the word “veronica”

Press enter or click to view image in full size
  • Right click > Follow > HTTP steam
Press enter or click to view image in full size

you can see the detail of HTTP stream. close it.

Press enter or click to view image in full size

You can see the IPv4 info is organized in Wireshark

Use Wireshark packets to map a network

Network diagram

Press enter or click to view image in full size
Press enter or click to view image in full size

Capturing traffic using Display filters

arp
  • show all of the arp requests and reply
dns
  • show all DNS requests
Press enter or click to view image in full size
dns.qry.name == "www.pluralsight.com"
  • show only dns query of the specific DNS query
Press enter or click to view image in full size
Press enter or click to view image in full size

you can see the answers section

Press enter or click to view image in full size

combining multiple display filters

dns.qry.name == "www.pluralsight.com" ||dns
Press enter or click to view image in full size
ip.addr eq 192.168.3.9 && ip.addr == 52.88.45.204
Press enter or click to view image in full size
(ip.src == 192.168.3.9) && (ip.dst == 52.88.45.204)
Press enter or click to view image in full size
Press enter or click to view image in full size

you can create automated filter as well.

Foundational TCP Analysis

  • Lets create a new profile from bottom right. right-click > new. Name
    “TCP plain”
Press enter or click to view image in full size
  • Wireshark > preferences >+ > add Delta
Press enter or click to view image in full size
  • Drag and drop to the position next to Time
  • View > coloring rules > add TCP SYN
  • statistics > conversations
Press enter or click to view image in full size

we can see the statistics of TCP

Press enter or click to view image in full size
  • this is the largest Delta time.
ip.addr==192.168.3.9 && tcp.port==59166 && ip.addr==75.2.53.94 && tcp.port==443 && tcp.analysis.flags
Press enter or click to view image in full size
tcp.analysis.flags

This shows error of tcp packet

Wireshark Configuration for Cyber Security Analysis

Creating a security profile

  • right bottom > right click > new. Create a profile called security operations
Press enter or click to view image in full size
  • View > Time Display format > Time of Day, milliseconds
Press enter or click to view image in full size
  • save useful TCP setting
tcp.flags.syn==1
Press enter or click to view image in full size
  • view > coloring rule

So you can color traffics

Press enter or click to view image in full size

The statistics view

  • statistics > conversations (ports, ip, bytes)
Press enter or click to view image in full size

Configure GeoIP location Resolution

  • Wireshark > preferences > name resolution > MaxMind database > Edit
  • write a path to MaxMind database
  • statistics > endpoints > IPv4
Press enter or click to view image in full size
Press enter or click to view image in full size
  • we can see where the traffic come from

Configure custom colums

  • choose one packet > tcp > source port > right click > add as column
Press enter or click to view image in full size
  • you can have your own column
Press enter or click to view image in full size
  • right click source port and edit column > add “or udp.srcport” in the Fields
Press enter or click to view image in full size
  • lets right click Request URI and add column too.
Press enter or click to view image in full size

Name resolutions

  • Wireshark > preferences > name resolution >
Press enter or click to view image in full size

exporting HTTP objects and files

  • file > HTTP object export > save
Press enter or click to view image in full size
  • After exporting, you can upload malicious files to VirusTotal.

Filtering for unusual DNS activity

dns.flags.response == 1
  • check how many responses
Press enter or click to view image in full size
dns.count.answers > 10
  • check answers more than 10 times
Press enter or click to view image in full size
dns.flags.response == 0 and ! ip.dst == 10.0.0.0/24 (local DNS IP address)
  • check the DNS query destination is not local DNS server (here pretending the local DNS server is in 10.0.0.x/24)
Press enter or click to view image in full size
dns.flags.response == 1 and ip.len > 500
  • DNS response which contains more than 500 bytes
Press enter or click to view image in full size

Filtering for traffic based on country location

ip.geoip.dst_country == "Japan"
  • filter traffic only coming from Japan
Press enter or click to view image in full size

filtering for suspect TCP behavior

(tcp.flags.syn==1) && (tcp.flags.ack == 0)
  • filter only Syn packet
Press enter or click to view image in full size
((tcp.flags.urg == 0) && (tcp.flags.syn == 0)) && (tcp.flags.push == 0)
  • filter for Xmas scan
Press enter or click to view image in full size
tcp.port == 22 and ! ip.src == 10.0.0.1/24 (spcific IP that ssh is allowed)
  • filter SSH that connect from strange ip address
Press enter or click to view image in full size

Filtering for Executable files

http contains DOS
  • right click the file > follow > TCP stream

executable file disguises

Decrypting TLS traffic

  • Wireshark > preference >protocol > TLS
Press enter or click to view image in full size

Identify Common Cyber Network Attacks with Wireshark

Detecting Port Scans

tcp.flags.syn == 1 and tcp.flags.ack == 1 and ip.dst == 10.0.2.15 <target IP >
  • check ports responded to scans from target IP
Press enter or click to view image in full size

Threat hunting: Analyzing a real netwrok and port scan

http.request or http.response
  • look for “post”
Press enter or click to view image in full size

check TCP stream as well

Press enter or click to view image in full size
!tcp.port in {80 135 443 445 995 8000}
  • check unusual ports are used or not
Press enter or click to view image in full size

check TCP stream as well

Press enter or click to view image in full size

MZ………………….@……………………………………… .!..L.!This program cannot be run in DOS

Press enter or click to view image in full size
http.request.uri contains "png"

name is png but the content is executable file.

tcp.analysis.flags
  • show all retransmission and strange TCP behavior
Press enter or click to view image in full size

You can also see other Wireshark articles

--

--

No responses yet