Home
Calendar
Certifications
Columns
Features
Forum
Resources
Vitals
Latest Additions
April 2013 Free Giveaway Sponsor - eLearnSecurity
Human Intelligence to Navigate the Security Data Deluge
February 2013 Free Giveaway Winner of SANS CyberCon Training
Interview: Bugcrowd Founders on Herding Ninjas for Crowdsourced Bug Bounties
Network Forensics: The Tree in the Forest
March 2013 Free Giveaway Sponsor - Mile2
Book Review: Violent Python
February 2013 Free Giveaway Sponsor - SANS
Holiday 2012 Free Giveaway Winner of Metasploit Pro by Rapid7
Course Review: SANS FOR408 Computer Forensic Investigations – Windows In-Depth
The Security Consulting Sugar High
Tutorial: Fun with SMB on the Command Line
Interview: Ilia Kolochenko, CEO of High-Tech Bridge
October 2012 Free Giveaway Winner of LearningGate Training
The Broken: Assessing Corporate Security in 2012 to Make a Better 2013
EH-Net Login
Welcome Guest.
Username:
Password:
Remember me
Lost Password?
No account yet?
Register
Who's Online
We have 61 guests and 1 member online
Free Business and Tech Magazines and eBooks
You are here:
Home
Ethical Hacking Discussions and Related Certifications
Programming
First shell script... COMPLETE.
EH-Net
May 24, 2013, 06:03:41 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: Go back to The Ethical Hacker Network Online Magazine
Home Page
Home
Help
Calendar
Login
Register
EH-Net
>
Ethical Hacking Discussions and Related Certifications
>
Programming
(Moderator:
don
) >
First shell script... COMPLETE.
Pages:
1
[
2
]
Go Down
« previous
next »
Print
Author
Topic: First shell script... COMPLETE. (Read 5382 times)
0 Members and 1 Guest are viewing this topic.
MaXe
Hero Member
Offline
Posts: 669
I've just upgraded myself to a cyborg muahahaa!!1
Re: First shell script... COMPLETE.
«
Reply #15 on:
October 01, 2012, 11:13:27 PM »
Exactly Seph, but you have to define $IP if you are going to use that. $1, $2, $3, $4, etc. are all predefined variables and is the same as sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], etc. If I am not entirely mistaken.
In PHP you would have to define $IP like:
$IP = sys.argv[1]; // afaik, this may be wrong.
system('clear');
$commandline = "nmap -sP $IP > /pentest/results/scans/$scanname.txt && echo scan complete."
system($commandline);
Now I know this about shell scripting, but since I don't know how to use getopts, even though it's fairly simple as I read the "manual" not long ago, I thought that I would use PHP instead as an example as most programming languages translates universally somewhat.
Logged
I'm an InterN0T'er
SephStorm
Hero Member
Offline
Posts: 530
Re: First shell script... COMPLETE.
«
Reply #16 on:
October 01, 2012, 11:38:19 PM »
I read the relevant portion of the man page as suggested, and that helped me understand it. The PHP and sys.argv stuff is still out of reach for the moment.
EDIT: ok, so i changed the script, and executed it, it worked!
«
Last Edit: October 02, 2012, 12:00:18 AM by SephStorm
»
Logged
Support my hactivities.
http://www.cafepress.com/TRUEHacker
MaXe
Hero Member
Offline
Posts: 669
I've just upgraded myself to a cyborg muahahaa!!1
Re: First shell script... COMPLETE.
«
Reply #17 on:
October 02, 2012, 01:49:24 AM »
Awesome, good to hear you read the manpage and understood everything
It's understandable you don't want to dive into PHP or other scripting or programming languages at the moment, as it is easy to get lost if you dive into too many projects / languages at once.
Logged
I'm an InterN0T'er
SephStorm
Hero Member
Offline
Posts: 530
Re: First shell script... COMPLETE.
«
Reply #18 on:
October 02, 2012, 08:38:54 AM »
So at this point, i'm feeling pretty good about everything, i've written a total of 3 scripts, one for ping scanning, one for port scanning (though im sure this one will require some manual interaction), and one for banner grabbing using ncat. I cant wait to practice using ncat, I hope to practice some proxying and SSL tunneling maybe?
Logged
Support my hactivities.
http://www.cafepress.com/TRUEHacker
hayabusa
Hero Member
Offline
Posts: 1633
Re: First shell script... COMPLETE.
«
Reply #19 on:
October 02, 2012, 11:40:34 AM »
Good work. Now keep going. There's no end to what you can script up, during a pentest, and more often than not, you don't have tons of time to do it, so practice, practice, practice, and get proficient at it.
Try chaining tools and output together (calling one tool with output from another), reading from input / output files, etc. Keep building on what you've accomplished, and you'll grow by leaps and bounds.
(And for your own benefit, learn to comment in your scripts, so you can reference them later, if you've forgotten something, or need a quick reminder.)
Logged
~ hayabusa ~
"All men can see these tactics whereby I conquer, but what none can see is the strategy out of which victory is evolved." - Sun Tzu, 'The Art of War'
OSCE, OSCP , GPEN, C|EH
Pages:
1
[
2
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
EH-Net
-----------------------------
=> Calendar Of Events
===> ChicagoCon 2007
===> ChicagoCon 2008s
===> ChicagoCon 2008f
===> ChicagoCon 2009s
=> Ethical Hacktivism
=> News Items and General Discussion About EH-Net
===> Greetings
=> Special Events
-----------------------------
Ethical Hacking Discussions and Related Certifications
-----------------------------
=> General Certification
===> Networking
===> OS
===> Security
=> Compliance, Regulations & Standards
=> Control Systems
=> Cyber Warfare
=> Forensics
===> CCE / MCCE - (Master) Certified Computer Examiner
===> CHFI - Computer Hacking Forensic Investigator
===> EnCE - EnCase® Certified Examiner
===> GCFA - GIAC Certified Forensics Analyst
=> Hardware
=> Incident Response
===> CSIH - Computer Security Incident Handler
===> GCIH - GIAC Certified Incident Handler
=> Malware
===> Advisories
=> Mobile
=> Network Pen Testing
===> CEH - Certified Ethical Hacker
===> CPTC - Certified Penetration Testing Consultant
===> CPTE - Certified Penetration Testing Engineer
===> CSTA - Certified Security Testing Associate
===> eCPPT - eLearnSecurity Certified Professional Penetration Tester
===> ECSA - EC-Council Certified Security Analyst
===> GPEN - GIAC Certified Penetration Tester
===> OSCP - Offensive Security Certified Professional
=> Physical Security
=> Programming
=> Social Engineering
=> Web Applications
=> Wireless
===> CWNP Certs
===> GAWN - GIAC Assessing Wireless Networks
===> OSWP - Offensive Security Wireless Professional
=> Other
-----------------------------
Columns
-----------------------------
=> Editor-In-Chief
=> Andress
=> Gates
=> Haddix
=> Hadnagy
=> Heffner
=> Hoffman
=> Linn
=> RichM
=> Murray
=> J. Peltier
=> Weidman
=> Wilson
-----------------------------
Features
-----------------------------
=> /root
=> Book Reviews
=> Opinions
=> Skillz
===> Examples
===> May 06 - Star Hacks, Episode V: The Empire Hacks Back
===> July 06 - Hack Bill!
===> Sept 06 - Netcat in the Hat
===> Nov 06 - Hitch-Hackers Guide to the Galaxy
===> Dec 06 - A Christmas (Hacking) Story
===> Feb 07 - Charlottes Web Site
===> April 07 - Microsoft Office Space
===> June 07 - Serenity Hack
===> Oct 07 - Worst. Ethical. Hacker. Challenge. Ever.
===> Dec 07 - Frosty the Snow Crash
===> March 2008 - It Happened One Friday
===> Oct 2008 - Scooby Doo and the Crypto Caper
===> Dec 08 - Santa Claus Is Hacking to Town
===> Feb 2009 - Brady Bunch Boondoggle
===> July 2009 - Prison Break
===> October 2009 - SSHliders
===> December 2009 - Miracle on Thirty-Hack Street
===> December 2010 - The Nightmare Before Charlie Browns Christmas
-----------------------------
Resources
-----------------------------
=> Career Central
===> Looking For Work
===> Looking To Hire
=> Links to cool sites.
=> Mass Media
=> News from the Outside World
=> Tools
=> Tutorials
===> Tutorial Requests
Loading...
Exclusive Deal
SANSFIRE 2013
June 15 - 22
5% Off
w/ Code
:
EHN_5
SANS Deals 4 EH-Netters
5% OFF
Any
SANS Course
in Any Format!
Coupon Code:
EHN_5
Including
SANS Rocky Mountain 2013
&
SANS Boston 2013
Polls
Compared to this year, 2013 will be:
Great!
Better.
About the same.
Little worse.
FUBAR!
Recent Forum Topics
News Items and General Discussion About EH-Net
: ÌÀÃÀÇÈÍ ÌÎÄÍÎÉ ÎÄÅÆÄÛ APPLE-FASHION!
(0) by
Infabeemace
News Items and General Discussion About EH-Net
: When your benjamin will be to your own car and truck clean up
(0) by
areluctes
Network Pen Testing
: Want a challenge? Want a GXPN practice exam?
(0) by
ajohnson
GCIH - GIAC Certified Incident Handler
: Passed my GCIH
(8) by
ajohnson
News Items and General Discussion About EH-Net
: Change is Coming to EH-Net!!
(29) by
ajohnson
GCIH - GIAC Certified Incident Handler
: GCIH Free Practice test attempt
(1) by
prats84
Greetings
: Hi from the UK
(4) by
MrTuxracer
EH-Net News Feeds
Latest Additions
Privacy Notice
for TDCC & All Properties
© 2013 The Ethical Hacker Network
Joomla!
is Free Software released under the GNU/GPL License.