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/env python3 | |
| import os | |
| from threading import Thread | |
| # writing secret values to FIFO-pipes so they can only be read/consumed once | |
| # safer than writing a text-file and then deleting it | |
| # read-out the fifo-pipes via: cat /tmp/t555_1 /tmp/t555_3 /tmp/t555_2 | |
| payload = { |
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/env bash | |
| # PREPARE: | |
| # download & extract easyrsa: https://github.com/openvpn/easy-rsa/releases | |
| # cd into the EasyRSA* dir | |
| # cp vars.example vars | |
| # edit the vars to your needs - you might want to change 'rsa' to 'ec' and set the 'EASYRSA_REQ_*' infos | |
| mkdir rootca subca | |
| cp vars rootca/ |
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/env python3 | |
| # the netfilter uses the 'token bucket algorithm' | |
| # it sometimes can be a bit 'unintuitive' how this rate-limit-algorithm works | |
| # the algorithm expects the packets, as defined by the limit, to be somewhat spread over the whole timewindow (second/minute/..) | |
| # token bucket punishes short-term overages beyond the burst capacity | |
| # limit source code: https://github.com/torvalds/linux/blob/master/net/netfilter/nft_limit.c | |
| # this script provides a way to easily test "rate-limit + burst" configurations | |
| # to get practical data you can simply run "tcpdump" on your target system and extract the packet-times from its output |
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
| /* | |
| NOTE: | |
| These are not perfect, but good enough for frontend-validation. | |
| A exact validation needs to be done on the backend anyways.. | |
| */ | |
| const REGEX_IP4 = /^([1-2]?)[0-9]{1,2}\.([1-2]?)[0-9]{1,2}\.([1-2]?)[0-9]{1,2}\.([1-2]?)[0-9]{1,2}$/ | |
| /* | |
| tested: | |
| 10.0.0.0 |
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 | |
| if [ -z "$1" ] | |
| then | |
| echo 'Provide a hostname of a website to check!' | |
| exit 1 | |
| fi | |
| if [ -z "$2" ] | |
| then |
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 | |
| if [ -z "$1" ] | |
| then | |
| echo 'Provide the target hostname!' | |
| exit 1 | |
| fi | |
| TARGET="$1" |
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/env python3 | |
| from sys import exit as sys_exit | |
| from pathlib import Path | |
| from argparse import ArgumentParser | |
| from ipaddress import IPv4Address, IPv6Address, IPv4Network, IPv6Network, AddressValueError, NetmaskValueError | |
| def _load_ip_list(ip_list_file: str) -> (list, list): | |
| safe_ips = [] |
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 | |
| IP="1.1.1.1" | |
| ip4="$(python3 -c "from ipaddress import IPv4Address; from sys import argv; ip=argv[1]; print(ip) if IPv4Address(ip).is_global else print('1')" "$IP" 2>/dev/null || echo '0')" | |
| if [[ "$ip4" == '0' ]] | |
| then | |
| ip6="$(python3 -c "from ipaddress import IPv6Address; from sys import argv; ip=argv[1]; print(ip) if IPv6Address(ip).is_global else print('1')" "$IP" 2>/dev/null || echo '0')" |
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 | |
| LOG_DIR='/var/log/ps/' | |
| TOP_N=5 | |
| TOP_N_H=$(( TOP_N + 1 )) | |
| mkdir -p "$LOG_DIR" | |
| date >> "${LOG_DIR}/mem.log" | |
| ps -eo rss,pid,user,command --sort -rss | head -n "$TOP_N_H" | tail -n "$TOP_N" >> "${LOG_DIR}/mem.log" |
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
| body.light { | |
| --darkVisible: hidden; | |
| --darkDisplay: none; | |
| --lightVisible: unset; | |
| --lightDisplay: inline-block; | |
| } | |
| body.dark { | |
| --darkVisible: unset; | |
| --darkDisplay: inline-block; |
NewerOlder