Linux-Rootkit-Symbols-2
Part 1: What Are Symbols?
1.1 Understanding Symbols
// You write this:
int my_variable = 42;
void my_function() {
printk("Hello\n");
}
// Compiler converts to this (simplified):
// Address 0xffffffffa1234000: value = 42
// Address 0xffffffffa1234100: <function code>1.2 Why Symbols Matter in Kernel
1.3 Types of Symbols
Part 2: The Kernel Symbol Table
2.1 What is the Symbol Table?
2.2 Why the Kernel Needs a Symbol Table
Part 3: /proc/kallsyms - The Live Symbol Table
3.1 What is /proc/kallsyms?
3.3 Symbol Types (The Letters)
Type
Meaning
Example
3.4 Practical Examples
3.5 Security Restrictions on /proc/kallsyms
Part 4: System.map - The Static Symbol Table
4.1 What is System.map?
4.2 System.map vs /proc/kallsyms
Feature
System.map
/proc/kallsyms
4.3 Viewing System.map
4.4 When to Use System.map
Part 5: Finding Symbols in Kernel Modules
5.1 Exported vs Non-Exported Symbols
5.2 Checking if a Symbol is Exported
5.3 Using Exported Symbols in Your Module
Part 6: Finding Unexported Symbols (Rootkit Technique!)
6.1 Why Find Unexported Symbols?
6.2 Method 1: Read /proc/kallsyms at Runtime
6.3 Method 2: Pattern Scanning (Advanced)
6.4 Method 3: Read System.map from Disk
Part 7: Symbol Resolution in Action
7.1 How Kernel Modules Use Symbols
7.2 Viewing Module Dependencies
7.3 Symbol Conflicts
Part 8: Rootkit Symbol Hiding Techniques
8.1 Why Hide Symbols?
8.2 Technique 1: Remove Module from List
8.3 Technique 2: Hide Symbols from kallsyms
8.4 Technique 3: Use Static Functions
8.5 Detection: How to Find Hidden Rootkits
Part 9: Practical Examples
Example 1: Finding sys_call_table
Example 2: Listing All Symbols Starting with "sys_"
Example 3: Resolving Symbol at Runtime
Part 10: Symbol Resolution Tools
Tool 1: nm (Name list)
Tool 2: objdump
Tool 3: readelf
Tool 4: modinfo
Part 11: Common Issues and Troubleshooting
Issue 1: "Unknown symbol" Error
Issue 2: kallsyms_lookup_name Returns NULL
Issue 3: Addresses are All Zeros
Last updated