PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Quick Scan Linux Script Security TUT

Go down

Quick Scan Linux Script Security TUT Empty Quick Scan Linux Script Security TUT

Post by jamied_uk 4th May 2017, 16:51



Code:

Code:
#!/bin/bash
#
# (c) J~Net 2017
#
# jnet.forumotion.com/t1477-quick-scan-linux-script-security-tut#2157
#
# Kali Linux
# chmod +x *.sh
#
# Non Kali
# sudo chmod +x *.sh
#
# Example:
# ./Run.sh enp0s3 or wlan0 or eth0
#
#apt update && apt upgrade -y
#apt install -y ettercap
var="$1"
# Non Kali Install
sudo apt install arp-scan
# Kali Install
# apt install arp-scan
clear
ifconfig
echo "Choose An Adapter & Type It In"
# Check if user put in any adapter
 if [ -z "$1" ] && [ -z "$2" ]
  then
  read var
 fi
# Kali Run
#arp-scan --interface=$var --localnet
# Non kali Run
sudo arp-scan --interface=$var --localnet
jamied_uk
jamied_uk
Admin

Posts : 3053
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Quick Scan Linux Script Security TUT Empty Re: Quick Scan Linux Script Security TUT

Post by jamied_uk 4th May 2017, 18:19

Scan Function



Code:
sudo gedit .bashrc



Code:
function Scan(){
var="$1"
# Non Kali Install
sudo apt install arp-scan
# Kali Install
# apt install arp-scan
clear
ifconfig
echo "Choose An Adapter & Type It In"
# Check if user put in any adapter
 if [ -z "$1" ] && [ -z "$2" ]
  then
  read var
 fi
# Kali Run
#arp-scan --interface=$var --localnet
# Non kali Run
sudo arp-scan --interface=$var --localnet
}
jamied_uk
jamied_uk
Admin

Posts : 3053
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Quick Scan Linux Script Security TUT Empty Re: Quick Scan Linux Script Security TUT

Post by jamied_uk 27th May 2017, 21:18

Also Check Out

jnet.forumotion.com/t1506-linux-bash-mass-scanning-the-whole-internet-web-cams#2223

https://jnet.forumotion.com/t1506-linux-bash-mass-scanning-the-whole-internet-web-cams#2223
jamied_uk
jamied_uk
Admin

Posts : 3053
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Quick Scan Linux Script Security TUT Empty Re: Quick Scan Linux Script Security TUT

Post by jamied_uk 27th May 2017, 21:21

Updated Quick Scan With Comparison For Security Checking


Code:
#!/bin/bash
#
# (c) J~Net 2017
#
# jnet.forumotion.com/t1477-quick-scan-linux-script-security-tut#2157
#
# Kali Linux
# chmod +x *.sh
#
# Non Kali
# sudo chmod +x *.sh
#
# Example:
# ./Run.sh enp0s3 or wlan0 or eth0

#
# Check old scan file exists and backup if it does for comparison
#

#apt update && apt upgrade -y
#apt install -y ettercap
var="$1"
# Non Kali Install
sudo apt install arp-scan
# Kali Install
# apt install arp-scan
#
# Check if old log file exists!...
if [ -f "output.txt" ]; then
 echo "backing Up Old Log File For Comparison, Please Wait...";
# Instead of copying we sort here to save time later!...
cat output.txt | sort > old_output.txt
#

fi

clear
ifconfig
echo "Choose An Adapter & Type It In"
# Check if user put in any adapter
 if [ -z "$1" ] && [ -z "$2" ]
  then
  read var
 fi
# Kali Run
#arp-scan --interface=$var --localnet
# Non kali Run
sudo arp-scan --interface=$var --localnet > output.txt
head -n -3 output.txt > tempoutput.txt ; mv tempoutput.txt output.txt
clear
cat output.txt
# Now compare with old scan data
if [ -f "old_output.txt" ]; then
echo "Comparing Log Files, Please Wait..."
 cat output.txt | sort > tmp_output.txt
 mv tmp_output.txt output.txt
 echo "Differences Are Listed Below"
 echo ""
 grep -f old_output.txt output.txt
#
 # var1 contains size of file1
var1=$(stat -c%s old_output.txt)
# var2 contains size of file2
var2=$(stat -c%s output.txt)
#same as above
if [[ "$var1" -lt "$var2" ]]; then
    echo ""
    echo ""
    echo 'New Devices Maybe On Youre Network'
 elif [[ "$var1" -gt "$var2" ]]; then
    echo ""
    echo ""
    echo 'Everything Seems Normal'
 elif [[ "$var1" -eq "$var2" ]]; then
     echo ""
     echo ""
     echo 'Everything Seems Normal'
 fi
fi
jamied_uk
jamied_uk
Admin

Posts : 3053
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Quick Scan Linux Script Security TUT Empty Re: Quick Scan Linux Script Security TUT

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum