guardicore / monkey

Infection Monkey - An open-source adversary emulation platform
https://www.guardicore.com/infectionmonkey/
GNU General Public License v3.0
6.68k stars 786 forks source link

Temp: In the middle of opensmtpd_68 packer script #4220

Closed VakarisZ closed 3 months ago

VakarisZ commented 4 months ago

Useful resources

To debug further you can use the deployed VM opensmtpd-66. su vakaris_zilius then history.

Mainly, the code required should already be in envs/monkey_zoo/packer/tasks/linux_setup_opensmtpd.yml, but it's not tested there might be bugs. You can also use this tutorial which will get you most of the way, but the contents of config files should be taken from opensmtpd-66 machine.

Once the image is built, you can use this to test if the exploit works

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 77.08%. Comparing base (f829392) to head (7223815). Report is 21 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #4220 +/- ## ======================================== Coverage 77.08% 77.08% ======================================== Files 442 442 Lines 14137 14137 Branches 18 18 ======================================== Hits 10897 10897 Misses 3240 3240 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

VakarisZ commented 4 months ago

I've fixed the config, but by practice and according to the CVE this version is not vulnerable:

# OpenSMTPD after commit a8e222352f and before version 6.6.2 does not adequately
# escape dangerous characters from user-controlled input.

The debian version seems to be close, but I'm getting some errors about missing dependencies:

googlecompute.opensmtpd-68: fatal: [default]: FAILED! => {"msg": "Unable to encrypt nor hash, passlib must be installed. No module named 'passlib'. Unable to encrypt nor hash, passlib must be installed. No module named 'passlib'"}

I'm not sure how much longer it would take to fix, so I'll drop it for now as it's not a priority