I've been experimenting with python 2.7's input() function and trying to find ways to exploit it. I know that by itself it's vulnerable to exploitation because you can input python expressions, which will then be evaluated. My question is, if you cast it as a string, ie:
str(input())
is it still vulnerable to these exploits? Does this make it completely safe?
As an example, given the following program, is there any way to exploit input() and make it output "RIGHT password"?
import random
inp = str(input("Enter the password: "))
password = random.randint(0, 100)
if inp == password:
print "RIGHT password"
else:
print "WRONG password"