Starting Nmap 7.70 ( https://nmap.org ) at 2018-09-09 07:24 CDT
Initiating Ping Scan at 07:24
Scanning 95.111.13.111 [4 ports]
Completed Ping Scan at 07:24, 0.03s elapsed (1 total hosts)
Initiating UDP Scan at 07:24
Scanning d1m0.com (95.111.13.111) [201 ports]
Discovered open port 1194/udp on 95.111.13.111
Not shown: 200 closed ports
PORT STATE SERVICE
1194/udp open openvpn
Spoofing & Decoy Scan
When we are scanning machines that are not ours, we often want to hide our IP (our identity). Obviously, every packet must contain our source address or else the response from the target system will not know where to return to. Nmap allows us to use decoy IP addresses so that it looks like many IP addresses are scanning the target.
Many firewalls and routers block or drop the ICMP (echo request, echo reply) ping. This is meant to obscure the presence of the hosts behind the firewall and protect against a possible DoS using the ping packet.To get around firewalls and routers that block or drop the ping, we need to suppress nmap’s default behavior of sending out that initial ping and get past the firewall that is blocking us. We can do this by using the -P0 switch:
nmap -sS -P0 192.168.3.10
Reason
Note in the output from the UDP scan above that some ports are reported as open/filtered. This indicates that nmap cannot determine whether the port is open or it is filtered by a device such as a firewall.
nmap -sU --reason 192.168.3.10
Using a List
Many times we want to scan a list of IP addresses and not an entire subnet. We can use any text editor and create a list of IP addresses and “feed” it to nmap. Here, I am using Leafpad, which is built into Kali (any text editor will work), to put together a list of IP addresses I want to scan.
nmap -iL scanlist.txt
TARGET SPECIFICATION:
Can pass hostnames, IP addresses, networks, etc.
Ex: scanme.nmap.org, microsoft.com/24, 192.168.0.1; 10.0.0-255.1-254
-iL : Input from list of hosts/networks
-iR : Choose random targets
–exclude : Exclude hosts/networks
–excludefile : Exclude list from file
HOST DISCOVERY:
-sL: List Scan – simply list targets to scan
-sn: Ping Scan – disable port scan
-Pn: Treat all hosts as online — skip host discovery
-PS/PA/PU/PY[portlist]: TCP SYN/ACK, UDP or SCTP discovery to given ports
-PE/PP/PM: ICMP echo, timestamp, and netmask request discovery probes
-PO[protocol list]: IP Protocol Ping
-n/-R: Never do DNS resolution/Always resolve [default: sometimes]
–dns-servers : Specify custom DNS servers
–system-dns: Use OS’s DNS resolver
–traceroute: Trace hop path to each host
PORT SPECIFICATION AND SCAN ORDER:
-p : Only scan specified ports
Ex: -p22; -p1-65535; -p U:53,111,137,T:21-25,80,139,8080,S:9
–exclude-ports : Exclude the specified ports from scanning
-F: Fast mode – Scan fewer ports than the default scan
-r: Scan ports consecutively – don’t randomize
–top-ports : Scan most common ports
–port-ratio : Scan ports more common than
SERVICE/VERSION DETECTION:
-sV: Probe open ports to determine service/version info
–version-intensity : Set from 0 (light) to 9 (try all probes)
–version-light: Limit to most likely probes (intensity 2)
–version-all: Try every single probe (intensity 9)
–version-trace: Show detailed version scan activity (for debugging)
SCRIPT SCAN:
-sC: equivalent to –script=default
–script=: is a comma separated list of
directories, script-files or script-categories
–script-args=: provide arguments to scripts
–script-args-file=filename: provide NSE script args in a file
–script-trace: Show all data sent and received
–script-updatedb: Update the script database.
–script-help=: Show help about scripts. is a comma-separated list of script-files or
script-categories.
OS DETECTION:
-O: Enable OS detection
–osscan-limit: Limit OS detection to promising targets
–osscan-guess: Guess OS more aggressively
TIMING AND PERFORMANCE:
Options which take
FIREWALL/IDS EVASION AND SPOOFING:
-f; –mtu : fragment packets (optionally w/given MTU)
-D : Cloak a scan with decoys
-S : Spoof source address
-e : Use specified interface
-g/–source-port : Use given port number
–proxies : Relay connections through HTTP/SOCKS4 proxies
–data : Append a custom payload to sent packets
–data-string : Append a custom ASCII string to sent packets
–data-length : Append random data to sent packets
–ip-options: Send packets with specified ip options
–ttl : Set IP time-to-live field
–spoof-mac : Spoof your MAC address
–badsum: Send packets with a bogus TCP/UDP/SCTP checksum
OUTPUT:
-oN/-oX/-oS/-oG : Output scan in normal, XML, s|: Output in the three major formats at once
-v: Increase verbosity level (use -vv or more for greater effect)
-d: Increase debugging level (use -dd or more for greater effect)
–reason: Display the reason a port is in a particular state
–open: Only show open (or possibly open) ports
–packet-trace: Show all packets sent and received
–iflist: Print host interfaces and routes (for debugging)
–log-errors: Log errors/warnings to the normal-format output file
–append-output: Append to rather than clobber specified output files
–resume : Resume an aborted scan
–stylesheet : XSL stylesheet to transform XML output to HTML
–webxml: Reference stylesheet from Nmap.Org for more portable XML
–no-stylesheet: Prevent associating of XSL stylesheet w/XML output
MISC:
-6: Enable IPv6 scanning
-A: Enable OS detection, version detection, script scanning, and traceroute
–datadir : Specify custom Nmap data file location
–send-eth/–send-ip: Send using raw ethernet frames or IP packets
–privileged: Assume that the user is fully privileged
–unprivileged: Assume the user lacks raw socket privileges
-V: Print version number
-h: Print this help summary page
Open Port Scanning and OS Detection
Ping scan on an IP to determine host using the following command:
nmap -sP 95.111.13.11
Open Port Scanning and OS Detection
Start a SYN scan with OS detection using the following command:
nmap -sS 95.111.13.11 -O
Nmap scan report for d1m0.com (95.111.13.111)
Host is up (0.00097s latency).
Not shown: 992 closed ports
PORT STATE SERVICE
25/tcp open smtp
53/tcp open domain
80/tcp open http
143/tcp open imap
465/tcp open smtps
993/tcp open imaps
4444/tcp open krb524
8181/tcp open intermapper
Start an open port scan with version detection using the command:
nmap -sV 95.111.13.111 -A
Nmap scan report for d1m0.com (95.111.13.111)
Host is up (0.00089s latency).
Not shown: 992 closed ports
PORT STATE SERVICE VERSION
25/tcp open smtp Postfix smtpd
|_smtp-commands: mail.d1m0.com, PIPELINING, SIZE 4194304, VRFY, ETRN, STARTTLS, ENHANCEDSTATUSCODES, 8BITMIME,
| ssl-cert: Subject: commonName=mail.d1m0.com/countryName=BG
| Subject Alternative Name: DNS:mail.d1m0.com
| Not valid before: 2017-05-09T19:56:41
|_Not valid after: 2019-05-09T12:06:00
|_ssl-date: TLS randomness does not represent time
53/tcp open domain ISC BIND 9.9.5 (Debian Linux 8.0 (Jessie))
| dns-nsid:
|_ bind.version: 9.9.5-9+deb8u15-Debian
80/tcp open http OpenWrt admin httpd (rejected RFC1918 address)
|_http-title: Site doesn’t have a title (text/html).
143/tcp open imap Dovecot imapd
|_imap-capabilities: STARTTLS LOGIN-REFERRALS AUTH=PLAIN IMAP4rev1 listed more IDLE SASL-IR have Pre-login AUTH=LOGINA0001 post-login ID LITERAL+ ENABLE capabilities OK
| ssl-cert: Subject: commonName=mail.d1m0.com/countryName=BG
| Subject Alternative Name: DNS:mail.d1m0.com
| Not valid before: 2017-05-09T19:56:41
|_Not valid after: 2019-05-09T12:06:00
|_ssl-date: TLS randomness does not represent time
465/tcp open ssl/smtp Postfix smtpd
|_smtp-commands: mail.d1m0.com, PIPELINING, SIZE 4194304, VRFY, ETRN, AUTH PLAIN LOGIN, ENHANCEDSTATUSCODES, 8BITMIME,
| ssl-cert: Subject: commonName=mail.d1m0.com/countryName=BG
| Subject Alternative Name: DNS:mail.d1m0.com
| Not valid before: 2017-05-09T19:56:41
|_Not valid after: 2019-05-09T12:06:00
|_ssl-date: TLS randomness does not represent time
993/tcp open ssl/imap Dovecot imapd
|_imap-capabilities: IDLE ID ENABLE more OK AUTH=PLAIN have AUTH=LOGINA0001 IMAP4rev1 listed post-login SASL-IR LITERAL+ Pre-login capabilities LOGIN-REFERRALS
| ssl-cert: Subject: commonName=mail.d1m0.com/countryName=BG
| Subject Alternative Name: DNS:mail.d1m0.com
| Not valid before: 2017-05-09T19:56:41
|_Not valid after: 2019-05-09T12:06:00
|_ssl-date: TLS randomness does not represent time
4444/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.4 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 b4:20:d2:bb:b4:64:be:80:6e:44:39:63:86:4a:3f:fe (RSA)
| 256 d0:39:21:89:b0:73:88:50:8e:dc:29:7c:3c:43:a6:1f (ECDSA)
|_ 256 ea:68:fd:d4:ce:31:e4:16:64:54:ab:bf:02:40:ff:5c (ED25519)
8181/tcp open http Apache httpd 2.4.6 ((CentOS) PHP/5.4.16)
|_http-server-header: Apache/2.4.6 (CentOS) PHP/5.4.16
Aggressive OS guesses: Linux 3.16 (96%), Linux 4.4 (95%), Linksys EA3500 WAP (94%), Linux 3.2 – 4.9 (93%), Android 4.4.0 (91%), Linux 2.6.18 – 2.6.32 (91%), Linux 3.10 – 4.11 (90%), Linux 4.10 (90%), Linux 3.4 – 3.10 (89%), Linux 3.13 – 3.16 (89%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 1 hop
Service Info: Host: mail.d1m0.com; OS: Linux; CPE: cpe:/o:linux:linux_kernel
Този урок покрива материала от LPIC-1 110.1, нужен за изпит 102-400.
Урока покрива следните команди и файлове: 1.
su
sudo
/etc/sudoers
passwd 2.
find
fuser
lsof
nmap
chage
usermod
ulimit 3.
who, w, last
1.
Когато става въпрос за сигурност едно от най-важните неща е да се избягва директното влизане като root в системата, освен когато е наложително. Когато ви потрябва достъп до root акаунта(напр. за дадена команда) е препоръчително да се достъпи чрез su или sudo командите. Continue reading ‘[LPIC-1] System Security(110.1)’ »
Този урок покрива материала от LPIC-1 105.1, нужен за изпит 102-400.
Урока покрива следните команди и файлове: 1. source
unset
export 2.
set
еnv 3. /etc/bash.bashrc /etc/profile ~/.bash_profile ~/.bash_login ~/.profile ~/.bashrc ~/.bash_logout 4. function alias