Demo entry 6838699

Gard3nia

   

Submitted by anonymous on Jun 11, 2019 at 13:50
Language: Bash. Code size: 971 Bytes.

#!/bin/bash
echo -e "Detect some of your server's services..."
echo -e "*********************Loading*********************"

file=/home/gard3nia/netinfo.txt
netstat -tuln > ${file}

info=$(grep ":80" ${file})
if [ "${info}" != "" ];
then
    echo "[+]Your www service is up..."
else
    echo "[-]You www service is down..."
fi

info=$(grep ":3306" ${file})
if [ "${info}" != "" ];
then
    echo "[+]Your mysql service is up..."
else
    echo "[-]Your mysql service is down..."
fi

info=$(grep ":22" ${file})
if [ "${info}" != "" ];
then
    echo "[+]Your ssh service is up..."
else
    echo "[-]Your ssh service is down..."
fi

info=$(grep ":21" ${file})
if [ "${info}" != "" ];
then
    echo "[+]Your ftp service is up..."
else
    echo "[-]Your ftp service is down..."
fi

info=$(grep ":25" ${file})
if [ "${info}" != "" ];
then
    echo "[+]Your mail service is running..."
else
    echo "[-]Your mail service is down..."
fi

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).