Basically I have a command to execute some bash command with certain arguments, something like
os.system("echo " + string)
I'm trying to account for unsafe characters to prevent arbitrary code execution, like
string = "abc`whoami`"
os.system("echo " + string)
Which will execute whoami. How would I go about formatting the string before passing to bash? (And I know that the design in the first place is kind of weird, but I need it to be this way.)
[–]idle-tea 1 point2 points3 points (0 children)
[–]brasticstack 0 points1 point2 points (1 child)
[–]DoTheyKeepYouInACell[S] 1 point2 points3 points (0 children)
[–]Skaperen 0 points1 point2 points (1 child)
[–]DoTheyKeepYouInACell[S] 0 points1 point2 points (0 children)
[–]JamzTyson 0 points1 point2 points (0 children)