bandit/examples/paramiko_injection.py
Travis McPeak d82506ea43 Modifying Paramiko Injection plugin
The way the paramiko check was previously working didn't catch
many uses because the qualified name is difficult to predict for
Paramiko calls.  This commit changes it so that paramiko detection
is accomplished by the combination of importing paramiko and using
one of the paramiko functions that executes with a shell.

Change-Id: Ib6e8f596a8f05475213be0ac8cf27e4e308b9617
2015-07-14 09:35:08 -06:00

12 lines
203 B
Python

import paramiko
# this is not safe
paramiko.exec_command('something; reallly; unsafe')
# this is safe
paramiko.connect('somehost')
# this is not safe
SSHClient.invoke_shell('something; bad; here\n')