Exploit databaseDownload repository ZIP
GH-e302ee33687556368bc5b04e1eed3931
8ee9627a76dab2c8a7/pstenable
Sources for CVE-2019-0708
115 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files4
8ee9627a76dab2c8a7/pstenableRevision 4fd6a36d2110
- ↑..Parent directory
- .DS_Store
- Invoke-PSTenableRest.ps1
- Invoke-PSTenableTokenRenewal.ps1
- Invoke-PSTenableTokenStatus.ps1
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
PSTenable/Private/Invoke-PSTenableTokenRenewal.ps1
PowerShell · 2,038 bytesFunction Invoke-PSTenableTokenRenewal {
<#
.SYNOPSIS
Function that returns another token upon session expiration.
.DESCRIPTION
Function that returns another token upon session expiration.
.EXAMPLE
PS C:\> Invoke-PSTenableTokenRenewal
.INPUTS
None
.OUTPUTS
None
.NOTES
This a private function dedicated to retreiving a new token for the user and storing it using PSFramework.
#>
[CmdletBinding()]
param (
)
# Credentials
$APICredential = @{
username = (Get-PSFConfigValue -FullName 'PSTenable.Credential').UserName
password = (Get-PSFConfigValue -FullName 'PSTenable.Credential').GetNetworkCredential().Password
releaseSession = "FALSE"
}
$SessionSplat = @{
URI = "$(Get-PSFConfigValue -FullName 'PSTenable.Server')/token"
SessionVariable = "SCSession"
Method = "Post"
ContentType = "application/json"
Body = (ConvertTo-Json $APICredential)
ErrorAction = "Stop"
ErrorVariable = "TenableTokenError"
}
## Enable TLS 1.2
## Taken from https://github.com/potatoqualitee/kbupdate/blob/master/kbupdate.psm1
$currentProgressPref = $ProgressPreference
$ProgressPreference = "SilentlyContinue"
$currentVersionTls = [Net.ServicePointManager]::SecurityProtocol
$currentSupportableTls = [Math]::Max($currentVersionTls.value__, [Net.SecurityProtocolType]::Tls.value__)
$availableTls = [enum]::GetValues('Net.SecurityProtocolType') | Where-Object { $_ -gt $currentSupportableTls }
$availableTls | ForEach-Object {
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor $_
}
$Session = Invoke-RestMethod @SessionSplat
[Net.ServicePointManager]::SecurityProtocol = $currentVersionTls
$ProgressPreference = $currentProgressPref
Set-PSFconfig -FullName "PSTenable.Token" -Value $Session.response.token
}