mirror of https://github.com/cowrie/cowrie.git
parent
9af813994e
commit
b8be378586
|
@ -268,10 +268,13 @@ class Command_curl(HoneyPotCommand):
|
|||
self.exit()
|
||||
return None
|
||||
|
||||
# TODO: need to do full name resolution.
|
||||
if ipaddress.ip_address(host).is_private:
|
||||
self.errorWrite("curl: (6) Could not resolve host: {}\n".format(host))
|
||||
return None
|
||||
# TODO: need to do full name resolution in case someon passes DNS name pointing to local address
|
||||
try:
|
||||
if ipaddress.ip_address(host).is_private:
|
||||
self.errorWrite("curl: (6) Could not resolve host: {}\n".format(host))
|
||||
return None
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
factory = HTTPProgressDownloader(
|
||||
self, fakeoutfile, url, outputfile, *args, **kwargs
|
||||
|
|
|
@ -154,14 +154,17 @@ class Command_wget(HoneyPotCommand):
|
|||
self.errorWrite("HTTP request sent, awaiting response... ")
|
||||
|
||||
# TODO: need to do full name resolution.
|
||||
if ipaddress.ip_address(host).is_private:
|
||||
self.errorWrite(
|
||||
"Resolving {} ({})... failed: nodename nor servname provided, or not known.\n".format(
|
||||
host, host
|
||||
try:
|
||||
if ipaddress.ip_address(host).is_private:
|
||||
self.errorWrite(
|
||||
"Resolving {} ({})... failed: nodename nor servname provided, or not known.\n".format(
|
||||
host, host
|
||||
)
|
||||
)
|
||||
)
|
||||
self.errorWrite("wget: unable to resolve host address ‘{}’\n".format(host))
|
||||
return None
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
# File in host's fs that will hold content of the downloaded file
|
||||
# HTTPDownloader will close() the file object so need to preserve the name
|
||||
|
|
Loading…
Reference in New Issue