= Iptables ! Apostolos rootApostolos@swarmlab.io // Metadata: :description: Intro and Install :keywords: sec, iptables :data-uri: :toc: right :toc-title: Πίνακας περιεχομένων :toclevels: 4 :source-highlighter: highlight :icons: font :sectnums: {empty} + [[cheat-Docker]] == Install swarmlab-sec (Home PC) HowTo: See http://docs.swarmlab.io/lab/sec/sec.adoc.html .NOTE [NOTE] ==== Assuming you're already logged in ==== == Find IP .Step 1 (find local IP) [source,bash] ---- # ifconfig eth0: flags=4163 mtu 1500 inet 172.21.0.2 netmask 255.255.0.0 broadcast 172.21.255.255 ether 02:42:ac:15:00:02 txqueuelen 0 (Ethernet) RX packets 61 bytes 9309 (9.3 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 loop txqueuelen 1000 (Local Loopback) RX packets 248 bytes 14260 (14.2 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 248 bytes 14260 (14.2 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ---- TIP: inet ***172.21.0.2*** netmask 255.255.0.0 broadcast 172.21.255.255 == Find live hosts .Step 2 (find live hosts on network) [source,bash] ---- nmap -sP 172.21.0.* Nmap scan report for 172.21.0.1 (172.21.0.1) Host is up (0.00028s latency). MAC Address: 02:42:56:48:D0:61 (Unknown) Nmap scan report for testnetwork2_worker_1.testnetwork2_net (172.21.0.3) Host is up (0.00015s latency). MAC Address: 02:42:AC:15:00:03 (Unknown) Nmap scan report for testnetwork2_worker_3.testnetwork2_net (172.21.0.4) Host is up (0.00018s latency). MAC Address: 02:42:AC:15:00:04 (Unknown) Nmap scan report for testnetwork2_worker_4.testnetwork2_net (172.21.0.5) Host is up (0.00015s latency). MAC Address: 02:42:AC:15:00:05 (Unknown) Nmap scan report for testnetwork2_worker_2.testnetwork2_net (172.21.0.6) Host is up (0.00017s latency). MAC Address: 02:42:AC:15:00:06 (Unknown) Nmap scan report for 9110d42e466b (172.21.0.2) nmap -sP 172.21.0.* | grep Nmap | cut -d' ' -f5-6 172.21.0.1 (172.21.0.1) testnetwork2_worker_1.testnetwork2_net (172.21.0.3) testnetwork2_worker_3.testnetwork2_net (172.21.0.4) testnetwork2_worker_4.testnetwork2_net (172.21.0.5) testnetwork2_worker_2.testnetwork2_net (172.21.0.6) 9110d42e466b (172.21.0.2) ---- .What is Nmap? [NOTE] ==== Nmap, short for Network Mapper, is a free, open-source tool for vulnerability scanning and network discovery. Network administrators use Nmap to identify what devices are running on their systems, discovering hosts that are available and the services they offer, finding open ports and detecting security risks. See https://en.wikipedia.org/wiki/Nmap ==== == Find open Ports .Step 3 (find open ports) [source,bash] ---- nmap -sP 83.212.114.* ---- [appendix] == How to use Nmap There is a wide range of free network monitoring utilities and vulnerability scanners available to network administrators and security auditors. While the basis of Nmap's functionality is port scanning, it allows for a variety of related capabilities including: - Network mapping: Nmap can identify the devices on a network (also called host discovery), including servers, routers and switches, and how they're physically connected. - OS detection: Nmap can detect the operating systems running on network devices (also called OS fingerprinting), providing the vendor name, the underlying operating system, the version of the software and even an estimate of devices' uptime. - Service discovery: Nmap can not only identify hosts on the network, but whether they're acting as mail, web or name servers, and the particular applications and versions of the related software they're running. - Security auditing: Figuring out what versions of operating systems and applications are running on network hosts lets network managers determine their vulnerability to specific flaws. If a network admin receives an alert about a vulnerability in a particular version of an application, for example, she can scan her network to identify whether that software version is running on the network and take steps to patch or update the relevant hosts. Scripts can also automate tasks such as detecting specific vulnerabilities. :hardbreaks: {empty} + {empty} + {empty} :!hardbreaks: ''' .Reminder [NOTE] ==== :hardbreaks: Caminante, no hay camino, se hace camino al andar. Wanderer, there is no path, the path is made by walking. *Antonio Machado* Campos de Castilla ====