Skip to content

Instantly share code, notes, and snippets.

@2XXE-SRA
Created September 9, 2021 21:08
Show Gist options
  • Save 2XXE-SRA/d0a7e977ceea121b09fac902a368d2cf to your computer and use it in GitHub Desktop.
Save 2XXE-SRA/d0a7e977ceea121b09fac902a368d2cf to your computer and use it in GitHub Desktop.
call Cobalt Strike headless Aggressor from Python using JPype1
# pip install JPype1
import jpype
import jpype.imports
from jpype.types import *
import os
os.chdir("<cobaltstrike directory>") # required for auth file lookup
jpype.startJVM()
jpype.addClassPath("<cobaltstrike directory>/cobaltstrike.jar")
from aggressor.headless import Start
strarray = JArray(JString)
args = strarray(["<ip>","<port>","<user>","<password>","<cna path>"])
Start.main(args)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment