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 | |
CHECKSUM=$1 | |
FILE=$2 | |
if [[ -z "$CHECKSUM" ]]; then | |
echo "Usage: $0 md5 file" | |
exit 1 | |
fi | |
if [[ -z "$FILE" ]]; 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
/ipv6 firewall filter | |
add chain=input action=accept comment="Allow established connections" connection-state=established | |
add chain=input action=accept comment="Allow related connections" connection-state=related | |
add chain=input action=accept comment="Allow ICMP" protocol=icmpv6 | |
add chain=input action=reject comment="Reject invalid packets" connection-state=invalid | |
add chain=input action=accept comment="Allow lo" in-interface=lo | |
add chain=input action=accept comment="Allow local network" in-interface=LAN | |
add action=add-src-to-address-list address-list=trying_to_login address-list-timeout=1d chain=input dst-port=22 protocol=tcp comment="list IP's who try remote login" | |
add action=drop chain=input comment="drop ssh brute forcers" dst-port=22 protocol=tcp src-address-list=ssh_blacklist | |
add chain=input action=reject comment="Reject TCP connections by default" protocol=tcp reject-with=tcp-reset |
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 | |
# Parameters | |
socket="/run/foo.sock" | |
dump="/tmp/capture.pcap" | |
# Extract repetition | |
port=9876 | |
source_socket="$(dirname "${socket}")/$(basename "${socket}").orig" |
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
local function tprint(tbl, indent) | |
if not indent then indent = 0 end | |
for k, v in pairs(tbl) do | |
local formatting = string.rep(" ", indent) .. k .. ": " | |
if type(v) == "table" then | |
print(formatting) | |
tprint(v, indent+1) | |
else | |
print(formatting .. tostring(v)) | |
end |