Skip to content

Commit 44f0dbd

Browse files
committed
Merge branch 'master' into update_Cache_Deception___CSPT__Turning_Non_Impactful_Find_20250914_012031
2 parents d30edd9 + f3b3004 commit 44f0dbd

File tree

23 files changed

+2043
-62
lines changed

23 files changed

+2043
-62
lines changed

hacktricks-preprocessor.py

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
logger.addHandler(handler2)
1818

1919

20-
def findtitle(search ,obj, key, path=(),):
20+
def findtitle(search, obj, key, path=()):
2121
# logger.debug(f"Looking for {search} in {path}")
2222
if isinstance(obj, dict) and key in obj and obj[key] == search:
2323
return obj, path
@@ -54,26 +54,42 @@ def ref(matchobj):
5454
if href.endswith("/"):
5555
href = href+"README.md" # Fix if ref points to a folder
5656
if "#" in href:
57-
chapter, _path = findtitle(href.split("#")[0], book, "source_path")
58-
title = " ".join(href.split("#")[1].split("-")).title()
59-
logger.debug(f'Ref has # using title: {title}')
57+
result = findtitle(href.split("#")[0], book, "source_path")
58+
if result is not None:
59+
chapter, _path = result
60+
title = " ".join(href.split("#")[1].split("-")).title()
61+
logger.debug(f'Ref has # using title: {title}')
62+
else:
63+
raise Exception(f"Chapter not found for path: {href.split('#')[0]}")
6064
else:
61-
chapter, _path = findtitle(href, book, "source_path")
62-
logger.debug(f'Recursive title search result: {chapter["name"]}')
63-
title = chapter['name']
65+
result = findtitle(href, book, "source_path")
66+
if result is not None:
67+
chapter, _path = result
68+
logger.debug(f'Recursive title search result: {chapter["name"]}')
69+
title = chapter['name']
70+
else:
71+
raise Exception(f"Chapter not found for path: {href}")
6472
except Exception as e:
6573
dir = path.dirname(current_chapter['source_path'])
6674
rel_path = path.normpath(path.join(dir,href))
6775
try:
6876
logger.debug(f'Not found chapter title from: {href} -- trying with relative path {rel_path}')
6977
if "#" in href:
70-
chapter, _path = findtitle(path.normpath(path.join(dir,href.split('#')[0])), book, "source_path")
71-
title = " ".join(href.split("#")[1].split("-")).title()
72-
logger.debug(f'Ref has # using title: {title}')
78+
result = findtitle(path.normpath(path.join(dir,href.split('#')[0])), book, "source_path")
79+
if result is not None:
80+
chapter, _path = result
81+
title = " ".join(href.split("#")[1].split("-")).title()
82+
logger.debug(f'Ref has # using title: {title}')
83+
else:
84+
raise Exception(f"Chapter not found for relative path: {path.normpath(path.join(dir,href.split('#')[0]))}")
7385
else:
74-
chapter, _path = findtitle(path.normpath(path.join(dir,href.split('#')[0])), book, "source_path")
75-
title = chapter["name"]
76-
logger.debug(f'Recursive title search result: {chapter["name"]}')
86+
result = findtitle(path.normpath(path.join(dir,href)), book, "source_path")
87+
if result is not None:
88+
chapter, _path = result
89+
title = chapter["name"]
90+
logger.debug(f'Recursive title search result: {chapter["name"]}')
91+
else:
92+
raise Exception(f"Chapter not found for relative path: {path.normpath(path.join(dir,href))}")
7793
except Exception as e:
7894
logger.debug(e)
7995
logger.error(f'Error getting chapter title: {rel_path}')

searchindex.js

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

src/SUMMARY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@
768768
- [Stack Shellcode - arm64](binary-exploitation/stack-overflow/stack-shellcode/stack-shellcode-arm64.md)
769769
- [Stack Pivoting - EBP2Ret - EBP chaining](binary-exploitation/stack-overflow/stack-pivoting-ebp2ret-ebp-chaining.md)
770770
- [Uninitialized Variables](binary-exploitation/stack-overflow/uninitialized-variables.md)
771-
- [ROP - Return Oriented Programing](binary-exploitation/rop-return-oriented-programing/README.md)
771+
- [ROP & JOP](binary-exploitation/rop-return-oriented-programing/README.md)
772772
- [BROP - Blind Return Oriented Programming](binary-exploitation/rop-return-oriented-programing/brop-blind-return-oriented-programming.md)
773773
- [Ret2csu](binary-exploitation/rop-return-oriented-programing/ret2csu.md)
774774
- [Ret2dlresolve](binary-exploitation/rop-return-oriented-programing/ret2dlresolve.md)
@@ -837,6 +837,7 @@
837837
- [WWW2Exec - GOT/PLT](binary-exploitation/arbitrary-write-2-exec/aw2exec-got-plt.md)
838838
- [WWW2Exec - \_\_malloc_hook & \_\_free_hook](binary-exploitation/arbitrary-write-2-exec/aw2exec-__malloc_hook.md)
839839
- [Common Exploiting Problems](binary-exploitation/common-exploiting-problems.md)
840+
- [Linux kernel exploitation - toctou](binary-exploitation/linux-kernel-exploitation/posix-cpu-timers-toctou-cve-2025-38352.md)
840841
- [Windows Exploiting (Basic Guide - OSCP lvl)](binary-exploitation/windows-exploiting-basic-guide-oscp-lvl.md)
841842
- [iOS Exploiting](binary-exploitation/ios-exploiting.md)
842843

0 commit comments

Comments
 (0)