P2- Intro to Kali Linux

Hi Everyone! Today we are recalling some Kali Linux commands, So let's begin.

==============================
Navigate to File System
==============================
·   
Command: 
ls -la
It shows hidden folders.

mkdir 
For making a new folder.

cd
cd for changing the folders or going in other folders or directories. 

cd ..
For going backward in the folder in the same directory.

man command
e.g man ls
it now gives a manual guide of the command, man is like a help command, both are pretty close but man gives more detailed guide.
also, ls --help can be used

echo "hi" > test.txt
This command makes a txt file with name "test" and writes "hi" inside of it

cp test.txt downloads/
This command means copy "test.txt" to "downloads" folder

rm Downloads/test.txt
remove command, so it removes the "test.txt" command that we just made.

mv test.txt Downloads/
move command, it moves the "test.txt" file into "downloads" folder.

locate command
locate bash
give you all and all of the files or folders that have bash in there. 

update db 
to update database

passwd
a command to change  a default password that is "toor" (in older versions of kali)


==============================
Users and Previlages
==============================

Ok if we do ls -la command , gives us the hidden files and folder
e.g
drwxr-xr-x 84 root root jan 09 00:46 .
-rw-r--r-- 1 root root 0228 jan 09 00:56 .bash_history

here first if the starting of the line has a d, it means that is a directory aka folder, but if it has a hyphen in the start, means that is  a file

now we take the very first line that is drwxr-xr-x 84 root root jan 09 00:46.
first, we see the very first 3 alphabets after d, 
d represents that is a directory
The next 3 alphabets are rwx means that have full access, that is admin, means r=read access w=write access and x=execute access. we always look at these types of file or folders that have full access

next three groups of alphabets are for those members of a group that have the file access, the next alphabets group is r-w means the members can only read or execute

the next alphabets group is for all other members group, that have r-x, that they can only run or execute

ls -la tmp
tmp has all rwx rights because that has all the access, so if we are launching our virus or something, we will might use tmp folder

Now we are making a new file and let's see what privileges it has by default.
So first we are making a text file "hello.txt".
now write command ls -la to show all hidden files and folders

now we see that the by default access to hello file is read and execute to the root user and not read access to all other users
so now here we change the mode of the file to have full access by chmod command, i.e chmod +rwx hello.txt

here we write 777 which means to give full rwx access across the board, means give rwx permission to everyone. so at the bottom of the image, hello.txt has to be changed to green color which means that a change has occurred.
now talking about the users, adduser command is used. So now after I have made another user account named "sheema", I am gonna see if I can see the password of the newly created user named "sheema".
 if we write cat command, it gives the inside content of a file. 

so cat /etc/passwd gives the password file that is placed in the etc folder but it does not give a password list as shown in the below picture.


so to have a password, there is another file that is named shadow, that gives us hash of the password, if we get hashes, we can say that its possible to crack the original password
below is the hash of "sheema" user that we just created

now see the below image

now inside of our root user, we switch to sheema user, so "su sheema".it instantly switches to the next user, but if we switch back to root user from sheema user, it will ask for password,
we were able to switch to sheema because we were already root. 
"sheema" that we just created has no sort of access, so if we want to do anything we should have some access first.
so if sheema user wants to change or modify the password, she can not because she doesn't have such kind of privileges.

so the password was not modified, because sheema has no access rights. For that, we give sheema the sudo rights, which will provide access if we give sudo to sheema , so anybody in the sudoers file can change anything if they are a sudo user.
Here we give sheema the sudo access, but here it is again not allowing us to change the password, which means that the sheema user is not inside the sudoers file, which means sheema has very lower privileges, have only base accesses. 
If any user is there, you have to give that Sudo privileges or put that in the sudoers file, other then root user, to have full and all privileges.

see the below image

==============================
Common Network Commands
==============================

·        
ifconfig

iwconfig (when doing pen-testing)

arp -a command
shows the arp table of IP addresses and corresponding MAC addresses.

If an IP comes, the arp table shows that on which machine this IP is on. so it sends the data to that specific machine.

netstat -ano (shows network statistics, all things, i.e network connections for transmission control protocol, routing tables, a number of network interface  and network protocol)
shows an act of connections that are running on the machines

so also know what ports are on a machine is talking to some other machines.

route command
this command is important
its shows the routing path 

so it shows that on which our traffic is going through which gateways

==============================
Viewing Creating and Editing Files
==============================

·   
Write "echo" to write inside by creating a new file

cat is used to list the contents that are inside of any document.

to overwrite, just write the text after echo command after greater than sign, and to append text before the previous text, write a double greater sign and append text.

"touch" command is used to only create an empty file, if we "cat" the file, it will display nothing as it is an empty file.

now nano is a terminal text editor, here we open an existing or newly created file in the terminal and write whatever we want, this is useful when we are writing scripts and similarly gedit is GUI editor for text documents.


