LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-17-2015, 07:41 AM   #1
budasouljah
LQ Newbie
 
Registered: Apr 2015
Posts: 5

Rep: Reputation: Disabled
Question 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!
 
Old 04-17-2015, 07:57 AM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
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.
 
Old 04-17-2015, 08:34 AM   #3
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
You can use 'timeout' command to run a program for 10 secs. You can use bash or even sh 'while' for loop.
 
Old 04-17-2015, 09:52 AM   #4
loadedmind
Member
 
Registered: Sep 2003
Location: Texas
Distribution: Red Hat/CentOS
Posts: 290
Blog Entries: 1

Rep: Reputation: Disabled
At a Linux terminal, type man bash

I'd also suggest looking at "sleep".
 
Old 04-17-2015, 10:34 AM   #5
budasouljah
LQ Newbie
 
Registered: Apr 2015
Posts: 5

Original Poster
Rep: Reputation: Disabled
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.
 
Old 04-17-2015, 10:39 AM   #6
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,429

Rep: Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348
Quote:
PLEASE HELP THIS NOOB!
This NOOB is seeking advice on automating the use of cracking tools (reaver and airodump-ng). Without a legitimate use case, I would consider any further advice as being complicit in cracking and so against LQ rules.
 
1 members found this post helpful.
Old 04-17-2015, 10:41 AM   #7
loadedmind
Member
 
Registered: Sep 2003
Location: Texas
Distribution: Red Hat/CentOS
Posts: 290
Blog Entries: 1

Rep: Reputation: Disabled
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?
 
Old 04-17-2015, 10:47 AM   #8
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
Quote:
Originally Posted by loadedmind View Post
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?
No one here is denying any assistance but allend raised a valid point. We need to know what exactly he is trying to achieve / do? And no one is admonishing hacking / reverse engineering, it is person's personal choice. It is just that at LQ we do not encourage discussions on those topics. More information on that rule LQ mods can give.
 
Old 04-17-2015, 10:50 AM   #9
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,429

Rep: Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348
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.
 
Old 04-17-2015, 10:53 AM   #10
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
Quote:
Originally Posted by allend View Post
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.
It might be possible that he is trying to test those tools obviously my assumption is that he is doing it for learning purpose. We cannot say for sure unless OP clarifies himself.

Another thing is that he is not asking us information on those tools instead he is asking on script.
 
Old 04-17-2015, 11:01 AM   #11
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,429

Rep: Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348Reputation: 1348
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.
 
Old 04-17-2015, 11:10 AM   #12
loadedmind
Member
 
Registered: Sep 2003
Location: Texas
Distribution: Red Hat/CentOS
Posts: 290
Blog Entries: 1

Rep: Reputation: Disabled
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?
 
Old 04-17-2015, 11:18 AM   #13
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,916

Rep: Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689
Quote:
Originally Posted by loadedmind View Post
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?
That's very true, and I absolutely agree with you...BUT...

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.
 
Old 04-17-2015, 11:23 AM   #14
loadedmind
Member
 
Registered: Sep 2003
Location: Texas
Distribution: Red Hat/CentOS
Posts: 290
Blog Entries: 1

Rep: Reputation: Disabled
So, guilty until proven innocent? OP didn't mention his motives. Do folks have to provide that information before we can help them?
 
Old 04-17-2015, 11:42 AM   #15
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
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:
In this case, it's not about censorship, but about accountability to this site.
I am not sure how it will make the site accountable? We are not teaching other person to use those tools as this site is not for hacking / cracking related stuff. However, this site is do here for assisting the members on anything related to linux and bash is definitely part of it. As per LQ rule:

Quote:
Posts containing information about cracking, piracy, warez, fraud or any topic that could be damaging to either LinuxQuestions.org or any third party will be immediately removed.
I don't see anything relate to cracking here but just the name of two tools which can be used for cracking. I don't think so mentioning just the names violates any rule. As long anyone as anyone put anything directly related to hacking / cracking I don't think LQ rules are getting violated. Here OP is asking about scripting and not anything about those tools whatsoever.

When looking at such posts I guess we should be neutral unless there is something happens which points to something fishy.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help in shell/bash script yashvanth Linux - Newbie 13 03-26-2012 09:10 AM
Calling a bash shell script from within another script dedman Linux - Software 7 04-24-2010 09:53 PM
in bash shell how to run shell script during startup rammohan04 Red Hat 2 07-31-2009 03:07 AM
Bash shell script moodupani Linux - General 2 09-01-2005 07:14 AM
Bash Shell script bd1308 Linux - Hardware 9 08-22-2005 06:38 PM


All times are GMT -5. The time now is 06:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration