[ SEA-GHOST MINI SHELL]

Path : /proc/2/cwd/proc/2/cwd/proc/2/cwd/proc/2/root/var/lib/zabbix/
FILE UPLOADER :
Current File : //proc/2/cwd/proc/2/cwd/proc/2/cwd/proc/2/root/var/lib/zabbix/blacklisted_ip

#!/bin/bash

function ip2dec () {
    local a b c d ip=$@
    IFS=. read -r a b c d <<< "$ip"
    printf '%d\n' "$((a * 256 ** 3 + b * 256 ** 2 + c * 256 + d))"
}

function dec2ip () {
    local ip dec=$@
    for e in {3..0}
    do
        ((octet = dec / (256 ** e) ))
        ((dec -= octet * 256 ** e))
        ip+=$delim$octet
        delim=.
    done
    printf '%s\n' "$ip"
}

ipList=$(ifconfig | grep "inet addr:" | sed "s/.*inet addr://" | sed "s/ .*//" | grep -vE '^((203)|(127)|(10)|(192\.168)|(172\.((1[6-9])|(2[0-9])|(3[0-1]))))\..*$')
blackList=$(wget -q -O - https://postmaster.live.com/snds/ipStatus.aspx?key=2e8e8c7a-ac92-87ea-f8c8-2a48d18d6a76)


while read -r line; do
  ipStart=$(ip2dec $(echo $line | awk -F "," '{print $1}'))
  ipEnd=$(ip2dec $(echo $line | awk -F "," '{print $2}'))
  comment=$(echo $line | awk -F "," '{print $4}' | sed "s/\r//")
  while read -r ip; do
    ipDec=$(ip2dec $ip)
    if [ $ipDec -ge $ipStart ] && [ $ipDec -le $ipEnd ]; then
      statusText+="$ip: $comment; "
    fi
  done <<< "$ipList"
done <<< "$blackList"
if [ ! -z "$statusText" ];then
  echo "ERROR: $statusText"
else
  echo "OK: There is no our IPs in Microsoft blacklist"
fi

SEA-GHOST - SHELL CODING BY SEA-GHOST