mirror of
https://github.com/aljazceru/cowrie.git
synced 2025-12-17 05:54:21 +01:00
Fix quotes stripping (#480)
* Fix quotes stripping * Update 'echo' tests * Revert "Update 'echo' tests" This reverts commit 88577794b1f98b9684be4a53b151d5d6c3db69cd.
This commit is contained in:
@@ -140,7 +140,7 @@ class command_echo(HoneyPotCommand):
|
|||||||
# FIXME: Wrap in exception, Python escape cannot handle single digit \x codes (e.g. \x1)
|
# FIXME: Wrap in exception, Python escape cannot handle single digit \x codes (e.g. \x1)
|
||||||
try:
|
try:
|
||||||
self.write(escape_fn(re.sub('(?<=\\\\)x([0-9a-fA-F]{1})(?=\\\\|\"|\'|\s|$)', 'x0\g<1>',
|
self.write(escape_fn(re.sub('(?<=\\\\)x([0-9a-fA-F]{1})(?=\\\\|\"|\'|\s|$)', 'x0\g<1>',
|
||||||
''.join(args).replace('\\\\x', '\\x'))).strip('\"\''))
|
''.join(args).replace('\\\\x', '\\x')).strip('\"\'')))
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
log.msg("echo command received Python incorrect hex escape")
|
log.msg("echo command received Python incorrect hex escape")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user