Just as Marines and Sailors train for combat in controlled environments for reasons of safety and security, we will conduct our cyber operations in a controlled virtual environment. This lab and the next two labs take place in a virtual computer network, which your instructor will explain in lab.
| Linux Command | Windows Equivalent |
|---|---|
| ls | dir |
| pwd | cd |
| cd path | cd path |
| cat | type |
| ping | ping |
| ifconfig | ipconfig |
| nslookup | nslookup |
| traceroute | tracert |
| nmap | n/a |
| nc | nc |
To get you started, I'm going to step you through the reconnaissance of the instructor station, www.red.net. Let's begin with defining the outermost barrier to the target.
traceroute to determine all of the routers
between you and your target, www.red.net. Enter the
following command in the terminal:
traceroute -n www.red.net NOTE: the -n option means no name resolution,
just IP's. It's faster that way.
From Blue From Gold 1.1.1.1 2.2.2.1 NOTE: If you see a 191.23.24.2 191.23.24.17 bunch of *'s, 191.23.24.6 191.23.24.9 try running the 3.3.3.3 3.3.3.3 command again! Equivalent Map for both options: [You]-----(R)-----(R)-----(R)-----[target]Note:
www.red.net resolves to 3.3.3.3.
Additional information about traceroute is located
here.
www.red.net is alive (which
we know it is since it is hosting this web page). This is a very
important verification used to determine the ACL rules of the
firewall, if present. If you receive a reply from the target, then
you now know echo (ping) requests and replies are not filtered by the
firewall.
ping www.red.net
www.red.net is running http service because
we were able to open a webpage from it. This tells us that port 80
is open on the target host and destination port 80 is not
filtered by the firewall, if present. Port 80 should go on a list of
potential entry points. To gain some clue as to which
web server is running on www.red.net (so we can research its
vulnerabilities later), connect to it using netcat.
nc -v 3.3.3.3 80Once connected, request an http document by typing the following:
GET / HTTP/1.0 ⇦ enter ⇦ enterSearch the response near the top for the line beginning with "Server" to see the http service family name and version. This is known as "banner grabbing" and it can be attempted on any port to gain information of a service. Though it will not always yield any useful information, it is always worth trying.
help usually gets some sort of response from a
target.
nc -v 3.3.3.3 22The connection was refused and now you know that the target is not listening on port 22.
nc -v 3.3.3.3 25Once connected, you should see the following message:
220 mail.red.net ESMTP Postfix (Ubuntu)Enter
quit to terminate the connection as shown below.
220 mail.red.net ESMTP Postfix (Ubuntu)
quit ⇦ enter
www.red.net target, but typical
targets will have an organization website to scour for clues. Visit
the website of the target organization and peruse every page, taking
note of anything you think may help you gain access to or escalate
privileges on a host on the target network.
Now, to help familiarize you with nmap, I will step you through the collection of data on the instructor's red network before you scan your opponent's network:
nmap scans may take
several minutes to complete. It is recommended that you open up a
separate terminal dedicated to scans.
-sn option:
nmap -sn 3.3.3.1-255You now have a list of hosts that are up (powered on) and responding to echo requests (pings) on the red network.
Note: you should see 3.3.3.1, 3.3.3.2, and 3.3.3.3
-sS
option:
nmap -sS 3.3.3.1,2,3The
-sS option performs a port scan of 1000 commonly used
ports of each target host and reports a list of open ports.
Notice that the protocols are given for each open port. Nmap is only
reporting the protocol that is registered for each port with IANA.
Note: you should see ports 25, 53, 80, and 110 open on 3.3.3.2 and 3.3.3.3 and all 1000 ports closed on 3.3.3.1.
-sV,. The following example will probe the
open ports on the targets for service names and versions.
nmap -sV 3.3.3.1,2,3
nmap reports specifics about the programs providing the services on each host.
Note: The program version for the http (web) service not only indicates that it is Apache (well known program), but also indicates the operating system on which it was compiled on. Ubuntu is a widely used Linux distribution.
-O option (that is a capital letter oh, not zero).
nmap -O 3.3.3.1,2,3
nmap is able to determine that 3.3.3.2 and 3.3.3.3 are both running Linux, but unable to determine what 3.3.3.1 is running.
Note: OS detection will not always possible for various reasons, but even when OS detection is possible, the guess may not be accurate. Take note of OS detection results to compare with other indications you find, but never accept them alone as fact.
Some additional information about using the nmap command can be found here.
From our reconnaissance of the instructor station's network, we know
that there seems to be no firewall. We know this because all of the ports
reported by our nmap scans were either open or closed. If
there were an active firewall, some ports would have been reported as
filtered. So, the network barrier is like a sieve - full of holes. We also
know that there are 3 hosts sharing the instructor's network and the ports
that are open on each. The diagram to the right is a visual representation
of what I just described. At the end of this lab, you will create a diagram
of your target network.
| blue.net | gold.net | |
|---|---|---|
| IP block: | 1.1.1.1-255 | 2.2.2.1-255 |
| DNS Server: | 1.1.1.64 | 2.2.2.187 |
|
⇦ Fill in front of worksheet |
|
⇦ Draw on back of worksheet |
nmap scans may take
several minutes to complete. It is recommended that you open up a
separate terminal dedicated to scans.
nmap -sS 2.2.2.A,C,M-Z
| Service | Protocol | Port | TCP/UDP | Tools |
|---|---|---|---|---|
| World Wide Web | HTTP | 80 | TCP | browsers |
| Name Resolution | DNS | 53 | UDP | nslookup |
| File Transfer | FTP | 21 | TCP | ftp |
| Secure Remote Shell | SSH | 22 | TCP | ssh |
| Simple Mail Transfer Protocol | SMTP | 25 | TCP | email clients |
| Post Office Protocol Version 3 | POP3 | 110 | TCP | email clients |
| Secure Web | HTTPS | 443 | TCP | browsers |
| Remote Desktop ( microsoft-rdp) |
RDP | 3389 | TCP | rdesktop |
| File/Print Sharing ( microsoft-ds) |
SMB | 445 | TCP | map net- work drive |
| Internet Relay Chat | IRC | 6667 | TCP | xchat |
-A option to nmap (-A = -sS, -sV, and -O).
Example (where X,Y,Z are replaced with actual numbers you
see):
nmap -A 1.1.1.X,Y,Z
Gold Team should use: nslookup IPaddress 1.1.1.64 Blue Team should use: nslookup IPaddress 2.2.2.187