MythicC2Profiles / http

Simple HTTP async comms using standard GET/POST requests
29 stars 15 forks source link

Ssl Letsencrypt #3

Closed Chomikmarkus closed 2 years ago

Chomikmarkus commented 2 years ago

Hello! Tried to configure http C2_Profile use ssl with Letsencrypt! Getting error that cannot find keys! Tried inside /etc/letsencrypt/live/somesite.com/ directory! Tried also to copy keys into C2_Profile directory still keys not found!

its-a-feature commented 2 years ago

Good question!

All of the c2 profiles run in their own Docker containers, which is why I think you're having issues with paths. Take your private key and cert and put them in Mythic/C2_Profiles/http/c2_code/. Let's say you called them "key.pem" and "key.cert". In the config.json file that's in that same folder (or through the configure button in the web UI), update the two key paths to just the names key.pem and key.cert. Now, when you click to start the profile, after a few seconds you should get a message saying that SSL was successfully started on the specified port. Also make sure you put use_ssl to true (https://github.com/MythicC2Profiles/http/blob/master/C2_Profiles/http/c2_code/config.json#L15)

Chomikmarkus commented 2 years ago

Exactly what i did!

Chomikmarkus commented 2 years ago

Screenshot_20211228-204223 Screenshot_20211228-204039 Screenshot_20211228-204112

its-a-feature commented 2 years ago

If your screenshot is accurate, then your cert_path value is : /fullchain.pem" which isn't valid syntax, hence the error. it should be : "fullchain.pem"

Chomikmarkus commented 2 years ago

I saw that fixed it and same error

Chomikmarkus commented 2 years ago

Screenshot_20211228-205527 Screenshot_20211228-205557

its-a-feature commented 2 years ago

Well, now it's a different error saying it can't be found. What are the permissions on the fullchain.pem and privkey.pem. I wonder if they're not readable by the container?

Chomikmarkus commented 2 years ago

Actually this was problem after moving .pem keys from letsencrypt folder they became unreadable! i generated keys with openssl and everything works fine!