Alexander Rymdeko-Harvey 326a5ca2e3 Add in reload error handling
When the user would use the reload command the entire framework would fail, this was due to a unhandled exception. Now when the user reloads a bad module it catches it and testing shows it will not instantiate the new module. This will allow the old module to be used till new one is fixed.
2016-03-21 14:55:53 -04:00
2016-03-21 14:55:53 -04:00
2016-02-29 13:37:27 -05:00
2016-02-29 13:37:27 -05:00
2016-02-29 13:37:27 -05:00
2016-02-29 13:37:27 -05:00

#EmPyre

EmPyre is a pure Python post-exploitation agent built on cryptologically-secure communications and a flexible architecture. It is based heavily on the controller and communication structure of Empire.

The Diffie Hellman implementation is from Mark Loiseau's project at https://github.com/lowazo/pyDHE, licensed under version 3.0 of the GNU General Public License.

The AES implementation is adapted from Richard Moore's project at https://github.com/ricmoo/pyaes, licensed under the MIT license.

The initial Python launcher code is inspired from MSF's Python Meterpreter launcher at https://github.com/rapid7/metasploit-framework/blob/master/lib/msf/core/payload/python/reverse_http.rb, licensed under the BSD-3-clause license.

Key negotiation

  • KEYs = staging key, set per server (used for RC4 and initial AES comms)
  • KEYn = the DH-EKE negotiated key
  • PUBc = the client-generated DH public key
  • PUBs = the server-generated DH public key

The process is as follows:

  1. client runs launcher.py that GETs stager.py from /stage0 launcher.py implements a minimized RC4 decoding stub and negotiation key

  2. server returns RC4(KEYs, stager.py) (key negotiation stager) stager.py contains minimized DH and AES

  3. client generates DH key PUBc, and POSTs HMAC(AES(KEYs, PUBc)) posts to /stage1 server generates a new DH key on each check in

  4. server returns HMAC(AES(KEYs, nonce+PUBs)) client calculates shared DH key KEYn

  5. client POSTs HMAC(AES(KEYn, [nonce+1]+sysinfo) to /stage2

  6. server returns HMAC(AES(KEYn, patched agent.py))

  7. client sleeps on interval, and then GETs /tasking.uri

  8. if no tasking, return standard looking page

  9. if tasking, server returns HMAC(AES(KEYn, tasking))

  10. client posts HMAC(AES(KEYn, tasking)) to /response.uri

S
Description
Automated archival mirror of github.com/EmpireProject/EmPyre
Readme BSD-3-Clause 866 KiB
Languages
Python 98.8%
Ruby 0.4%
Objective-C 0.2%
PHP 0.2%
Shell 0.2%
Other 0.2%