Skip to content

Instantly share code, notes, and snippets.

View thom-s's full-sized avatar

thom-s thom-s

View GitHub Profile
@thom-s
thom-s / dns_amplification.py
Last active April 11, 2024 23:31
Better understanding DNS Amplification DDoS attacks through Python and Scapy.
# Imports
from scapy.all import *
from pprint import pprint
import operator
# Parameters
interface = "eth0" # Interface you want to use
dns_source = "local-ip" # IP of that interface
dns_destination = ["ip1","ip2","ip3"] # List of DNS Server IPs
@thom-s
thom-s / status_code.ps1
Last active July 26, 2022 12:22
Return Web Request Status Code as Integer (PowerShell Core 6)
$uri = "https://httpstat.us/404" # Replace '404' by any status code you want to test
try {
$r = Invoke-WebRequest -URI $uri -SkipCertificateCheck -MaximumRedirection 0
$a = [int]$r.StatusCode
}
catch {
$a = [int]$_.Exception.Response.StatusCode
}
write-output $a