Files
Powershell/TheHive/API-TheHive.ps1
2025-06-03 09:53:55 +02:00

41 lines
1.0 KiB
PowerShell

# Define the API endpoint and headers
$apiUrl = "https://thcp19.aws.thehive-cloud.io/9dd3b3a0-f662-4fda-9202-06d13ba6dc90/thehive/api/v1/alert"
$headers = @{
"Authorization" = "Bearer HcWe1tq3s6m+/wAYcJmyR83W17Ave5lb"
"accept" = "application/json"
"Content-Type" = "application/json"
}
# Define the request body (if needed)
$body = @{
"type"= "Tentative d'intrusion"
"source"= "Firewall"
"sourceRef"= "11"
"title"= "Tentative d'intrusion"
"description"= "Je fais un test un peu plus détaillé"
"severity"= 4
"tags" = @(
"Firewall"
)
"observables" = @(
@{
"dataType"= "url"
"data"= "https://www.tips-of-mine.com"
},
@{
"dataType"= "mail"
"data"= "admin@tips-of-mine.fr"
}
@{
"dataType"= "ip"
"data"= "82.65.77.254"
}
)
} | ConvertTo-Json -Depth 10
# Make the API call using Invoke-RestMethod
$response = Invoke-RestMethod -Uri $apiUrl -Method Post -Headers $headers -Body $body
# Output the response
$response