Calling C from Python

Python C

Whatever the reason you would like to call C functions from Python, one approach is presented here and consists in creating a C dynamic library, compiled as a .so module and accessing the library thanks to the ctypes package of Python. Explanations are given step by step and stand for a Linux environment (tested with Ubuntu20.04).

Creating a dynamic library in C


C libraries are handy for distribution of programming work or for structuring a large development into units. In the specific case of Python programming, a C dynamic library can be a solution for a missing Python equivalent or if performance in execution time is a concern. We explain hereunder with an example the steps necessary to write a dynamic (shared) C library in Linux (tested on Ubuntu20.04). Another blog describes how to call a C dynamic library from Python ([]).

How (and why) to use TeX Live


LaTeX may be almost 40 years old now (first release dates from 1984), it is still a very active ecosystem. On CTAN, more than 100 packages are created or updated every month. To get the best results for your book or paper, you should keep your LaTeX packages updated. This is precisely the goal of TeX Live...

ssh-agent and ssh-add


You probably use ssh on a regular basis. It's easy and powerful. But once in a while you might be confronted to ssh utility tools like ssh-agent and ssh-add. What are these, and what are they used for?

Mitre Att&ck in Practice - Part I : Navigator & Atomic Red Team

Tools Offensive Security Red Teaming

One of our previous blog post presented the Mitre Att&ck Framework and the associated Mitre Att&ck Matrix. This post is the first of a set of three that will present how to link the Mitre Framework with open source tools to design and test offensive actions in practice.

We are looking for a new colleague!

News Jobs

This year we are starting a new project entitled "Using blockchain to secure the software supply chain". To work on this project, we are hiring a new researcher in cyberdefense.

Build and store Docker images with GitLab

GitLab Docker

With GitLab, you can add a job to your pipeline to build Docker images, and push them to the built-in container registry. Here is how...

Getting started with Ansible


Ansible is an extremely powerful configuration management system. Ansible is able to perform a wide range of tasks on a large and heterogeneous ensemble of devices. Indeed, it relies on a system of modules (plugins) that allow to perform different tasks like software provisioning, system and application configuration management, application-deployment etc. Moreover, Ansible modules exist to manage a wide variety of devices like Linux and Windows computers, but also network equipment like switches and routers, kubernetes clusters and other cloud services like AWS, GCE and Azure. For this reasons, Ansible is sometimes coined as an infrastructure automation engine.

File upload, validation and storage with Laravel

Laravel Cyrange

Laravel is a powerful framework, that offers all functionalities required to implement file upload, validation and storage. Here is a complete and concrete example.

Syntax highlighting with prism.js for your Laravel application


Prism is a light and easy javascript library that allows to integrate code highlighting in your web application. Here is how to install and use it with Laravel...

A light NAT router and DHCP server with Alpine Linux

Cyber Range Sysadmin Cyrange

Alpine Linux is a very light Linux distribution, that can run with less than 100MB of harddisk space. Here is how to configure Alpine Linux to run as a NAT router and DHCP server.

Network reconnaissance with arp-scan

Offensive Security

arp-scan is a simple tool that can be used list the IP addresses (and devices) used in a network. It works by sender ARP 'who-has' requests for every IP address of the subnet. If the IP address is used by a device, it will reply with an ARP 'reply' packet.

This website uses cookies. More information about the use of cookies is available in the cookies policy.