Monday, June 29, 2015

How to Decrypt 802.11

How to Decrypt 802.11

Wireshark can decrypt WEP and WPA/WPA2 in pre-shared (or personal) mode. WPA/WPA2 enterprise mode decryption is not yet supported.
You can add decryption keys using Wireshark's 802.11 preferences or by using the wireless toolbar. Up to 64 keys are supported.

Adding Keys: 802.11 Preferences

Go to Edit->Preferences->IEEE 802.11. You should see a window that looks like this:
dot11-wep-wpa.png
Note that the key examples mention WPA, and that each key item is labeled "Key". If your preferences window doesn't mention WPA, like this
dot11-wep-only.png
then your version of Wireshark only supports WEP decryption. This might be the case with older versions of Wireshark, particularly the 64-bit Windows version.
In all versions WEP keys can be specified as a string of hexadecimal numbers, with or without colons:
    a1:b2:c3:d4:e5
    0102030405060708090a0b0c0d
In versions that support WPA decryption you should use a prefix to tell Wireshark what kind of key you're using:
  • wep The key is parsed as a WEP key.
    wep:a1:b2:c3:d4:e5
  • wpa-pwd The password and SSID are used to create a raw pre-shared key.
    wpa-pwd:MyPassword:MySSID
  • wpa-psk The key is parsed as a raw pre-shared key.
    wpa-psk:0102030405060708091011...6061626364

Tuesday, June 23, 2015

malloc returns NULL

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>

int main()
{
    char *ptr = NULL;
    ptr = malloc(SIZE_MAX);
    if (ptr == NULL)
        printf("memory allocation failed\n");
    else
        printf("memory allocation success\n");
}

Where SIZE_MAX is defines as

/* Limit of `size_t' type.  */
# if __WORDSIZE == 64
#  define SIZE_MAX      (18446744073709551615UL)
# else
#  define SIZE_MAX      (4294967295U)
# endif
 

Wednesday, June 10, 2015

iperf to multicast addreses

Following is the way to iperf data to multicast addresses.



1.Add multicast addresses to all STA(AP and STA connected) as below
        route add -net 224.0.0.0/4 dev eth0
2.At server
                Iperf –s –u –B 224.0.0.13 –I 1
3.client side
                Iperf –c 224.0.0.13 –u 1 1000 –T 5 –I 1
4.To delete route for multicast addresses.
        route del -net 224.0.0.0/4 dev eth0