Last active
February 27, 2022 19:20
-
-
Save mcorybillington/279084c7a033db2b858ec2658c0cc6a4 to your computer and use it in GitHub Desktop.
UFW script to only allow traffic out on UDP port 53 (DNS lookups) and 1194 (common VPN port). Safety precaution for bug bounty to make sure you don't accidentally hit stuff from your home IP if VPN drops/etc.
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
#!/bin/bash | |
VPN_INTERFACE="tun0" | |
LAN_INTERFACE="enp1s0" | |
UFW="/usr/sbin/ufw" | |
"${UFW}" enable | |
"${UFW}" --force reset | |
"${UFW}" default deny incoming | |
"${UFW}" default deny outgoing | |
"${UFW}" allow out on "${VPN_INTERFACE}" | |
"${UFW}" allow out on "${LAN_INTERFACE}" to any port 53,1194 proto udp | |
"${UFW}" enable | |
"${UFW}" status verbose |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment