CyberSecurityPrograms
CyberSecurityPrograms
Aim:
To Install Kali Linux on Virtual Box .
Procedure:
Step 1 : Open the Virtual box website . Go to https:// www.virtualbox.org/ in your
computer’s Internet browser . This is the website from which you’ll download the
Virtual Box Setup file
Step 3 : Click on the Download and Select the Kali for Virtual Box and Download .
Step 4 : From the Download Location and Extract the .zip file.
Step 5 : Click on the Extracted file and Double Click on the file.
Step 6 : Click the Start Button to Start The Virtual Machine And Enter User name: Kali and
Password : Kali.
Result :
Thus to Install Kali Linux on Virtual Box was Successfully Installed.
2. Explore Kali Linux and bash scripting
Aim
Bash Scripting
The GNU Bourne-Again Shell (Bash) is a powerful tool and scripting engine. We can do
automate many tasks on command-line.
Introduction to Bash Scripting
A Bash script is a plain-text file that contains a series of commands that are
executed as if they had been typed on terminal window.
In general, Bash scripts have an optional extension of .sh for identification
(but it can be run without extension name), begin wit #!/bin/bash and must
have executable permission set before the script can be executed. Let's write
a simple "Hello World" Bash script on a new file using any text editor,
named it hello-world.sh and write the following contains inside it:
#!/bin/bash
# Hello World on Bash Script.
echo "Hello World!"
bash hello-world.sh
We can see that our script shows output of "Hello World!" on our terminal as we
can see in the following screenshot:
The chmod command, with +x flag is used to make the bash script executable and
bash along with scriptname.sh we can run it.
Reading User Input
Command-line arguments are a form of user input, but we can also capture interactive user input
during a script is running with the read command.
We are going to use read to capture user input and assign it to a variable, as we did in the
following screenshot:
#!/bin/bash
Result
This script covers basic concepts like printing messages, capturing user input, and executing
commands.
2.(i)Explore Kali Linux and write a script to compare two numbers
Aim:
To write a Bash script in Kali Linux that accepts two numbers from the user, compares them,
and displays whether the first number is greater than, less than, or equal to the second
number.
Algorithm:
1. Start
Begin the script with a shebang (#!/bin/bash) to specify the Bash shell.
2. Input Numbers
o Use the read command to prompt the user for the first number.
o Store the input in a variable (e.g., num1).
o Repeat the same process for the second number and store it in another variable
(e.g., num2).
3. Compare Numbers
Use if, elif, and else conditional statements:
o Check if num1 is equal to num2 using [ "$num1" -eq "$num2" ].
o Check if num1 is greater than num2 using [ "$num1" -gt "$num2" ].
o If neither condition is true, conclude that num1 is less than num2.
4. Display Results
Use the echo command to display the appropriate message based on the comparison.
5. End
Exit the script after displaying the result.
Program
#!/bin/bash
# Prompt the user to enter the first number
read -p "Enter the first number: " num1
Screenshots
2. WHOIS Lookups
Purpose: Gather domain registration details.
Steps :
4. DNS Reconnaissance
Nslookup
nslookup is a command-line tool used for querying the Domain Name System (DNS) to
obtain information about a domain name or an IP address. It’s commonly used to troubleshoot
DNS-related issues or find details about specific domains.
For example:
nslookup www.google.com
Basic Query:
Command:
Copy code
nslookup google.com
Output:
Server: dns.google
Address: 8.8.8.8
Non-authoritative answer:
Name: google.com
Address: 142.250.190.78
Output
The Harvester
Open source intelligence (OSINT) gathering is the process of collecting information from publicly
available sources to analyze and generate intelligence. Tools like Harvester and Maltego are commonly
used for OSINT.
For Windows>>
The Harvester
The Harvester is a tool designed to gather emails, subdomains, IPs, and URLs using various public data
sources such as search engines and PGP key servers.
Installation
To install The Harvester, follow these steps:
Commands:
# Clone the repository
git clone https://github.com/laramies/theHarvester.git
>venv\Scripts\activate
# Parameters:
# -d: Domain to search
# -l: Limit the number of results to work with
# -b: Data source (e.g., google, bing, linkedin, etc.)
Maltego
Maltego is a powerful tool for link analysis and data mining, which is commonly used for OSINT. It
provides a graphical representation of the relationships between pieces of information.
Installation
You can download Maltego from the official website. Choose the appropriate version for your operating
system and follow the installation instructions.
After Installation
Usage
Once installed, you can use Maltego to perform various OSINT tasks. Here is a basic workflow:
1. Create a New Graph: Open Maltego and create a new graph.
2. Add Entities: Add entities such as domains, email addresses, or IP addresses.
3. Run Transforms: Use transforms to gather information about the entities. Transforms can be run
by right-clicking on an entity and selecting the desired transform.
4. Analyze the Graph: Analyze the relationships and connections between entities based on the
gathered data.
Example: Using The Harvester and Maltego Together
1. Gather Data with The Harvester: First, use The Harvester to collect initial data about a domain.
Command:
python3 theHarvester.py -d example.com -l 500 -b google -f example_com_report
This command will generate a report (example_com_report.html) with the gathered data.
1. Import Data into Maltego: Open Maltego and import the data from the report generated by The
Harvester.
Create a new graph in Maltego.
Use the import function to load the data from the HTML or CSV report.
Run additional transforms on the imported entities to gather more information.
By combining The Harvester and Maltego, you can efficiently gather and analyze OSINT data from
various sources, providing a comprehensive view of the target information.
YouTube reference:
https://youtu.be/KzP1Aml3uoA?si=iPsuvxIK2KvEVyEG
For Linux>>
The Harvester
Installation on Linux
1. Install Dependencies:
Ensure you have Python and pip installed on your system. You can install them using the
following commands:
Command:
sudo apt update
sudo apt install python3 python3-pip
2. Clone The Harvester Repository:
Clone the repository from GitHub and navigate to the directory:
Command:
git clone https://github.com/laramies/theHarvester.git
cd theHarvester
3. Install Required Python Packages:
Install the required packages using pip:
Command:
pip3 install -r requirements.txt
Usage
To use The Harvester, you can run a command like the following:
Command:
# Basic usage
python3 theHarvester.py -d example.com -l 500 -b google
# Parameters:
# -d: Domain to search
# -l: Limit the number of results to work with
# -b: Data source (e.g., google, bing, linkedin, etc.)
Maltego
Maltego is a powerful tool for link analysis and data mining, which is commonly used for OSINT. It
provides a graphical representation of the relationships between pieces of information.
Installation
You can download Maltego from the official website.( https://www.maltego.com/downloads/) Choose the
appropriate version for your operating system and follow the installation instructions.
Usage
Once installed, you can use Maltego to perform various OSINT tasks. Here is a basic workflow:
5. Create a New Graph: Open Maltego and create a new graph.
6. Add Entities: Add entities such as domains, email addresses, or IP addresses.
7. Run Transforms: Use transforms to gather information about the entities. Transforms can be run
by right-clicking on an entity and selecting the desired transform.
8. Analyze the Graph: Analyze the relationships and connections between entities based on the
gathered data.
Example: Using The Harvester and Maltego Together
2. Gather Data with The Harvester: First, use The Harvester to collect initial data about a domain.
Command:
python3 theHarvester.py -d example.com -l 500 -b google -f example_com_report
This command will generate a report (example_com_report.html) with the gathered data.
2. Import Data into Maltego: Open Maltego and import the data from the report generated by The
Harvester.
Create a new graph in Maltego.
Use the import function to load the data from the HTML or CSV report.
Run additional transforms on the imported entities to gather more information.
By combining The Harvester and Maltego, you can efficiently gather and analyze OSINT data from
various sources, providing a comprehensive view of the target information.
YouTube reference:
https://youtu.be/KzP1Aml3uoA?si=iPsuvxIK2KvEVyEG
Installation on Linux
1. Download Maltego:
Go to the Maltego download page and download the appropriate version for Linux.
2. Install Maltego:
After downloading, you can install Maltego using the following commands:
Command:
# Navigate to the directory where the Maltego .deb file is located
cd /path/to/downloads