Capturing WiFi Beacon Frames, Probe Requests and Probe Responses in Python with Scapy

WiFi is almost everywhere. Wherever you go there are WiFi packets emitted by smartphones, tablets, computers, access-points, etc. All WiFi packets “flying” around are divided into four main groups (802.11 Frame Types) – management, data, control and extension. In this article we will take care of capturing some interesting subtype packets of management group (Beacon … Read more

Fast string to integer conversion (C/C++)

This article presents a few fast and lightweight implementations of conversion from ASCII string to integer. It can be an interesting fit to use in a small microcontrollers like for example ATtiny13, which resources are very limited. All presented functions are simplified and require a null-terminated array of chars as an argument. Convert string to … Read more

Packet sniffer in Python with Scapy

The common method of making a packet sniffer in User-Space is to use low-level operations on RAW sockets. But, instead of that, you can just use a powerful Python library – Scapy (see documentation), which exposes a user-friendly high level API. So, it hides all unfortunately low-level abstraction which we don’t really like in Python. … Read more

Fast string comparison for microcontrollers (C/C++)

This short article presents trivial but fast and memory efficient function to compare two strings. Function returns “0” (zero) on success (strings are the same), otherwise function returns the position where different characters occurred. Example code #include <stdint.h> #include <assert.h> static int8_t xstrcmp(const char *s1, const char *s2) { while(*s1 != ‘\0’ && *s1 == … Read more

How to add custom section to ELF file?

All linux binary applications have a common ELF format (Executable and Linking Format). This format consist of header and variouse sections (see ELF Specification). The ELF allows you to attach custom sections with some extra user-data. It means that you can hide some usefull information inside a binary file (like library for example). Why you … Read more