There was this challenge in one of the CTF's I played in which you had to exploit the input vulnerability of Python 2.x . I was just wondering that since the input function in Python 2.x is same as eval(raw_input()) you could basically give a power off or move into another directory. How do you setup the server such that you can prevent people from doing that but also let them allow you to exploit the vulnerability?
1 Answer
One simple way I can think of is to sanitize user input using a blacklist which contains the commands you do not want to allow, such as the ones you have mentioned. OWASP provides very good explanation about White/Black lists HERE
-
-
The simple answer is - it depends. Both should work but it will boil down to what is easier to implement in that specific scenario Commented Aug 11, 2019 at 20:46