Information Security News|Cyber Security|Hacking Tutorial https://www.securitynewspaper.com/ Information Security Newspaper|Infosec Articles|Hacking News Mon, 22 Apr 2019 18:16:35 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.1 https://www.securitynewspaper.com/snews-up/2018/12/news5.png Information Security News|Cyber Security|Hacking Tutorial https://www.securitynewspaper.com/ 32 32 How to Scan whole country IP Addresses in a while https://www.securitynewspaper.com/2019/04/10/how-to-scan-whole-country-ip-addresses-in-a-while/ Thu, 11 Apr 2019 00:57:12 +0000 https://www.securitynewspaper.com/?p=13829 In some phases of information gathering. Pentester do require to scan some of the IP addresses that are most commonly used. As per ethical hacking researcher if International Institute ofRead More →

The post How to Scan whole country IP Addresses in a while appeared first on Information Security Newspaper | Hacking News.

]]>
In some phases of information gathering. Pentester do require to scan some of the IP addresses that are most commonly used. As per ethical hacking researcher if International Institute of Cyber Security, scanning is the most important phase of penetration testing. The most common addresses can be of routers or search engines. These common scan are used to check normal activities that how target is using the internet. There are many popular tools like nmap (network mapper) which scans open ports and IP addresses. But today we are talking about Masscan.

According to ethical hacking researcher of international institute of cyber security masscan do helps in scanning phases of pentesting/ VAPT.

Masscan is a tool which scans internet in very short time. It uses asynchronous scanning similar as to nmap. This tool uses custom ports or IPs to scan target. Masscan is the fastest tool to scan for open ports. For showing you, we have tested on Kali Linux 2018.4 in vmware. We will be scanning local IP addresses, whole country IP’s and will show packet analysis in wireshark, to check how the Masscan is noisy on network.

Scanning Local Networks :-

  • Here we have created an local network on 3 computers to show you how masscan scan packets. For creating local network.
  • 192.168.1.20 & 192.168.1.22 both are the target machine, both are running on windows platform. And attacking machine is the Kali Linux 2018.4

Steps to configure your Virtual Machines IP’s

  • For assigning static IP addresses, go to Control Panel/ Network and Internet/ Network Connections.
  • Go to local area connection properties. Go to IPv4 connection. Enter IP 192.168.1.20
  • Replicate above process with another computer type IP 192.168.1.22
  • After creating local network. You can check by pinging to both IP addresses. Open cmd in both computers and type ping 192.168.1.20 and to another computer ping 192.168.1.22
  • Now to make ping from Kali Linux you have to create virtual network in the vmware.
  • Go to Kali Linux network settings enter static IP. Go to wifi settings select manual type 192.168.1.23 in IPv4 and enter subnet mask 255.255.255.0
  • Go to virtual network editor of vmware in windows.
  • Select the network editor as shown below. Remember to select appropriate settings.
  • As shown above click on Vmnet0 and select network interface card.
  • Then click on Vmnet8 and select local ethernet
  • Click on apply and ok
  • After assigning Then go to Kali Vmware settings and open network settings. Select the virtual network adapter

Moving to installing MASSCAN on KALI

  • After assigning static IP addresses to target computers and Kali Linux install required library in Kali Linux before using masscan.
  • Type sudo apt-get install git gcc make libpcap-dev in Kali Linux terminal.
root@kali:/home/iicybersecurity/Downloads/masscan# sudo apt-get install git gcc make libpcap-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
make is already the newest version (4.2.1-1.2).
make set to manually installed.
The following package was automatically installed and is no longer required:
php7.2
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
cpp cpp-8 g++ g++-8 gcc-8 gcc-8-base git-man lib32gcc1 lib32stdc++6 libasan5 libatomic1 libcc1-0 libgcc-8-dev libgcc1 libgfortran5
libgomp1 libitm1 liblsan0 libmpx2 libobjc-8-dev libobjc4 libpcap0.8-dev libquadmath0 libstdc++-8-dev libstdc++6 libtsan0 libubsan1
Suggested packages:
cpp-doc gcc-8-locales g++-multilib g++-8-multilib gcc-8-doc libstdc++6-8-dbg gcc-multilib autoconf automake libtool bison gcc-doc
gcc-8-multilib libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan5-dbg liblsan0-dbg libtsan0-dbg libubsan1-dbg
libmpx2-dbg libquadmath0-dbg git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-cvs
git-mediawiki git-svn libstdc++-8-doc
The following NEW packages will be installed:
libpcap-dev libpcap0.8-dev
The following packages will be upgraded:
cpp cpp-8 g++ g++-8 gcc gcc-8 gcc-8-base git git-man lib32gcc1 lib32stdc++6 libasan5 libatomic1 libcc1-0 libgcc-8-dev libgcc1
libgfortran5 libgomp1 libitm1 liblsan0 libmpx2 libobjc-8-dev libobjc4 libquadmath0 libstdc++-8-dev libstdc++6 libtsan0 libubsan1
28 upgraded, 2 newly installed, 0 to remove and 1094 not upgraded.
Need to get 266 kB/37.1 MB of archives.
After this operation, 2,753 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 https://ftp.yzu.edu.tw/Linux/kali kali-rolling/main amd64 libpcap0.8-dev amd64 1.8.1-6 [240 kB]
Get:2 https://ftp.yzu.edu.tw/Linux/kali kali-rolling/main amd64 libpcap-dev amd64 1.8.1-6 [25.9 kB]
Fetched 266 kB in 9s (28.6 kB/s)
Reading changelogs… Done
(Reading database … 342760 files and directories currently installed.)
Preparing to unpack …/0-libquadmath0_8.2.0-13_amd64.deb …
Unpacking libquadmath0:amd64 (8.2.0-13) over (8.2.0-7) …
Preparing to unpack …/1-libubsan1_8.2.0-13_amd64.deb …
-------------------------------SNIP------------------------------
Unpacking libubsan1:amd64 (8.2.0-13) over (8.2.0-7) …
Preparing to unpack …/2-lib32gcc1_1%3a8.2.0-13_amd64.deb …
Unpacking lib32gcc1 (1:8.2.0-13) over (1:8.2.0-7) …
Preparing to unpack …/3-libitm1_8.2.0-13_amd64.deb …
Unpacking libitm1:amd64 (8.2.0-13) over (8.2.0-7) …
Preparing to unpack …/4-libgfortran5_8.2.0-13_amd64.deb …
Unpacking libgfortran5:amd64 (8.2.0-13) over (8.2.0-7) …
Preparing to unpack …/5-libasan5_8.2.0-13_amd64.deb …
Unpacking libasan5:amd64 (8.2.0-13) over (8.2.0-7) …
Preparing to unpack …/6-lib32stdc++6_8.2.0-13_amd64.deb …
Unpacking lib32stdc++6 (8.2.0-13) over (8.2.0-7) …
Preparing to unpack …/7-gcc-8-base_8.2.0-13_amd64.deb …
Unpacking gcc-8-base:amd64 (8.2.0-13) over (8.2.0-7) …
Setting up gcc-8-base:amd64 (8.2.0-13) …
(Reading database … 342760 files and directories currently installed.)
Preparing to unpack …/libstdc++6_8.2.0-13_amd64.deb …
Unpacking libstdc++6:amd64 (8.2.0-13) over (8.2.0-7) …
Setting up libstdc++6:amd64 (8.2.0-13) …
(Reading database … 342760 files and directories currently installed.)
Preparing to unpack …/00-libgomp1_8.2.0-13_amd64.deb …
Unpacking libgomp1:amd64 (8.2.0-13) over (8.2.0-7) …
Preparing to unpack …/01-libatomic1_8.2.0-13_amd64.deb …
Unpacking libatomic1:amd64 (8.2.0-13) over (8.2.0-7) …
Preparing to unpack …/02-liblsan0_8.2.0-13_amd64.deb …
Unpacking liblsan0:amd64 (8.2.0-13) over (8.2.0-7) …
Preparing to unpack …/03-libtsan0_8.2.0-13_amd64.deb …
Unpacking libtsan0:amd64 (8.2.0-13) over (8.2.0-7) …
Preparing to unpack …/04-libmpx2_8.2.0-13_amd64.deb …
Unpacking libmpx2:amd64 (8.2.0-13) over (8.2.0-7) …
Preparing to unpack …/05-cpp-8_8.2.0-13_amd64.deb …
Unpacking cpp-8 (8.2.0-13) over (8.2.0-7) …
Preparing to unpack …/06-libcc1-0_8.2.0-13_amd64.deb …
Unpacking libcc1-0:amd64 (8.2.0-13) over (8.2.0-7) …
Preparing to unpack …/07-gcc-8_8.2.0-13_amd64.deb …
Unpacking gcc-8 (8.2.0-13) over (8.2.0-7) …
Preparing to unpack …/08-g++-8_8.2.0-13_amd64.deb …
Unpacking g++-8 (8.2.0-13) over (8.2.0-7) …
Preparing to unpack …/1-gcc_4%3a8.2.0-2_amd64.deb …
Unpacking gcc (4:8.2.0-2) over (4:8.1.0-1) …
Preparing to unpack …/2-cpp_4%3a8.2.0-2_amd64.deb …
Unpacking cpp (4:8.2.0-2) over (4:8.1.0-1) …
Preparing to unpack …/3-git_1%3a2.20.1-1_amd64.deb …
Unpacking git (1:2.20.1-1) over (1:2.19.1-1) …
Preparing to unpack …/4-git-man_1%3a2.20.1-1_all.deb …
Unpacking git-man (1:2.20.1-1) over (1:2.19.1-1) …

  • Type git clone https://github.com/robertdavidgraham/masscan.git
root@kali:/home/iicybersecurity/Downloads# git clone https://github.com/robertdavidgraham/masscan.git
Cloning into 'masscan'…
remote: Enumerating objects: 20, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 4101 (delta 6), reused 8 (delta 4), pack-reused 4081
Receiving objects: 100% (4101/4101), 2.56 MiB | 17.00 KiB/s, done.
Resolving deltas: 100% (2778/2778), done.
  • Then type cd masscan
  • Type make and then make install
root@kali:/home/iicybersecurity/Downloads/masscan# make
clang -g -ggdb -Wall -O3 -c src/crypto-base64.c -o tmp/crypto-base64.o
clang -g -ggdb -Wall -O3 -c src/crypto-blackrock2.c -o tmp/crypto-blackrock2.o
clang -g -ggdb -Wall -O3 -c src/event-timeout.c -o tmp/event-timeout.o
clang -g -ggdb -Wall -O3 -c src/in-binary.c -o tmp/in-binary.o
clang -g -ggdb -Wall -O3 -c src/in-filter.c -o tmp/in-filter.o
clang -g -ggdb -Wall -O3 -c src/in-report.c -o tmp/in-report.o
clang -g -ggdb -Wall -O3 -c src/logger.c -o tmp/logger.o
clang -g -ggdb -Wall -O3 -c src/main-conf.c -o tmp/main-conf.o -DGIT=\"1.0.5-51-g6c15edc\"
clang -g -ggdb -Wall -O3 -c src/main-dedup.c -o tmp/main-dedup.o
clang -g -ggdb -Wall -O3 -c src/main-initadapter.c -o tmp/main-initadapter.o
clang -g -ggdb -Wall -O3 -c src/main-listscan.c -o tmp/main-listscan.o
clang -g -ggdb -Wall -O3 -c src/main-ptrace.c -o tmp/main-ptrace.o
clang -g -ggdb -Wall -O3 -c src/main-readrange.c -o tmp/main-readrange.o
clang -g -ggdb -Wall -O3 -c src/main-src.c -o tmp/main-src.o
clang -g -ggdb -Wall -O3 -c src/main-status.c -o tmp/main-status.o
clang -g -ggdb -Wall -O3 -c src/main-throttle.c -o tmp/main-throttle.o
clang -g -ggdb -Wall -O3 -c src/main.c -o tmp/main.o
src/main.c:282:24: warning: passing 'const struct RangeList *' to parameter of type 'struct RangeList *' discards qualifiers
[-Wincompatible-pointer-types-discards-qualifiers]
rangelist_sort(&masscan->targets);
---------------------------SNIP---------------------------------
src/ranges.h:200:34: note: passing argument to parameter 'targets' here
rangelist_sort(struct RangeList *targets);
^
src/main.c:284:24: warning: passing 'const struct RangeList *' to parameter of type 'struct RangeList *' discards qualifiers
[-Wincompatible-pointer-types-discards-qualifiers]
rangelist_sort(&masscan->ports);
^~~~~~~
src/ranges.h:200:34: note: passing argument to parameter 'targets' here
rangelist_sort(struct RangeList *targets);
^
2 warnings generated.
clang -g -ggdb -Wall -O3 -c src/masscan-app.c -o tmp/masscan-app.o
clang -g -ggdb -Wall -O3 -c src/out-binary.c -o tmp/out-binary.o
clang -g -ggdb -Wall -O3 -c src/out-certs.c -o tmp/out-certs.o
clang -g -ggdb -Wall -O3 -c src/out-grepable.c -o tmp/out-grepable.o
clang -g -ggdb -Wall -O3 -c src/out-json.c -o tmp/out-json.o
clang -g -ggdb -Wall -O3 -c src/out-ndjson.c -o tmp/out-ndjson.o
clang -g -ggdb -Wall -O3 -c src/out-null.c -o tmp/out-null.o
clang -g -ggdb -Wall -O3 -c src/out-redis.c -o tmp/out-redis.o
clang -g -ggdb -Wall -O3 -c src/out-tcp-services.c -o tmp/out-tcp-services.o
clang -g -ggdb -Wall -O3 -c src/out-text.c -o tmp/out-text.o
clang -g -ggdb -Wall -O3 -c src/out-unicornscan.c -o tmp/out-unicornscan.o
clang -g -ggdb -Wall -O3 -c src/out-xml.c -o tmp/out-xml.o
clang -g -ggdb -Wall -O3 -c src/output.c -o tmp/output.o
clang -g -ggdb -Wall -O3 -c src/pixie-backtrace.c -o tmp/pixie-backtrace.o
  • Type masscan
