Skip to content
This repository was archived by the owner on Dec 17, 2021. It is now read-only.

Commit c5af7d6

Browse files
committed
new cmdlet watch-urlscanio
1 parent 2aa7923 commit c5af7d6

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/Public/Watch-UrlScanio.ps1

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
function Watch-UrlScanio {
2+
<#
3+
.SYNOPSIS
4+
Live feed of urlscan.io submissions.
5+
6+
.DESCRIPTION
7+
Get a live feed of submissions on urlscan.io returning id, time of submission, IP address and submitted URL.
8+
9+
.EXAMPLE
10+
Watch-UrlScanio | ? Url -match 'login'
11+
Watch urlscan.io for any submitted URL's which contain "login"
12+
#>
13+
14+
$url = "https://urlscan.io/api/v1/frontpage/?size=10&q=page.ip:* AND task.method:(api%20OR%20manual%20OR%20automatic)"
15+
16+
while ($true) {
17+
$req = Invoke-WebRequest -Uri $url -UseBasicParsing
18+
$resp = $req.Content | ConvertFrom-Json
19+
20+
$props = @{
21+
Property = @{n="id";e={$_.'_id'}},
22+
@{n="time";e={$_.task.time}},
23+
@{n="ip";e={$_.page.ip}},
24+
@{n="Url";e={$_.page.url}}
25+
}
26+
27+
$resp.results | ? _id -notin $prevResp._id | select @props
28+
$prevResp = $resp.results
29+
Start-Sleep 5
30+
}
31+
}

0 commit comments

Comments
 (0)