Server IP : 184.154.167.98 / Your IP : 3.135.193.70 Web Server : Apache System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 User : puertode ( 1767) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/local/ddos/ |
Upload File : |
########script for IP blacklist and ptr record check############################### #!/bin/bash # Slack configuration USERNAME="IP_BLACKLIST" WEBHOOK_URL="https://hooks.slack.com/services/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" # List of IP addresses to check IPS=( "184.154.167.98" "184.154.167.99" "184.154.167.100" "184.154.167.101" "184.154.167.102" ) # List of DNSBL servers to query DNSBL_SERVERS=( "zen.spamhaus.org" "bl.spamcop.net" "dnsbl.sorbs.net" "psbl.surriel.com" "ubl.unsubscore.com" "sbl.spamhaus.org" "xbl.spamhaus.org" "pbl.spamhaus.org" "dnsbl-1.uceprotect.net" "dnsbl-2.uceprotect.net" "dnsbl-3.uceprotect.net" "bl.spameatingmonkey.net" "dyna.spamrats.com" ) # Array of email addresses to notify EMAILS=( "mrhhosting@gmail.com" "techtest24x7@hotmail.com" "mrhtest@yahoo.com" ) # Function to send email notification send_email_notification() { local ip=$1 local dnsbl=$2 local ptr_record=$3 local subject="IP Blacklisted Alert: $ip" local message="IP Blacklisted on ${HOSTNAME}: $ip : $dnsbl\n $ptr_record" for email in "${EMAILS[@]}"; do echo "Sending email to $email" echo -e "Subject: $subject\n\n$message" | mail -s "$subject" "$email" if [ $? -ne 0 ]; then echo "Failed to send email to $email" else echo "Email sent to $email successfully" fi done } # Function to send Slack notification send_slack_notification() { local ip=$1 local dnsbl=$2 local ptr_record=$3 local messagetext="IP Blacklisted on ${HOSTNAME}: ${ip} : ${dnsbl}\n${ptr_record}" JSON="{ \"username\":\"$USERNAME\", \"attachments\":[{\"color\":\"danger\" , \"text\": \"$messagetext\"}]}" curl -s -d "payload=$JSON" "$WEBHOOK_URL" } # Function to perform blacklist check check_blacklist() { local ip=$1 local is_blacklisted=false # Convert the IP address to reverse DNS format local reversed_ip=$(echo $ip | awk -F. '{print $4"."$3"."$2"."$1}') echo "Checking IP: $ip" for dnsbl in "${DNSBL_SERVERS[@]}"; do result=$(dig +short "$reversed_ip.$dnsbl") if [ -z "$result" ]; then echo " Not listed on $dnsbl" else echo " Listed on $dnsbl: $result" is_blacklisted=true local ptr_record="PTR record: $(dig +short -x $ip)" send_email_notification $ip $dnsbl "$ptr_record" send_slack_notification $ip $dnsbl "$ptr_record" fi done if ! $is_blacklisted; then echo " IP $ip is not listed on any DNSBL" fi echo } # Loop through each IP and check if it's blacklisted for ip in "${IPS[@]}"; do check_blacklist $ip done