Coder Social home page Coder Social logo

cobalt-strike / sleep_python_bridge Goto Github PK

View Code? Open in Web Editor NEW
161.0 161.0 26.0 587 KB

This project is 'bridge' between the sleep and python language. It allows the control of a Cobalt Strike teamserver through python without the need for for the standard GUI client. NOTE: This project is very much in BETA. The goal is to provide a playground for testing and is in no way an officially support feature. Perhaps this could be something added in the future to the core product.

License: Apache License 2.0

Python 68.15% HTML 13.10% CSS 2.28% JavaScript 16.47%

sleep_python_bridge's People

Contributors

chris-thorpe avatar mgeeky avatar sims-security avatar vestjoe avatar whatisupmyhomie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sleep_python_bridge's Issues

beaconlogtrack does not see logs on teamserver v4.7

Hello,

thanks you for the tool.

while testing beaconlogtracker.py, i have the following error "No logs yet. Did you just start the teamserver" even though i started teamserver with listeners and running beacons. I think something has changed in the teamserver v4.7.

logs from cs console showing that logtracker logged in to collect logs:

09/01 15:41:07 *** logtracker_striker has joined.
09/01 15:41:08 *** External Action Taken: [Beacon Log Tracker] Getting beacon logs from teamserve
09/01 15:41:09 *** External Action Taken: [Beacon Log Tracker] Processing logs
09/01 15:41:11 *** logtracker_striker has left.

execution logs:

$ python3 beaconlogtracker.py 127.0.0.1 50050 logtracker PASSWORD /opt/cobaltstrike

Beacon Log Tracker

[*] Connecting to teamserver: 127.0.0.1
[Beacon Log Tracker] Getting beacon logs from teamserver...
[!] No logs yet. Did you just start the teamserver?

(kali㉿kali)-[~/sleep_python_bridge]
$ ls -lah /opt/cobaltstrike/logs
total 16K
drwxr-xr-x 4 root root 4.0K Sep 1 19:30 .
drwxrwxr-x 5 kali lxd 4.0K Sep 1 22:41 ..
drwxr-xr-x 2 root root 4.0K Aug 31 23:46 220831
drwxr-xr-x 3 root root 4.0K Sep 1 22:37 220901

(kali㉿kali)-[~/sleep_python_bridge]
$ ls -lah /opt/cobaltstrike/logs/220901
total 20K
drwxr-xr-x 3 root root 4.0K Sep 1 22:37 .
drwxr-xr-x 4 root root 4.0K Sep 1 19:30 ..
drwxr-xr-x 2 root root 4.0K Sep 1 22:37 192.168.0.1
-rw-r--r-- 1 root root 921 Sep 1 22:41 events.log
-rw-r--r-- 1 root root 132 Sep 1 22:21 weblog_80.log

Send command to beacon

There is a method that writes a command to beacon by "bid"????
Something like:
inputBeacon(self, bid, command)

Muchas gracias =)

agressor.headless.Start.class Not Found

In case anyone else is running a newer version of CS (like 4.6)...

When running example.py, the following error occurs when connecting to the CS server.
[*] Connecting to teamserver: 127.0.0.1
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
Error: Could not find or load main class aggressor.headless.Start.class
Caused by: java.lang.ClassNotFoundException: aggressor.headless.Start.class

If the sleep_python_bridge/sleep_python_bridge/striker.py file is updated on 57 to
self.aggscriptcmd = "java -XX:ParallelGCThreads=4 -XX:+AggressiveHeap -XX:+UseParallelGC -classpath '{}/cobaltstrike-client.jar' aggressor.headless.Start".format(self.cs_directory)

That should resolve the error.

ag_load_script not doing anything: Payload generator + arsenal kit

Hello,

I'm unsure what I may be doing wrong, I am unable to get the payload generator to generate a payload using the arsenal kit. What I've done:

I've dropped the contents of the generated dist folder (arsenal_kit.cna & artifact/**) into the same folder with the payload_scripts.cna, and renamed the arsenal_kit.cna to payload_scripts.cna.

However when I run the payload generator I appear to get a vanilla payload as opposed to the customized payload.

In this first screenshot is the metadata of the payload generator beacon.
Payload Generator Beacon

This beacon was generated using the GUI with arsenal kit loaded. In it you can see the contents of the resource.rc being added as additional attributes as expected, indicating the arsenal kit was loaded.
GUI Generated Beacon

Am I doing something wrong? Is this a bug?

Thanks!

how to get result from a command?

3ks to the tool !
Here i call the function bmimikatz('{beacon_id}', '{command}'), command is 'sekurlsa::logonpasswords'
the code is
cmd = f"return base64_encode(bmimikatz('{beacon_id}', '{command}'))" bytes = self.ag_get_object(cmd, timeout=30000, sleep_time=3)
and i get bytes is empty, but the client console do print task is delivered, and the passwords/user has been caught;
how can i receive the command running result in python script?

Support for Cobalt Strike 4.8

I'm getting "Error: Cobalt Strike JAR file not found" when running striker.py against Cobalt Strike 4.8. I see that connectTeamserver is looking for cobaltstrike.jar, but that file doesn't exist in 4.8. Is there a workaround?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.