root@kali:/home/iicybersecurity/Downloads/masscan# masscan
usage:
masscan -p80,8000-8100 10.0.0.0/8 --rate=10000
scan some web ports on 10.x.x.x at 10kpps
masscan --nmap
list those options that are compatible with nmap
masscan -p80 10.0.0.0/8 --banners -oB
save results of scan in binary format to
masscan --open --banners --readscan -oX
read binary scan results in and save them as xml in
  • Type masscan to view the help menu.
  • Start Wireshark in Kali Linux or host machine and select netwok interface and see the packet analyzing.
  • If wireshark is not installed in Kali Linux. Install wireshark from https://packages.qa.debian.org/w/wireshark.html and for windows go to https://www.wireshark.org/download.html

Scanning Target Computers :-

  • For scanning type masscan -p0-1000 192.168.1.20 –router-mac <enter mac address>
  • 192.168.1.20 is the target computer.
  • For knowing mac address open cmd type getmac in target computers.
  • -p is used to enter port. You can give an port range -p0-5000 or you can specify and ports of your choice.
  • –router-mac is used to enter mac addresses of the target.
root@kali:/home/iicybersecurity# masscan -p0-1000 192.168.1.20 --router-mac <enter mac addresses>
Starting masscan 1.0.6 (https://bit.ly/14GZzcT) at 2019-01-10 12:03:11 GMT
-- forced options: -sS -Pn -n --randomize-hosts -v --send-eth
Initiating SYN Stealth Scan
Scanning 1 hosts [1001 ports/host]
Discovered open port 443/tcp on 192.168.1.20
Discovered open port 135/tcp on 192.168.1.20
Discovered open port 912/tcp on 192.168.1.20
Discovered open port 139/tcp on 192.168.1.20
Discovered open port 445/tcp on 192.168.1.20
Discovered open port 902/tcp on 192.168.1.20
  • After running above query, masscan shows list of open ports in the target operating system. If you start wireshark in target machine 192.168.1.20 you can see no. of packets retrieving from attacker 192.168.1.5 machine as shown below.
  • The above screenshot shows TCP packet transfer of each packet. The above information can be used in other hacking activities.
  • Type masscan -p0-1000 192.168.1.22 –router-mac <enter mac address>
  • 192.168.1.22 is the target computer.
  • For knowing mac address open cmd type getmac
  • -p is used to enter port. You can give an port range -p0-1000 or you can specify and ports of your choice.
  • –router-mac is used to enter mac addresses of the target.
root@kali:/home/iicybersecurity# masscan -p0-1000 192.168.1.22 --router-mac <enter mac address>                                         
Starting masscan 1.0.6 (https://bit.ly/14GZzcT) at 2019-01-10 12:21:21 GMT
-- forced options: -sS -Pn -n --randomize-hosts -v --send-eth
Initiating SYN Stealth Scan
Scanning 1 hosts [1001 ports/host]
Discovered open port 135/tcp on 192.168.1.22
Discovered open port 445/tcp on 192.168.1.22
Discovered open port 139/tcp on 192.168.1.22
  • After running above query, masscan shows list of ports that are open in the target operating system. The above list can be used to make scenario for attacking further.
  • If you start wireshark in target machine 192.168.1.22 you can see no. of packets retrieving from attacker 192.168.1.5 machine as shown below.
  • The above screenshot shows TCP packet transfer of each packet. As it showing 3-Way handshaking.
  • The above information can be used in other hacking activities.

Scanning Vulnerable IP addresses :-

  • There are many sources where you can use tool for testing. Next we have used OWASP iso for scanning open ports.
  • Owasp iso is most popular for testing your hacking skills.
  • For downloading iso go to https://sourceforge.net/projects/owaspbwa/
  • After downloading the owasp iso. Open iso in vmware. Simply start iso.
  • After starting iso, you will see your IP address as shown below.
  • Enter the IP 192.168.1.10 in web browser to check if iso working as shown below.
  • As you can see, iso is working.
  • Now for scanning above IP address type masscan -p0-8000 192.168.1.10
  • -p is used to enter port ranges.
  • Then type IP address.
root@kali:/home/iicybersecurity# masscan -p0-8000 192.168.1.10
Starting masscan 1.0.6 (https://bit.ly/14GZzcT) at 2019-01-10 18:11:29 GMT
-- forced options: -sS -Pn -n --randomize-hosts -v --send-eth
Initiating SYN Stealth Scan
Scanning 1 hosts [8001 ports/host]
Discovered open port 445/tcp on 192.168.1.10
Discovered open port 443/tcp on 192.168.1.10
Discovered open port 143/tcp on 192.168.1.10
Discovered open port 80/tcp on 192.168.1.10
Discovered open port 139/tcp on 192.168.1.10
Discovered open port 5001/tcp on 192.168.1.10
Discovered open port 22/tcp on 192.168.1.10
  • The above query shows open ports of the target IP address. The above information can be used in other hacking activities.

As explained in the ethical hacking course of International Institute of Cyber Security, scanning any random IP with large no, of ports may slow the Kali Linux. Use only limited ports. Or give any short port range. Do not scan any public IP. Your Linux Distros may got hang. If you scan large no. of ports, your ISP may blocks you as large no. of request is send to public IP. Sending Large no. packets may slow the internet.

Analyzing Countries IP Ranges :-

  • Masscan can scan with different IP ranges & different ports. Here we have taken China country IP ranges. For IP ranges go to : https://lite.ip2location.com/china-ip-address-ranges
  • Type masscan -v -sS 43.225.84.0-43.225.87.255 -p0-100
  • -v is used to increase verbosity level.
  • 17.50.48.0-17.50.55.255 is ip range used in scanning.
  • -sS is used to make TCP syn scan always on.
  • -p is used to port ranges. we have used -p0-100
root@kali:~/Downloads/masscan# masscan -v -sS 43.225.84.0-43.225.87.255 -p0-100

Starting masscan 1.0.4 (https://bit.ly/14GZzcT) at 2019-04-10 05:28:06 GMT
-- forced options: -sS -Pn -n --randomize-hosts -v --send-eth
Initiating SYN Stealth Scan
Scanning 1024 hosts [101 ports/host]
THREAD: status: starting thread
THREAD: xmit: starting thread #0 0:00:00 remaining, found=0
maxrate = 100.00
THREAD: recv: starting thread #0
THREAD: recv: starting main loop
Discovered open port 53/tcp on 43.225.87.113
Discovered open port 53/tcp on 43.225.87.45
Discovered open port 53/tcp on 43.225.87.51
Discovered open port 80/tcp on 43.225.87.31
Discovered open port 53/tcp on 43.225.87.39
Discovered open port 53/tcp on 43.225.87.81
Discovered open port 53/tcp on 43.225.87.34
Discovered open port 53/tcp on 43.225.87.104
Discovered open port 53/tcp on 43.225.87.63
Discovered open port 53/tcp on 43.225.87.22
Discovered open port 80/tcp on 43.225.87.195
Discovered open port 53/tcp on 43.225.87.78
Discovered open port 53/tcp on 43.225.87.65
Discovered open port 80/tcp on 43.225.87.69
Discovered open port 53/tcp on 43.225.87.162
Discovered open port 80/tcp on 43.225.87.70
Discovered open port 53/tcp on 43.225.87.133
Discovered open port 80/tcp on 43.225.87.157
Discovered open port 80/tcp on 43.225.87.118
Discovered open port 80/tcp on 43.225.87.55
Discovered open port 53/tcp on 43.225.87.200
-----------------------------SNIP---------------------------------
Discovered open port 53/tcp on 43.225.87.163
Discovered open port 80/tcp on 43.225.87.201
Discovered open port 53/tcp on 43.225.87.109
Discovered open port 53/tcp on 43.225.87.59
Discovered open port 80/tcp on 43.225.87.28
Discovered open port 53/tcp on 43.225.87.24
Discovered open port 80/tcp on 43.225.87.160
Discovered open port 53/tcp on 43.225.87.54
Discovered open port 80/tcp on 43.225.87.198
Discovered open port 80/tcp on 43.225.87.187
Discovered open port 53/tcp on 43.225.87.77
Discovered open port 53/tcp on 43.225.87.120
Discovered open port 80/tcp on 43.225.87.72
Discovered open port 53/tcp on 43.225.87.83
Discovered open port 53/tcp on 43.225.87.194
  • The above query shows initialization SYN scan, ranging port from 0-100. Thread started from default gateway with maxrate of packets. Here 100 packets are sending by default. You can also send large no. of packets to scan IP ranges.
  • Meanwhile we have also try to send large no. of packets, after sending large of packets our internet got stuck. Network provider may block your IP address mentions the ethical hacking professor.
  • For sending large no. of packets you need Intel 10-gbps Ethernet adapter & special driver called PF RING ZC. Download driver from : https://www.ntop.org/products/packet-capture/pf_ring/pf_ring-zc-zero-copy/
  • While scanning with given IP ranges. Masscan has found port 80,53 opened in the IP ranges. Port 53 is used for zone transfers (used in dns enumeration) which can be bypassed by sending UDP packets with port equal to 53.
  • While scanning with nmap, it didn’t run with this IP address.
  • Type nmap -v 43.225.84.0/255
  • -v is used to increase verbosity level.
root@kali:~# nmap -v 43.225.84.0/255
Starting Nmap 7.70 ( https://nmap.org ) at 2019-04-10 05:45 UTC
Illegal netmask in "43.225.84.0/255". Assuming /32 (one host)
Initiating Ping Scan at 05:45
Scanning 43.225.84.0 [4 ports]
Completed Ping Scan at 05:45, 3.04s elapsed (1 total hosts)
Nmap scan report for 43.225.84.0 [host down]
Read data files from: /usr/bin/../share/nmap
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 3.13 seconds
Raw packets sent: 8 (304B) | Rcvd: 0 (0B)
  • Nmap doesn’t scan as we have to use NMAP with -Pn option, as ping might be blocked explains the ethical hacking professor. So overall MASSCAN is relativelvy faster then NMAP any of the host because target IP address range blocking port scanner. But in masscan whole ip range was scanning because masscan has its own TCP/IP stack. While nmap is build on common networking protocols.

The post How to Scan whole country IP Addresses in a while appeared first on Information Security Newspaper | Hacking News.

]]>
How to scan whole Internet 3.7 billion IP addresses in few minutes? https://www.securitynewspaper.com/2015/10/15/how-to-scan-whole-internet-3-7-billion-ip-addresses-in-few-minutes/ Thu, 15 Oct 2015 07:28:40 +0000 https://www.securitynewspaper.com/?p=986 Cyber security audit and ethical hacking training professionals normally use scanner to scans the networks. Scanning every IP address on the internet isn’t an easy job, and if you don’tRead More →

The post How to scan whole Internet 3.7 billion IP addresses in few minutes? appeared first on Information Security Newspaper | Hacking News.

]]>
Cyber security audit and ethical hacking training professionals normally use scanner to scans the networks. Scanning every IP address on the internet isn’t an easy job, and if you don’t have the resources of a botnet, a single scan can take months. If you want to take snapshots of the internet it will be very difficult, because doing a network scan of the whole thing has typically taken weeks or months to complete. However this is now possible explains cyber security services expert with the help of new tools like ZMap Masscan and other tools. In this article we will be covering different advance port scanning tools.

ZMap

ZMap is designed to execute widespread scans of the IPv4 address space or large portions of it. It is a very powerful tool for cyber security services researchers, and you can scan the entire IPv4 address space by using its high rate of 1.4 million packets per second. ZMap can’t replace general-purpose mappers like Nmap, which is excellent for scanning sub-networks in depth. ZMap is intended to do a shallow scan – typically of a single port or service – of the entire internet, or at least the IPv4 internet, from a single, dedicated computer, in under an hour. Ame Wilson, cyber security audit services consultant mentions that ZMap is proficient of scanning the IPv4 public address space over 1300 times faster than the Nmap.

ZMap is able to work so fast because it uses cyclic multiplicative groups. ZMap has been designed to achieve parallelism and performance. First, ZMap is completely stateless, which means that it does not maintain status per connection. In place of maintaining a big list of probes it’s sent, and the time they’ve been out there, and how much longer it should wait for each one, and thoroughly updating the list with every acknowledged response, ZMap just use cyclic multiplicative group to avoid all this explains Ame Wilson, cyber security audit services consultant.

Second, ZMap sends in parallel as many probes as the network bandwidth permits, in order to attain the maximum rate possible. Normally all the probes are sent in a pseudo-random order, so that’s if lot of people do scan together there is no DDOS attack, this way the probability to overload a single network is greatly reduced. Although each successive probe follows a strict algorithmic sequence, the IP numbers randomly bounce around the IPv4 address space. Thus, we don’t get thousands of probes delivered in on a single subnet at the same time.

Because of these reasons with ZMap we can scan about 3.7 billion addresses available for use in IPv4 addresses, in an hour thus ZMap really can crawl across the entire internet.

 

ZMap-Scanner
ZMap-Scanner

 

By default, ZMap will execute a TCP SYN scan on the particular port at the maximum rate possible. A more different configuration will be to scan 10,000 random addresses on port 80 at a maximum 10 Mbps and can be run as follows:

$ ZMap –bandwidth=10M –target-port=80 –max-targets=10000 –output-file=results.csv

You can also use ZMap to scan specific subnets or CIDR blocks. For instance, to scan only 10.0.0.0/8 and 192.168.0.0/16 on port 80, run:

ZMap -p 80 -o results.csv 10.0.0.0/8 192.168.0.0/16

As per cyber security services expert, normally when we use ZMap, it will deliver a list of distinct IP addresses that answered successfully (e.g. with a SYN ACK packet). Also it is recommended to use a blacklist file, with which you can exclude both reserved/unallocated IP space (e.g. multicast, RFC1918), as well as companies or military networks that should be excluded from your scans. By default, ZMap will employ a simple blacklist file having reserved and unallocated addresses and this file can be found in /etc/ZMap/blacklist.conf.

MASSCAN: Mass IP port scanner

Masscan is one of the fastest Internet port scanner as it can scan the all the IP’s of the Internet in less than 6 minutes, while transmitting 10 million packets per second mentions ethical hacking training professor. It produces output similar to Nmap and employs asynchronous transmission. The only big difference is that Masscan is faster than these other scanners. Also, it’s more flexible, allowing arbitrary address ranges and port ranges. Masscan uses a its own custom TCP/IP stack which means anything other than simple port scans will cause inconsistency with the local TCP/IP stack. This means we should either use the -S option to use a separate IP address, or configure your operating system to firewall the ports that Masscan uses.

While Linux is the primary platform on which Masscan works, the code runs well on many other operating systems like:

  • Windows w/ Visual Studio
  • Windows w/ MingGW
  • Windows w/ cygwin
  • Mac OS X /w XCode
  • Mac OS X /w cmdline
  • FreeBSD

To reach beyond two million packets per second, we need an Intel 10-gbps Ethernet adapter and a special driver called as “PF_RING DNA”. Masscan doesn’t need to be rebuilt in order to use PF_RING. To use PF_RING, you need to build the following components:

  • libpfring.so (installed in /usr/lib/libpfring.so)
  • pf_ring.ko (their kernel driver)
  • ixgbe.ko (their version of the Intel 10-gbps Ethernet driver)

 

Masscan-Scanner
Masscan-Scanner

 

Masscan can be used to for different purposes than just detect whether ports are open as per cyber security services experts. It can also be used to complete the TCP connection and interaction with the application at that port in order to grab simple “banner” information. The trouble with this is that Masscan contains its own custom TCP/IP stack separate from the operating system you run it on. When the local system accepts a SYN-ACK from the probed target machines, it replys with a RST packet that kills the connection before Masscan can grab the banner. The easiest way to stop this is to allocate Masscan a separate IP address.

How to scan the entire Internet

The software is designed really with the entire Internet, while it is also very useful for smaller, internal networks. When you run it for the internet, it might look something like this:

# masscan 0.0.0.0/0 -p0-65535

It is very bad to scan the entire Internet. For one thing, some organizations of the Internet react badly to being scanned. For another thing, some websites track scans and can add you to a blacklist, which will get you, firewalled from useful websites of the Internet. Therefore, it sis suggested to exclude a lot of IP ranges. To exclude IP ranges, you want to use the following syntax:

# masscan 0.0.0.0/0 -p0-65535 –excludefile exclude.txt

 

Scanrand

Scanrand is a high speed port scanner, route-tracer and very efficient in scanning explains ethical hacking training professor of international institute o cyber security. It is a fast network scanner that can scan single hosts to very large networks easily. Scanrand supports what is called stateless TCP scanning, which sets it apart from the other network scanners. Scanrand takes a different approach than the typical network scanner and implements more of a, ‘fire and forget’ ideology using little math.

 

Scanrand-Scanner
Scanrand-Scanner

 

Scanrand divides itself up into two processes. One process is accountable for doing nothing but sending out SYN packets using libnet. The other process is accountable for getting the responses from the remote computers using libpcap. One significant thing to note here is that these processes work separately. There is no consulting with the other process. Scanrand stores a list of IP addresses it is expecting a response from and the sending process does not wait for a response at all. It fires off a SYN, and then moves on to the next target leaving the receiving process to sort out the inundation of responses.

 

Unicornscan

Unicornscan is an open source (GPL) tool and intended to assist with information gathering and security auditing. As we all know that Nmap sets the standard for port scanning on both windows and UNIX systems. Nevertheless full range UDP and TCP port scans (65k ports) take a long time to finish. Unicornscan resolves this problem and excels at speed. Unicornscan is an asynchronous stateless port scanner that implements its own TCP/IP stack. Unicornscan passes the ports that are found to Nmap and/or Amap for further analysis.

 

unicorn-scan
unicorn-scan

 

Scanning Best Practices

Cyber security audit services experts offer these advices for researchers performing Internet-wide scans as guidelines for good Internet citizenship.

  • Organize closely with local network administrators to diminish the risks and handle inquiries.
  • Authenticate that scans will not overload the local network or upstream provider.
  • Indicate the nature of the scans in web pages and DNS entries of the source addresses.
  • Plainly explain the reason and scope of the scans in all interactions.
  • Provide a simple form of opting out and honor requests promptly.
  • Perform scans no larger or more frequent than is necessary for research objectives.
  • Distribute scan traffic over time or source addresses when feasible

It should go without saying that scan researchers should abstain from exploiting vulnerabilities or accessing protected resources, and should comply with any special legal requirements in their jurisdictions.

Security concerns and ethical problems

As usual, the capacity to almost instantly find out computers and networks that have un-patched security vulnerabilities can be a good thing for researchers, but it can be used for evil gain by the hackers out there. These are for sure great tools and will doubtless be accepted by many researchers. However, such potent Internet scanners can be used by hackers for malicious behavior such as vulnerability detection and exploitation. The only thing a hacker needs is a potent machine and a network with a high upload speed. Nowadays, these requirements can be easily fulfilled by a cloud virtual machine. The presence of these tools proves also that the time window between the presence of detection of vulnerability and its detection by hackers is getting shorter day by day. For this reason, it is important to properly secure your own infrastructure and protect personal/business data.

Ethical hacking training professor advices that these tools should be tools should be used cautiously without invading someone else’s privacy as anybody can use them.

 

Source: https://www.iicybersecurity.com/internet-port-scanner.html

The post How to scan whole Internet 3.7 billion IP addresses in few minutes? appeared first on Information Security Newspaper | Hacking News.

]]>