1
Intrusion Detection and Prevention / Re: OPNsense IPS syslog triggers IPS
« on: June 27, 2022, 02:44:11 pm »
I've had to add a pass rule from the IPS internal interface to my syslog receiver because of this.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
"@
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
$user = 'APIKEY'
$pass = 'APISECRET'
$pair = "$($user):$($pass)"
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
$basicAuthValue = "Basic $encodedCreds"
$Headers = @{
Authorization = $basicAuthValue
}
$URL = "https://IPOFROUTER/api/core/firmware/upgrade"
Invoke-WebRequest -uri $url -method post -Headers $Headers -Body '{"upgrade":"maj"}' -ContentType "application/json"