mirror of
https://github.com/h3xduck/TripleCross.git
synced 2025-12-17 07:33:07 +08:00
156 lines
9.2 KiB
TeX
156 lines
9.2 KiB
TeX
\boolfalse {citerequest}\boolfalse {citetracker}\boolfalse {pagetracker}\boolfalse {backtracker}\relax
|
|
\babel@toc {english}{}
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {chapter}{\numberline {1}Introduction}{1}{chapter.1}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {1.1}Motivation}{1}{section.1.1}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {1.2}Project objectives}{3}{section.1.2}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {1.3}Regulatory framework}{4}{section.1.3}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {1.3.1}Social and economic environment}{4}{subsection.1.3.1}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {1.3.2}Budget}{4}{subsection.1.3.2}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {1.4}Structure of the document}{4}{section.1.4}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {1.5}Code availability}{4}{section.1.5}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {chapter}{\numberline {2}Background}{5}{chapter.2}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {2.1}BPF}{5}{section.2.1}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.1.1}Introduction to the BPF system}{5}{subsection.2.1.1}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.1.2}The BPF virtual machine}{6}{subsection.2.1.2}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.1.3}Analysis of a BPF filter program}{6}{subsection.2.1.3}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.1.4}BPF bytecode instruction format}{7}{subsection.2.1.4}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.1.5}An example of BPF filter with tcpdump}{8}{subsection.2.1.5}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {2.2}Modern eBPF}{10}{section.2.2}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.2.1}eBPF instruction set}{12}{subsection.2.2.1}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.2.2}JIT compilation}{13}{subsection.2.2.2}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.2.3}The eBPF verifier}{13}{subsection.2.2.3}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.2.4}eBPF maps}{14}{subsection.2.2.4}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.2.5}The eBPF ring buffer}{15}{subsection.2.2.5}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.2.6}The bpf() syscall}{15}{subsection.2.2.6}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.2.7}eBPF helpers}{15}{subsection.2.2.7}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {2.3}eBPF program types}{18}{section.2.3}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.3.1}XDP}{18}{subsection.2.3.1}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.3.2}Traffic Control}{18}{subsection.2.3.2}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.3.3}Tracepoints}{20}{subsection.2.3.3}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.3.4}Kprobes}{21}{subsection.2.3.4}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.3.5}Uprobes}{22}{subsection.2.3.5}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {2.4}Developing eBPF programs}{23}{section.2.4}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.4.1}BCC}{23}{subsection.2.4.1}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.4.2}Bpftool}{23}{subsection.2.4.2}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.4.3}Libbpf}{24}{subsection.2.4.3}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {2.5}Security features in eBPF}{26}{section.2.5}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.5.1}Access control}{26}{subsection.2.5.1}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {2.6}Memory management in Linux}{28}{section.2.6}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.6.1}Memory pages and faults}{28}{subsection.2.6.1}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.6.2}Process virtual memory}{29}{subsection.2.6.2}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.6.3}The process stack}{31}{subsection.2.6.3}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {2.7}Attacks at the stack}{35}{section.2.7}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.7.1}Buffer overflow}{35}{subsection.2.7.1}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.7.2}Return oriented programming attacks}{38}{subsection.2.7.2}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {2.8}Networking fundamentals in Linux}{40}{section.2.8}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.8.1}An overview on the network layer}{41}{subsection.2.8.1}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.8.2}Introduction to the TCP protocol}{42}{subsection.2.8.2}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {2.9}ELF binaries}{44}{section.2.9}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.9.1}The ELF format and Lazy Binding}{45}{subsection.2.9.1}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.9.2}Hardening ELF binaries}{48}{subsection.2.9.2}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {2.10}The proc filesystem}{50}{section.2.10}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.10.1}/proc/<pid>/maps}{50}{subsection.2.10.1}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {2.10.2}/proc/<pid>/mem}{51}{subsection.2.10.2}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {chapter}{\numberline {3}Analysis of offensive capabilities}{52}{chapter.3}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {3.1}eBPF maps security}{52}{section.3.1}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {3.2}Abusing tracing programs}{53}{section.3.2}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {3.2.1}Access to function arguments}{53}{subsection.3.2.1}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {3.2.2}Reading memory out of bounds}{56}{subsection.3.2.2}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {3.2.3}Overriding function return values}{56}{subsection.3.2.3}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {3.2.4}Sending signals to user programs}{58}{subsection.3.2.4}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {3.2.5}Takeaways}{58}{subsection.3.2.5}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {3.3}Memory corruption}{58}{section.3.3}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {3.3.1}Attacks and limitations of bpf\_probe\_write\_user()}{58}{subsection.3.3.1}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {3.3.2}Takeaways}{61}{subsection.3.3.2}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {3.4}Abusing networking programs}{62}{section.3.4}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {3.4.1}Attacks and limitations of networking programs}{62}{subsection.3.4.1}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {3.4.2}Takeaways}{65}{subsection.3.4.2}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {chapter}{\numberline {4}Design of a malicious eBPF rootkit}{66}{chapter.4}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {4.1}Rootkit architecture}{66}{section.4.1}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {4.2}Library injection module}{70}{section.4.2}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {4.2.1}ROP with eBPF}{70}{subsection.4.2.1}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {4.2.2}Bypassing hardening features in ELFs}{73}{subsection.4.2.2}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {subsection}{\numberline {4.2.3}Library injection via GOT hijacking}{75}{subsection.4.2.3}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {chapter}{\numberline {5}Evaluation}{81}{chapter.5}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {5.1}Developed capabilities}{81}{section.5.1}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {section}{\numberline {5.2}Rootkit use cases}{81}{section.5.2}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {chapter}{\numberline {6}Related work}{82}{chapter.6}%
|
|
\defcounter {refsection}{0}\relax
|
|
\contentsline {chapter}{Bibliography}{83}{chapter.6}%
|
|
\contentsfinish
|