Bash Shell Script Help please
I want to write a bash shell script to execute a command for one minute then stop that command (ctrl c) pause for 10 seconds then run another command for one minute then stop that command pause for 10 seconds then go back to the begining of the script and loop indefinetly.
First I want to run this command for one minute; reaver -i mon0 -c 6 -b "mac address" -a -vv stop previous command and pause for 10 seconds Then run this command for one minute; airodump-ng -i mon0 stop previous command and pause for 10 seconds Then recall reaver command and continue to loop through until reaver spits out result. I imagine I will need to create a function for each command, an if statement and an ifelse statement and I will need the break and sleep commands. but I am not sure about the syntax, PLEASE HELP THIS NOOB! |
Welcome to LQ!!!
As you are new to LQ it will be good if you have a look at LQ rules here We are happy to assist you but you have to let us know what you have done so far. You already have requirements for your script in place let us know what you have prepared for that? Share the script which you have prepared and let us know where you are stuck. |
You can use 'timeout' command to run a program for 10 secs. You can use bash or even sh 'while' for loop.
|
At a Linux terminal, type man bash
I'd also suggest looking at "sleep". |
Thanks guys for your help.
The truth is I need to read up more on this. I have no Idea where to start and how the syntax would go. |
Quote:
|
That's a pretty hefty assumption. How do we know the OP doesn't want to test this on his LAN? Is that really the attitude we want to portray to the community? That hacking/reverse engineering is to be admonished?
|
Quote:
|
No less hefty than the assumption that the OP does not have malicious motives.
If the OP has pure motives, then disabling WPS and WEP on the AP would seem an easier course. |
Quote:
Another thing is that he is not asking us information on those tools instead he is asking on script. |
I accept that the intent of the post was advice on scripting, and the answers addressed that. I just have a reservation about a self-confessed noob having trouble writing a script also wanting to conduct pen-testing.
|
QUOTE: "If the OP has pure motives, then disabling WPS and WEP on the AP would seem an easier course."
Unless he was trying to hack his own network. I just don't see how this kind of attitude can propagate anything but negative bias. Of COURSE I don't condone nefarious behavior, but one can only learn better security by learning how to defend one's self. What better way to do this than to learn what someone might do to your network? |
Quote:
There is no way for us to KNOW the OP's motives; we can only address what we see, and acknowledge the position it will put LQ in, if those motives aren't correct. Knowledge should be free and open..and thankfully there is no shortage of advice on how to use either of those programs, nor is there shortage of advice on how to construct bash shell scripts to automate tasks. The OP has free, unfettered access to those resources. Putting the two together is up to them. In this case, it's not about censorship, but about accountability to this site. |
So, guilty until proven innocent? OP didn't mention his motives. Do folks have to provide that information before we can help them?
|
I do agree that OP should have clarified on what exactly he is trying to do / achieve but without giving him a chance to clarify we cannot simply roll the case against him.
Quote:
Quote:
When looking at such posts I guess we should be neutral unless there is something happens which points to something fishy. |
All times are GMT -5. The time now is 04:16 PM. |