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
| ( | |
| printf "EHLO myhost.example.com\r\n" | |
| sleep 1 | |
| printf "MAIL FROM:<sender@example.com>\r\n" | |
| sleep 1 | |
| printf "RCPT TO:<recipient@example.com>\r\n" | |
| sleep 1 | |
| printf "DATA\r\n" | |
| sleep 1 | |
| printf "Subject: Netcat Test Email\r\n" |
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
| while IFS= read -r line; do | |
| # Check if the line contains a tab | |
| if [[ "$line" == *$'\t'* ]]; then | |
| # Split the line by tabs into an array | |
| IFS=$'\t' read -r -a cols <<< "$line" | |
| # Only process if at least 4 columns exist | |
| if [[ ${#cols[@]} -ge 4 ]]; then | |
| # Grab column 4 | |
| col4="${cols[3]}" | |
| # Do the replacements using perl |
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
| openssl verify -CAfile /etc/ssl/certs/ca-bundle.crt your_cert.crt |
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 zsh | |
| set -euo pipefail | |
| if [[ $# -ne 1 ]]; then | |
| echo "Usage: $0 <input_file>" | |
| exit 1 | |
| fi | |
| input_file=$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 bash | |
| # runscript.sh | |
| # Usage: ./runscript.sh <ip-address> | |
| set -euo pipefail | |
| IP_ADDRESS=${1:-} | |
| if [[ -z $IP_ADDRESS ]]; then | |
| echo "Usage: $0 <ip-address>" >&2 | |
| exit 1 | |
| fi |
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 | |
| # Usage: ./run.sh <ips.csv> | |
| set -euo pipefail | |
| IP_CSV="$1" | |
| OUT_LOG="combined-output.log" | |
| # 1) Clear the single output file | |
| : > "$OUT_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
| #!/usr/bin/env python3 | |
| import ipaddress, csv | |
| # ◼ Adjust these file‐names/paths as needed | |
| CIDR_FILE = 'cidrs.tsv' | |
| IP_FILE = 'ips.txt' | |
| OUTPUT_FILE = 'matched.tsv' | |
| # 1) Load and parse your CIDRs | |
| networks = [] |
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 | |
| # runscript.sh | |
| # Usage: ./runscript.sh <ip-address> | |
| set -euo pipefail | |
| IP_ADDRESS=${1:-} | |
| if [[ -z $IP_ADDRESS ]]; then | |
| echo "Usage: $0 <ip-address>" | |
| exit 1 |