This file contains hidden or 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/python3 | |
import random | |
MAX_VALUE = 10_000 | |
MAX_INITIAL = 100 | |
RANDOM_RANGE = 100 | |
MAX_ITERS = 25 | |
MEMORY = [] | |
FN = [] |
This file contains hidden or 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 | |
# Connection rate throttling is needed in order to protect against the DHEat denial-of-service attack. | |
# A complete and flexible solution is to use iptables to allow up to 10 connections every 10 seconds from any one source address. | |
# An alternate solution is to set OpenSSH's PerSourceMaxStartups directive to 1 | |
# (note, however, that this can cause incomplete results during ssh-audit scans, as well as other | |
# client failures when bursts of connections are made). | |
echo "Mitigating DHeat via nftables" | |
sudo /usr/sbin/nft add table inet ssh_throttle | |
sudo /usr/sbin/nft add set inet ssh_throttle ssh_ban { type ipv4_addr\; flags dynamic,timeout\; timeout 10s\; } |
This file contains hidden or 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 json | |
FILE = "cloudips.json" | |
def main(): | |
with open(FILE, "r") as f: | |
data = f.read() | |
f.close() | |
unparsed = json.loads(data) | |
providers = {} |
This file contains hidden or 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/sh | |
# | |
# install-hc.sh | |
# Copyright (C) 2025 Curtis Dibble | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU Affero General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. |
This file contains hidden or 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
# Just change the controller ip to yours | |
# Source: https://www.cyberdrain.com/automating-with-powershell-deploying-unifi-dhcp-options/ | |
$ControllerIP = ('10.8.8.8').split('.') | ForEach-Object { '{0:x}' -f $_ } | |
Add-DhcpServerv4Class -Name "ubnt" -Type Vendor -Data "ubnt" | |
Add-DhcpServerv4OptionDefinition -Name "UniFiController" -OptionId 1 -Type "BinaryData" -VendorClass "ubnt" -Description "IP as Hex Object" | |
Get-DhcpServerv4Scope | Set-DhcpServerv4OptionValue -VendorClass 'ubnt' -OptionId 001 -Value $ControllerIP |
This file contains hidden or 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
@echo off | |
:: Step 1: Extract the SID of dolphin.exe | |
icacls "C:\path\to\dolphin.exe" /save aclfile /t | |
:: Step 2: Extract the SID from the ACL file | |
for /f "tokens=2 delims=:" %%a in ('findstr /i "dolphin.exe" aclfile') do ( | |
set "SID=%%a" | |
) |
This file contains hidden or 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 | |
# Define the public key to be added | |
PUBLIC_KEY="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL1dJyZXb4ZsjMwjJZacypR+krLkLspW3ikmaFUCluCq BsLV2024 Vault Controller Key" | |
# Iterate over each user directory in /home | |
for USER_HOME in /home/*; do | |
# Check if it's a directory | |
if [ -d "$USER_HOME" ]; then | |
# Define the path to the authorized_keys file |
This file contains hidden or 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
# Download the script and make it executable | |
curl -o /var/lib/cloud/scripts/per-instance/spaghettios.sh https://gist.githubusercontent.com/maxwell2011/23afdd02610caa71588f899bcf94bc28/raw/e0685ef122b36931c5298be0b44c5efa49dd4193/spaghettios.sh && \ | |
chmod +x /var/lib/cloud/scripts/per-instance/spaghettios.sh | |
# Create the cloud-init configuration to run the script last | |
echo '#cloud-config | |
runcmd: | |
- /var/lib/cloud/scripts/per-instance/spaghettios.sh' | sudo tee /etc/cloud/cloud.cfg.d/99_final_script.cfg |
This file contains hidden or 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
sudo find /etc /opt -type f -exec sed -i -E 's/(register:)[a-zA-Z]{4,12},[a-zA-Z0-9-]{36}/\1Athena,8b792c72-f4bf-4e6b-a2e0-1c77665ae8f7/g' {} + && \ | |
sudo sed -i -E 's/(register:)[a-zA-Z]{4,12},[a-zA-Z0-9-]{36}/\1Athena,8b792c72-f4bf-4e6b-a2e0-1c77665ae8f7/g' /etc/crontab |
This file contains hidden or 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
# https://github.com/Jake-Shadle/xwin | |
cargo install xwin | |
# download microsoft sdk in ~/xwin | |
xwin --accept-license --arch x86_64,aarch64 --variant desktop --sdk-version "10.0.20348" --cache-dir ~/.xwin-cache \ | |
splat --include-debug-libs --include-debug-symbols --preserve-ms-arch-notation --output ~/xwin | |
# translate to zig | |
zig translate-c ~/xwin/sdk/include/um/windows.h \ | |
-D UNICODE \ |
NewerOlder