Created
September 9, 2021 21:08
-
-
Save 2XXE-SRA/d0a7e977ceea121b09fac902a368d2cf to your computer and use it in GitHub Desktop.
call Cobalt Strike headless Aggressor from Python using JPype1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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