Corporate Tax Calculator

Description

Our website help corporates to calculate their annual taxes, Our developers said it's sand-boxed can you double check for me?

Solution

Corporate Tax Calculator.png

Post request on / evaluates given math expression

Corporate Tax Calculator-1.png

If we cause an error we see eval function is used, which is considered to be dangerous for RCE.

Corporate Tax Calculator-2.png

system('id') didn't work, use phpinfo() to inspect configuration. Our interest is in disable_functions which restricts which functions are allowed.

Corporate Tax Calculator-3.png

With scandir we can locate files

Corporate Tax Calculator-4.png

Now we just have to read it somehow.

https://book.hacktricks.wiki/en/network-services-pentesting/pentesting-web/php-tricks-esp/php-useful-functions-disable_functions-open_basedir-bypass/index.html#filesystem-functionsarrow-up-right

After some digging I found simplexml_load_file function which is able to read first line of file which is enough for flag.txt.

circle-check

Last updated