05-06-2012, 11:19 AM
misi teman",, ini saya coba kembangin tools live ip cheker yang semalam di post di sini
maksudnya ingin nambahin pilihan untuk melakukan scanning atau tidak ,,
berikut kode nya
setelah dijalankan terdapat error sebagai berikut
mohon koreksi script nya,, maklum hampir 3 tahun g nyentuh bash lagi
error nya di else,,perasaan g salah ketik,,
makasih
regards junior
maksudnya ingin nambahin pilihan untuk melakukan scanning atau tidak ,,
berikut kode nya
Code:
#!/bin/bash
#!/original by predi
#!/editing by junior.riau18
echo '
__ __ __ __
| | | | ________ ________ __ _______ | | ________ | |
| |__| || || _____| _| |__ | ____| | |____ | _ || | __
| || __ || |_____ |_ __| | | | _ || |_| || |/ /
| __ || |__| ||_____ | | | | | _ | | | || _____|| /
| | | || | _____| | | |_ | |____| || | | || |_____ | \
|__| |__||________||________| |____| |_________||__| |__||________||__|\__\
'
#!input net id
echo -n -e "Input your Net ID target(such as 192.168.0.): ";
read ip
echo -n -e "Would you want to save the target and continue with host fingerprinting?(y)/(n): ";
read fp
if ["$fp"=="n"]
for i in {1..10}
do
{
iptest=$ip$i
ping -c 1 $iptest > /dev/null
[ $? -eq 0 ] && echo Host with IP: $iptest is live.
}
done
else
declare -a targetip
a=0;
for i in {1..10}
do
{
iptest=$ip$i
ping -c 2 $iptest > /dev/null
[ $? -eq 0 ] && echo Host with IP: $iptest is live.
targetip["$a"]=$iptest;
let a=$a+1;
}
done
echo "Launch nmap -O"
nmap -O ${targetip[0]};
fi
exit;
setelah dijalankan terdapat error sebagai berikut
Code:
root@bt:~/cekiplive# ./ceklive.sh
__ __ __ __
| | | | ________ ________ __ _______ | | ________ | |
| |__| || || _____| _| |__ | ____| | |____ | _ || | __
| || __ || |_____ |_ __| | | | _ || |_| || |/ /
| __ || |__| ||_____ | | | | | _ | | | || _____|| /
| | | || | _____| | | |_ | |____| || | | || |_____ | \
|__| |__||________||________| |____| |_________||__| |__||________||__|\__\
Input your Net ID target(such as 192.168.0.): 10.75.42.
Would you want to save the target and continue with host fingerprinting?(y)/(n): n
./ceklive.sh: line 31: syntax error near unexpected token `else'
./ceklive.sh: line 31: `else'
root@bt:~/cekiplive#
mohon koreksi script nya,, maklum hampir 3 tahun g nyentuh bash lagi
error nya di else,,perasaan g salah ketik,,
makasih
regards junior