Saturday, February 05, 2022

medusa on macos - fix flags to allow compile libssh2

compile Medusa to enable ssh module on Macos

==================

Medusa 

sw_vers Medusa v2.3_devel https://github.com/jmk-foofus/medusa 

Mac sw_vers 

ProductName: macOS ProductVersion: 12.0.1 BuildVersion: 21A559 Kernel Version: Darwin 21.1.0

==================

before fix flags: 

./configure --enable-module-ssh=yes 

 

upon configure, make, make install: 

 medusa -d 

Medusa v2.3_devel [http://www.foofus.net] (C) JoMo-Kun / Foofus 

Networks Available modules in "." : 

Available modules in "/usr/local/lib/medusa/modules" : 

+ cvs.mod : Brute force module for CVS sessions : version 2.0 

snip...

 + ssh.mod : Brute force module for SSH v2 sessions : version 2.1 (No usable LIBSSH2. Module disabled.) 

snip... 

 

This conducted to errors like these: 

macos1:some_dir lab$ medusa -v 6 -u user1 -P pass.txt -h 192.168.18.5 -M ssh 

Medusa v2.3_devel [http://www.foofus.net] (C) JoMo-Kun / Foofus Networks  

GENERAL: Parallel Hosts: 1 Parallel Logins: 1 

GENERAL: Total Hosts: 1 GENERAL: Total Users: 1 

GENERAL: Total Passwords: 17 

IMPORTANT: Couldn't load "ssh" [dlopen(/usr/local/lib/medusa/modules/ssh.mod, 0x0002): tried: '/usr/local/lib/medusa/modules/ssh.mod' (no such file), '/usr/local/lib/ssh.mod' (no such file), '/usr/lib/ssh.mod' (no such file)]. Place the module in the medusa directory, set the MEDUSA_MODULE_NAME environment variable or run the configure script again using --with-default-mod-path=[path]. invokeModule failed - see previous errors for an explanation 

 

================== 

after fix flags: 

credits to user njspix in: https://github.com/ropensci/git2r/issues/426 

tip: 

For compilers to find openssl@1.1 you may need to set: 

export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib" 

export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include" 

 

change file "configure" lines 4765 and 4766: 

before:

---

if test -d "/opt/local"; then 

CPPFLAGS="$CPPFLAGS -I/opt/local/include" 

LDFLAGS="$LDFLAGS -L/opt/local/lib" 

fi 

---

the change includes addiing 2 new paths on CPPFLAGS and LDFLAGS 

after change you should have:

---

if test -d "/opt/local"; then 

CPPFLAGS="$CPPFLAGS -I/opt/local/include -I/usr/local/opt/openssl@1.1/include" LDFLAGS="$LDFLAGS -L/opt/local/lib -L/usr/local/opt/openssl@1.1/lib" 

fi 

---

make clean 

./configure --enable-module-ssh=yes upon configure, make, make install: 

medusa -d 

Medusa v2.3_devel [http://www.foofus.net] (C) JoMo-Kun / Foofus 

Networks Available modules in "." : 

Available modules in "/usr/local/lib/medusa/modules" : 

+ cvs.mod : Brute force module for CVS sessions : version 2.0 

snip... 

+ ssh.mod : Brute force module for SSH v2 sessions : version 2.1 

snip...

================== 

hope this helps!!!