This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import netfilterqueue | |
import scapy.all as scapy | |
acknowledge_list = [] | |
def setting_load(packet, load): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#importing modules | |
import subprocess | |
import optparse | |
import re | |
#function for handling user input(arguments) | |
def getting_arguments(): | |
parser = optparse.OptionParser() |