mirror of https://github.com/cowrie/cowrie.git
handle submission if there is no good url (#1144)
This commit is contained in:
parent
8b363c3432
commit
31ad2c1a54
|
@ -168,15 +168,16 @@ class Output(cowrie.core.output.Output):
|
|||
session=entry['session'],
|
||||
sha256=j['resource'],
|
||||
is_new="true")
|
||||
p = urlparse(entry['url']).path
|
||||
if p == "":
|
||||
fileName = entry['shasum']
|
||||
else:
|
||||
b = os.path.basename(p)
|
||||
|
||||
try:
|
||||
b = os.path.basename(urlparse(entry['url']).path)
|
||||
if b == "":
|
||||
fileName = entry['shasum']
|
||||
else:
|
||||
fileName = b
|
||||
except KeyError:
|
||||
fileName = entry['shasum']
|
||||
|
||||
if self.upload is True:
|
||||
return self.postfile(entry['outfile'], fileName)
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue