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
4.06k stars 645 forks source link

cannot send * through axiom-exec #502

Closed proabiral closed 2 years ago

proabiral commented 2 years ago

When I tried to send * via axiom-exec to remote machine, the * get expanded in local machine rather than remote machine.

For Example :

Running following command :

axiom-exec "ls /tmp/*"

send ls <list of files in /tmp/ on localmachine> to remove boxes.

I tried running the command with single quote axiom-exec 'ls /tmp/*' and also escaping * with \ axiom-exec 'ls /tmp/\*' axiom-exec "ls /tmp/\*" but none of it worked.

Please let me know if I could not explain the issue properly.

0xtavian commented 2 years ago

@proabiral i don’t believe asterisk ever worked thru axiom-exec. You should be able to accomplish the same above by running axiom-exec 'ls /tmp/'. Lmk if that helps.

proabiral commented 2 years ago

Hello @0xtavian ,

Thank you for such a quick response. I can not run something like axiom-exec 'ls /tmp/' when I need to list files starting with certain names like axiom-exec 'ls /tmp/dirsearch*'

I came up with the following temporary fix, (wrapping user supplied command in double quote " while passing to ssh):

axiom_execx(){
    servers="fleet01 fleet02 fleet03 fleet04 fleet05"
    echo $servers | xargs -n1 | xargs -I {} -P 100 -t ssh {} -F /home/foobar/.axiom/.sshconfig "$1"
}

axiom_execx "ls /tmp/dirsearch*"

Maybe it is possible to implement something that that with axiom-exec and axiom-ssh.

0xtavian commented 2 years ago

@proabiral this fix is being worked on here. I should be able to push by end of week. new-axiom-exec-help-menu

proabiral commented 2 years ago

@0xtavian Thanks.

A similar bug also exists on axiom-scp :

When I run something like : axiom-scp 'myfleet*':"/tmp/dir_*" '/tmp/puredns_axiom/'

I get error like following - (* is getting replaced by instance name in path aswell )

rsync: link_stat "/tmp/dir_myfleet01" failed: No such file or directory (2)

rsync: link_stat "/tmp/dir_myfleet02" failed: No such file or directory (2)

rsync: link_stat "/tmp/dir_myfleet03" failed: No such file or directory (2)
0xtavian commented 2 years ago

This fix for exec has been pushed to master. Scp will follow in the coming weeks. Thank you!