BC-SECURITY / Empire

Empire is a post-exploitation and adversary emulation framework that is used to aid Red Teams and Penetration Testers.
https://bc-security.gitbook.io/empire-wiki/
BSD 3-Clause "New" or "Revised" License
4.21k stars 575 forks source link

[BUG] Unable to start http listener with CertPath option #665

Closed CustosClarus closed 1 year ago

CustosClarus commented 1 year ago

Note: Please fill out all sections (if applicable) and do not delete the below section headers, otherwise the bot will close the issue.

Empire Version

OS Information (Linux flavor, Python version)

Describe the bug

Using HTTP listener , I cannot run the listener using CertPath argument

To Reproduce

  1. Start powershell-empire server
  2. Start powershell-empire client (Empire: uselistener/http) > set CertPath data/empire-chain.pem INFO: Set CertPath to ../empire/server/data/empire-chain.pem
[INFO]: 127.0.0.1:37800 - "POST /api/v2/listeners HTTP/1.1" 400 
[INFO]: v2: Starting listener 'First' 
[ERROR]: First: Listener startup on port 9090 failed: [Errno 2] No such file or directory 
Traceback (most recent call last):
  File "/usr/share/powershell-empire/empire/server/listeners/http.py", line 1235, in start_server
FileNotFoundError: [Errno 2] No such file or directory
[ERROR]: Failed to start listener 'First' 
[INFO]: 127.0.0.1:53352 - "POST /api/v2/listeners HTTP/1.1" 400 
 ##Expected behavior
[*] Active listeners:

  ID    Name              Host                                 Type      Delay/Jitter   KillDate    Redirect Target
  --    ----              ----                                 -------   ------------   --------    ---------------
  1     test              http://192.168.10.3:9090                 native    5/0.0      

Screenshots

alt text

Additional info

I have generated the cert using the script located in location /usr/share/powershell-empire/setup/cert.sh

CustosClarus commented 1 year ago

Problem solved you don't need to enter full path with file-name as with earlier version but just using the absolute path of the folder where the .pem file is located be enough.