Day 19 - Introduction To Ethical Hacking
Day 19 - Introduction To Ethical Hacking
Problem Statement:
Use netcat to scan the target URL and return the respective HTML output in the Kali terminal
Solution:
● Step 1: Run the terminal and enter command as shown in the image
● The extra line in the end is to be typed, hence press enter twice.
Problem Statement:
Use netcat to create a web server which serves HTTP requests and responses
Solution:
● Step 1: Open the leafpad and enter the commands as shown below to create an HTTP text
file
● Step 2: Type the below command in the terminal after saving the above HTTP file.
● Step 3: Open any browser and browse the localhost URL to visit the webpage being served
● Step 4: The netcat server also receives the data as a browser even while serving requests.
Problem Statement:
Solution
● Step 1: Open the terminal and enter the command shown below.
● This generates a single time use SSL certificate, and will encrypt all communication on port
31337 using SSL as shown above.
Problem Statement
● Step 1: Open the terminal and enter the command shown below.
● Step 2: The log file with the name ‘ssh-hex.log’ is saved to the system, and it will contain
the hexadecimal log values of the interaction.
● Use command: “nano ssh-hex.log” to view the file.
Problem Statement
Netcat can also be configured to select which connections to communicate with and which to be
blocked, much like an access control list. Curate an access list to allow/block connections as per
choice.
Solution
● Step 1: Open the terminal and enter the command shown to allow a specific host and
block all other connections.
● Use command: “ncat -l --allow 10.10. 10. 10”
● Step 2: Open the terminal and enter the command shown to deny a specific host and
allow all other connections
● Use command: “ncat -l --deny 10.10. 10. 8”
● Step 3: Open the terminal and enter the command shown to allow/block a specific file
● Since the said files are not present on the connection, the above message is shown.
● Step 4: Open the terminal and enter the command shown to limit the maximum number
of connections
● Use command: “ncat -l --max-conns 10”
● Step 1: Open the terminal and enter the commands shown below to create a named pipe.
● Step 2: Open another terminal and display the contents of the pipe
● This command will scan all open ports in the range 1-300 of the Windows instance.
● Step 2: Type the following command on the attack machine to retrieve the file
● Step 3: Now display the contents of the file on both the terminals