CS Final
CS Final
Installing Kali Linux (single boot) on your computer is an easy process. This
guide will cover the basic install (which can be done on bare metal or guest
VM), with the option of encrypting the partition. At times, you may have
sensitive data you would prefer to encrypt using Full Disk Encryption (FDE).
During the setup process you can initiate an LVM encrypted install on either
Hard Disk or USB drives.
Our i386 images, by default use a PAE kernel, so you can run them on
systems with over 4 GB of RAM.
In our example, we will be installing Kali Linux in a fresh guest VM, without
any existing operating systems pre-installed. We will explain other possible
scenarios throughout the guide.
System Requirements
The installation requirements for Kali Linux will vary depending on what you
would like to install and your setup. For system requirements:
On the low end, you can set up Kali Linux as a basic Secure Shell
(SSH) server with no desktop, using as little as 128 MB of RAM (512 MB
recommended) and 2 GB of disk space.
On the higher end, if you opt to install the default Xfce4 desktop and
the kali-linux-default metapackage, you should really aim for at least 2 GB
of RAM and 20 GB of disk space.
o When using resource-intensive applications, such as Burp
Suite, they recommend at least 8 GB of RAM (and even more if it large web
application!) or using simultaneous programs at the same time.
Installation Prerequisites
This guide will make also the following assumptions when installing Kali
Linux:
We will be wiping any existing data on the hard disk, so please backup any
important information on the device to an external media.
Boot
2. Select your preferred language. This will be used for both the setup
process and once you are using Kali Linux.
Network
5. The setup will now probe your network interfaces, looks for a DHCP
service, and then prompt you to enter a hostname for your system. In
the example below, we’ve entered kali as our hostname.
If there isn’t a DHCP service running on the network, it will ask you to
manually enter the network information after probing for network
interfaces, or you can skip.
If Kali Linux doesn’t detect your NIC, you either need to include the
drivers for it when prompted, or generate a custom Kali Linux ISO with
them pre-included.
If the setup detects multiple NICs, it may prompt you which one to use
for the install.
If the chosen NIC is 802.11 based, you will be asked for your wireless
network information before being prompted for a hostname.
6. You may optionally provide a default domain name for this system to
use (values may be pulled in from DHCP or if there is an existing
operating systems pre-existing).
User Accounts
7. Next, create the user account for the system (Full name, username
and a strong password).
Clock
9. The installer will now probe your disks and offer you various choices,
depending on the setup.
In our guide, we are using a clean disk, so we have four options to pick
from. We will select Guided - the entire disk, as this is the single boot
installation for Kali Linux, so we do not want any other operating systems
installed, so we are happy to wipe the disk.
If there is an pre-existing data on the disk, you will have have an extra
option (Guided - use the largest continuous free space) than the example
below. This would instruct the setup not to alter any existing data, which is
perfect for for dual-booting into another operating system. As this is not the
case in this example, it is not visible.
Experienced users can use the “Manual” partitioning method for more
granular configuration options, which is covered more in our BTRFS guide.
If you want to encrypt Kali Linux, you can enable Full Disk Encryption (FDE),
by selecting Guided - used entire disk and setup encrypted LVM. When
selected, later on in the setup (not in this guide) prompt you to enter a
password (twice). You will have to enter this password every time you start
up Kali Linux.
10. Select the disk to be partitioned.
11. Depending on your needs, you can choose to keep all your files
in a single partition - the default - or to have separate partitions for
one or more of the top-level directories.
If you’re not sure which you want, you want “All files in one partition”.
12. Next, you’ll have one last chance to review your disk
configuration before the installer makes irreversible changes. After you
click Continue, the installer will go to work and you’ll have an almost
finished installation.
Encrypted LVM
If enabled in the previous step, Kali Linux will now start to perform a secure
wipe of the hard disk, before asking you for a LVM password.
Please sure a strong password, else you will have to agree to the warning
about a weak passphrase.
Proxy Information
Metapackages
14. Next you can select which metapackages you would like to install. The
default selections will install a standard Kali Linux system and you
don’t really have to change anything here.
16. Select the hard drive to install the GRUB bootloader in (it does
not by default select any drive).
Reboot
17. Finally, click Continue to reboot into your new Kali Linux
installation.
Post Installation
Now that you’ve completed installing Kali Linux, it’s time to customize your
system.
The General Use section has more information and you can also find tips on
how to get the most out of Kali Linux in our User Forums.
Introduction to Kali Linux tools list
Kali Linux tools list is defined as a list of tools present in Kali Linux
distribution, which aids users to perform penetration testing and
understand that Kali Linux is the most recommended distribution for
ethical hackers around the world. But the utilization of the tool is just
not restricted to ethical hacking, but even for a webmaster, many of
these tools are equally efficient and worthy. These tools aid users in
penetration testing by enabling their task in testing, hacking or
anything which is part of digital forensics. No matter who is using the
tools or what specifics of utility space of the tools, the list we are going
to discuss here caters to the top tools in Kali Linux!
1. Gathering Information
TracerRoute: This is a utility in Kali Linux which enables users in
network diagnostic. It shows up the connection route and as well as
measures the delays in transit of the packets across an IP network.
SQLiv: This tool is one of the most common ones used for simple and
massive vulnerability scanner of SQL injection. This is one of the few
ones in the list that doesn’t come pre-installed in Kali Linux distribution
but is still the most widely used!
BurpSuite: This is another addition to the web application analysis,
which itself comprises of a collection of tools that are bundled to form
a single suite of web application’s security testing starting from the
scratch, i.e. analysis of the attack surface.
OWASP-ZAP: This is a Java based tool for testing the web
application’s security which promises an intuitive GUI to perform tasks
that include fuzzing, spidering, scripting etc., along with the presence
of a number of plugins to ease of the task in hand.
3. Analysis of Vulnerability
4. Password attacks
6. Wireless attack
8. Keeping anonymity
(i)IP Spoofing
Process :
With IP spoofing, intruder sends message to a computer system with an IP
address indicating message is coming from a different IP address than its
actually coming from. If intent is to gain unauthorized access, then Spoof
IP address will be that of a system the target considers a trusted host. To
Successfully perpetrate an IP Spoofing attack, hacker must find IP address
of a machine that the target System Considers a trusted source. Hackers
might employ a variety of techniques to find an IP address of a trusted
host. After they have obtained trusted IP address they can then modify
packet headers of their transmission so its appears that the packet coming
from the host.
DOS DDOS
DOS stands for Denial Of Service DDOS stands for Distributed Denial
attack. Of Service attack.
DOS attack single system targets the In DDOS multiple systems attacks
victim system. the victim system.
DOS attack is slower than DDOS DDOS attack is faster than DOS
attack. attack.
It can be blocked easily as only one It is difficult to block this attack as
system is used. multiple devices are sending packets
and attacking from multiple
locations.
In DDOS attack,only single device is In DDOS attack,Bots are used to
used with DOS attack tools. attack at the same time.
DOS attack are easy to trace. DDOS attacks are difficult to trace.
Volume of traffic on DOS attack is DDOS attacks allow the attacker to
less as compared to DDOS. send massive volumes of traffic to
the victim network.
Types of DOS attacks are: Types of DDOS attacks are:
1.Buffer overflow attacks 1.Volumetric attacks
2.Ping of Death or ICMP flood 2.Fragmentation attacks
3.Teardrop attack 3.Application layer attacks
Victim PC is loaded from the packet Victim PC is loaded from the packet
of data sent from a sender location. of data send from multiple location.
Conclusion :
NMAP/ZenMap :
How it works :
It ships with some handy pre-set profiles, such as Intense scan, which scans
hosts with “all advanced/aggressive options,” Quick scan, which scans hosts
without those advanced options, and Slow comprehensive scan, which is
exactly as it sounds.
Type the following command to start zenmap:
Defining a target :-
Useful tools :
Scan : The most important tab, where you can specify targets, scan
type (TCP, UDP, IP), timing template, and much more
Source : Specify how you would like the scanner to behave with
respect to scanning identity, IP address, port, and interface
Other : Includes options for verbosity level, TTL, and other scanner
behaviours
Timing : Defines timing profile with respect to maximum scan time,
scan delay, and timeouts, among other things
Using saved profiles also ensures that when comparing two scan results you
are working from the same scan options. One of my favorite option in
Source tab is to use decoys to hide identity. Decoys lessens the chances of
being caught and does it even better when used in conjunction with IP
spoofing (also available in source tab).
Use the Profile Editor to develop custom profiles that meet your enterprise
needs
PRACTICAL - 4
Aim: Explore the NetCat tool.
Netcat is a great network utility for reading and writing to network
connections using the TCP and UPD protocol. Netcat is often referred to as
the Swiss army knife in networking tools and we will be using it a lot
throughout the different tutorials on Hacking Tutorials. Most common use for
Netcat when it comes to hacking is setting up reverse and bind shells, piping
and redirecting network traffic, port listening, debugging programs and
scripts and banner grabbing. In this tutorial we will be learning how to use
the basic features from Netcat such as:
Banner grabbing
Raw connections
Webserver interaction
File transfers
The following command is used the grab a service banner (make a raw
connection to a service):
Let’s try this on the FTP service on Metasploitable 2 which is running on port
21:
As we can see there is a vsFTPD service running on port 21. Have a look at
the service enumeration tutorial if you want to learn more about this subject
Netcat raw connection :
This example demonstrates how to grab a banner and how to setup and use
a raw data connection. In this example we’ve used an FTP service but this
also works on other services such as SMTP and HTTP services.
Web server interaction :
In the first part of the Hacking with Netcat tutorials we have learned how to
work with several basic features like raw connections, banner grabbing and
file transfers. We have learned how to grab service banners which contain
information about the service running on the specific port. We have also
learned how to interact with services by using raw connections and Netcat.
In the tutorial we have gained anonymous access to a FTP server using a
raw data connection and issued some FTP commands. We have also learned
how to use Netcat for interaction with a webserver. We are able to retrieve
webpages and send HTTP requests. Last but not least, we have learned how
to transfer files from one box to another with Netcat.
PRACTICAL – 5
Aim: Use Wireshark tool and explore the packet format and
content at each OSI layer.
Wireshark is the world’s foremost network protocol analyzer. It lets you see
what’s happening on your network at a microscopic level. It is the de facto
(and often de jure) standard across many industries and educational
institutions.
This tutorial can be an angel and also devil in the same time, it depends to
you who use this tutorial for which purpose…me as a writer of this tutorial
just hope that all of you can use it in the right way , because I believe that
no one from you want your password sniffed by someone out there so don’t
do that to others too
Disclaimer :-
Our tutorials are designed to aid aspiring pen testers/security enthusiasts in learning
new skills, we only recommend that you test this tutorial on a system that belongs to
YOU. We do not accept responsibility for anyone who thinks it’s a good idea to try to
use this to attempt to hack systems that do not belong to you.
Requirements :
Wireshark Network Analyzer (wireshark.org)
Network Card (Wi-Fi Card, LAN Card, etc) FYI : for wi-fi it should
support promiscious mode
Step 1 :
Step 2 :
Analyze POST data for username and password Now right click on that line and select
Follow TCP Steam
This will open a new Window that contains something like this:
So in this case,
username: sampleuser
password: e4b7c855be6e3d4307b8d6ba4cd4ab91
But hold on, e4b7c855be6e3d4307b8d6ba4cd4ab91 can’t be a real
password. It must be a hash value.
to crack this password its simple just open new terminal window and type
this :
Conclusion:
If a user Karen with the password ‘ 12345 ’ wanted to log in, after clicking
the Submit or the Log in button, the query that would be sent to the
database would look like this:
If an attacker knew the username and wanted to bypass the login window,
they would put something like Karen;-- in the username field. The resulting
SQL query would look like this:
Interestingly, when you check the URL, you will see there is an injectable
parameter which is the ID. Currently, my URL looks like this:
Let’s change the ID parameter of the URL to a number like 1,2,3,4 etc. That
will also return the First_name and Surname of all users as follows:
If you were executing this command directly on the DVWA database, the
query for User ID 3 would look like this:
The Database user is listed next to the surname field in the last line as in the
image below.
Step 6: Display Database Name
To display the database name, we will inject the SQL code below in the User
ID field.
The database name is listed next to the surname field in the last line.
Step 7: Display all tables in information_schema
The Information Schema stores information about tables, columns, and all
the other databases maintained by MySQL. To display all the tables present
in the information_schema, use the text below.
Step 8: Display all the user tables in information_schema
For this step, we will print all the tables that start with the prefix user as
stored in the information_schema. Enter the SQL code below in the User ID.
%' and 1=0 union select null, table_name from information_schema.tables where table_name like
'user%'#
Step 9: Display all the columns fields in the
information_schema user table
We will print all the columns present in the users’ table. This information will
include column information like User_ID, first_name, last_name, user, and
password. Enter the input in the User_ID field.
users #
From the image above, you can see the password was returned in its hashed
format. To extract the password, copy the MD5 hash and use applications
like John the Ripper to crack it. There are also sites available on the internet
where you can paste the hash and if lucky, you will be able to extract the
password.
Conclusion:
From the various examples listed in this article, SQL injection proves to be a
critical vulnerability that can exist in a system. Not only can attackers exploit
it to reveal user or customer information, but it can also be used to corrupt
the entire database thus bringing the whole system down. As of writing this
post (2021), Injection is listed as the number one vulnerability in the OWASP
Top 10 Vulnerabilities summary. The DVWA acts as a reliable resource for
both penetration testers who want to improve their skills and web
developers who want to develop systems with security in mind.
PRACTICAL - 8
Aim: Examine Command Execution attack in DVWA
Command Execution or Command injection is an attack in which the goal is
execution of arbitrary commands on the host operating system via a
vulnerable application. Command injection attacks are possible when an
application passes unsafe user supplied data (forms, cookies, HTTP headers
etc.) to a system shell.
Low
we can see that the code does not check if $target matches an IP Address.
No filtering on special characters. ; in Unix/Linux allows for commands to be
separated. 127.0.0.1; ls -la /root - list all the files in the root directory :
127.0.0.1 ; cat /etc/passwd | tee /tmp/passwd - Displays the contents of
/etc/passwd on the webpage and also copies the contents of /etc/passwd file
to the /tmp directory.
Alternatives to ;
Medium
High
Viewing source code, more extensive blacklist has been set. Slightly trickier,
however the answer is in the view source , '| ' => '', - note that there is a
space after the | character. If we try | pwd , no output is returned, however
if we use |pwd we are including our command within this space, as shown
below:
Bind Shell
Points to note:
1. Ensure you are using commands specific to the target you are trying to
attack, all of the above are Linux, Windows commands will be different.
2. Try commands with and without a space between them 3. You will not
always have access to the source code. OWASP:
https://www.owasp.org/index.php/Testing_for_Command_Injection_(O TG-
INPVAL-013)
PRACTICAL-9
What is a keylogger?
It’s something that records keystrokes and is normally used without the
consent of the user.
You’ve probably heard that keyloggers are a bad thing. It is when used for
illegal purposes, such as having a keylogger app installed without your
knowledge via spyware. But it’s not a bad thing when you are the one who
installed it to keep track of what people are doing when using your
computer. For example, if you’re a parent who thinks your child is doing not-
so-good things on the internet, you’ll be able to find out what’s been going
on with a keylogger.
If you decide to use one, you can opt to use hardware or software.
Hardware
The only real drawback is that it is, as you can see, a PS/2 connector and
not USB. However that can be easily remedied with an adapter should you
use USB.
Cost is $59.99
There are other hardware-based keyloggers out there on the internet, just
do a search for them and they’ll show up.
Software
You need not look any further than SourceForge to find freely available
keylogging applications for Windows and Linux.
Bear in mind you do have to set up appropriate permissions for this app, and
if you use existing spyware/malware security software it may identify this
app as “dangerous”. Obviously it isn’t, so if you see the warning(s), give the
app the appropriate security “pass”.
Hardware is the better of the two because it’s not an app you can simply
disable as it requires no software. The only way to disable the hardware is to
literally unplug it.