Loading...
Loading...
Simple command injection through unsanitized user input in shell commands.
1import os23def check_domain(domain):4 # Check if domain is reachable5 result = os.popen(f"nslookup {domain}").read()6 return result
os.popen() executes commands through the shell, allowing command chaining with ; | && etc. User input should never be interpolated into shell commands.
Use semicolon to execute additional commands
domain = "google.com; whoami; id"Returns DNS lookup + current user + user ID