Saturday, June 14, 2014

Starting with new and fresh recipe

College day's has gone !! And my brain start thinking about my life. what to do? how to do? why to do? etc so this type of questions running in my mind since I completed my M.Sc in Comp sci from Pune University.
Those relaxation will never ever be  made me good now, because I'm missing something in my life.  May be it's about my passion , my career , my goal. So here I started to write something and trying to listen to my heart. I know if there is something I give dedication into this profession I would also become A Penetration tester. somebody said "If u want to become Penetration tester learn a lot, stay hungry . certification is not necessary that much. Knowledge count you. "

So here I give you only Knowledge regarding Cyber Security field which I learn my self. Hope you also get knowledge using this blog. here u can also share your idea's with me so that I can learn a lot and try to get more knowledge. 

Already I know the basic things in this field and I have shared already with you guys, so from know i will share other things which is very important than basic.....
starting from two main programming subject which is very helpful to create viruses and exploit in next level . today on-word's  i'm gonna tell you about Shell Scripting in detail.

Shall Scripting  
                    
                     Shell Scripting is series of command written in plain text file. Shell scripting is like a batch file is MS-DOS but have more powerful than MS-DOS batch file. And this is designed to be run on Unix shell, a command line interpreter.

Why you should write this shell script?

  • Shell script can take input from user, file and output them on screen.
  • Useful to create our own commands.
  • Save lots of time.
  • To automate some task of day today life.
  • System Administration part can be also automated.
And know how to write a simple Shell script. 

Following steps are required to write shell script:
(1) Use any editor like vi or mcedit to write shell script. (I'm using Vim Editor In KALI ) 
(2) After writing shell script set execute permission for your script as follows
syntax: 

chmod permission your-script-name 
e.g :- $ chmod 755 your-script-name

This will set read write execute(7) permission for owner, for group and other permission is read and execute only(5).
 Execute your script as
Syntax :-
bash your-script-name
sh your-script-name
./your-script-name


e.g :- $ bash bar
       $ sh bar
       $ ./bar

 In the last syntax ./ means current directory, But only . (dot) means execute given command file in current shell without starting the new copy of shell, The syntax for . (dot) command is as follows
Syntax :-
. command-name

e.g :- $ . foo

Now you are ready to write first shell script that will print "Knowledge is Power" on screen. See the common vi command list , if you are new to vi.
$  vi first
#
# my first shell script
#
#
clear
echo "knowledge is power".

After saving the above script, you can run the script as follows:
$ ./first

This will not run script since we have not set execute permission for our script first; to do this type command
$ chmod 755 first
$ ./first

First screen will be clear, then Knowledge is Power is printed on screen.