Skip to content

Commit 74692ce

Browse files
committed
Honeytrap file transmission renew
1 parent d2f5c5f commit 74692ce

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

ews.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -984,13 +984,15 @@ def honeytrap():
984984

985985
honeytrap.request('description', 'NetworkHoneypot Honeytrap v1.1')
986986

987-
if (HONEYPOT["newversion"].lower() == "true") and (md5 in payloadfilelist):
988-
error, payload = honeytrap.malwarecheck(HONEYPOT['payloaddir'], re.findall(f'.*{md5}*', payloadfilelist), False, md5)
989-
990-
if (error is True) and (len(payload) <= 5 * 1024) and (len(payload) > 0):
991-
honeytrap.request('binary', payload.decode('utf-8'))
992-
elif (error is True) and (ECFG["send_malware"] is True) and (len(payload) > 0):
993-
honeytrap.request('largepayload', payload.decode('utf-8'))
987+
if (HONEYPOT["newversion"].lower() == "true"):
988+
for md5_file in payloadfilelist:
989+
if (re.search(md5, md5_file)):
990+
error, payload = honeytrap.malwarecheck(HONEYPOT['payloaddir'], md5_file , False, md5)
991+
if (error is True) and (len(payload) <= 5 * 1024) and (len(payload) > 0):
992+
honeytrap.request('binary', payload.decode('utf-8'))
993+
elif (error is True) and (ECFG["send_malware"] is True) and (len(payload) > 0):
994+
honeytrap.request('largepayload', payload.decode('utf-8'))
995+
break
994996

995997
honeytrap.adata('hostname', ECFG['hostname'])
996998
honeytrap.adata('externalIP', ECFG['ip_ext'])

0 commit comments

Comments
 (0)