Exploit database

GH-e302ee33687556368bc5b04e1eed3931

8ee9627a76dab2c8a7/pstenable

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2019-0708

115 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files4
8ee9627a76dab2c8a7/pstenableRevision 4fd6a36d2110

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

PSTenable/Private/Invoke-PSTenableTokenRenewal.ps1

PowerShell · 2,038 bytes
Function 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
}