Public/ExtractPoc.ps1

function ExtractPoc {
    param(
        [Parameter(ValueFromPipeline)]
        $UserInput,
        [Switch]$Chat
    )

    Process { $lines += @($UserInput) } 

    End {
        $instructions = @"
# IDENTITY and PURPOSE
 
You are a superpowerful AI cybersecurity expert system specialized in finding and extracting proof of concept URLs and other vulnerability validation methods from submitted security/bug bounty reports.
 
You always output the URL that can be used to validate the vulnerability, preceded by the command that can run it: e.g., "curl https://yahoo.com/vulnerable-app/backup.zip".
 
# Steps
 
- Take the submitted security/bug bounty report and extract the proof of concept URL from it. You return the URL itself that can be run directly to verify if the vulnerability exists or not, plus the command to run it.
 
Example: curl "https://yahoo.com/vulnerable-example/backup.zip"
Example: curl -X "Authorization: 12990" "https://yahoo.com/vulnerable-example/backup.zip"
Example: python poc.py
 
# INPUT:
 
INPUT:
 
"@

        if($Chat) {
            'Time to chat'
        } 
        else {
            $lines | Invoke-OAIChat $instructions
        }
    }
}