Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create HighlightTrackerServices.bambda #49

Merged
merged 4 commits into from
Dec 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions Proxy/HTTP/HighlightTrackerServices.bambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* HighlightTrackerServices: Burp Suite Bambda for Identifying Tracking Services
* FilterOut Burp Suite history to detect and analyze tracking services from web requests
* @author Tur24Tur / BugBountyzip (https://github.com/BugBountyzip)
**/

// Define hash sets for hosts, paths, and parameters
Set<String> trackedHosts = new HashSet<>(Arrays.asList("www.gstatic.com", "events.statsigapi.net", "ingesteer.services-prod.nsvcs.net", "js-eu1.hs-analytics.net", "static.hotjar.com", "forms-eu1.hscollectedforms.net", "www.google-analytics.com", "www.googletagmanager.com", "static.xx.fbcdn.net", "stats.g.doubleclick.net", "collector.github.com"));
Set<String> trackedPaths = new HashSet<>(Arrays.asList("/logging/v1", "/track"));
Set<String> trackedParameters = new HashSet<>(Arrays.asList("logs", "log"));

// Main logic of the Bambda
var request = requestResponse.request();
String requestUrl = request.url().toLowerCase();

// Extract host and path from URL
String[] urlParts = requestUrl.split("/", 4);
String host = urlParts.length > 2 ? urlParts[2] : "";
String path = urlParts.length > 3 ? "/" + urlParts[3].split("\\?")[0] : "";

// Check for tracked host
if (trackedHosts.contains(host)) {
requestResponse.annotations().setHighlightColor(HighlightColor.RED);
return true;
}

// Check for tracked path
if (trackedPaths.contains(path)) {
requestResponse.annotations().setHighlightColor(HighlightColor.RED);
return true;
}

// Check for tracked parameters
var parameters = request.parameters();
for (HttpParameter param : parameters) {
if (trackedParameters.contains(param.name().toLowerCase()) || trackedParameters.contains(param.value().toLowerCase())) {
requestResponse.annotations().setHighlightColor(HighlightColor.RED);
return true;
}
}

return false;
Loading