Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:cmd:ip [2020/10/28 15:35] jslinux:cmd:ip [2020/10/28 16:05] (current) js
Line 4: Line 4:
 <code bash>ifconfig</code> <code bash>ifconfig</code>
  
-==== disable eth ====+===== disable eth =====
 <code bash>ip link set eth2 down</code> <code bash>ip link set eth2 down</code>
  
-==== show services of port ====+===== show services of port =====
 <code bash>getent services <port></code> <code bash>getent services <port></code>
  
-==== show all listen ports ====+===== show all listen ports =====
 <code bash>netstat -lnput</code> <code bash>netstat -lnput</code>
 <code>[root@srv]# netstat -lnput <code>[root@srv]# netstat -lnput
Line 47: Line 47:
 udp        0      0 192.168.122.1:53        0.0.0.0:                          2154/dnsmasq udp        0      0 192.168.122.1:53        0.0.0.0:                          2154/dnsmasq
 </code> </code>
 +
 +<code bash>sudo ss -tulwn</code>
 +<code>Netid  State      Recv-Q Send-Q                      Local Address:Port                                     Peer Address:Port
 +udp    UNCONN          0                                       *:50001                                               *:*
 +udp    UNCONN          0                                       *:973                                                 *:*
 +udp    UNCONN          0                                       *:5353                                                *:*
 +udp    UNCONN          0                                       *:34776                                               *:*
 +udp    UNCONN          0                           192.168.122.1:53                                                  *:*
 +udp    UNCONN          0                              172.16.0.2:53                                                  *:*
 +udp    UNCONN          0                               127.0.0.1:53                                                  *:*
 +udp    UNCONN          0                                *%virbr0:67                                                  *:*
 +udp    UNCONN          0                                       *:111                                                 *:*
 +udp    UNCONN          0                  [::ffff:192.168.122.1]:47422                                            [::]:*
 +udp    UNCONN          0                                    [::]:973                                              [::]:*
 +udp    UNCONN          0                                    [::]:5353                                             [::]:*
 +udp    UNCONN          0                     [::ffff:172.16.0.2]:50500                                            [::]:*
 +</code>
 +===== check ports with nmap =====
 +<code bash>nmap -Pn -sV --version-all --reason -v 172.16.0.1</code>
 +<code>Starting Nmap 6.40 ( http://nmap.org ) at 2020-10-28 16:24 CET
 +NSE: Loaded 23 scripts for scanning.
 +Initiating ARP Ping Scan at 16:24
 +Scanning 172.16.0.1 [1 port]
 +Completed ARP Ping Scan at 16:24, 0.24s elapsed (1 total hosts)
 +Initiating Parallel DNS resolution of 1 host. at 16:24
 +Completed Parallel DNS resolution of 1 host. at 16:24, 0.00s elapsed
 +Initiating SYN Stealth Scan at 16:24
 +Scanning ubnt.lab.schnuerle.com (172.16.0.1) [1000 ports]
 +Discovered open port 80/tcp on 172.16.0.1
 +Discovered open port 443/tcp on 172.16.0.1
 +Discovered open port 53/tcp on 172.16.0.1
 +Discovered open port 22/tcp on 172.16.0.1
 +Completed SYN Stealth Scan at 16:24, 1.36s elapsed (1000 total ports)
 +Initiating Service scan at 16:24
 +Scanning 4 services on ubnt.lab.schnuerle.com (172.16.0.1)
 +Completed Service scan at 16:24, 12.47s elapsed (4 services on 1 host)
 +NSE: Script scanning 172.16.0.1.
 +Nmap scan report for ubnt.lab.schnuerle.com (172.16.0.1)
 +Host is up, received arp-response (0.0014s latency).
 +Not shown: 996 closed ports
 +Reason: 996 resets
 +PORT    STATE SERVICE  REASON  VERSION
 +22/tcp  open  ssh      syn-ack OpenSSH 6.6.1p1 Debian 4~bpo70+1 (protocol 2.0)
 +53/tcp  open  domain   syn-ack dnsmasq 2.78-23-g9e09429
 +80/tcp  open  http     syn-ack lighttpd
 +443/tcp open  ssl/http syn-ack lighttpd
 +MAC Address: B4:FB:E4:2D:BE:6A (Unknown)
 +Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
 +
 +Read data files from: /usr/bin/../share/nmap
 +Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .
 +Nmap done: 1 IP address (1 host up) scanned in 14.60 seconds
 +           Raw packets sent: 1088 (47.856KB) | Rcvd: 1090 (43.674KB)
 +</code>
 +
 +===== UDP nmap scan =====
 +<code bash>nmap -Pn -sU -sV --version-all --reason -v 172.16.0.1</code> 
 +
 +===== nmap with OS detection =====
 +<code bash>nmap -Pn -sS -sV --version-all --reason -v -A -O --osscan-guess -p0-65535 172.16.0.1</code>
 +
 +
 +====== Links =======
 +[[https://www.kuketz-blog.de/nmap-systeme-auf-offene-ports-scannen/]]