Showing posts with label bash. Show all posts
Showing posts with label bash. Show all posts

Monday, October 6, 2014

bash vulnerability - shellshock

0 comments

bash vulnerability - shellshock

The bash vulnerability which Was discovered weeks before . has already been fixed so rapidly, and the most interesting thing is that no matter how the serious bug is all developers tried fix the bug. Everyone using Bash has the freedom to download, inspect, and modify the code -- unlike with Microsoft, Apple, or other proprietary software.

The bug, which is being referred to as "shellshock," can allow, in some circumstances, attackers to remotely access and control systems using Bash (and programs that call Bash).

     
Read more...

Tuesday, July 22, 2014

A quick glance at the shell script

0 comments

A quick glance at the shell script

Linux system consists of several components, the most important of these components is the Linux kernel which is the heart of the system, the so-called Shell that takes Linux kernel as casing.

Bash is in all Linux distributions almost, it is responsible for the implementation of the terminals commands as an example, and it is responsible for taking commands and passed them to the kernel and deal with them, which is very useful and depend on them most of the Linux applications.

When you execute ls command, for example, which lists all the files and folders in the current path in the terminal, the Bash automatically execute the program in /bin/ls, then the program is executed and the components are listed the current path.

Shell script is a set of serial commands that are written for a particular job, you can perform anything and modify anything you want the system via the shell script, the Bash reads the commands and instructions from a shell script and it is implemented to perform the task that it was designed for.

Shell script does not require simple commands such as ls and pwd, it can contain conditional sentences  like if and functions and variables and things very complicated, it differs from the use of these things, each according to the goal of shell scripts.


This is an example of a very simple shell script file which will ask for your name and your age, then print them in the screen, take these commands and save them in a file in a folder, for example test.sh  in the home directory :

#! / bin / bash 
echo "Enter your name:"; read name 
echo "Enter your age:"; read age 
echo "Hello $ name, you are $ age years old!" 

Then run the following command to make it executable :

chmod +x test.sh 

Now to execute shell scripts, do as this :

. / test.sh 

Enter your name, and enter your age, and will print the sentence .. Of course this is a very simple example to give you an idea about it, writing useful shell scripts needs a higher level than that, you can learn shell scripts from some online Guides.

     
Read more...