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
# Identify the interface with the default route to the Internet (0.0.0.0 route) | |
$defaultRoute = Get-NetRoute -DestinationPrefix "0.0.0.0/0" | Sort-Object -Property RouteMetric | Select-Object -First 1 | |
$interfaceIndex = $defaultRoute.InterfaceIndex | |
# Retrieve all network interfaces | |
$interfaces = Get-NetIPInterface -AddressFamily IPv4 | |
# Set the priority for the interface with the default route to the highest (lowest metric) | |
foreach ($interface in $interfaces) { | |
if ($interface.InterfaceIndex -eq $interfaceIndex) { |
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
# Use Python 3.12 slim image | |
FROM python:3.12.1-slim | |
# Set Environment Variables | |
ENV PYTHONUNBUFFERED=1 \ | |
TZ=Europe/London | |
ENV PYTHONOPTIMIZE=TRUE | |
ENV PYTHONMALLOC=malloc |
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
#the following code takes a list such as | |
#[1,1,2,6,8,5,5,7,8,8,1,1,4,5,5,0,0,0,1,1,4,4,5,1,3,3,4,5,4,1,1] | |
#with states labeled as successive integers starting with 0 | |
#and returns a transition matrix, M, | |
#where M[i][j] is the probability of transitioning from i to j | |
def transition_matrix(transitions): | |
n = 1+ max(transitions) #number of states | |
M = [[0]*n for _ in range(n)] |
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
apt update | |
apt upgrade -y | |
apt install linux-xanmod-edge -y | |
apt install glances htop nmap bleachbit git python3-pip iperf3 easy-rsa iptables-persistent tuned neofetch net-tools fail2ban ntpdate ntp ntpstat -y | |
service tuned start | |
tuned-adm list | |
tuned-adm profile throughput-performance | |
service tuned restart | |
apt autoclean -y |
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 time | |
import praw | |
import sqlite3 | |
from random import randint | |
from time import sleep | |
# FROMSUB = "cyber" # The subreddit you want to take posts from | |
# TOSUBS = ["cyber_security", "cyberlaws", "security", "privacy", | |
# "netsec", "technology", "computerforensics", "ComputerSecurity"] # The | |
# subreddits you want to post to |
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
# """THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND | |
# NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE | |
# DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, | |
# WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
# SOFTWARE.""" | |
# Bitcoin Cash (BCH) qpz32c4lg7x7lnk9jg6qg7s4uavdce89myax5v5nuk |
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
iptables -t mangle -A OUTPUT -p udp -j DSCP --set-dscp-class ef | |
root@raspberrypi:~# iptables -t nat -L | |
Chain PREROUTING (policy ACCEPT) | |
target prot opt source destination | |
Chain INPUT (policy ACCEPT) | |
target prot opt source destination |
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
#this may take a while, run with no hup and monitor the log | |
rm blocklist-ipsets/ -r | |
git clone https://github.com/firehol/blocklist-ipsets.git | |
cd blocklist-ipsets/ | |
#We just want the IP's | |
grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}" *.ipset > merged-file | |
#We just want the unique IP's across the board | |
sort -u merged-file > merged-file_output | |
#Just the unique ips, iptables | |
for IP in $(cat merged-file_output | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | awk '{print $1}' | sort | uniq); do echo "Banning $IP"; iptables -A INPUT -s $IP/32 -d 0/0 -j DROP; iptables -A INPUT -s $IP/32 -d 0/0 -j LOG --log-prefix 'firehol-iptables-rule-js'; done |
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 | |
#If possible, add something in for choosing [1] Configure Basics [2] Configure Security [3] Configure VMware Tools [4] Configure All. This might require Perl. | |
#set -x | |
#read -p "Configure this server to be on 192.168.1.3/24?" yn | |
#while true; do | |
#case $yn in | |
# [Yy]* ) | |
# echo "What IP address will be assigned to this server?" |
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
from datetime import datetime | |
import time | |
import threading | |
########################### | |
from multiprocessing import Process | |
import random | |
########################### | |
import dns.resolver | |
import dns.reversename | |
import ftplib |
NewerOlder