Jump to content

Need to run/sleep commands from shell. How to do it?


ViTALiTY
 Share

Recommended Posts

So, because all of the scripts I've tried to automate reaver and MDK3 are not working properly, I need to try to do things on my own.

This is basically what I need.

Reaver will stay open in one shell, cracking the WPS.

It has to be Reaver doing this because I can execute Reaver without the -c command, after the AP reboots with the MDK3 attack, it will change channel (changes between 1 and 6, always), and for Bully I have always to give the -c command so I'll leave Bully off.

Allright, so, Reaver will always stay open.

The AP will lock forever after 10 wrong pins. Let's say reaver will take 12 minutes to go all over the 10 pins (made it to try 1 pin/minute, and also better give it some delay).

Now the difficult part where I need help.

These 4 commands have to be executed:

mdk3 mon0 a -a **:**:**:**:**:** -m

mdk3 mon0 b -a **:**:**:**:**:** -n "*************" -h -c *

mdk3 mon0 d -a **:**:**:**:**:** -c *

mdk3 mon0 m -t **:**:**:**:**:**

For about 10 minutes, and then stop, so that the AP reboots and reaver can continue.

So basically:

Reaver starts to work, for 12 minutes.

The commands start to work after 12 minutes of Reaver starting.

They all run for 10 minutes, then stop.

Reaver starts again, will look for the channel again, and continue for 12 minutes.

Reaver stops, the commands start to work for 10 minutes.

And like this, forever (Reaver would eventually find the pin).

Another thing that worries me is that 2 of the MDK3 commands need the channel. And the channel would change every 10 minutes of those commands working, so they would have to change every new time they are executed...

I know this is a little confusing, but if anyone could help that would be amazing.

Thanks in advance.

Link to comment
Share on other sites

I would say look into cron jobs aka crontab.

If I'm thinking properly, reaver will lock onto a channel when it finds the target, so you may not need to specify the channel for mon0 to run your mdk3 commands. When the commands stop (probably a killall mdk3 in cron), reaver will re-scan and find the channel and continue, which locks the channel on mon0. Then mdk3 commands shouldn't change the channel and rinse repeat.

I could be wrong or this may not be the best way, just woke up.

Link to comment
Share on other sites

I would say look into cron jobs aka crontab.

If I'm thinking properly, reaver will lock onto a channel when it finds the target, so you may not need to specify the channel for mon0 to run your mdk3 commands. When the commands stop (probably a killall mdk3 in cron), reaver will re-scan and find the channel and continue, which locks the channel on mon0. Then mdk3 commands shouldn't change the channel and rinse repeat.

I could be wrong or this may not be the best way, just woke up.

I will look into that, thanks.

But yes, the MDK3 attacks will make the router reboot and it will change channel, it alternates between channel 1 and channel 6.

Anyway, will take a look when I have the time and will report back.

Link to comment
Share on other sites

Using the 'at' command you can schedule a command to run a relative time from now in the future.

Going this route is probably more convenient because unlike with the Cron approach you can simply start a sequence at any time and have it perform everything you want it to, all relative to the moment at which you started the script. End your script with a command that reruns your full script at the appropriate time in the future whenever the intended result hasn't been reached just yet and you should be done.

Link to comment
Share on other sites

Using the 'at' command you can schedule a command to run a relative time from now in the future.

Going this route is probably more convenient because unlike with the Cron approach you can simply start a sequence at any time and have it perform everything you want it to, all relative to the moment at which you started the script. End your script with a command that reruns your full script at the appropriate time in the future whenever the intended result hasn't been reached just yet and you should be done.

Any easy way to write a script like that?

Searched google a bit and found out some sites in which I can paste the commands and configure the minutes, and the site returns the cron script.

Anything like that for "at"?

Thanks for your reply!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...