From 5740e5beff22526f859bb65ba8432ba5d40ec892 Mon Sep 17 00:00:00 2001 From: arkadiyt <> Date: Thu, 3 Oct 2024 21:19:36 -0700 Subject: [PATCH] Only take the most recent Intigriti scopes --- lib/bounty-targets/intigriti.rb | 18 +++++++++--------- spec/bounty-targets/intigriti_spec.rb | 2 +- spec/fixtures/intigriti/scopes.json | 14 +++++++++++++- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/lib/bounty-targets/intigriti.rb b/lib/bounty-targets/intigriti.rb index 379b0d7..c3a5b41 100644 --- a/lib/bounty-targets/intigriti.rb +++ b/lib/bounty-targets/intigriti.rb @@ -70,15 +70,15 @@ def directory_index def program_scopes(program) url = "https://app.intigriti.com/api/core/public/programs/#{encode(program[:company_handle])}/#{encode(program[:handle])}" - targets = JSON.parse(SsrfFilter.get(url).body)['domains'].flat_map do |domains| - domains['content'].map do |content| - { - type: TYPES[content['type']], - endpoint: content['endpoint'], - description: content['description'], - impact: TIERS[content['bountyTierId']] - } - end + targets = (JSON.parse(SsrfFilter.get(url).body)['domains'].max_by do |domains| + domains['createdAt'] + end)['content'].map do |content| + { + type: TYPES[content['type']], + endpoint: content['endpoint'], + description: content['description'], + impact: TIERS[content['bountyTierId']] + } end.group_by do |scope| scope[:impact] != 'Out of scope' end diff --git a/spec/bounty-targets/intigriti_spec.rb b/spec/bounty-targets/intigriti_spec.rb index ff64c3a..9f1cb6b 100644 --- a/spec/bounty-targets/intigriti_spec.rb +++ b/spec/bounty-targets/intigriti_spec.rb @@ -53,7 +53,7 @@ in_scope: [ { description: nil, - endpoint: "(Hardware)\tProcessor (inclusive of micro-code ROM + updates)", + endpoint: 'endpoint', impact: 'Tier 1', type: 'other' } diff --git a/spec/fixtures/intigriti/scopes.json b/spec/fixtures/intigriti/scopes.json index 0471b62..f37bef1 100644 --- a/spec/fixtures/intigriti/scopes.json +++ b/spec/fixtures/intigriti/scopes.json @@ -19,7 +19,19 @@ } ], "createdAt": 1638481238 - } + }, + { + "content": [ + { + "id": "dd6d5718-737b-44f3-a833-fa74d0462f1f", + "type": 6, + "endpoint": "endpoint", + "bountyTierId": 4, + "description": null + } + ], + "createdAt": 1638481240 + } ], "inScopes": [ {