Skip to content

Commit

Permalink
Merge pull request PortSwigger#78 from GangGreenTemperTatum/ads/creat…
Browse files Browse the repository at this point in the history
…ebambaforlast48hrs

feat: highlight the past 48 hrs bambdaaaa
  • Loading branch information
josh-psw authored Jul 23, 2024
2 parents 2d01566 + e0cf4f9 commit 03dc205
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Filter/Proxy/HTTP/HighlightPast48hrs.bambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Filter the past 48 hours worth of in-scope proxy history
*
* @author GangGreenTemperTatum (https://github.com/GangGreenTemperTatum)
**/

boolean configInScopeOnly = true; // Flag to filter only in-scope items

// Get current time and calculate 48 hours ago
ZonedDateTime now = ZonedDateTime.now();
ZonedDateTime fortyEightHoursAgo = now.minusHours(48);

// Check if the request time is within the last 48 hours
boolean afterCheck = requestResponse.time().isAfter(fortyEightHoursAgo);

// Check if the request is in scope
boolean inScopeCheck = !configInScopeOnly || requestResponse.request().isInScope();

// Return true only if both conditions are met
return afterCheck && inScopeCheck;

0 comments on commit 03dc205

Please sign in to comment.