Home

Awesome

<p align="center"> <img src="https://i.imgur.com/kaY6nqc.jpg"> </p>

The Cartographer

What is it

Cartographer is a linux kernel module that is able to modify and hide linux memory maps from userspace.

Update for Kernel >= 5.7

Kernel 5.7 stops the export of kallsyms functions and has forced us to change the way we get symbol addresses.

The new method by heep requires Kernel 5.0 or higher and uses the livepatcher feature.

System Requirements

Your distro provider probably put a list of your config options in /boot/config*, there's a good chance your kernel already has these options, but if it does not, you'll have to rebuild from source.

Build Instructions

AUR Installation

How to Use

You can see all the output Cartographer makes in the kernel log with dmesg --follow or if you don't have dmesg, tail -f the appropriate log in /var/log

After you have built Cartographer, you will need to load it. Since it is a kernel module, it has to be done by root.

sudo insmod cartographer_module.ko

Cartographer is very verbose and should tell you in the logs if something went wrong.

After the module is loaded, it is now ready for commands.

Commands for Cartographer

When the module is loaded, it creates a file in /proc/ (/proc/cartographer) that handles all input. ( see PROC_FILENAME in the code if you wish to change this ).

Note: Only the root user is allowed to send input to Cartographer.

Commands are sent to Cartogarpher like this [root@localhost]# echo "$COMMAND ..." > /proc/cartographer

The following commands are recognized by the program.

To unload the module, use rmmod cartographer ( as root still ). All features will be disabled.

Example

I'll show you an example of removeentry. First set the target library( this is just some random one I picked )

echo "settarget libgio-2.0.so.0.5800.2" > /proc/cartographer

Then enable the feature

echo "removeentry" > /proc/cartographer

Before:

<p align="center"> <img src="https://i.imgur.com/fISekdt.png"> </p>

After:

<p align="center"> <img src="https://i.imgur.com/Mr2Pak1.png"> </p>

Credits

-Alexey Lozovsky - For his series of articles part1 about ftrace and hooking with ftrace along with code snippets that I used in this project.

-Heep for the Idea of changing maps this way, and for the new livepatch symbol resolving method.

-telans for the AUR package.