Nmap For Mac
Posted : admin On 12/5/2019Nmap can discover the MAC address of a remote target only if. The target is on the same link as the machine nmap runs on, or; the target leaks this information through SNMP, NetBIOS etc. Another possibility comes with IPv6 if the target uses EUI-64 identifiers, then the MAC address can be deduced from the IP address.
- Nmap Examples
- Nmap Cheatsheet
- Nmap Enumeration Examples
Further down in the output nmap gave us the Media Access Control address (MAC address) of the device. This is a unique reference that is assigned to network interfaces. The first three bytes of the MAC address is known as the Organizationally Unique Identifier (OUI). This can be used to identify the vendor or manufacturer of the network interface. Zenmap is the official Nmap Security Scanner GUI. It is a multi-platform (Linux, Windows, Mac OS X, BSD, etc.) free and open source application which aims to make Nmap easy for beginners to use while providing advanced features for experienced Nmap users. Frequently used scans can be saved as profiles to make them easy to run repeatedly.
Nmap (network mapper), the god of port scanners used for network discovery and the basis for most security enumeration during the initial stages of a penetration test. The tool was written and maintained by Fyodor AKA Gordon Lyon.
Nmap displays exposed services on a target machine along with other useful information such as the verion and OS detection.
Nmap has made twelve movie appearances, including The Matrix Reloaded, Die Hard 4, Girl With the Dragon Tattoo, and The Bourne Ultimatum.
Nmap in a nutshell
- Host discovery
- Port discovery / enumeration
- Service discovery
- Operating system version detection
- Hardware (MAC) address detection
- Service version detection
- Vulnerability / exploit detection, using Nmap scripts (NSE)
Nmap Examples
Basic Nmap scanning examples, often used at the first stage of enumeration.
Command | Description |
---|---|
| Ping scans the network, listing machines that respond to ping. |
| Full TCP port scan using with service version detection - usually my first scan, I find T4 more accurate than T5 and still 'pretty quick'. |
| Prints verbose output, runs stealth syn scan, T4 timing, OS and version detection + traceroute and scripts against target services. |
| Prints verbose output, runs stealth syn scan, T5 timing, OS and version detection + traceroute and scripts against target services. |
| Prints verbose output, runs stealth syn scan, T5 timing, OS and version detection. |
| Prints verbose output, runs stealth syn scan, T4 timing, OS and version detection + full port range scan. |
| Prints verbose output, runs stealth syn scan, T5 timing, OS and version detection + full port range scan. |
Agressive scan timings are faster, but could yeild inaccurate results!
T5 uses very aggressive scan timings and could lead to missed ports, T4 is a better compromise if you need fast results.
Nmap scan from file
Command | Description |
---|---|
| Scans a list of IP addresses, you can add options before / after. |
Nmap output formats
Command | Description |
---|---|
| Outputs 'grepable' output to a file, in this example Netbios servers. E.g, The output file could be grepped for 'Open'. |
| Export nmap output to HTML report. |
Nmap Netbios Examples
Command | Description |
---|---|
| Find all Netbios servers on subnet |
| Nmap display Netbios name |
| Nmap check if Netbios servers are vulnerable to MS08-067 |
--script-args=unsafe=1 has the potential to crash servers / services
Becareful when running this command.
Nmap Nikto Scan
Command | Description |
---|---|
| Scans for http servers on port 80 and pipes into Nikto for scanning. |
| Scans for http/https servers on port 80, 443 and pipes into Nikto for scanning. |
Nmap Cheatsheet
Target Specification
Nmap allows hostnames, IP addresses, subnets.
Example blah.highon.coffee, nmap.org/24, 192.168.0.1; 10.0.0-255.1-254
Command | Description |
---|---|
| inputfilename: Input from list of hosts/networks |
| num hosts: Choose random targets |
| host1[,host2][,host3],.. : Exclude hosts/networks |
| exclude_file: Exclude list from file |
Host Discovery
Command | Description |
---|---|
| List Scan - simply list targets to scan |
| Ping Scan - disable port scan |
| Treat all hosts as online -- skip host discovery |
| TCP SYN/ACK, UDP or SCTP discovery to given ports |
| ICMP echo, timestamp, and netmask request discovery probes |
| IP Protocol Ping |
| Never do DNS resolution/Always resolve [default: sometimes] |
Scan Techniques
Command | Description |
---|---|
| TCP SYN scan |
| UDP Scan |
| TCP Null scan |
| Customize TCP scan flags |
| Idle scan |
| SCTP INIT scan |
| IP protocol scan |
| FTP bounce scan |
Port Specification and Scan Order
Command | Description |
---|---|
| Specify ports, e.g. -p80,443 or -p1-65535 |
| Scan UDP ports with Nmap, e.g. -p U:53 |
| Fast mode, scans fewer ports than the default scan |
| Scan ports consecutively - don't randomize |
| Scan 'number' most common ports |
| Scan ports more common than 'ratio' |
Service Version Detection
Command | Description |
---|---|
| Probe open ports to determine service/version info |
| Set from 0 (light) to 9 (try all probes) |
| Limit to most likely probes (intensity 2) |
| Try every single probe (intensity 9) |
| Show detailed version scan activity (for debugging) |
Script Scan
Command | Description |
---|---|
| equivalent to --script=default |
| 'Lua scripts' is a comma separated list ofdirectories, script-files or script-categories |
| provide arguments to scripts |
| provide NSE script args in a file |
| Show all data sent and received |
| Update script database |
| Show help about scripts |
OS Detection
Command | Description |
---|---|
| Enable OS Detection |
| Limit OS detection to promising targets |
| Guess OS more aggressively |
Timing and Performance
Options which take TIME are in seconds, or append 'ms' (milliseconds),'s' (seconds), 'm' (minutes), or 'h' (hours) to the value (e.g. 30m).
Command | Description |
---|---|
| Set timing template - higher is faster (less accurate) |
| Parallel host scan group sizes |
| Probe parallelization |
| Specifies probe round trip time |
| Caps number of port scan probe retransmissions |
| Give up on target after this long |
| Adjust delay between probes |
| Send packets no slower than NUMBER per second |
| Send packets no faster than NUMBER per second |
Firewalls IDS Evasion and Spoofing
Command | Description |
---|---|
| Fragment packets (optionally w/given MTU) |
| Cloak a scan with decoys |
| Spoof source address |
| Use specified interface |
| Use given port number |
| Relay connections through HTTP / SOCKS4 proxies |
| Append random data to sent packets |
| Send packets with specified ip options |
| Set IP time to live field |
| Spoof NMAP MAC address |
| Send packets with a bogus TCP/UDP/SCTP checksum |
Nmap Output Options
Command | Description |
---|---|
| Output Normal |
| Output to XML |
| Script Kiddie / 1337 speak.. sigh |
| Output greppable - easy to grep nmap output |
| Output in the three major formats at once |
| Increase verbosity level use -vv or more for greater effect |
| Increase debugging level use -dd or more for greater effect |
| Display the reason a port is in a particular state |
| Only show open or possibly open ports |
| Show all packets sent / received |
| Print host interfaces and routes for debugging |
| Log errors/warnings to the normal-format output file |
| Append to rather than clobber specified output files |
| Resume an aborted scan |
| XSL stylesheet to transform XML output to HTML |
| Reference stylesheet from Nmap.Org for more portable XML |
| Prevent associating of XSL stylesheet w/XML output |
Misc Nmap Options
Command | Description |
---|---|
| Enable IPv6 scanning |
| Enable OS detection, version detection, script scanning, and traceroute |
| Specify custom Nmap data file location |
| Send using raw ethernet frames or IP packets Unpacking git (1:2.21.0-0ppa1ubuntu16.04.1) over (1:2.7.4-0ubuntu1.6). Git for mac. Unpacking git-man (1:2.21.0-0ppa1ubuntu16.04.1) over (1:2.7.4-0ubuntu1.6). Preparing to unpack./git-man1%3a2.21.0-0ppa1ubuntu16.04.1all.deb. Preparing to unpack./git1%3a2.21.0-0ppa1ubuntu16.04.1amd64.deb. |
| Assume that the user is fully privileged |
| Assume the user lacks raw socket privileges |
| Show nmap version number |
| Show nmap help screen |
Nmap Enumeration Examples
The following are real world examples of Nmap enumeration.
Enumerating Netbios
The following example enumerates Netbios on the target networks, the same process can be applied to other services by modifying ports / NSE scripts.
Detect all exposed Netbios servers on the subnet.
Nmap find exposed Netbios servers
root:~#nmap -sV -v -p 139,445 10.0.1.0/24
Starting Nmap 6.47 ( http://nmap.org ) at 2014-12-11 21:26 GMT
Nmap scan report for nas.decepticons 10.0.1.12
Host is up (0.014s latency).
PORT STATE SERVICE VERSION
139/tcp open netbios-ssn Samba smbd 3.X (workgroup: MEGATRON)
445/tcp open netbios-ssn Samba smbd 3.X (workgroup: MEGATRON)
Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 256 IP addresses (1 hosts up) scanned in 28.74 seconds
</p>
Nmap find Netbios name.
Nmap find exposed Netbios servers
root:~#nmap -sU --script nbstat.nse -p 137 10.0.1.12
Nmap Examples
Starting Nmap 6.47 ( http://nmap.org ) at 2014-12-11 21:26 GMTNmap scan report for nas.decepticons 10.0.1.12
Host is up (0.014s latency).
PORT STATE SERVICE VERSION
137/udp open netbios-ns
Host script results:
_nbstat: NetBIOS name: STARSCREAM, NetBIOS user: unknown, NetBIOS MAC: unknown (unknown)
Nmap done: 256 IP addresses (1 hosts up) scanned in 28.74 seconds
</p>
Check if Netbios servers are vulnerable to MS08-067
Nmap check MS08-067
Nmap For Mac Osx
root:~#nmap --script-args=unsafe=1 --script smb-check-vulns.nse -p 44510.0.0.1
Nmap scan report for ie6winxp.decepticons (10.0.1.1)
Host is up (0.00026s latency).
PORT STATE SERVICE
445/tcp open microsoft-ds
Host script results:
Nmap For Mac Os
smb-check-vulns:MS08-067: VULNERABLE
Conficker: Likely CLEAN
regsvc DoS: NOT VULNERABLE
SMBv2 DoS (CVE-2009-3103): NOT VULNERABLE
_ MS07-029: NO SERVICE (the Dns Server RPC service is inactive)
Nmap done: 1 IP address (1 host up) scanned in 5.45 seconds
</p>
The information gathered during the enumeration indicates the target is vulnerable to MS08-067, exploitation will confirm if it’s vulnerable to MS08-067.