Skip to content

Commit

Permalink
Fix intigriti
Browse files Browse the repository at this point in the history
  • Loading branch information
arkadiyt committed Oct 28, 2024
1 parent 38c949a commit 6a424c1
Show file tree
Hide file tree
Showing 4 changed files with 227 additions and 79 deletions.
8 changes: 4 additions & 4 deletions lib/bounty-targets/intigriti.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'json'
require 'ssrf_filter'
require 'uri'
require 'nokogiri'

module BountyTargets
class Intigriti
Expand Down Expand Up @@ -49,10 +50,9 @@ def encode(component)
end

def directory_index
page = SsrfFilter.get(::URI.parse('https://www.intigriti.com/programs')).body
tag = page.match(%r{/_next/static/([^/]+)/_buildManifest.js})[1]
programs = ::JSON.parse(SsrfFilter.get(::URI.parse("https://www.intigriti.com/_next/data/#{tag}/en/programs.json")).body)
programs['pageProps']['programs'].map do |program|
page = ::Nokogiri::HTML(SsrfFilter.get(::URI.parse('https://www.intigriti.com/programs')).body)
programs = JSON.parse(page.css('#__NEXT_DATA__').inner_text)['props']['pageProps']['programs']
programs.map do |program|
{
id: program['programId'],
name: program['name'],
Expand Down
17 changes: 7 additions & 10 deletions spec/bounty-targets/intigriti_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@
end

it 'fetches a list of programs' do
programs = File.read('spec/fixtures/intigriti/programs.json')
tag = '123'
programs = File.read('spec/fixtures/intigriti/programs.html')
stub_request(:get, %r{/programs}).with(headers: {host: 'www.intigriti.com'})
.to_return(status: 200, body: "/_next/static/#{tag}/_buildManifest.js")
stub_request(:get, %r{/_next/data/#{tag}/en/programs.json}).with(headers: {host: 'www.intigriti.com'})
.to_return(status: 200, body: programs)
expect(client.directory_index).to eq(
[
Expand All @@ -22,20 +19,20 @@
handle: 'doccle',
id: '12715f4b-d10e-415f-a309-6ab042f6158a',
status: 'open',
tacRequired: true,
twoFactorRequired: nil,
tacRequired: false,
twoFactorRequired: false,
url: 'https://www.intigriti.com/programs/doccle/doccle/detail',
max_bounty: {'currency' => 'EUR', 'value' => 2500},
max_bounty: {'currency' => 'EUR', 'value' => 4000},
min_bounty: {'currency' => 'EUR', 'value' => 0},
name: 'Doccle'
name: 'Doccle Bug Bounty program'
},
{
company_handle: 'bpost',
confidentiality_level: 'application',
confidentiality_level: 'public',
handle: 'e-tracker',
id: 'a09e497e-fd75-4b56-afa0-7a6689389b76',
tacRequired: false,
twoFactorRequired: nil,
twoFactorRequired: false,
max_bounty: {'currency' => 'EUR', 'value' => 0},
min_bounty: {'currency' => 'EUR', 'value' => 0},
name: 'e-tracker',
Expand Down
216 changes: 216 additions & 0 deletions spec/fixtures/intigriti/programs.html

Large diffs are not rendered by default.

65 changes: 0 additions & 65 deletions spec/fixtures/intigriti/programs.json

This file was deleted.

0 comments on commit 6a424c1

Please sign in to comment.