mirror of https://github.com/cowrie/cowrie.git
Merge branch 'master' of https://github.com/micheloosterhof/cowrie
This commit is contained in:
commit
4c64f494fc
|
@ -332,7 +332,7 @@ Options: (H) means HTTP/HTTPS only, (F) means FTP only
|
|||
shasum=shasum)
|
||||
|
||||
# Link friendly name to hash
|
||||
os.symlink(shasum, self.safeoutfile)
|
||||
# os.symlink(shasum, self.safeoutfile)
|
||||
|
||||
# FIXME: is this necessary?
|
||||
# self.safeoutfile = hashPath
|
||||
|
|
|
@ -131,7 +131,7 @@ Download a file via FTP
|
|||
shasum=shasum)
|
||||
|
||||
# Link friendly name to hash
|
||||
os.symlink(shasum, self.safeoutfile)
|
||||
# os.symlink(shasum, self.safeoutfile)
|
||||
|
||||
self.safeoutfile = None
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ usage: nc [-46bCDdhjklnrStUuvZz] [-I length] [-i interval] [-O length]
|
|||
if not args or len(args) < 2:
|
||||
self.help()
|
||||
self.exit()
|
||||
return
|
||||
|
||||
host = args[0]
|
||||
port = args[1]
|
||||
|
@ -46,10 +47,10 @@ usage: nc [-46bCDdhjklnrStUuvZz] [-I length] [-i interval] [-O length]
|
|||
if self.protocol.cfg.has_option('honeypot', 'out_addr'):
|
||||
out_addr = (self.protocol.cfg.get('honeypot', 'out_addr'), 0)
|
||||
else:
|
||||
out_addr = '0.0.0.0'
|
||||
out_addr = ('0.0.0.0', 0)
|
||||
|
||||
self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
self.s.bind((out_addr, 0))
|
||||
self.s.bind(out_addr)
|
||||
self.s.connect((host, int(port)))
|
||||
self.recv_data()
|
||||
|
||||
|
|
|
@ -124,7 +124,6 @@ class command_scp(HoneyPotCommand):
|
|||
if os.path.exists(self.safeoutfile):
|
||||
with open(self.safeoutfile, 'rb') as f:
|
||||
shasum = hashlib.sha256(data).hexdigest()
|
||||
sha1sum = hashlib.sha1(data).hexdigest()
|
||||
hash_path = os.path.join(self.download_path_uniq, shasum)
|
||||
|
||||
# If we have content already, delete temp file
|
||||
|
@ -139,11 +138,10 @@ class command_scp(HoneyPotCommand):
|
|||
filename=os.path.basename(fname),
|
||||
url=fname,
|
||||
outfile=shasum,
|
||||
shasum=shasum,
|
||||
sha1=sha1sum)
|
||||
shasum=shasum)
|
||||
|
||||
# Link friendly name to hash
|
||||
os.symlink(hash_path, self.safeoutfile)
|
||||
# os.symlink(hash_path, self.safeoutfile)
|
||||
|
||||
self.safeoutfile = None
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ class command_tftp(HoneyPotCommand):
|
|||
shasum=shasum)
|
||||
|
||||
# Link friendly name to hash
|
||||
os.symlink(shasum, self.safeoutfile)
|
||||
# os.symlink(shasum, self.safeoutfile)
|
||||
|
||||
self.safeoutfile = None
|
||||
|
||||
|
|
|
@ -210,7 +210,7 @@ class command_wget(HoneyPotCommand):
|
|||
shasum=shasum)
|
||||
|
||||
# Link friendly name to hash
|
||||
os.symlink(shasum, self.safeoutfile)
|
||||
# os.symlink(shasum, self.safeoutfile)
|
||||
|
||||
self.safeoutfile = None
|
||||
|
||||
|
|
|
@ -82,11 +82,11 @@ class Artifact:
|
|||
else:
|
||||
os.rename(self.fp.name, shasumFilename)
|
||||
|
||||
if size>0:
|
||||
linkName = self.artifactDir + "/" \
|
||||
+ time.strftime('%Y%m%dT%H%M%S') \
|
||||
+ "_" + re.sub('[^-A-Za-z0-9]', '_', self.label)
|
||||
os.symlink(shasum, linkName)
|
||||
# if size>0:
|
||||
# linkName = self.artifactDir + "/" \
|
||||
# + time.strftime('%Y%m%dT%H%M%S') \
|
||||
# + "_" + re.sub('[^-A-Za-z0-9]', '_', self.label)
|
||||
# os.symlink(shasum, linkName)
|
||||
|
||||
return shasum, shasumFilename
|
||||
|
||||
|
|
Loading…
Reference in New Issue