(self)
| 12 | |
| 13 | class DshellPlugin(HTTPPlugin): |
| 14 | def __init__(self): |
| 15 | super().__init__( |
| 16 | name="rip-http", |
| 17 | author="bg,twp", |
| 18 | bpf="tcp and (port 80 or port 8080 or port 8000)", |
| 19 | description="Rips files from HTTP traffic", |
| 20 | output=AlertOutput(label=__name__), |
| 21 | optiondict={'append_conn': |
| 22 | {'action': 'store_true', |
| 23 | 'help': 'append sourceip-destip to filename'}, |
| 24 | 'append_ts': |
| 25 | {'action': 'store_true', |
| 26 | 'help': 'append timestamp to filename'}, |
| 27 | 'direction': |
| 28 | {'help': 'cs=only capture client POST, sc=only capture server GET response', |
| 29 | 'metavar': '"cs" OR "sc"', |
| 30 | 'default': None}, |
| 31 | 'outdir': |
| 32 | {'help': 'directory to write output files (Default: current directory)', |
| 33 | 'metavar': 'DIRECTORY', |
| 34 | 'default': '.'}, |
| 35 | 'content_filter': |
| 36 | {'help': 'regex MIME type filter for files to save', |
| 37 | 'metavar': 'REGEX'}, |
| 38 | 'name_filter': |
| 39 | {'help': 'regex filename filter for files to save', |
| 40 | 'metavar': 'REGEX'} |
| 41 | } |
| 42 | ) |
| 43 | |
| 44 | def premodule(self): |
| 45 | if self.direction not in ('cs', 'sc', None): |
nothing calls this directly
no test coverage detected