الأحد، 9 يونيو 2019

سكريبت الهاكر

Scripting :

Scripting for the Aspiring Hacker(BASH scripting) Any self-respecting hacker must be able to script. For that matter, any self-respecting Linux administrator must be able to script. With the arrival of the Windows PowerShell, Windows administrators are increasingly required to script as well perform automated tasks and be more efficient. Types of Shells A shell is an interface between the user and the operating system. This enables us to run commands, programs, manipulate files, etc. There are a number of different shells available for Linux. These include the Korn shell, the Z shell, the C shell, and the Bourne again shell (or BASH). As the BASH shell is available on nearly all Linux and UNIX distributions (including Mac OS X, BackTrack, and Kali), we will be using the BASH shell, exclusively. BASH Basics To create a shell script, we need to start with a text editor. You can use any of the text editors in Linux including vi, vim, emacs, gedit, kate, etc., but I will be using kwrite here in these tutorials. Using a different editor should not make any difference in your script. "Hello, Null Byte!" For our first script, we will start with a simple script that returns a message to the screen that says "Hello, Null Byte!". We start by entering the shebang or #!. This tells the operating system that whatever follows the shebang is the interpreter we want to use for our script. We then follow the shebang with /bin/bash indicating that we want the operating system to use the BASH shell interpreter. #! /bin/bash Next, we enter echo, a command in Linux that tells the system to simply repeat or "echo" back to our monitor (stdout) what follows. In this case, we want the system to echo back to us "Hello Null Byte!". Note that the text or message we want to "echo back" is in double quotation marks. echo "Hello Null Byte!" Now, let's save this file as HelloNullByte and exit from our text editor. Set Execute Permissions When we create a file, it's not necessarily executable, not even by us, the owner. Let's look at the permissions on our new file, by typing ls -l in our directory. As you can see, our new file has rw-r--r-- permissions. The owner of this file only has read (r) and write (w) permissions, but no execute (x) permissions. The group and all have only read permission. We need to modify it to give us execute permissions in order to run this script. We do this with the chmod command. To give the owner, the group, and all execute permissions, we type: chmod 755 HelloNullByte Now when we do a long listing (ls -l) on the file, we can see that we have execute permissions. Run HelloNullByte To run our simple script, we simply type: ./HelloNullByte The ./ before the file name tells the system that we want to execute this script in the current directory. This means that if there is another file in another directory named HelloNullByte, please ignore it and run HelloNullByte in my current directory. When we then hit enter, our very simple script returns to our monitor.

@Ethical Hacking

https://play.google.com/store/apps/details?id=com.wondrousapps.ethicalhacking

ليست هناك تعليقات:

إرسال تعليق