jm33-m0 / emp3r0r

Linux/Windows post-exploitation framework made by linux user
https://infosec.exchange/@jm33
MIT License
1.26k stars 232 forks source link

Error while building Agent with Indicator URL (expected 'package', found https) #10

Closed joaovarelas closed 3 years ago

joaovarelas commented 3 years ago
$ ./build.py agent
Use cached CC address (localhost)? [Y/n] n
Clean everything and start over? [Y/n] Y
 Deleted ./tls/emp3r0r-cert.pem
 Deleted ./tls/emp3r0r-key.pem
 Deleted ./tls/openssl-42c0be74-52ad-11eb-a236-3aad793bbfde.cnf
 Deleted ./build/agent
 Deleted ./build/build.json
 Deleted ./build/cc
 Deleted ./build/emp3r0r-cert.pem
 Deleted ./build/emp3r0r-key.pem
 Deleted ./build/emp3r0r.history
Traceback (most recent call last):
  File "./build.py", line 163, in clean
    os.remove(f)
IsADirectoryError: [Errno 21] Is a directory: './build/[agent_root]'
 Deleted ./tls/42c0be74-52ad-11eb-a236-3aad793bbfde-req.csr
CC server address (domain name or ip address): 127.0.0.1
Use cached CC indicator ()? [Y/n] n
CC status indicator: https://gist.githubusercontent.com/ID/raw/ID/gistfile1.txt
[!] Generating new certs...
>> creating serial
>> generating a keypair for: f02c3c48-52b0-11eb-a236-3aad793bbfde
.. key
Generating RSA private key, 2048 bit long modulus (2 primes)
...+++++
...+++++
e is 65537 (0x010001)
.. request
.. certificate
Signature ok
subject=CN = f02c3c48-52b0-11eb-a236-3aad793bbfde.com
Getting CA Private Key
.. removing key password
writing RSA key
<< f02c3c48-52b0-11eb-a236-3aad793bbfde keypair generated.
 Copy ./tls/emp3r0r-cert.pem to ./build
 Copy ./tls/emp3r0r-key.pem to ./build
GO BUILD starts...
../../internal/agent/def.go:1:1: expected 'package', found https <------------------
GO BUILD ends...
go build failed
jm33-m0 commented 3 years ago

image

jm33-m0 commented 3 years ago

IsADirectoryError: [Errno 21] Is a directory: './build/[agent_root]'

how did [agent_root] tag become a directory under build?

../../internal/agent/def.go:1:1: expected 'package', found https

looks like this file is fucked up, did you check how?

from my test build.py works just fine, with the config you provided

please re-clone the repo and try again, if the issue still exists, it might has something to do with your actual build config, you can dig into it and report the bug to me

joaovarelas commented 3 years ago

please re-clone the repo and try again, if the issue still exists, it might has something to do with your actual build config, you can dig into it and report the bug to me

Re-cloned the repo and now I am able to build both C&C and Agent.

Probably some misconfiguration as I was missing few dependencies and had to install after running emp3r0r.

The build config was broken.

Thanks