How to scan devices in the IP subnet with Ping

PingScan – ICMP Ping a Range of IP Addresses and Devices in Network with Linux

If you need to determine which devices are currently connected to the network. There is a simple way using ICMP ping running in a Linux For Loop.

Run the following command using ping in a Linux Bash For Loop

$ for i in $(seq 254); do ping -c1 -W1 10.1.1.$i & done | grep from

The output from this IPv4 example looks like this.

64 bytes from 10.1.1.1: icmp_seq=1 ttl=255 time=0.528 ms
64 bytes from 10.1.1.2: icmp_seq=1 ttl=64 time=4.82 ms
64 bytes from 10.1.1.4: icmp_seq=1 ttl=64 time=0.046 ms
64 bytes from 10.1.1.5: icmp_seq=1 ttl=64 time=6.52 ms
64 bytes from 10.1.1.103: icmp_seq=1 ttl=255 time=0.295 ms
64 bytes from 10.1.1.104: icmp_seq=1 ttl=64 time=0.083 ms
64 bytes from 10.1.1.105: icmp_seq=1 ttl=64 time=0.513 ms
64 bytes from 10.1.1.106: icmp_seq=1 ttl=64 time=1.16 ms
64 bytes from 10.1.1.110: icmp_seq=1 ttl=64 time=0.485 ms

Explanation of ping parameters:

  • -c1 number of ping requests (one ping for each address).
  • -W1 time to wait for response (timeout)..

Linux ICMP Ping to scan IP addresses of devices

Instead of the Class A subnet shown above, any IPv4 class can be used in the loop, whereby after sec the corresponding number of hosts for an range can be inserted, may depending on what kind of netmask is used.

$ for i in $(seq 99 199); do ping -c1 -W1 10.1.1.$i & done | grep from
64 bytes from 10.1.1.103: icmp_seq=1 ttl=64 time=0.521 ms
64 bytes from 10.1.1.104: icmp_seq=1 ttl=255 time=0.474 ms
64 bytes from 10.1.1.105: icmp_seq=1 ttl=64 time=3.36 ms
64 bytes from 10.1.1.106: icmp_seq=1 ttl=64 time=1.37 ms
64 bytes from 10.1.1.110: icmp_seq=1 ttl=64 time=0.645 ms

  Ping sends an ICMP (Internet Control Message Protocol) echo request to a probed interface on the network and then waits for a response. After the initiator run a ping command, a ping signal is sent to a specific address. If the destination host receives the echo request, it responds by sending an echo reply packet. Here in this example ping is used to get the ICMP echo replies for a range of addresses using a For Loop applied.

Another useful alternatives to scan a subnet is to use nmap, but this tool is usually not built-in and must first be installed, if using a Debian GNU/Linux-Distribution then run sudo apt install nmap

nmap is a powerful and versatile tool to check security, but here in order not to leave the context, the command with the effect similar to ICMP echo reply results of ping works like this.

$ nmap -T5 -sP 10.1.1.1-254 | grep scan

Conclusion

This post shows how to scan whole ip subnets or ranges for devices in a simple way. Without additional tools by using the ICMP Ping command. There are certainly many other methods and commands. We limit ourselves to a few but useful examples here, may have inspired you! which of course I’m would be happy about.

How to find IP Hosts in Network using Ping

How to Check Cipher used by HTTPS Connection

Identify SSL/TLS Cipher used by an Browser HTTPS Secure Connection

When making a connection using HTTPS, either SSL or TLS will be used to encrypt the information being sent to and from the server. This connection are encrypted by Cipher algorithm and makes it very difficult for a third party to read the data packets between you received in the browser. The information is encrypted using a Cipher or encryption key, the type of Cipher used depends on the Cipher Suite installed and the preferences of the server.

This post describes how to find the Cipher used by an HTTPS browser connection, by using Microsoft Edge, Google Chrome or Mozilla Firefox, to show the current cipher suite and certificate information.

Find the Cipher in Microsoft Edge Browser

  1. Launch Microsoft Edge.
  2. Enter the URL you wish to check in the browser.
  3. Click on the three-dots on the top-right (Alt+F) in the browser.
  4. Select More tools > Developer tools > Security (Ctrl+Shift+I).

Find the Cipher in Google Chrome Browser

  1. Launch Google Chrome.
  2. Enter the URL you wish to check in the browser.
  3. Click on the three-dots on the top-right (Alt+F) in the browser.
  4. Select More tools > Developer tools > Security (Ctrl+Shift+I).

How to find the Cipher in Firefox Browser

  1. Launch Firefox.
  2. Enter the URL you wish to check in the browser.
  3. In the address bar, click the icon to the left of the URL.
  4. Now click on Connection secure > More Information.

Now see the Cipher connection in the Browser.

How to find Cipher using OpenSSL

If you are using a Linux machine and the OpenSSL library is available on the preferred system, you can run the command in the example below.

openssl s_client -connect think.unblog.ch:443 | find "Cipher"

The next command causes openssl to produce the Cipher connection without using a browser.

$ openssl s_client -verify_quiet -brief think.unblog.ch:443
depth=2 C = US, O = Internet Security Research Group, CN = ISRG Root X1
CONNECTION ESTABLISHED
Cipher Protocol version: TLSv1.3
Ciphersuite: TLS_AES_256_GCM_SHA384
Peer certificate: CN = unblog.ch
Hash used: SHA256
Signature type: RSA-PSS
Server Temp Key: X25519, 253 bits

What is Cipher Suite?

SSL is standard technology for securing an internet connection by encrypting data sent between a website and a browser (or between two servers). It prevents hackers from seeing or stealing any information transferred, including personal or financial data.

A cipher suite is a set of cryptographic algorithms. The schannel SSP implementation of the TLS/SSL protocols use algorithms from a cipher suite to create keys and encrypt information. A cipher suite specifies one algorithm for each of the following tasks: Key exchange. Cipher Browser connection.

Exit mobile version