How to disable and / or enable ICMP ping from Linux host ?

To disable the ICMP ping from certain linux host, lets say which has IP of 192.168.0.100 use below command, Type below command on the console of linux PC on which you are trying to enable / disable the ping. $ sudo iptables -A INPUT -p icmp –icmp-type any -j REJECT $ sudo iptables -A OUTPUT … Read more

Understanding wireless beacon packet ( captured using pcap API’s )

As per Wikipedia, Beacon frame is one of the management frames in IEEE 802.11 based WLANs. It contains all the information about the network. Beacon frames are transmitted periodically, they serve to announce the presence of a wireless LAN and to synchronise the members of the service set. Beacon frames are transmitted by the access point (AP) in an infrastructure basic … Read more

Understanding pcap file format – part I – Global Header

The file must begin with a Section Header Block.  Below is typical configuration, with a single Section Header that covers the whole file. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SHB v1.0 | Data | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Typical configuration with a single Section Header Block The Section Header Block is mandatory. It identifies the beginning of a section of the capture dump … Read more

How to get mac-id using ipaddress in linux

Make sure you ping that IP atleast once so this can get address into ARP table. $ ping -c 1 192.168.1.105 PING 192.168.1.105 (192.168.1.105) 56(84) bytes of data.64 bytes from 192.168.1.105: icmp_seq=1 ttl=128 time=4.68 ms— 192.168.1.105 ping statistics —1 packets transmitted, 1 received, 0% packet loss, time 0msrtt min/avg/max/mdev = 4.681/4.681/4.681/0.000 ms Now user arp … Read more

Wi-Fi Initial Communication between device and access point

Following diagram shows the initial handshaking between the device ( like mobile ) and wireless access-point ( AP ) in open access mode and secured ( e.g. WPA ) mode, Authentication frame ( in open access ): 802.11 authentication is a process whereby the access point either accepts or rejects the identity of a radio … Read more

iwlist – Get detailed information from a wireless interface

Iwlist is used to display some additional information from a wireless network interface that is not displayed by iwconfig. The main argument is used to select a category of information, iwlist displays in detailed form all information related to this category, including information already shown by iwconfig Make sure your machine’s WiFi is turned on … Read more

How to Install Apache Tomcat on Ubuntu

$ sudo apt-get install openjdk-8-jdk Downoad apache tomcat 8 from website https://tomcat.apache.org/download-80.cgi , this can be downloaded as below, $ wget -c https://mirrors.estointernet.in/apache/tomcat/tomcat-8/v8.5.53/bin/apache-tomcat-8.5.53.tar.gz $ tar xvf apache-tomcat-8.5.53.tar.gz $ mv apache-tomcat-8.5.53 tomcat Now, we need to export the following parameters, for this we can create the script as, $ vim setenv.sh we need to source the … Read more

C program to read mac address using WiFi interface name

If you need to get the mac address of certain wifi interface using C program, you can use the below program. This program should work on any Linux as well as Android platforms. $ vim read_wifi_mac.c Now, you can compile and run the program as, $ gcc -o read_wifi_mac read_wifi_mac.c $ ./read_wifi_mac