Tracking third party URLs (In Javascripts)

Welcome Forums General PowerShell Q&A Tracking third party URLs (In Javascripts)

This topic contains 0 replies, has 1 voice, and was last updated by  fackeid67 1 week, 5 days ago.

  • Author
    Posts
  • #175375

    Participant
    Topics: 1
    Replies: 0
    Points: 13
    Rank: Member

    Hi

    I want to know how can we get the list of URLs/IPs the website is getting connected, i have made following small script but it is not able to collect all the links which are mentioned in the javascripts etc

     

    $path = Get-Content -Path 'C:\URL Internal Links Scanner\URLlist.txt'
    $path2 = "C:\URL Internal Links Scanner\output.csv"

    [int]$i = 0
    Foreach ($URL in $path)
    {
    $a = Invoke-WebRequest -Uri $URL
    $links=$a.Links | Where-Object {$_.href -notlike "*$url*"} |select href
    $csp=$a.Headers.'Content-Security-Policy'
    write-host "`n"
    $output = $URL +"`t"+ $links.href +"`t"+ $csp
    $output | Out-File $path2 -Append

    }

     

    Basic expectations is

    1. Example URL – http://www.ndtv.com
    2. When opened – it connects to various third party tracker URLs – example Google Analytics, Google Fonts etc
    3. With above script i am not able to catch such URLs

You must be logged in to reply to this topic.