Scripted Cache AnyThing - HTTPS included - in Python with mitmproxy

The last article demonstrated how we could simply make any https flow going out a virtual bridge network interface through mitmproxy to cache anything. In this article, we’ll focus on the logic to “cache anything” from within our mitmproxy script. Design We’d like each fetched file to be stored in a directory as is to make it easy to tweak the cached content: remove a file from the cache directory to force the proxy to re-fetch it, fill the cache directory with your own files, have the cache directory mountable in a memory (ie. [Read More]

Scripted MITM AnyThing in Python with mitmproxy

This article describes how to get a working transparent HTTP/HTTPS proxy which you can script in Python. I intend to use it to have custom caching and be able to abstract away all HTTP/HTTPS connections made in my LXC containers which are spawned by CI to be able to test deployment scripts even when internet is down. A nice journey ;) First, install mitmproxy with pip: pip install mitmproxy mitmproxy documentation describes the iptables commands to intercept Assuming you have LXC with Nat. [Read More]

YourLabs Arch Linux Package Repository

Today is the grand openning of our Arch Linux package repository, with the release of postgresql-bdr. It’s a patched PostgreSQL server with BiDirectionnal Replication which seems too good to be true. I ran split brain tests and it reacted amazingly well, although it needs all nodes to be up for schema updates which is ok to me because I won’t be running upgrades while I have a broken node: I’ll be working on fixing it. [Read More]

Speed up your travis-ci builds with container based infrastructure

Travis-ci just released container based infrastructure for open source repository (free users). We tried it with our apps, and you can see we had some performance increase, even on database-intensive jobs: django-autocomplete-light normal build takes around 1 hour and 35 minutes while it takes rather 1 hour and 22 minutes with container based build](https://travis-ci.org/yourlabs/django-autocomplete-light/builds/45086517) so that’s around a 10% build speed increase, pretty cool right ? read on ;) django-cities-light normal build takes around 5 hours and 45 minutes, on travis-container it takes around 3 hours and 30 minutes ! [Read More]

Install Arch Linux on a dedicated server via Ubuntu Live

In the process of making YourLabs new cloud, I ordered a first dedicated server at online.net. They don’t provide an installer for Arch Linux, but they do provide a “rescue mode” which is at this time Ubuntu 13.04 Live. Boot that and get an Arch Linux install on BtrFS with just one command: Format /dev/sda to BtrFS Partionning and install arch linux in subvolumes with just one command: ansible-playbook -i "yourhostname," -e "hostname=your_host_name" --ask-sudo-pass rescue_reinstall_arch_linux. [Read More]

Fun with debugging symbols

This article follows up with Basics of GDB debugging, focus on symbols. List symbols with nm Use the nm command to list symbols in a binary: $ nm main 0000000000600920 B __bss_start 0000000000600920 b completed.6330 0000000000600910 D __data_start 0000000000600910 W data_start 0000000000400440 t deregister_tm_clones 00000000004004b0 t __do_global_dtors_aux 00000000006006f8 t __do_global_dtors_aux_fini_array_entry 0000000000600918 D __dso_handle 0000000000600708 d _DYNAMIC 0000000000600920 D _edata 0000000000600928 B _end 00000000004005a4 T _fini 00000000004004d0 t frame_dummy 00000000006006f0 t __frame_dummy_init_array_entry 00000000004006e8 r __FRAME_END__ 00000000006008e0 d _GLOBAL_OFFSET_TABLE_ w __gmon_start__ 00000000004003a8 T _init 00000000006006f8 t __init_array_end 00000000006006f0 t __init_array_start 00000000004005b0 R _IO_stdin_used w _ITM_deregisterTMCloneTable w _ITM_registerTMCloneTable 0000000000600700 d __JCR_END__ 0000000000600700 d __JCR_LIST__ w _Jv_RegisterClasses 00000000004005a0 T __libc_csu_fini 0000000000400530 T __libc_csu_init U __libc_start_main@@GLIBC_2. [Read More]

GDB debugging basics

Introduction GDB is a debugger for executables “objects” on Linux. It will use source code and “debug symbols” if available: source code to display the code ie. corresponding to a specific frame at runtime, debug symbols to display variables and functions names like in the code. What’s the relation between security and GDB ? Well it will help finding security bugs which may be vulnerabilities to buffer overflow. [Read More]

Strace basics

This is the first of a series of articles on security and exploiting. For starters we’ll cover basic debugging tools before we get into actual exploiting because the first step to exploiting is reverse-engineering most of the time. The series targets experienced developers and tries to go straight to the point for them. Every article in this series is tagged “security”. Introduction strace is a tool that prints system calls like open, connect, etc … and signals like INT, KILL, etc … of a process. [Read More]

Better manual reader with most: the slang-pager

The default pager in most linux distributions is more. But it’s not very colorful. This article presents a more fun alternative: most. Your manual probably looks like this: Not very awesome, wouldn’t it be nicer to have it with colors ? like this: Then go ahead and install most, ie.: sudo apt-get install most Try it out: MANPAGER=most man man If you like it, set something like that in your . [Read More]
linux