Skip to content

Latest commit

 

History

History
76 lines (56 loc) · 3.43 KB

File metadata and controls

76 lines (56 loc) · 3.43 KB

Network Security Project: CSE508-HW3

Description

In this assignment you will develop 1) an on-path DNS poisoning attack tool, and 2) a passive DNS poisoning attack detector. Both tools should be developed in Go using the GoPacket library, and should support just plain (UDP) DNS traffic over port 53.

Part 1:

The DNS packet injector you are going to develop, named 'dnspoison', captures the traffic from a network interface in promiscuous mode, and injects forged responses to selected DNS A requests with the goal of poisoning the cache of the victim's resolver.

Your program should conform to the following specification:

go run dnspoison.go [-i interface] [-f hostnames] [expression]

-i Listen on network device (e.g., eth0). If not specified, dnspoison should select a default interface to listen on. The same interface should be used for packet injection.

-f Read a list of IP address and hostname pairs specifying the hostnames to be hijacked. If '-f' is not specified, dnspoison should forge replies to all observed requests with the chosen interface's IP address as an answer.

The optional argument is a BPF filter that specifies a subset of the traffic to be monitored. This option is useful for targeting a single victim or a group of victims.

The file should contain one IP and hostname pair per line, separated by whitespace, in the following format: 10.6.6.6 foo.example.com 10.6.6.6 bar.example.com 192.168.66.6 www.cs.stonybrook.edu

Pay attention to the time needed for generating the spoofed response. Your code should be fast enough so that the injected reply reaches the victim before the server's real response. The spoofed packet and content should be valid according to the initial DNS request, and the forged response should be accepted and processed normally by the victim. Failure to win the race will not affect your grade, but you should at least try (see hints below).

Part 2:

The DNS poisoning attack detector you are going to develop, named 'dnsdetect', captures the traffic from a network interface in promiscuous mode and detects DNS poisoning attack attempts, such as those generated by your own dnspoison, or dnsspoof (https://www.monkey.org/~dugsong/dsniff/). Detection is based on identifying duplicate responses within a short time interval towards the same destination, which contain different answers for the same A request (i.e., the observation of the attacker's spoofed response and the server's actual response). The order of arrival should not matter: you should raise an alert irrespectively of whether the attacker's spoofed response arrived before or after the real response. You should make every effort to avoid false positives, e.g., due to legitimate consecutive responses with different IP addresses for the same hostname due to DNS-based load balancing.

Your program should conform to the following specification:

go run dnsdetect.go [-i interface] [-r tracefile] expression

-i Listen on network device (e.g., eth0). If not specified, the program should select a default interface to listen on.

-r Read packets from (tcpdump format). Useful for detecting DNS poisoning attacks in existing network traces.

is a BPF filter that specifies a subset of the traffic to be monitored.

Once an attack is detected, dnsdetect should print to stdout a detailed alert containing a printout of both the spoofed and legitimate responses.