Created
December 17, 2020 19:00
-
-
Save hemoglobin/f4d52c1c17aa77f89564ffd8f65f5f37 to your computer and use it in GitHub Desktop.
Shell implementation of csf integration
This file contains 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/sh | |
# Set your AbuseIPDB API key here. | |
key="f4635bfa5be867bcd3543064934716df3506bf8dbfe9daaedd896331b465851f0e3049daa6add6d2" | |
# Choose the appropriate AbuseIPDB category ID depending on what LFD is scanning. | |
# https://www.abuseipdb.com/categories | |
categories="18,22" | |
# Rename arguments for readability. | |
ports=$2 | |
inOut=$3 | |
message=$6 | |
logs=$7 | |
trigger=$8 | |
# Concatenate details to form a useful AbuseIPDB comment. | |
comment="${message}; Ports: ${ports}; Direction: ${inOut}; Trigger: ${trigger}; Logs: ${logs}" | |
curl https://api.abuseipdb.com/api/v2/report \ | |
--data-urlencode "ip=$1" \ | |
-d categories=$categories \ | |
--data-urlencode "comment=$comment" \ | |
-H "Key: $key" \ | |
-H "Accept: application/json" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment