Skip to content
KitploitKITPLOIT
OutilsBlog
Soumettre
OutilsBlog
Soumettre

Outils de Hacking, PenTest et Cybersécurité pour votre Arsenal de Sécurité !

Kitploit est un répertoire d'outils de hacking, de cybersécurité et de pentesting. Découvrez les dernières mises à jour des projets pour trouver des vulnérabilités, analyser des systèmes, automatiser les tests et renforcer votre sécurité.

··Flux·Contact·Confidentialité·© 2026 Kitploit

Répertoire d'outils

Catégories

Voir toutes les catégories
Loading categories
bochs_linux_kernel_debugging — Outils de débogage du noyau Linux sur Bochs (incluant les symboles, le débogueur natif Bochs et IDA PRO) | Kitploit
Outils/GitHubGitHub/therealdreg/bochs_linux_kernel_debugging
Rétro-ingénierieDébogueursAnalyse de BinairesApprentissage et Éducation
GitHubtherealdreg/bochs_linux_kernel_debugging

bochs_linux_kernel_debugging

Outils de débogage du noyau Linux sur Bochs (incluant les symboles, le débogueur natif Bochs et IDA PRO)

Voir le dépôt

Populaires

Voir tout →

Découvrez les outils les plus utilisés par notre communauté.

Explorer tous les outils

Parcourez notre collection d'outils

Voir tous les outils →
Partager
Site web
339il y a 3 ansVérifié par Kitploit

bochs_linux_kernel_debugging

Outils pour le débogage du noyau Linux sur Bochs (y compris les symboles, le débogueur natif Bochs et IDA PRO)

linux_idt_disas_syscall

bochs_ida_pro_linux_kernel_debug

Générer un fichier de symboles pour le débogage du noyau Linux

Suivez les étapes ci-dessous :

0- Générer un fichier d'informations de débogage au format nm

Utilisez simplement la commande nm sur l'image du noyau de débogage, exemple pour Debian :

1- Installez l'image dbg

root@kitploit:~
root@debian# apt-get install linux-image-$(uname -r)-dbg

2- Vérifiez si nm fonctionne sur l'image dbg :

root@kitploit:~
dreg@debian# nm /usr/lib/debug/boot/vmlinux-$(uname -r) | tail
ffffffff8207d7c0 d zswap_same_filled_pages_enabled
ffffffff8262b54c b zswap_stored_pages
ffffffff8262b420 b zswap_trees
ffffffff81225df0 t zswap_update_total_size
ffffffff81226a50 t zswap_writeback_entry
ffffffff8262b538 b zswap_written_back_pages
ffffffff81c41fb8 r zswap_zpool_ops
ffffffff8207d7e0 d zswap_zpool_param_ops

3- Générez un fichier de sortie valide pour linsymtobch.py :

root@kitploit:~
dreg@debian# nm /usr/lib/debug/boot/vmlinux-$(uname -r) > nm_output.txt

Vous pouvez également utiliser/combiner d'autres types d'outils, consultez ce dépôt pour plus d'astuces :

https://github.com/therealdreg/linux_kernel_debug_disassemble_ida_vmware

  • dump_kallsyms.sh : extraire les symboles depuis /proc/kallsyms
  • vmlinuxsystemap.sh : copier le vmlinuz du noyau actuel et system.map dans le répertoire courant
  • lkmsym/dumpsyms.sh : charger pattern-finder-ring0-LKM et extraire les symboles du noyau

1- Conversion d'un fichier de sortie au format nm en symboles Bochs

Utilisez linsymtobch.py pour convertir un fichier de sortie au format nm en fichier de symboles Bochs :

root@kitploit:~
python linsymbtobch.py symbol_file.txt output_bochs_syms.txt [letter 1] [letter 2] [letter 3] .... [--verbose]

Exemple :

root@kitploit:~
./linsymtobch.py nm_output.txt output_bochs_syms.txt 

Sortie :

root@kitploit:~
https://github.com/therealdreg/bochs_linux_kernel_debugging
-
MIT LICENSE Copyright <2020>
David Reguera Garcia aka Dreg - [email protected]
http://www.fr33project.org/ - https://github.com/therealdreg

usage: python linsymbtobch.py symbol_file.txt output_bochs_syms.txt [letter 1] [letter 2] [letter 3] .... [--verbose]

where letters can be empty for all symbols or a combination:

If lowercase, the symbol is local; if uppercase, the symbol is global (external).
------------------------------------
"A" The symbol's value is absolute, and will not be changed by further linking.

"B" "b" The symbol is in the uninitialized data section (known as BSS ).

"C" The symbol is common. Common symbols are uninitialized data. When linking, multiple common symbols may appear with the same name. If the symbol is defined anywhere, the common symbols are treated as undefined references.

"D" "d" The symbol is in the initialized data section.

"G" "g" The symbol is in an initialized data section for small objects. Some object file formats permit more efficient access to small data objects, such as a global int variable as opposed to a large global array.

"i" For PE format files this indicates that the symbol is in a section specific to the implementation of DLLs. For ELF format files this indicates that the symbol is an indirect function. This is a GNU extension to the standard set of ELF symbol types. It indicates a symbol which if referenced by a relocation does not evaluate to its address, but instead must be invoked at runtime. The runtime execution will then return the value to be used in the relocation.

"N" The symbol is a debugging symbol.

"p" The symbols is in a stack unwind section.

"R" "r" The symbol is in a read only data section.

"S" "s" The symbol is in an uninitialized data section for small objects.

"T" "t" The symbol is in the text (code) section.

"U" The symbol is undefined.

"u" The symbol is a unique global symbol. This is a GNU extension to the standard set of ELF symbol bindings. For such a symbol the dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use.

"V" "v" The symbol is a weak object. When a weak defined symbol is linked with a normal defined symbol, the normal defined symbol is used with no error. When a weak undefined symbol is linked and the symbol is not defined, the value of the weak symbol becomes zero with no error. On some systems, uppercase indicates that a default value has been specified.

"W" "w" The symbol is a weak symbol that has not been specifically tagged as a weak object symbol. When a weak defined symbol is linked with a normal defined symbol, the normal defined symbol is used with no error. When a weak undefined symbol is linked and the symbol is not defined, the value of the symbol is determined in a system-specific manner without error. On some systems, uppercase indicates that a default value has been specified.

"-" The symbol is a stabs symbol in an a.out object file. In this case, the next values printed are the stabs other field, the stabs desc field, and the stab type. Stabs symbols are used to hold debugging information.

"?" The symbol type is unknown, or object file format specific.
------------------------------------

0xffffffff81412a30 T_aa_af_perm
0xffffffff813ff4f0 T_aa_alloc_profile
0xffffffff8140c420 T_aa_alloc_proxy
0xffffffff82c71f0d T_aa_alloc_root_ns
0xffffffff81409e20 T_aa_alloc_secid
0xffffffff813f7bc0 T_aa_apply_modes_to_perms
0xffffffff813f6030 T_aa_audit
0xffffffff8140a210 T_aa_audit_file
0xffffffff813f6010 T_aa_audit_msg

...

done!

        total symbols written: 115131
        total letters written: A B D R T V W a b d r t
          total letters found: A B D R T V W a b d r t

Exemple de filtrage de certains symboles :

root@kitploit:~
./linsymtobch.py nm_output.txt output_bochs_syms.txt T V d 

2- Charger le fichier de symboles dans le débogueur Bochs

Chargez le fichier généré dans le débogueur Bochs avec "ldsym global", exemple :

root@kitploit:~
ldsym global "C:\Users\leno\Desktop\bochs_linux_kernel_debugging\output_bochs_syms.txt"

Terminé ! Testez si les symboles fonctionnent en exécutant quelques commandes dans le débogueur Bochs :

  • info idt
  • u /10
  • ...

linux_idt_disas_syscall

Comment utiliser le fichier de symboles Bochs dans le débogueur Local Bochs d'IDA PRO

Modifiez "C:\Program Files\IDA Pro 7.7\cfg\dbg_bochs.cfg"

root@kitploit:~
BOCHSDBG = "C:\\Users\\leno\\Desktop\\Bochs-pruebas\\bochs\\bochs.exe";
BOCHSRC = "C:\\Users\\leno\\Desktop\\Bochs-pruebas\\bochs\\.bochsrc";

Allez dans IDA .....

Debugger -> Run -> Local Bochs Debugger

Application :

root@kitploit:~
C:\Users\leno\Desktop\Bochs-pruebas\bochs\.bochsrc

Cliquez sur Debug Options -> Set specific options -> Select Disk image

Téléchargez ida_load_names.py depuis ce dépôt :

https://github.com/therealdreg/symseghelper

Ouvrez IDA PRO, démarrez une session de débogage Bochs et allez dans File -> Script File

Sélectionnez ida_load_names.py, ce script vous demande le fichier de symboles Bochs généré

Terminé !

Après cela, vous pouvez également charger les symboles dans le débogueur natif Bochs (il s'exécute dans IDA PRO). Sélectionnez simplement Bochs dans la ligne de commande IDA et exécutez "ldsym global"

IDA PRO avec les symboles Bochs (ida_load_names.py) + le débogueur natif Bochs avec les symboles (ldsym global), le meilleur des deux mondes :

bochs_ida_pro_linux_kernel_debug_and_native

AVERTISSEMENT : votre propre instrumentation Bochs peut causer des problèmes sur IDA PRO Local Bochs

Voir aussi

Scripts d'assistance pour le débogage Windows avec symboles pour Bochs et IDA Pro (fichiers PDB). Très pratiques pour le mode utilisateur <--> mode noyau :

  • https://github.com/therealdreg/symseghelper

Script d'assistance pour le débogage du noyau Linux avec IDA Pro sur VMware + stub GDB (y compris quelques utilitaires de symboles) :

  • https://github.com/therealdreg/linux_kernel_debug_disassemble_ida_vmware

Extraction des symboles PDB incluant la prise en charge du format de débogage Bochs (avec prise en charge de Wine) :

  • https://github.com/therealdreg/pdbdump_bochs

Script d'assistance pour le débogage du noyau Windows avec IDA Pro sur le débogueur natif Bochs :

  • https://github.com/therealdreg/ida_bochs_windows
Télécharger l’outil