Code Injection
Code Injection vulnerabilities occur when user-controllable input is executed directly by the interpreter. In CTFs, this often leads to remote code execution (RCE) or the disclosure of internal files.
def process_input(data):
exec(data)
return
data = input('Enter some data: ')
process_input(data)
import os; os.system('cat flag.txt')
- Search for functions like
eval,exec,pickle.loads, or template evaluation. - Inject harmless test payloads first (e.g.,
print(1+1)orsleep(2)). - Always URL‑encode test injections when passing input via parameters.