Eth LAB Port Scanning - JadenGil/Jaden-Tech-Journal GitHub Wiki
First Deliverable:
Second Deliverable:
Third Deliverable:
So, you notice we target the file /dev/tcp/thehostip/thetcpport. Can you find this file in kali? Break out our friend google and see if you can find out what is going on. Briefly explain what you discover.
No you cannot /dev/tcp/thehostip/thetcpport is not a regular file in Kali. The kernel handles a request to open a file with a name of this form by trying to open a TCP connection to the port that is specified at the specified address.
Fourth Deliverable:
Fith Deliverable:
NMAP Command used was: sudo nmap 10.0.5.21 -p 80
Sixth Deliverable:
What's the difference?
The difference between the two is that 10.0.5.31 gets a complete handshake before resetting and the host is not unreachable. 10.0.5.21 on the other hand is not getting a complete handshake and retests before the second acknowledgement.
Seventh Deliverable:
The Script:
#!/bin/bash
#This code was made by Jaden Gilmond
hostfile=
portfile=
if [ ! -e "$hostfile" ]; then
echo "ERROR! The host file '$hostfile' was not found."
exit 1
fi
if [ ! -e "$portfile" ]; then
echo "ERROR! the port file '$portfile' was not found"
exit 1
fi
#^ these check if the host and port files exist and if they don't then it will respond with and error and stop the script^
echo "host,port"
for host in $(cat $hostfile); do
for port in $(cat $portfile); do
timeout .1 bash -c "echo >dev/tcp/$host/$port" 2>/dev/null &&
echo "$host,$port"
done
done