Tags: php 

Rating:

# ▼▼▼ Mandatory PHP (Web:125pts)▼▼▼
**This writeup is written by [@kazkiti_ctf](https://twitter.com/kazkiti_ctf)**

http://159.89.166.12:14000/

```
0&&$d>0&&$d>$c&&$a==$c*$c+$d*$d)
$s1="true";
else
die("Bye...");
if($s1==="true")
echo $flag1;
for($i=1;$i<=10;$i++){
if($b==urldecode($b))
die('duck');
else
$b=urldecode($b);
}
if($b==="WoAHh!")
$s2="true";
else
die('oops..');
if($s2==="true")
echo $flag2;
die('end...');
?>
Bye...
```

---

`$a==$c*$c+$d*$d`


a^2=c^2+d^2 (Right triangle)

for example,3, 4, 5 right triangle.(Right triangle)

Search brute force for the value a such that `(log10 ($ a ** (0.5))) = 5`

val1=AAKFu  ⇒ `1e10ce0c3593db31892d38b72fac23408bd056ffafcf9efe50374d328e8bd6b4`

---

GET /?val1=AAKFu&val2=%2525252525252525252557oAHh!&val3=3&val4=4

`pctf{b3_c4r3fu1_w1th_pHp_f31145}`