Wireshark

Wireshark lab:

  1. find your IP address: ipconfig or ip a on linux
  2. open wireshark
  3. find your interface-look for squiggly lines
  4. double click on the interface to start
  5. notice the flow of packets, everything you see
Network scanning is a bit like burglary:
  1. who lives where: ARP
  2. are they home? ICMP ping
  3. what is their street address?
  4. do they answer the door? ACK-SYN
  5. what doors or windows are open? netcat 
One could also make the analogy with a "man on the inside": if inside your home is the same as your LAN (local area network), then being able to plant a spy inside defies all of your security (firewalls in a network).
Malware is like sending a letter to your house, someone opens it thinking it is safe, and it maps out where your valuables are, in some case throwing them out the window do be collected. 

part 1: ARP

part 2: Ping

part 3: DNS

part 4: ACK-SYN

  1. SYN is sent from the client to the web server, synchronizing the conversation and opening ports needed (like port 80)
  2. ACK is sent from the server to the client, acknowledging the port is open
  3. SYN-ACK is sent from the client saying “got it”
  4. connection is open, data transferred
  5. FIN is used to end the link

example: web pages

  1. open wireshark, start a capture
  2. browse to a web page, capture packets
  3. look for ACK
  4. what type of packet is this?
  5. repeat with the tcp filter (hit return after applying the filter)
  6. repeat going to a machine serving xml
  7. what do you see?
  8. hacker note: how could you infect another computer using this?

part 5: netcat

  1. open wireshark, in the filter window enter tcp.port == 1234
  2. on a client machine, type netcat -l 1234 in a terminal window
  3. on your machine, run netcat <ip address of client> 1234 then return
  4. type some text
  5. does it show up on the client machine?
  6. look for the packets on wireshark
  7. can you see the text in each packet?
  8. try these flags:
    1. n is the ip address
    2. l means listen
    3. v means verbose
    4. p means port number
  9. did you notice there was no password needed?
  10. why would it be dangerous to leave nc -l open?
  11. look up a reverse shell and explain how to do this
  12. hacker note: how could malware open this, and what could it do then?

part 6: netcat port scanning

  1. open wireshark, start a capture
  2. run the command nc -v -n 8.8.8.8 1-100
  3. filter using this filter: ip.addr == 8.8.8.8
  4. what do you see?
  5. repeat with a local address (web server, device)
  6. go to the device (e.g. port 80) and watch packets
  7. hacker note: how can a hacker use this command to look for open ports?
  8. how could you detect it happening if you are a white hat or sysadmin (system administrator)?
  9. if you had access inside a network, how could this be useful?
  10. if this were packaged into malware, how could it be useful?




Migrated from Apple Server Wiki. Original page ID: u3F713S1d


Revision #2
Created 2026-09-29 15:59:32 UTC by Admin
Updated 2026-09-29 16:22:11 UTC by Admin