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

Markdown to PDF – quick howto for linux users (Ubuntu)

This is a quick howto guide showing how to create beautiful PDF files from Markdown format text files using a single command line in your linux (Ubuntu) terminal. If you need to convert files from one markup format into another, then it can be your swiss-army knife. Many thanks to pandoc creators! 1. Install tools sudo apt-get install … Read more

Arduino – LED logarithmic fade

Yet another Arduino LED fade effect. Similar to Arduino – LED linear fade. However, this one is using logarithmic scale for the delay time. It gives a nice “breathing” LED light effect. With properly adjusted settings it can look like a sleep LED effect in a macbook. This example Arduino project lights the basic LED connected in series with … Read more

Arduino – LED linear fade

This article explains how to make an example Arduino project that lights the basic LED (connected in series with resistor to pin 11) using linear fade effect. To build a nice fade effect you need to know how to change the LED brightness, first. The complete code is also on GitHub, here. Linear Fade effect changes the LED brightness … Read more