hakermania
February 20th, 2010, 05:17 PM
Hello all!
I've written a script.This is what is was supposed to do:
First of all, the user has to give his interface by typing "7".
when the interface was specified the program would start from the beginning asking for another number.This program works fine till this stage. Unfortunately, when I am giving for example 1, the program "airmon-ng" runs but it misbehaves.That means that wrong info have been given to it, although the interface I 've given to 7 are right. For example, I give to 7 "wlan0". A file named wlan0_DAT which includes the word "wlan0" is created in /home/alex/Documents/hakforothers/.Then the program reruns.I give it "1".The program airmon-ng starts normally but it gives errors. That means that the final given command wasn't "airmon-ng start wlan0" as it was supposed to be but something else. Now, if I push "2" it says:
"cat: /home/alex/Documents/hakforothers/_DAT: No such file or directory"
Where do I do wrong? Here is my code:
num1="1"
num2="2"
num3="3"
num4="4"
num5="5"
num6="6"
num7="7"
echo
echo "Type what you wanna do..."
echo "1= Start interface 2= Stop interface 3= See your mac"
echo "4= Change your mac 5= Hack WEP...... 6= Hack WPA...."
echo "IF YOU RUN FIRST TIME --> 7= Say which is your interface"
read number
if [ "$number" == "$num1" ]; then
int=`cat /home/alex/Documents/hakforothers/${int}_DAT`
airmon-ng start $int
/home/alex/Desktop/hakfile
elif [ "$number" == "$num2" ]; then
int=`cat /home/alex/Documents/hakforothers/${int}_DAT`
airmon-ng stop $int
/home/alex/Desktop/hakfile
elif [ "$number" == "$num3" ]; then
int=`cat /home/alex/Documents/hakforothers/${int}_DAT`
macchanger -s $int
/home/alex/Desktop/hakfile
elif [ "$number" == "$num4" ]; then
int=`cat /home/alex/Documents/hakforothers/${int}_DAT`
macchanger -m 00:11:22:33:44:55 $int
/home/alex/Desktop/hakfile
elif [ "$number" == "$num5" ]; then
exit
elif [ "$number" == "$num6" ]; then
exit
elif [ "$number" == "$num7" ]; then
if [ -s /home/alex/Documents/script/${USERNAME}_DAT ]; then
echo "interface already mentioned.You can change it by editing /home/alex/Documents/hakforothers/*file*"
/home/alex/Desktop/hakfile
else
echo "Type your interface.Do not do any mistakes.Be careful"
read int
echo $int > /home/alex/Documents/hakforothers/${int}_DAT
/home/alex/Desktop/hakfile
fi
fi
Thx in advance for any answers!
I've written a script.This is what is was supposed to do:
First of all, the user has to give his interface by typing "7".
when the interface was specified the program would start from the beginning asking for another number.This program works fine till this stage. Unfortunately, when I am giving for example 1, the program "airmon-ng" runs but it misbehaves.That means that wrong info have been given to it, although the interface I 've given to 7 are right. For example, I give to 7 "wlan0". A file named wlan0_DAT which includes the word "wlan0" is created in /home/alex/Documents/hakforothers/.Then the program reruns.I give it "1".The program airmon-ng starts normally but it gives errors. That means that the final given command wasn't "airmon-ng start wlan0" as it was supposed to be but something else. Now, if I push "2" it says:
"cat: /home/alex/Documents/hakforothers/_DAT: No such file or directory"
Where do I do wrong? Here is my code:
num1="1"
num2="2"
num3="3"
num4="4"
num5="5"
num6="6"
num7="7"
echo
echo "Type what you wanna do..."
echo "1= Start interface 2= Stop interface 3= See your mac"
echo "4= Change your mac 5= Hack WEP...... 6= Hack WPA...."
echo "IF YOU RUN FIRST TIME --> 7= Say which is your interface"
read number
if [ "$number" == "$num1" ]; then
int=`cat /home/alex/Documents/hakforothers/${int}_DAT`
airmon-ng start $int
/home/alex/Desktop/hakfile
elif [ "$number" == "$num2" ]; then
int=`cat /home/alex/Documents/hakforothers/${int}_DAT`
airmon-ng stop $int
/home/alex/Desktop/hakfile
elif [ "$number" == "$num3" ]; then
int=`cat /home/alex/Documents/hakforothers/${int}_DAT`
macchanger -s $int
/home/alex/Desktop/hakfile
elif [ "$number" == "$num4" ]; then
int=`cat /home/alex/Documents/hakforothers/${int}_DAT`
macchanger -m 00:11:22:33:44:55 $int
/home/alex/Desktop/hakfile
elif [ "$number" == "$num5" ]; then
exit
elif [ "$number" == "$num6" ]; then
exit
elif [ "$number" == "$num7" ]; then
if [ -s /home/alex/Documents/script/${USERNAME}_DAT ]; then
echo "interface already mentioned.You can change it by editing /home/alex/Documents/hakforothers/*file*"
/home/alex/Desktop/hakfile
else
echo "Type your interface.Do not do any mistakes.Be careful"
read int
echo $int > /home/alex/Documents/hakforothers/${int}_DAT
/home/alex/Desktop/hakfile
fi
fi
Thx in advance for any answers!