Skip to content

Instantly share code, notes, and snippets.

@warsocket
warsocket / dnsmitm.py
Created May 21, 2021 11:13
KISS dns mitm gist which demonstratoes how to relay dns requests (to cloudflare in this case) unsing only a few lines of code
#!/usr/bin/env python3
import socket
import os
# Beware: this is a navive KISS implementation of a DNS MITM relaying server
# It therefor has no timeouts and other safeguards preventing resource exausstion
# and since it forks you can run out of PIDS's pretty fast is a malicious actor can coerce this server to hang on one of the recv calls.
#
# Another point of notice: this server only works for udp so if a request is to long and a client sends a request via tcp nobody will be listening.
@warsocket
warsocket / disable-connectivity-check.sh
Created December 8, 2020 10:30
Fix spotify code 4 error on ubuntu / linux mint by disabling the connectivity-check amed toward a canonical server
busctl --system set-property org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager ConnectivityCheckEnabled "b" 0