pry0cc / axiom

The dynamic infrastructure framework for everybody! Distribute the workload of many different scanning tools with ease, including nmap, ffuf, masscan, nuclei, meg and many more!
MIT License
4k stars 622 forks source link

axiom-account fails on first run when cloud provider is Digital Ocean #672

Closed joaopfcruz closed 1 year ago

joaopfcruz commented 1 year ago

In this line: https://github.com/pry0cc/axiom/blob/9489246808467c92914bc65713b1389388c6cdfc/interact/axiom-account#L65

At least on Debian (tested both 10 and 11 versions) this $OSvar will never be equal to "Linux". Example on debian 10:

# cat /etc/debian_version
10.12
# lsb_release -i | awk '{ print $3 }'
Debian

Because of this, doctl is not installed and axiom-account fails a few lines later when it tries to use doctl: /home/xpto/.axiom/interact/axiom-account: line 69: doctl: command not found Maybe that line should be replaced with the equivalent if condition as seen on axiom-configure: https://github.com/pry0cc/axiom/blob/master/interact/axiom-configure#L220

Or the same if clause as seen on do.sh helper: https://github.com/pry0cc/axiom/blob/master/interact/account-helpers/do.sh#L47

P.S-Because the first run we run and this fails like seen, the bootstrap function is executed which calls do.sh and here doctl installs sucessfully, which means that if we run axiom-account a 2nd time, doctl is already installed and will not show the error.

0xtavian commented 1 year ago

@joaopfcruz thanks for this fix! I’ll likely merge by end of day.

joaopfcruz commented 1 year ago

Tested (on Debian 11 only) and it's working like a charm! Will close the issue for you