Published 2025-06-05
Keywords
- cmk rootkit,
- syslogk,
- magic packets,
- botnet,
- Netfilter
Copyright (c) 2024 David Álvarez Pérez, Manuel Fernández-Veiga (Author)

This work is licensed under a Creative Commons Attribution 4.0 International License.
How to Cite
Download Citation
Abstract
The present paper analyzes the CMK Linux Kernel Rootkit. It demonstrates that it is possible to unpack the rootkit using emulation to avoid inserting the module in a real Linux distribution matching specific Linux kernel requirements. CMK Rootkit implements "magic packets", this study also demonstrates that it is possible to extract the requirements for the "magic packets" based on assembly language patterns. We provide the implementation for both, the Linux kernel rootkit unpacker and a Ghidra script for extracting the requirements of the "magic packets".
References
- “Reptile Rootkit. github repository of the project.”
- https://github.com/f0rb1dd3n/Reptile.
- “Rootkit. nist glossary of terms..” https://csrc.nist.gov/glossary/term/rootkit.
- “Rootkits. enisa incident response glossary of terms..” https://www.enisa.europa.eu/topics/incident-response/glossary/rootkits.
- “Reptile Rootkit. 36/61 av engine detectionsw in virustotal.” https://www.virustotal.com/gui/file/cbe9107185c8e42140dbd1294d8c20849134dd122cc64348f1bfcc90401379ec/detection. Accessed: 2024-01-07.
- “Virustotal.” https://www.virustotal.com/.
- T. Brosch and M. Morgenstern, “Runtime packers: The hidden problem,” Black Hat USA, 2006.
- “CMK Rootit detections (10/12/2022).” https://www.virustotal.com/gui/file/54d8b09ffc15c657abf29a0c313b377df64988848f2c3814243b2478b4b881cc/detection.
- D. Alvarez-Perez, “Syslogk Rootkit. executing bots via "magic packets",” The Journal on Cybercrime & Digital Investigations, vol. 8, 2023.
- “Linux Threat Hunting ‘syslogk’ a kernel rootkit found under development in the wild.” https://decoded.avast.io/davidalvarez/linux-threat-hunting-syslogk-a-kernel-rootkit-found-under-development-in-the-wild/.
- Y. Dong, Z. Li, Y. Tian, C. Sun, M. W. Godfrey, and M. Nagappan, “Bash in the wild: Language usage, code smells, and bugs,” ACM Trans. Softw. Eng. Methodol., vol. 32, feb 2023.
- “systemd-hwdb. linux hardware database management tool.” https://man7.org/linux/man-pages/man8/systemd-hwdb.8.html.
- “pkill user command. oracle solaris 11.2 documentation.” https://docs.oracle.com/cd/E36784_01/html/E36870/pkill-1.html.
- “systemd-journald.service linux manual page.” https://man7.org/linux/man-pages/man8/systemd-journald.service.8.html.
- “insmod linux manual page..” https://man7.org/linux/man-pages/man8/insmod.8.html.
- “Linux Kernel. reproducible builds..” https://docs.kernel.org/kbuild/reproducible-builds.html.
- “R. Love, Linux Kernel Development: Linux kerneldevelopment _p3. pearson education, 2010..”
- “Debian 8.11 Jessie. press release.” https://www.debian.org/News/2015/20150426.
- A. Devi and G. Aggarwal, “Manual unpacking ofupx packed executable using ollydbg and importrec,” IOSR Journal of Computer Engineering,vol. 16, no. 1, pp. 71–77, 2014.
- F. Desclaux, “Miasm: Framework de reverse engineering,” Actes du SSTIC. SSTIC, 2012.
- “MIASM reverse engineering framework.” https://github.com/cea-sec/miasm.
- P. C. T. Ðang, M. S. Phan, and M. H. Phan, Building a Binary De-obfuscation Tool with Miasm Framework. PhD thesis, 2021.
- “sysinitmodule linux documentation.” https://man7.org/linux/man-pages/man2/init_module.2.html.
- “kallsymsoneachsymbol linux kernel documentation.” https://lore.kernel.org/all/20200221114404.14641-1-will@kernel.org/#rl.
- R. Rosen and R. Rosen, “Netfilter,” Linux Kernel Networking: Implementation and Theory, pp. 247278, 2014.
- J. Engelhardt and N. Bouliane, “Writing netfilter modules,” Revised, February, vol. 7, 2011.
- “Linux Kernel documentation. workqueues and kevents..” https://www.kernel.org/doc/html/v4.13/driver-api/basics.html#workqueues-and-kevents.
- “Out-of-sight-out-of-mind-rootkit linux kernel rootkit..” https://github.com/NinnOgTonic/Out-of-Sight-Out-of-Mind-Rootkit/blob/master/osom.c#L211. Accessed: 2023-02-26.
- J. Magnusson, “Survey and analysis of dns filtering components,” arXiv preprint arXiv:2401.03864, 2024.
- J. Junnila, “Effectiveness of linux rootkit detection tools,” Master’s thesis, J. Junnila, 2020.
- “Nick Newson Linux Kernel Rootkit.” https://github.com/nnewson/km/blob/master/src/rootkit.c.
- “Linux Kernel documentation, sysfs_unlink_sibling.” https://lore.kernel.org/netdev/m1lk0iihhp.fsf_-_@frodo.ebiederm.org/raw.
- “Linux Kernel documentation, sysfs_link_sibling.” https://lkml.kernel.org/netdev/20091029233848.GV3141@kvack.org/.
- “Linux Kernel documentation, kernfs_link_sibling.” https://lore.kernel.org/lkml/747aee3255e7a07168557f29ad962e34e9cb964b.camel@themaw.net/.
- “snprintf, _snprintf, _snprintf_l, _snwprintf, _snwprintf_l microsoft documentation.” https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/snprintf-snprintf-snprintf-l-snwprintf-snwprintf-l?view=msvc-170.
- “Linux Kernel documentation, call_usermodehelper.” https://archive.kernel.org/oldlinux/htmldocs/kernel-api/API-call-usermodehelper.html.
- D. Andriesse, Practical binary analysis: build your own Linux tools for binary instrumentation, analysis, and disassembly. no starch press, 2018.
- P. Guide, “Intel® 64 and ia-32 architectures software developer’s manual,” Volume 3B: system programming guide, Part, vol. 2, no. 11, pp. 1–64, 2011.
- “Linux Kernel documentation. filldir..” https://lore.kernel.org/lkml/lsq.1578512578.759211401@decadent.org.uk/.
- “The Linux Documentation Project. chapter 8. system calls..” https://tldp.org/LDP/lkmpg/2.4/html/c937.htm.
- “KUnkillable github repository.” https://github.com/spiderpig1297/kunkillable.
- I. A. Ilya V. Matveychikov, “Linux kernel rootkits advanced techniques,” 2018.
- “A collection of Linux kernel rootkits. linux rootkits..” https://github.com/R3x/linux-rootkits.
- R. Rosen, Linux kernel networking: Implementation and theory. Apress, 2014.
- E. Eliando and A. B. Warsito, “Lockbit black ransomware on reverse shell: Analysis of infection,”CogITo Smart Journal, vol. 9, no. 2, pp. 228–240, 2023.
- H. Sharma and H. Singh, Hands-on red team tactics: a practical guide to mastering red team operations. Packt Publishing Ltd, 2018.
- K. Thang and A. Nyberg, “Impact of fixed-rate fingerprinting defense on cloud gaming experience,” 2023.
- N. Gandotra and L. S. Sharma, “Exploring the use of iptables as an application layer firewall,” Journal of The Institution of Engineers (India): Series B, vol. 101, pp. 707–715, 2020.
- “KoviD github repository.” https://github.com/carloslack/KoviD
- F. Wang and Y. Shoshitaishvili, “Angr-the next generation of binary analysis,” in 2017 IEEE Cybersecurity Development (SecDev), pp. 8–9, IEEE, 2017.
- “Angr open-source binary analysis platform for python.” https://angr.io/.
- X. Zhang, C. Zhang, X. Li, Z. Du, Y. Li, Y. Zheng, Y. Li, B. Mao, Y. Liu, and R. H. Deng, “A survey of protocol fuzzing,” arXiv preprint arXiv:2401.01568, 2024.
- B. T. ODEHNAL, “Port block allocation for network address translation,”
- “Linux Kernel documentation. skbuff..” https://docs.kernel.org/networking/skbuff.html.
- A. David, Ghidra Software Reverse Engineering for Beginners: Analyze, identify, and avoid malicious code and potential threats in your networks and systems. Packt Publishing Ltd, 2021.
- C. Eagle and K. Nance, The Ghidra Book: The Definitive Guide. no starch press, 2020.
- “Ghidra a software reverse engineering (sre) suite of tools developed by nsa’s research directorate in support of the cybersecurity mission.” https: //ghidra-sre.org/.
- T. Æ. Mogensen, “Machine-code generation,” in Introduction to Compiler Design, pp. 161–172, Springer, 2024.
- “Kernel Probes documentation..” https://docs.kernel.org/trace/kprobes.html. Accessed: 2023-02-26.
- “R. Krishnakumar, Kernel korner: kprobes-a kernel debugger, linux journal, vol. 2005, no. 133, p. 11, 2005..”
- “Spotify KProbes examples linux kernel module..” https://github.com/spotify/linux/tree/ma
- ster/samples/kprobes. accessed: 2023-02-26.
- “Kprobes. blacklisted functions.” https://docs.kernel.org/trace/kprobes.html#kprobes-blacklist. Accessed: 2024-01-07.