==============================
Starting ans Stoping Kali services
==============================


now we are here starting with servers. we are starting and stopping  web-servers for hosting any malicious web page or something through the web pages


the first web server that we are starting is the apache2 server. this server is running on port 80 by default.

now go to your browser and write your IP address, which will open the Apache server. 
there will be a path is given, of var>www>html>index.html, means that if we want to upload any file through the web browser, we will put that malicious file in this folder each time we are using Apache server

and stop this server. and run the python server, if we run the python server without stopping the Apache server, it will not be opened on port 80, so we have to define the port number in the command clearly. 

Here we are running the python server on both, port 80 and 8080, by stopping and not stopping Apache server.
so the benefit of python server over Apache server is that in python server, we don't need to place everything in a specific folder, we can move to any folder by cd command, and then inside that folder open python server and after that, write your IP on the browser with the port number that you specified, and all of the files and folders of that specific folders are now browsed in the web browser.


so as first I moved to my downloads folder and then inside I ran the python server, above is the result.
here is the thing, if we reboot our machine, if we restart our machine, the above services that we just enabled will be stopped, so if we want to keep them running after our reboot, we will enable these servers services by "systemCTL enable" command

here we are only enabling postgresql that is a database for Metasploit, now on the startup of Metasploit, it will not take time as the postgresql will already be enabled.



==============================
Installing and Updating tools
==============================


In this  Section, it has been tough how to update or download specific tools like python.


pip is a tool that will be used for python.
if from the first command it does not work, write some random numbers after pip to recheck if the right package has been installed or not.
and for git cloning, go to git hub repository and do the command below and other instructions are given on the git page of how to clone the package into Kali Linux.

to check if the pip is installed or not, we have that one tool called psexec.py 


So yeah, We learned about Kali Linux. 
That's it for today!






Comments

  1. good
    practical work is here :https://www.youtube.com/channel/UCLs0xuT8eJ5FeifPjemHzhw/playlists?view_as=subscriber

    ReplyDelete
  2. Selling USA FRESH SSN Leads/Fullz, along with Driving License/ID Number with good connectivity.

    **Price for One SSN lead 2$**

    All SSN's are Tested & Verified. Fresh spammed data.

    **DETAILS IN LEADS/FULLZ**

    ->FULL NAME
    ->SSN
    ->DATE OF BIRTH
    ->DRIVING LICENSE NUMBER
    ->ADDRESS WITH ZIP
    ->PHONE NUMBER, EMAIL
    ->EMPLOYEE DETAILS

    ->Bulk order negotiable
    ->Hope for the long term business
    ->You can asked for specific states too

    **Contact 24/7**

    Whatsapp > +923172721122

    Email > leads.sellers1212@gmail.com

    Telegram > @leadsupplier

    ICQ > 752822040

    ReplyDelete
  3. tq your post is awasome.

    At this time, Around 70% of "Computer Science and Engineer" students wants to Become an Ethical Hacker. But Due to the expensive cost, Some people can't afford to pay the Ethical hacking course fee. If you desire to make your Career in Ethical Hacking, Pentestblog'll provide you the Best Ethical Hacking Course. Our Ethical Hacking Blogs are available with practical videos. This website has been designed for those people, Who aren't able to afford to pay an expensive course fee.

    Pentestblog website

    wordpress hacking

    pentestblog course

    pentestblog hacking blogs


    ReplyDelete
  4. I rarely write reviews, but I had to for this! Because I tried several apps to help with no luck. Back then, I was very confused and always felt awful about my partner’s cheating attitude. I really wanted to track and catch him red-handed. I downloaded this app hoping it would help but I wasn’t satisfied with its features as I needed to monitor my partner closely. I then spoke with a trusted colleague of mine at work and she gave me a genuine recommendation about an ethical private investigator named Nathaniel Williams, I wrote to his email at {wizardcyprushacker@gmail.com} explaining how I wanted to have complete access to his call log, iMessage/SMS, social media activities, gallery, texts, deleted or not, his precise location day in day out. I paid for his services and in about 2-3 hours, I had complete access to his phone. I got concrete evidence. it was unbelievable to see the evidence of cheating on me. Who likes to live with a cheater, I used the evidence I got to file for a divorce. I’m thankful to Nathan for helping me out of my dilemma and suspicions. His services are highly rated and affordable. If you are having trust issues and need valid evidence, how about you contact {wizardcyprushacker@gmail.com} Thank you Nathan, for an incredible job !! I highly recommend his services, simply the best.

    Contact :{wizardcyprushacker@gmail.com}
    WhatsApp :+1 (424) 209-7204

    ReplyDelete

Post a Comment

Popular posts from this blog

P3- Basic Bash Scripting

P4- Stages of Ethical Hacking