2021-csci-ga3205-hw-10/README.md

109 lines
6.9 KiB
Markdown

# 2021 CSCI-GA3205 Homework 10
Author: Vicky Rampin
## Prompt
Packet sniffers are programs that intercept the network traffic flowing in and out of a system through network interfaces. Packet sniffers can be coded by either using sockets API provided by the kernel, or by using some packet capture libraries. Write a program and implement your own packet sniffer in your programming language of choice.
## Installation
This script is made with Python 3.8 and uses the `argparse` library, and [scapy](https://scapy.net/), a program for packet manipulation. Ensure that you have [Python 3.8+](https://www.python.org/downloads/) and these dependencies installed in order to run this script correctly.
## Usage
First, clone this repository to your machine. Open the command line on your machine and navigate to where you cloned this repository. To get help using `cd`, use [this tutorial](https://swcarpentry.github.io/shell-novice/02-filedir/index.html).
This script needs sudo or administrative privileges to run. The script will run explicitly until you kill it using either `CTRL+C` or closing the terminal window.
Run the script with the following (on UNIX-based systems):
~~~
$ sudo -E env PATH="$PATH" python index.py
~~~
Sample output:
~~~
Ether / IP / TCP 192.168.0.102:59642 > 142.250.65.197:https PA / Raw
Ether / IP / TCP 192.168.0.102:59642 > 142.250.65.197:https PA / Raw
Ether / IP / TCP 192.168.0.102:59642 > 142.250.65.197:https A / Raw
Ether / IP / TCP 192.168.0.102:59642 > 142.250.65.197:https PA / Raw
Ether / IP / TCP 192.168.0.102:59642 > 142.250.65.197:https PA / Raw
Ether / IP / TCP 192.168.0.102:59642 > 142.250.65.197:https PA / Raw
Ether / IP / TCP 104.16.249.249:https > 192.168.0.102:50324 PA / Raw
Ether / IP / TCP 192.168.0.102:50324 > 104.16.249.249:https A
Ether / IP / TCP 104.16.249.249:https > 192.168.0.102:50324 PA / Raw
Ether / IP / TCP 192.168.0.102:50324 > 104.16.249.249:https A
Ether / IP / TCP 142.251.41.14:https > 192.168.0.102:48384 A
Ether / IP / TCP 142.251.41.14:https > 192.168.0.102:48384 PA / Raw
Ether / IP / TCP 192.168.0.102:48384 > 142.251.41.14:https A
Ether / IP / TCP 142.251.41.14:https > 192.168.0.102:48384 PA / Raw
Ether / IP / TCP 192.168.0.102:48384 > 142.251.41.14:https A
Ether / IP / TCP 142.251.41.14:https > 192.168.0.102:48384 PA / Raw
Ether / IP / TCP 192.168.0.102:48384 > 142.251.41.14:https A
Ether / IP / TCP 192.168.0.102:48384 > 142.251.41.14:https PA / Raw
Ether / IP / TCP 104.16.249.249:https > 192.168.0.102:50324 PA / Raw / Padding
Ether / IP / TCP 192.168.0.102:50324 > 104.16.249.249:https A
Ether / IP / TCP 142.250.65.197:https > 192.168.0.102:59642 PA / Raw / Padding
Ether / IP / TCP 192.168.0.102:59642 > 142.250.65.197:https A
Ether / IP / TCP 142.250.65.197:https > 192.168.0.102:59642 A / Padding
Ether / IP / TCP 142.250.65.197:https > 192.168.0.102:59642 A / Padding
Ether / IP / TCP 142.250.65.197:https > 192.168.0.102:59642 A / Padding
Ether / IP / TCP 142.250.65.197:https > 192.168.0.102:59642 A / Padding
Ether / IP / TCP 142.250.65.197:https > 192.168.0.102:59642 A / Padding
Ether / IP / TCP 142.251.41.14:https > 192.168.0.102:48384 A / Padding
Ether / IP / TCP 192.168.0.102:52440 > 52.86.220.33:https PA / Raw
Ether / IP / TCP 142.250.65.197:https > 192.168.0.102:59642 PA / Raw
Ether / IP / TCP 192.168.0.102:59642 > 142.250.65.197:https A
Ether / IP / TCP 142.250.65.197:https > 192.168.0.102:59642 PA / Raw
Ether / IP / TCP 192.168.0.102:59642 > 142.250.65.197:https A
Ether / IP / TCP 142.250.65.197:https > 192.168.0.102:59642 PA / Raw
Ether / IP / TCP 192.168.0.102:59642 > 142.250.65.197:https A
Ether / IP / TCP 142.250.65.197:https > 192.168.0.102:59642 PA / Raw
Ether / IP / TCP 192.168.0.102:59642 > 142.250.65.197:https A
Ether / IP / TCP 142.250.65.197:https > 192.168.0.102:59642 PA / Raw / Padding
Ether / IP / TCP 192.168.0.102:59642 > 142.250.65.197:https A
Ether / IP / TCP 192.168.0.102:59642 > 142.250.65.197:https PA / Raw
Ether / IP / TCP 192.168.0.102:59642 > 142.250.65.197:https PA / Raw
Ether / IP / TCP 192.168.0.102:59642 > 142.250.65.197:https FA
Ether / IP / TCP 142.250.65.197:https > 192.168.0.102:59642 PA / Raw / Padding
Ether / IP / TCP 192.168.0.102:59642 > 142.250.65.197:https A
Ether / IP / TCP 52.86.220.33:https > 192.168.0.102:52440 PA / Raw / Padding
Ether / IP / TCP 192.168.0.102:52440 > 52.86.220.33:https A
Ether / IP / TCP 142.250.65.197:https > 192.168.0.102:59642 PA / Raw / Padding
Ether / IP / TCP 192.168.0.102:59642 > 142.250.65.197:https A
Ether / IP / TCP 142.250.65.197:https > 192.168.0.102:59642 A / Padding
Ether / IP / TCP 142.250.65.197:https > 192.168.0.102:59642 A / Padding
Ether / IP / TCP 142.250.65.197:https > 192.168.0.102:59642 FA / Padding
Ether / IP / TCP 192.168.0.102:59642 > 142.250.65.197:https A
Ether / IP / TCP 142.250.65.197:https > 192.168.0.102:59642 A / Padding
Ether / IP / TCP 192.168.0.102:47798 > 142.251.41.14:https PA / Raw
Ether / IP / TCP 192.168.0.102:47798 > 142.251.41.14:https PA / Raw
Ether / IP / TCP 192.168.0.102:47798 > 142.251.41.14:https A / Raw
Ether / IP / TCP 192.168.0.102:47798 > 142.251.41.14:https PA / Raw
Ether / IP / TCP 192.168.0.102:47798 > 142.251.41.14:https PA / Raw
Ether / IP / TCP 192.168.0.102:50324 > 104.16.249.249:https PA / Raw
Ether / IP / TCP 192.168.0.102:50324 > 104.16.249.249:https PA / Raw
Ether / IP / TCP 142.251.41.14:https > 192.168.0.102:47798 A / Padding
Ether / IP / TCP 142.251.41.14:https > 192.168.0.102:47798 A / Padding
Ether / IP / TCP 142.251.41.14:https > 192.168.0.102:47798 A / Padding
Ether / IP / TCP 142.251.41.14:https > 192.168.0.102:47798 A / Padding
Ether / IP / TCP 142.251.41.14:https > 192.168.0.102:47798 A / Padding
Ether / IP / TCP 192.168.0.102:50324 > 104.16.249.249:https PA / Raw
Ether / IP / TCP 104.16.249.249:https > 192.168.0.102:50324 A / Padding
Ether / IP / TCP 104.16.249.249:https > 192.168.0.102:50324 PA / Raw
Ether / IP / TCP 192.168.0.102:50324 > 104.16.249.249:https A
Ether / IP / TCP 104.16.249.249:https > 192.168.0.102:50324 PA / Raw
Ether / IP / TCP 192.168.0.102:50324 > 104.16.249.249:https A
Ether / IP / TCP 142.251.41.14:https > 192.168.0.102:47798 PA / Raw
Ether / IP / TCP 142.251.41.14:https > 192.168.0.102:47798 PA / Raw
Ether / IP / TCP 192.168.0.102:47798 > 142.251.41.14:https A
Ether / IP / TCP 142.251.41.14:https > 192.168.0.102:47798 PA / Raw
Ether / IP / TCP 142.251.41.14:https > 192.168.0.102:47798 PA / Raw
Ether / IP / TCP 192.168.0.102:47798 > 142.251.41.14:https A
Ether / IP / TCP 192.168.0.102:47798 > 142.251.41.14:https PA / Raw
Ether / IP / TCP 104.16.249.249:https > 192.168.0.102:50324 PA / Raw / Padding
Ether / IP / TCP 192.168.0.102:50324 > 104.16.249.249:https A
Ether / IP / TCP 104.16.249.249:https > 192.168.0.102:50324 A / Padding
Ether / IP / TCP 142.251.41.14:https > 192.168.0.102:47798 PA / Raw / Padding
Ether / IP / TCP 192.168.0.102:47798 > 142.251.41.14:https A
Ether / IP / TCP 142.251.41.14:https > 192.168.0.102:47798 A / Padding
Ether / IP / TCP 192.168.0.102:43796 > 5.135.179.196:https PA / Raw
~~~