i take one breath / mint at a time

Week 9.1: Lectures Notes, Class Activities on Routing, DHCP, NAT, 802.11

#networking #dhcp #nat #bridgemode #tcpip #OSI #mask #subnet #gateway # definitions #wireshark #aircrackng #80211

Follow-Up Questions

Self-Learning Notes

DHCP is an extension of BOOTP mechanism: DHCP uses BOOTP as its transport protocol

Activity 9.04 on DHCP Attacks

These employees are receiving error messages saying no local IP addresses are available, indicating a potential issue with DHCP:

  1. Create a filter to determine the count for each DHCP activity:
    • DHCP Discover: dhcp.option.dhcp == 1 – @150
    • DHCP Offer: dhcp.option.dhcp == 2 –@32
    • DHCP Request: dhcp.option.dhcp == 3 @1

QUESTION: Why does the Request say *REF*?

  1. Based on these results, summarize what type of attack may have occurred, and why you believe Acme Corp's employees are having network issues.
  2. there were 150 DHCP Discover requests and 32 DHCP Offer responses so it is likely that most of these requests were fraudulent and made the DHCP server run out of IPs.

Bonus

QUESTION: What does this mean?

[Expert Info (Warning/Protocol): Source MAC must not be a group address: IEEE 802.3-2002, Section 3.2.3(b)]

Activity: Analyzing Wireless Security

Aircrack-ng Practice Activity:

KEY FOUND! [ 1F:1F:1F:1F:1F ]
– ARP flood attack clearly happening
802.11 has a lot of: Acknowledgement, Association Response, Authentication, Clear-to-Send, Disassociate
– 1 x 802.11 Beacon frame from SSID Appart,BSS Id: Arcadyan_12:32:29 (00:12:bf:12:32:29), with no security??? - There areIGMPv2` packets: IGMP (Internet Group Management Protocol) is a Host-Router Multicast Signalling Protocol that provides dynamically registration of the hosts to the desired Multicast Groups.


9.1 CLASS NOTES:

NAT Pathway:

(1) connecting to internet:
– outbound packet's destination port is standard, i.e. 80 or 443
– source port is randomly generated and unique for each connection
– when website replies, it sends packets back to you with source/destination IPs reversed

In detail: Loading Reddit:
– client sends packet to router to Reddit's IP + port 80/443 with source data of aka TRANSPORT LAYER encapuslates this data
– computer checks its subnet mask adn compares its own IP and the destination IP for computer to determine if a destination is beyond teh same router or if it'll need routing services: ARP Resolution Request

Example:
[192.168.0.2] [255.255.255.255] [ Who has router IP 192.168.0.1? ] Broadcasted on LAN

[192.168.0.1] [192.169.0.2] [ I have the Router IP, and you can reach me via MAC Address ffff ]

Your computer now knows how to reach the router, so now it fires the porn browsing packet to the router:

[192.168.0.2] [1.2.3.4] [ open connection ]

The router, upon receiving this packet, is smart enough to know that it's a connection request, so first it adds the source, destination and port to something called a NAT table, which looks like this:

Source Port Destination Port Local IP Remote IP
96354 80 192.168.0.2 1.2.3.4
88965 22 192.168.0.3 4.5.6.7
12345 8888 192.168.0.99 9.9.3.9

PUBLIC IP & NAT:

Every device on the internet has an IP address. This address must be unique, there can be no two devices with the same IP. The number of IP addresses is limited, and mostly used up. There is a group of addresses that have been reserved for use only in internal networks. This works because the devices sharing an address cannot see each other – they are on different networks with no route between them.

Nat is implemented by a device (a computer, a router, or a firewall) that has two network connections, one to the internal network, one to the internet. When a device on the internal network wants to connect outside, it sends its messages (packets) to the NAT device. The NAT device strips the address of the original device and substitutes its own, then sends it out to the internet.

When the reply comes back, the NAT device then strips its own address, substitutes the address of the original device, and sends it to the internal network.

In this way, many devices can share one IP address.

LAN: local area network

Gateway:

Mask: defines how many IP addresses are usable minu the network and broadcast addrsses

NAT: Network Address Translation (PUBLIC IP)

DHCP: Dynamic Host Configuration Protocol (PRIVATE IP)

Bridge Mode

DHCP (Dynamic Host Configuration Protocol)

Four-Step Process

  1. DHCP Discover: find the DHCP server
  2. sends out message to everyone on local network: “I need a DHCP server”

  3. DHCP Offer: Find available IP addresses

  4. DHCP server finds and selects an available IP address and sends it out to network: “Here is your IP address, DHCP client”

  5. DHCP Request: DHCP client returns message of receipt

  6. “Thanks for IP address, I will take it”

  7. DHCP ACK: DHCP server acknowledges that IP is taken + issues DHCP lease which upon expiry, IP can be given to another device

To view specific DHCP steps:

DHCP Discover filter: dhcp.option.dhcp == 1
DHCP Offer filter: dhcp.option.dhcp == 2
DHCP Request filter: dhcp.option.dhcp == 3
DHCP ACK filter : dhcp.option.dhcp == 5

DHCP Attacks

DHCP Starvation: a type of DDoS

Mitigation of DHCP starvation:

DHCP Spoofing: AFTER starvation

Mitigation of DHCP spoofing with DHCP Snooping:

Routing Schemes and Protocols

Routing: The act of choosing the path that traffic takes in or across networks

Routing Schemes:
1. Unicast: Single device delivers a message to another single specific device, i.e. a phone call
2. Broadcast: Single device broadcasts to all devices on same network, i.e. DHCP broadcast, ARP broadcast
3. Multicast: Single device sends message to devices that have expressed interest in receiving message, i.e. subscription

Static Routing Vs Dynamic Routing

Static: manual configuration of a network route, usually by net admin
– smaller networks or less changes
– PRO: lower CPU on router, net admin has full control of their net's routing behaviour
– CON: fault tolerance; router can't be adjusted

Dynamic routing: network acts on its own to avoid network blockages
– network is adaptive
– primary routing techniques
– uses Routing Protocols

Dynamic Routing Protocols: 2 Primary Criteria

(1) Distance: amount of devices/hops used to get data from source to destination –> chooses least hops
“Distance-Vector Routing Protocols” include:
-RIP: Routing Information Protocol: Uses hop count as main criteria
EIGRP: Enhanced Interior Gateway Routing Protocol: Better than RIP because it only sends incremental updates, reducing workload on router and amount of data being transmitted
– More on comparison: https://community.fs.com/blog/eigrp-vs-ospf-differences.html

(2) Speed: Route is determined by time taken to move from source to destination
– just because a path has more hops does not make it slower
“Link-State Routing Protocols include:
OSPF: Open Shortest Path First:

Wireless Networking

WAP: Wireless Access Point: networking hardware device that connects a wireless network to a wired network by broadcasting a wireless signal called a beacon.

Wifi in Wireshark: Detect Security Protection Manually:

Decrypting with Aircrack-NG

Wifi Security Vulnerabilities

Wardriving: driving/walking around with wireless-enabled device looking for unsecured wireless LANs
Warchalking: using chalk markings to show presence and vulnerabilities of wireless networks nearby
Warflying: Using drones
Evil Twin: Make a fake SSID to trick users to connecting to attacker's WAP