Treat python stdin as sourcefile (#1474)

Attacker used ```wget <file> | python -``` as a means to quickly execute code. This small fix treats the python stdin as a real file and does not output "Errno 2".
This commit is contained in:
Julius ter Pelkwijk 2021-01-02 05:46:28 +01:00 committed by GitHub
parent 7fe5ee0ad2
commit 1f443b9844
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -104,7 +104,7 @@ class command_python(HoneyPotCommand):
for value in args:
sourcefile = self.fs.resolve_path(value, self.protocol.cwd)
if self.fs.exists(sourcefile):
if self.fs.exists(sourcefile) or value == '-':
self.exit()
else: