Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Script to perform ICMP port knocking
- #
- # Firewall filters for Mikrotik:
- # add action=add-src-to-address-list address-list=tmp_remote address-list-timeout=3m chain=input comment="icmp port knocking" packet-size=125 protocol=icmp src-address-list=icmp_stage2
- # add action=add-src-to-address-list address-list=icmp_stage2 address-list-timeout=3s chain=input packet-size=124 protocol=icmp src-address-list=icmp_stage1
- # add action=add-src-to-address-list address-list=icmp_stage1 address-list-timeout=3s chain=input packet-size=123 protocol=icmp
- #
- # Made by: Sunn3h < m [at] sunneh.ru >
- #
- # Code stylized according to:
- # https://google.github.io/styleguide/shell.xml
- readonly DEST="$1"
- if [[ -z "${DEST}" ]]; then
- echo "Usage: $0 destination"
- exit
- fi
- now() {
- date +'%Y-%m-%dT%H:%M:%S%z'
- }
- while true; do
- echo "[$(now)]: Ping..."
- ping "${DEST}" -s 95 -c1 -W1 2>&1 >/dev/null
- ping "${DEST}" -s 96 -c1 -W1 2>&1 >/dev/null
- ping "${DEST}" -s 97 -c1 -W1 2>&1 >/dev/null
- sleep 60
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement