subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
fn = f'img_{h}.{ext}' out = os.path.join(img_dir, fn) for attempt in range(3): r = subprocess.run(['curl','-sL','--insecure','--max-time','30','-A',UA,'-o',out,u], capture_output=True) if os.path.exists(out) and os.path.getsize(out) > 500: head = open(out,'rb').read(8) if head[:4]==b'\x89PNG' or head[:3]==b'\xff\xd8\xff' or head[:4]==b'GIF8' or head[:4]==b'RIFF':- Confidence
- 70% confidence
- Finding
- r = subprocess.run(['curl','-sL','--insecure','--max-time','30','-A',UA,'-o',out,u], capture_output=True)
