-
Notifications
You must be signed in to change notification settings - Fork 13
/
Win-EnumChromeExt_v2.ps1
51 lines (49 loc) · 2.51 KB
/
Win-EnumChromeExt_v2.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# TODO: Need to integrate into WinInspect script.
# EnumChromeExtv2 now queries extensions directly from Google's Chrome Store
$username = "USERNAME"
if (test-path "C:\Users\$username\appdata\local\Google\chrome\User Data\default") {
$defaultExtensions = @(gci "C:\Users\$username\appdata\local\Google\chrome\User Data\default\extensions" -r -fi "manifest.json" | % { $_.FullName})
foreach ($extension in $defaultExtensions) {
if (test-path $extension) {
foreach ($dprofile in $extension) {
$extid = (($dprofile -split '\\extensions')[1] -split '\\')[1]
$url = "https://chrome.google.com/webstore/detail/docs/"
$eurl = "$($url)$($extid)"
try {
$res = Invoke-WebRequest $eurl -ErrorAction Ignore
$content = $res.Content
$srange = $content.IndexOf("<title>")+"<title>".Length
$erange = $content.IndexOf("</title>")
$title = $content.Substring($srange,$erange - $srange)
"`nPath: $dprofile -> $title"
} catch {
"`nPath: $dprofile ! Failed to detect!"
}
}
}
}
}
if (test-path "C:\Users\$username\appdata\local\Google\chrome\User Data\Profile*") {
$profiles = @(gci "C:\Users\$username\appdata\local\Google\chrome\User Data\Profile*").Name
foreach ($profile in $profiles) {
if(test-path "C:\Users\$username\appdata\local\Google\chrome\User Data\$profile") {
"`n[+] chrome profile $profile on profile $username"
$ProfilesExtensions = @(gci "C:\Users\$username\appdata\local\Google\chrome\User Data\$profile\extensions" -r -fi "manifest.json" | % { $_.FullName})
foreach ($cprofile in $ProfilesExtensions) {
$extid = (($cprofile -split '\\extensions')[1] -split '\\')[1]
$url = "https://chrome.google.com/webstore/detail/docs/"
$eurl = "$($url)$($extid)"
try {
$res = Invoke-WebRequest $eurl -ErrorAction Ignore
$content = $res.Content
$srange = $content.IndexOf("<title>")+"<title>".Length
$erange = $content.IndexOf("</title>")
$title = $content.Substring($srange,$erange - $srange)
"`nPath: $cprofile -> $title"
} catch {
"`nPath: $cprofile ! Failed to detect!"
}
}
}
}
}