penetration testing in real workd introduction lect_01
Introduction to kali Deamons and bash shells
- Introduction to the services and how to manage them in kali
- How to write custom bash scripts (methodology )
            Hi i am Rikan . 
            
Here i would be uploading all the challenges i am facing learning cyber Security 
            
This will be a well documented journey as i think , in my past i have never gone for a 
            
documented journey while learning something but this time i am trying this as someone else can 
            
 also get help from me . By the way thanks for being a part of this journey , today is 3rd sept 2019.
            
            
 and my journey starts from here 
        
Introduction to the services
            In introduction to the kali interface , you will notice a ton of tools which will help you to 
            
breach the Security 
            
 The ssh  and apache2 are works as the services 
            
 They are located as in the /usr/bin/ 
            
 The files are in the format of .d i.e demon format  
            
 For example /usr/bin/ssh.d 
            
To start the service or Demons the following commands are used 
            
                systemctl service_name start/stop/restart/enable/disable
                service service_name start/stop/restart/enable/disable 
            
            
 The above commands can be remembered by system control then service name followed by what you want
                to do 
            
- Example service ssh start
- Example systemctl ssh start
            The other way is to make a boot p resistance while booting the system
            
that can be done by the file updat-rc.dfile,below is one example 
            
lets assume i want ssh to be started while system boots up 
            
 The command for that will be 
            
 update-rc.d enable ssh
            
 For disabling it while start up the following code can be used 
            
  updat-rc.d disable ssh 
        
Bash Shell commands and scripts
            
 Bash Shell is the terminal window what you will be using in kali for most of the time as its 
            
 the built in shell in kali machine . This usually coded using C language  for faster execution
            of codes 
            
Here i am considering that you know a little bit about commands of linux 
            
Some of the basic commands
some basic commands are follows which will help to locate file directory ,files in the directory.
- locate:locate command is used to find where the file is located in the linux file system
- find:find is also used for the same purpose as locate and its bit slow as its serch entire directories
- which:which command is used to find the path of the file
syntax and use of some useful command lines
            
 some of the syntax are given below for the above commands 
            
                find {directory} [option ] filename 
            
  find / -name sbd.exe 
:it means find in the
            root directories a file named as sbd.exe 
        
             locate command works quickly as its linked to the the data base built in for file system of linux
                os the command to uppdate the data base manually is  updatedb
        
bash scripting (one sample)
            Bash scripting can be very useful and handy to automate simple tasks 
            
for example to see the sub domain ips by one by one url found in the file 
            
 in a txt file can be done through a simple bash script as follows 
            
               
            
 #!/bin/bash 
            
               
 for url in $(cat filename.txt );
                
 do 
                
 host url |grep "address has " |cut -d "space' -f4 
                
 done
            
 open your favorite text editor like emacs , nano, viand punch in the codes and see the magic
            
 try to write the script for the ping command to ping a network range 
            
 also give a try to write a script for saving a page of a website as a parameter and extract its all
            subdomain and their ips 
        
Comments
Post a Comment