├── .gitignore ├── LICENSE ├── README.md ├── accounts ├── aws.json.example ├── azure.json.example ├── do.json.example ├── exoscale.json.example ├── hetzner.json.example ├── ibm.json.example └── linode.json.example ├── configs ├── 00-header ├── bashrc ├── sshd_config ├── sudoers ├── tmux-splash.sh ├── xstartup └── zshrc ├── images ├── json │ ├── builders │ │ ├── aws.json │ │ ├── azure.json │ │ ├── do.json │ │ ├── exoscale.json │ │ ├── gcp.json │ │ ├── hetzner.json │ │ ├── ibm-classic.json │ │ ├── ibm-vpc.json │ │ ├── linode.json │ │ └── scaleway.json │ └── provisioners │ │ ├── barebones.json │ │ ├── default.json │ │ ├── extras.json │ │ └── reconftw.json └── pkr.hcl │ ├── builders │ ├── aws.pkr.hcl │ ├── azure.pkr.hcl │ ├── do.pkr.hcl │ ├── exoscale.pkr.hcl │ ├── gcp.pkr.hcl │ ├── hetzner.pkr.hcl │ ├── ibm-classic.pkr.hcl │ ├── ibm-vpc.pkr.hcl │ ├── linode.pkr.hcl │ └── scaleway.pkr.hcl │ └── provisioners │ ├── barebones.pkr.hcl │ ├── default.pkr.hcl │ ├── extras.pkr.hcl │ └── reconftw.pkr.hcl ├── interact ├── account-helpers │ ├── aws.sh │ ├── azure.sh │ ├── do.sh │ ├── exoscale.sh │ ├── gcp.sh │ ├── hetzner.sh │ ├── ibm-classic.sh │ ├── ibm-vpc.sh │ ├── linode.sh │ └── scaleway.sh ├── ax ├── axiom-account ├── axiom-account-setup ├── axiom-build ├── axiom-configure ├── axiom-deploy ├── axiom-exec ├── axiom-fleet ├── axiom-fleet2 ├── axiom-images ├── axiom-init ├── axiom-ls ├── axiom-power ├── axiom-provider ├── axiom-region ├── axiom-rm ├── axiom-scan ├── axiom-scp ├── axiom-select ├── axiom-sizes ├── axiom-ssh ├── axiom-sync ├── axiom-update ├── expand_cidr.py ├── generate_packer ├── includes │ ├── ax-completion.sh │ ├── backup-files.txt │ ├── nmap-bootstrap.xsl │ ├── system-notification.sh │ └── vars.sh ├── nMap_Merger.py └── nmaptocsv.py ├── modules ├── amass.json ├── aquatone.json ├── arjun.json ├── asm.json ├── assetfinder.json ├── cero.json ├── cngo.json ├── commix.json ├── corsy.json ├── crlfuzz.json ├── crobat.json ├── ctfr.json ├── dalfox.json ├── dirdar.json ├── dnscewl.json ├── dnsgen.json ├── dnsrecon.json ├── dnsvalidator.json ├── dnsx.json ├── erlpopper-brute.json ├── exclude-cdn.json ├── exec.json ├── feroxbuster.json ├── fff.json ├── ffuf.json ├── ffuf_base.json ├── ffuz.json ├── findomain.json ├── gau.json ├── gauplus.json ├── github-endpoints.json ├── github-subdomains.json ├── gobuster-dir.json ├── gobuster-dns.json ├── gorgo.json ├── gospider.json ├── gospider_base.json ├── gowitness.json ├── gxss.json ├── hakrawler.json ├── hakrevdns.json ├── http2smugl.json ├── httprobe.json ├── httpx.json ├── ipcdn.json ├── jaeles.json ├── katana.json ├── krbrute.json ├── krscan.json ├── kxss.json ├── linkfinder.json ├── mantra.json ├── masscan.json ├── massdns.json ├── meg.json ├── naabu-nmap.json ├── naabu.json ├── nmap.json ├── nmapx.json ├── nuclei-screenshots.json ├── nuclei.json ├── openredirex.json ├── paramspider.json ├── puredns-bruteforce.json ├── puredns-resolve.json ├── puredns-single.json ├── rustscan.json ├── s3scanner.json ├── scrying.json ├── shuffledns.json ├── soxy.json ├── sqlmap.json ├── subfinder.json ├── subjs.json ├── testssl.json ├── tlscout.json ├── tlsx.json ├── trufflehog.json ├── unimap.json ├── wafw00f.json ├── waybackurls.json ├── waymore.json ├── webscreenshot.json ├── whois.json ├── wpscan.json └── xnlinkfinder.json ├── profiles ├── covenant.json ├── desktop.json ├── example.json ├── openvpn.json ├── squid.json └── wireguard.json ├── providers ├── aws-functions.sh ├── azure-functions.sh ├── do-functions.sh ├── exoscale-functions.sh ├── gcp-functions.sh ├── hetzner-functions.sh ├── ibm-classic-functions.sh ├── ibm-vpc-functions.sh ├── linode-functions.sh └── scaleway-functions.sh └── screenshots ├── aws.png ├── axbanner.png ├── axiom-fleet.gif ├── azure.png ├── digitalocean.png ├── exoscale.png ├── gcp.png ├── hetzner.png ├── ibm_cloud.png ├── linode.png ├── read-the-docs.png └── scaleway.png /.gitignore: -------------------------------------------------------------------------------- 1 | keys/* 2 | .sshconfig 3 | stats.log 4 | logs/* 5 | accounts/*.json 6 | .syncthing.* 7 | selected.conf 8 | .DS_store 9 | *.swp 10 | authorized_keys 11 | boxes/* 12 | archive/* 13 | tmp/* 14 | axiom.json 15 | images/json/axiom.json 16 | images/pkr.hcl/axiom.pkr.hcl 17 | images/axiom.json 18 | interact/includes/functions.sh 19 | selected.conf 20 | interact/includes/.auto_update 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 0xtavian 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /accounts/aws.json.example: -------------------------------------------------------------------------------- 1 | { 2 | "aws_access_key": "", 3 | "aws_secret_access_key": "aws secret access key", 4 | "group_owner_id": "", 5 | "security_group_id": "", 6 | "region": "us-west-2", 7 | "provider": "aws", 8 | "default_size": "t2.medium", 9 | "imageid": "axiom-default-", 10 | "sshkey": "axiom_rsa", 11 | "provisioner": "default" 12 | 13 | } 14 | -------------------------------------------------------------------------------- /accounts/azure.json.example: -------------------------------------------------------------------------------- 1 | { 2 | "client_id": "", 4 | "tenant_id": "", 5 | "subscription_id": "", 6 | "region": "eastus", 7 | "sshkey": "axiom_rsa", 8 | "resource_group": "axiom", 9 | "provider": "azure", 10 | "default_size": "Standard_B1ls", 11 | "use_azure_cli_auth": "true", 12 | "imageid": "axiom-default-", 13 | "provisioner": "default" 14 | } 15 | -------------------------------------------------------------------------------- /accounts/do.json.example: -------------------------------------------------------------------------------- 1 | { 2 | "do_key": "", 3 | "region": "nyc1", 4 | "provider": "do", 5 | "default_size": "s-1vcpu-1gb", 6 | "sshkey": "axiom_rsa", 7 | "op": "", 8 | "imageid": "axiom-default-", 9 | "provisioner": "default" 10 | } 11 | -------------------------------------------------------------------------------- /accounts/exoscale.json.example: -------------------------------------------------------------------------------- 1 | { 2 | "api_key": "", 3 | "api_secret": "", 4 | "security_group_name": "", 5 | "security_group_id": "", 6 | "region": "ch-gva-2", 7 | "provider": "exoscale", 8 | "default_size": "standard.medium", 9 | "sshkey": "axiom_rsa", 10 | "imageid": "axiom-default-", 11 | "provisioner": "default" 12 | } 13 | -------------------------------------------------------------------------------- /accounts/hetzner.json.example: -------------------------------------------------------------------------------- 1 | { 2 | "hetzner_key": "", 3 | "region": "nbg1", 4 | "provider": "hetzner", 5 | "default_size": "cx22", 6 | "sshkey": "axiom_rsa", 7 | "op": "", 8 | "imageid": "axiom-default-", 9 | "provisioner": "default" 10 | } 11 | -------------------------------------------------------------------------------- /accounts/ibm.json.example: -------------------------------------------------------------------------------- 1 | { 2 | "sl_key": "", 3 | "ibm_cloud_api_key": "", 4 | "region": "dal13", 5 | "provider": "ibm", 6 | "default_size": "2048", 7 | "cpu": "2", 8 | "username": "", 9 | "sshkey": "axiom_rsa", 10 | "imageid": "axiom-default-", 11 | "op": "", 12 | "provisioner": "default" 13 | } 14 | -------------------------------------------------------------------------------- /accounts/linode.json.example: -------------------------------------------------------------------------------- 1 | { 2 | "linode_key": "", 3 | "region": "us-east", 4 | "provider": "linode", 5 | "default_size": "g6-standard-1", 6 | "sshkey": "axiom_rsa", 7 | "op": "", 8 | "imageid": "axiom-default-", 9 | "provisioner": "default" 10 | } 11 | 12 | -------------------------------------------------------------------------------- /configs/00-header: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ip=$(dig +short myip.opendns.com @resolver1.opendns.com) 4 | echo "" 5 | cat << EOF 6 | █████╗ ██╗ ██╗ 7 | ██╔══██╗╚██╗██╔╝ 8 | ███████║ ╚███╔╝ 9 | ██╔══██║ ██╔██╗ 10 | ██║ ██║██╔╝ ██╗ 11 | ╚═╝ ╚═╝╚═╝ ╚═╝ 12 | 13 | EOF 14 | echo "" 15 | echo -e "Public IP: \033[0;34m$ip\033[0m - Instance: \033[0;34m$(hostname)\033[0m" 16 | echo "" 17 | -------------------------------------------------------------------------------- /configs/bashrc: -------------------------------------------------------------------------------- 1 | 2 | # Add RVM to PATH for scripting. Make sure this is the last PATH variable change. 3 | export PATH="$PATH:$HOME/.rvm/bin" 4 | export GOPATH=/home/op/go 5 | export PS1='\[\033[01;32m\]$(whoami)@$(hostname) \[\033[0m\]' 6 | alias ls="ls --color=auto" 7 | -------------------------------------------------------------------------------- /configs/sshd_config: -------------------------------------------------------------------------------- 1 | # Package generated configuration file 2 | # See the sshd_config(5) manpage for details 3 | 4 | # What ports, IPs and protocols we listen for 5 | Port 2266 6 | # Use these options to restrict which interfaces/protocols sshd will bind to 7 | #ListenAddress :: 8 | #ListenAddress 0.0.0.0 9 | Protocol 2 10 | # HostKeys for protocol version 2 11 | HostKey /etc/ssh/ssh_host_rsa_key 12 | HostKey /etc/ssh/ssh_host_dsa_key 13 | HostKey /etc/ssh/ssh_host_ecdsa_key 14 | HostKey /etc/ssh/ssh_host_ed25519_key 15 | #Privilege Separation is turned on for security 16 | UsePrivilegeSeparation yes 17 | 18 | # Lifetime and size of ephemeral version 1 server key 19 | KeyRegenerationInterval 3600 20 | ServerKeyBits 1024 21 | 22 | # Logging 23 | SyslogFacility AUTH 24 | LogLevel INFO 25 | 26 | # Authentication: 27 | LoginGraceTime 120 28 | PermitRootLogin no 29 | StrictModes yes 30 | 31 | RSAAuthentication yes 32 | PubkeyAuthentication yes 33 | #AuthorizedKeysFile %h/.ssh/authorized_keys 34 | 35 | # Don't read the user's ~/.rhosts and ~/.shosts files 36 | IgnoreRhosts yes 37 | # For this to work you will also need host keys in /etc/ssh_known_hosts 38 | RhostsRSAAuthentication no 39 | # similar for protocol version 2 40 | HostbasedAuthentication no 41 | # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication 42 | #IgnoreUserKnownHosts yes 43 | 44 | # To enable empty passwords, change to yes (NOT RECOMMENDED) 45 | PermitEmptyPasswords no 46 | 47 | # Change to yes to enable challenge-response passwords (beware issues with 48 | # some PAM modules and threads) 49 | ChallengeResponseAuthentication no 50 | 51 | # Change to no to disable tunnelled clear text passwords 52 | PasswordAuthentication no 53 | 54 | # Kerberos options 55 | #KerberosAuthentication no 56 | #KerberosGetAFSToken no 57 | #KerberosOrLocalPasswd yes 58 | #KerberosTicketCleanup yes 59 | 60 | # GSSAPI options 61 | #GSSAPIAuthentication no 62 | #GSSAPICleanupCredentials yes 63 | 64 | X11Forwarding yes 65 | X11DisplayOffset 10 66 | PrintMotd no 67 | PrintLastLog no 68 | TCPKeepAlive yes 69 | #UseLogin no 70 | 71 | #MaxStartups 10:30:60 72 | #Banner /etc/issue.net 73 | 74 | # Allow client to pass locale environment variables 75 | AcceptEnv LANG LC_* 76 | 77 | Subsystem sftp /usr/lib/openssh/sftp-server 78 | 79 | # Set this to 'yes' to enable PAM authentication, account processing, 80 | # and session processing. If this is enabled, PAM authentication will 81 | # be allowed through the ChallengeResponseAuthentication and 82 | # PasswordAuthentication. Depending on your PAM configuration, 83 | # PAM authentication via ChallengeResponseAuthentication may bypass 84 | # the setting of "PermitRootLogin yes 85 | # If you just want the PAM account and session checks to run without 86 | # PAM authentication, then enable this but set PasswordAuthentication 87 | # and ChallengeResponseAuthentication to 'no'. 88 | UsePAM yes 89 | -------------------------------------------------------------------------------- /configs/sudoers: -------------------------------------------------------------------------------- 1 | # 2 | # This file MUST be edited with the 'visudo' command as root. 3 | # 4 | # Please consider adding local content in /etc/sudoers.d/ instead of 5 | # directly modifying this file. 6 | # 7 | # See the man page for details on how to write a sudoers file. 8 | # 9 | Defaults env_reset 10 | Defaults mail_badpass 11 | Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin" 12 | 13 | # Host alias specification 14 | 15 | # User alias specification 16 | 17 | # Cmnd alias specification 18 | 19 | # User privilege specification 20 | root ALL=(ALL:ALL) ALL 21 | 22 | # Members of the admin group may gain root privileges 23 | %admin ALL=(ALL) ALL 24 | 25 | # Allow members of group sudo to execute any command 26 | %sudo ALL=(ALL:ALL) NOPASSWD: ALL 27 | 28 | # See sudoers(5) for more information on "#include" directives: 29 | 30 | #includedir /etc/sudoers.d 31 | -------------------------------------------------------------------------------- /configs/tmux-splash.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$(tty)" == "/dev/pts/1" && "$(echo $TMUX | wc -c)" -gt "1" ]] 4 | then 5 | /etc/update-motd.d/00-header 6 | fi 7 | -------------------------------------------------------------------------------- /configs/xstartup: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Uncomment the following two lines for normal desktop: 4 | # unset SESSION_MANAGER 5 | # exec /etc/X11/xinit/xinitrc 6 | 7 | [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup 8 | [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources 9 | xsetroot -solid grey 10 | vncconfig -iconic & 11 | x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & 12 | x-window-manager & 13 | 14 | gnome-panel & 15 | gnome-settings-daemon & 16 | metacity & 17 | nautilus & 18 | -------------------------------------------------------------------------------- /configs/zshrc: -------------------------------------------------------------------------------- 1 | export TERM="xterm-256color" 2 | export ZSH=/home/op/.oh-my-zsh 3 | export EDITOR='vim' 4 | export GOPATH=/home/op/go 5 | export HOME=/home/op 6 | export PATH="$PATH:$HOME/.rvm/bin:/home/op/go/bin:/home/op/bin:/home/op/.local/bin:/usr/local/go/bin" 7 | 8 | alias ls=" ls --color -sh" 9 | alias wclone="wget -H -p -k" 10 | alias nmap="grc nmap" 11 | alias netstat="grc netstat" 12 | alias ping="grc ping" 13 | alias tail="grc tail" 14 | alias ps="grc ps" 15 | 16 | zstyle ':omz:update' mode auto 17 | ZSH_THEME="mrtazz" 18 | 19 | source $ZSH/oh-my-zsh.sh 20 | source ~/.profile 21 | source $HOME/bin/tmux-splash.sh 22 | 23 | stty sane 24 | -------------------------------------------------------------------------------- /images/json/builders/aws.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [ 3 | { 4 | "access_key": "{{ user `aws_access_key` }}", 5 | "ami_name": "{{ user `snapshot_name` }}", 6 | "instance_type": "{{ user `default_size` }}", 7 | "region": "{{ user `region` }}", 8 | "secret_key": "{{ user `aws_secret_access_key` }}", 9 | "launch_block_device_mappings": [ 10 | { 11 | "device_name": "/dev/sda1", 12 | "volume_type": "gp2", 13 | "volume_size": 20, 14 | "encrypted": true, 15 | "delete_on_termination": true 16 | } 17 | ], 18 | "source_ami_filter": { 19 | "filters": { 20 | "virtualization-type": "hvm", 21 | "name": "ubuntu/images/*ubuntu-focal-20.04-amd64-server-*", 22 | "root-device-type": "ebs" 23 | }, 24 | "owners": [ 25 | "099720109477" 26 | ], 27 | "most_recent": true 28 | }, 29 | "ssh_username": "ubuntu", 30 | "temporary_key_pair_type": "ed25519", 31 | "type": "amazon-ebs" 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /images/json/builders/azure.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [ 3 | { 4 | "type": "azure-arm", 5 | "client_id": "{{ user `client_id` }}", 6 | "client_secret": "{{ user `client_secret` }}", 7 | "tenant_id": "{{ user `tenant_id` }}", 8 | "subscription_id": "{{ user `subscription_id` }}", 9 | "managed_image_resource_group_name": "{{ user `resource_group` }}", 10 | "managed_image_name": "{{ user `snapshot_name` }}", 11 | "build_resource_group_name": "{{ user `resource_group` }}", 12 | "os_type": "Linux", 13 | "image_publisher": "Canonical", 14 | "image_offer": "0001-com-ubuntu-server-focal-daily", 15 | "image_sku": "20_04-daily-lts-gen2", 16 | "vm_size": "{{ user `default_size` }}" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /images/json/builders/do.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [ 3 | { 4 | "type": "digitalocean", 5 | "ssh_username": "root", 6 | "snapshot_name": "{{ user `snapshot_name` }}", 7 | "api_token": "{{ user `do_key` }}", 8 | "image": "ubuntu-20-04-x64", 9 | "region": "{{ user `region` }}", 10 | "size": "{{ user `default_size` }}" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /images/json/builders/exoscale.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [ 3 | { 4 | "type": "exoscale", 5 | "api_key": "{{ user `api_key` }}", 6 | "api_secret": "{{ user `api_secret` }}", 7 | "instance_template": "Linux Ubuntu 20.04 LTS 64-bit", 8 | "instance_type": "{{ user `default_size` }}", 9 | "instance_security_groups": ["{{ user `security_group_name` }}"], 10 | "template_zones": ["{{ user `region` }}"], 11 | "template_name": "{{ user `snapshot_name` }}", 12 | "template_username": "op", 13 | "ssh_username": "root" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /images/json/builders/gcp.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [ 3 | { 4 | "type": "googlecompute", 5 | "project_id": "{{user `project`}}", 6 | "region": "{{user `physical_region`}}", 7 | "zone": "{{user `region`}}", 8 | "machine_type": "{{user `default_size`}}", 9 | "image_name": "{{user `snapshot_name`}}", 10 | "image_family": "axiom-images", 11 | "source_image_family": "ubuntu-2004-lts", 12 | "ssh_username": "root", 13 | "credentials_file": "{{user `service_account_key`}}", 14 | "network": "default", 15 | "subnetwork": "default", 16 | "use_internal_ip": false, 17 | "disk_size": 20, 18 | "disk_type": "pd-ssd", 19 | "ssh_timeout": "10m" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /images/json/builders/hetzner.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [ 3 | { 4 | "type": "hcloud", 5 | "image": "ubuntu-24.04", 6 | "server_type": "{{user `default_size`}}", 7 | "location": "{{user `region`}}", 8 | "token": "{{user `hetzner_key`}}", 9 | "ssh_username": "root", 10 | "snapshot_name": "{{ user `snapshot_name` }}", 11 | "snapshot_labels": { 12 | "packer.io/version": "{{ packer_version }}", 13 | "packer.io/build.id": "{{ build_name }}", 14 | "packer.io/build.time": "{{ timestamp }}", 15 | "os-flavor": "{{user `default_image`}}" 16 | } 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /images/json/builders/ibm-classic.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [ 3 | { 4 | "type": "ibmcloud", 5 | "api_key": "{{ user `sl_key` }}", 6 | "username": "{{ user `username` }}", 7 | "datacenter_name": "{{ user `region` }}", 8 | "base_os_code": "UBUNTU_20_64", 9 | "image_name": "{{ user `snapshot_name` }}", 10 | "instance_name": "packer-{{timestamp}}", 11 | "image_description": "Axiom full image built at {{isotime}}", 12 | "image_type": "standard", 13 | "instance_domain": "ax.private", 14 | "instance_flavor": "{{ user `default_size` }}", 15 | "instance_network_speed": 1000, 16 | "ssh_port": 22, 17 | "ssh_timeout": "15m", 18 | "instance_state_timeout": "25m", 19 | "communicator": "ssh" 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /images/json/builders/ibm-vpc.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [ 3 | { 4 | "type": "ibmcloud-vpc", 5 | "api_key": "{{user `ibm_cloud_api_key`}}", 6 | "region": "{{user `physical_region`}}", 7 | "subnet_id": "{{user `subnet_id`}}", 8 | "vsi_base_image_name": "ibm-ubuntu-22-04-4-minimal-amd64-4", 9 | "communicator": "ssh", 10 | "vsi_profile": "{{user `default_size`}}", 11 | "ssh_username": "root", 12 | "image_name": "{{user `snapshot_name`}}", 13 | "timeout": "50m" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /images/json/builders/linode.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [ 3 | { 4 | "type": "linode", 5 | "ssh_username": "root", 6 | "image_label": "{{ user `snapshot_name` }}", 7 | "instance_label": "{{ user `snapshot_name` }}", 8 | "image_description": "Axiom image", 9 | "linode_token": "{{ user `linode_key` }}", 10 | "image": "linode/ubuntu20.04", 11 | "region": "{{ user `region` }}", 12 | "instance_type": "{{ user `default_size` }}", 13 | "image_create_timeout": "60m" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /images/json/builders/scaleway.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [ 3 | { 4 | "type": "scaleway", 5 | "project_id": "{{user `default_project_id`}}", 6 | "access_key": "{{user `access_key`}}", 7 | "secret_key": "{{user `secret_key`}}", 8 | "image": "ubuntu_focal", 9 | "zone": "{{user `region`}}", 10 | "commercial_type": "{{user `default_size`}}", 11 | "ssh_username": "root", 12 | "image_name": "{{user `snapshot_name`}}", 13 | "snapshot_name": "{{user `snapshot_name`}}", 14 | "remove_volume": true 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /images/json/provisioners/barebones.json: -------------------------------------------------------------------------------- 1 | { 2 | "builders": [], 3 | "provisioners": [ 4 | { 5 | "type": "file", 6 | "source": "./configs", 7 | "destination":"/tmp/configs" 8 | }, 9 | { 10 | "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'", 11 | "inline": [ 12 | 13 | "echo 'Waiting for cloud-init to finish, this can take a few minutes please be patient...'", 14 | "/usr/bin/cloud-init status --wait", 15 | 16 | "fallocate -l 2G /swap && chmod 600 /swap && mkswap /swap && swapon /swap", 17 | "echo '/swap none swap sw 0 0' | sudo tee -a /etc/fstab", 18 | 19 | "echo 'Running dist-uprade'", 20 | "sudo apt update -qq", 21 | "DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew dist-upgrade -qq", 22 | 23 | "echo 'Installing ufw fail2ban net-tools zsh jq build-essential python3-pip unzip git p7zip libpcap-dev rubygems ruby-dev grc'", 24 | "sudo apt install fail2ban ufw net-tools zsh zsh-syntax-highlighting zsh-autosuggestions jq build-essential python3-pip unzip git p7zip libpcap-dev rubygems ruby-dev grc -y -qq", 25 | "ufw allow 22", 26 | "ufw allow 2266", 27 | "ufw --force enable", 28 | 29 | "echo 'Creating OP user'", 30 | "useradd -G sudo -s /usr/bin/zsh -m op", 31 | "mkdir -p /home/op/.ssh /home/op/c2 /home/op/recon/ /home/op/lists /home/op/go /home/op/bin /home/op/.config/ /home/op/.cache /home/op/work/ /home/op/.config/amass", 32 | "rm -rf /etc/update-motd.d/*", 33 | "/bin/su -l op -c 'wget -q https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O - | sh'", 34 | "chown -R op:users /home/op", 35 | "touch /home/op/.sudo_as_admin_successful", 36 | "touch /home/op/.cache/motd.legal-displayed", 37 | "chown -R op:users /home/op", 38 | "echo 'op:{{ user `op_random_password` }}' | chpasswd", 39 | "echo 'ubuntu:{{ user `op_random_password` }}' | chpasswd", 40 | "echo 'root:{{ user `op_random_password` }}' | chpasswd", 41 | 42 | "echo 'Moving Config files'", 43 | "mv /tmp/configs/sudoers /etc/sudoers", 44 | "pkexec chown root:root /etc/sudoers /etc/sudoers.d -R", 45 | "mv /tmp/configs/bashrc /home/op/.bashrc", 46 | "mv /tmp/configs/zshrc /home/op/.zshrc", 47 | "mv /tmp/configs/sshd_config /etc/ssh/sshd_config", 48 | "mv /tmp/configs/00-header /etc/update-motd.d/00-header", 49 | "mv /tmp/configs/authorized_keys /home/op/.ssh/authorized_keys", 50 | "mv /tmp/configs/tmux-splash.sh /home/op/bin/tmux-splash.sh", 51 | "/bin/su -l op -c 'sudo chmod 600 /home/op/.ssh/authorized_keys'", 52 | "chown -R op:users /home/op", 53 | "sudo service sshd restart", 54 | "chmod +x /etc/update-motd.d/00-header", 55 | 56 | "echo 'Installing Golang {{ user `golang_version` }}'", 57 | "wget -q https://golang.org/dl/go{{ user `golang_version` }}.linux-amd64.tar.gz && sudo tar -C /usr/local -xzf go{{ user `golang_version` }}.linux-amd64.tar.gz && rm go{{ user `golang_version` }}.linux-amd64.tar.gz", 58 | "export GOPATH=/home/op/go", 59 | 60 | "echo 'Installing Docker'", 61 | "curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh && rm get-docker.sh", 62 | "sudo usermod -aG docker op", 63 | 64 | "echo 'Installing Interlace'", 65 | "git clone https://github.com/codingo/Interlace.git /home/op/recon/interlace && cd /home/op/recon/interlace/ && python3 setup.py install", 66 | 67 | "echo 'Optimizing SSH Connections'", 68 | "/bin/su -l root -c 'echo \"ClientAliveInterval 60\" | sudo tee -a /etc/ssh/sshd_config'", 69 | "/bin/su -l root -c 'echo \"ClientAliveCountMax 60\" | sudo tee -a /etc/ssh/sshd_config'", 70 | "/bin/su -l root -c 'echo \"MaxSessions 100\" | sudo tee -a /etc/ssh/sshd_config'", 71 | "/bin/su -l root -c 'echo \"net.ipv4.netfilter.ip_conntrack_max = 1048576\" | sudo tee -a /etc/sysctl.conf'", 72 | "/bin/su -l root -c 'echo \"net.nf_conntrack_max = 1048576\" | sudo tee -a /etc/sysctl.conf'", 73 | "/bin/su -l root -c 'echo \"net.core.somaxconn = 1048576\" | sudo tee -a /etc/sysctl.conf'", 74 | "/bin/su -l root -c 'echo \"net.ipv4.ip_local_port_range = 1024 65535\" | sudo tee -a /etc/sysctl.conf'", 75 | "/bin/su -l root -c 'echo \"1024 65535\" | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range'", 76 | "chmod 600 /home/op/.ssh/authorized_keys", 77 | 78 | "echo 'Installing nmap'", 79 | "sudo apt-get -qy --no-install-recommends install alien", 80 | "/bin/su -l op -c 'wget https://nmap.org/dist/nmap-7.94-1.x86_64.rpm -O /home/op/recon/nmap.rpm && cd /home/op/recon/ && sudo alien ./nmap.rpm && sudo dpkg -i ./nmap*.deb'", 81 | "/bin/su -l root -c 'apt-get clean'", 82 | "echo \"CkNvbmdyYXR1bGF0aW9ucywgeW91ciBidWlsZCBpcyBhbG1vc3QgZG9uZSEKCiDilojilojilojilojilojilZcg4paI4paI4pWXICDilojilojilZcgICAg4paI4paI4paI4paI4paI4paI4pWXIOKWiOKWiOKVlyAgIOKWiOKWiOKVl+KWiOKWiOKVl+KWiOKWiOKVlyAgICAg4paI4paI4paI4paI4paI4paI4pWXCuKWiOKWiOKVlOKVkOKVkOKWiOKWiOKVl+KVmuKWiOKWiOKVl+KWiOKWiOKVlOKVnSAgICDilojilojilZTilZDilZDilojilojilZfilojilojilZEgICDilojilojilZHilojilojilZHilojilojilZEgICAgIOKWiOKWiOKVlOKVkOKVkOKWiOKWiOKVlwrilojilojilojilojilojilojilojilZEg4pWa4paI4paI4paI4pWU4pWdICAgICDilojilojilojilojilojilojilZTilZ3ilojilojilZEgICDilojilojilZHilojilojilZHilojilojilZEgICAgIOKWiOKWiOKVkSAg4paI4paI4pWRCuKWiOKWiOKVlOKVkOKVkOKWiOKWiOKVkSDilojilojilZTilojilojilZcgICAgIOKWiOKWiOKVlOKVkOKVkOKWiOKWiOKVl+KWiOKWiOKVkSAgIOKWiOKWiOKVkeKWiOKWiOKVkeKWiOKWiOKVkSAgICAg4paI4paI4pWRICDilojilojilZEK4paI4paI4pWRICDilojilojilZHilojilojilZTilZ0g4paI4paI4pWXICAgIOKWiOKWiOKWiOKWiOKWiOKWiOKVlOKVneKVmuKWiOKWiOKWiOKWiOKWiOKWiOKVlOKVneKWiOKWiOKVkeKWiOKWiOKWiOKWiOKWiOKWiOKWiOKVl+KWiOKWiOKWiOKWiOKWiOKWiOKVlOKVnQrilZrilZDilZ0gIOKVmuKVkOKVneKVmuKVkOKVnSAg4pWa4pWQ4pWdICAgIOKVmuKVkOKVkOKVkOKVkOKVkOKVnSAg4pWa4pWQ4pWQ4pWQ4pWQ4pWQ4pWdIOKVmuKVkOKVneKVmuKVkOKVkOKVkOKVkOKVkOKVkOKVneKVmuKVkOKVkOKVkOKVkOKVkOKVnQoKTWFpbnRhaW5lcjogMHh0YXZpYW4KCvCdk7LwnZO38J2TvPCdk7nwnZOy8J2Tu/Cdk67wnZOtIPCdk6vwnZSCIPCdk6rwnZSB8J2TsvCdk7jwnZO2OiDwnZO98J2TsfCdk64g8J2TrfCdlILwnZO38J2TqvCdk7bwnZOy8J2TrCDwnZOy8J2Tt/Cdk6/wnZO78J2TqvCdk7zwnZO98J2Tu/Cdk77wnZOs8J2TvfCdk77wnZO78J2TriDwnZOv8J2Tu/Cdk6rwnZO28J2TrvCdlIDwnZO48J2Tu/Cdk7Qg8J2Tr/Cdk7jwnZO7IPCdk67wnZO/8J2TrvCdk7vwnZSC8J2Tq/Cdk7jwnZOt8J2UgiEgLSBA8J2TufCdk7vwnZSCMPCdk6zwnZOsIEAw8J2UgfCdk73wnZOq8J2Tv/Cdk7LwnZOq8J2TtwoKUmVhZCB0aGVzZSB3aGlsZSB5b3UncmUgd2FpdGluZyB0byBnZXQgc3RhcnRlZCA6KQoKICAgIC0gTmV3IFdpa2k6IGh0dHBzOi8vYXgtZnJhbWV3b3JrLmdpdGJvb2suaW8vd2lraS8KICAgIC0gRXhpc3RpbmcgVXNlcnM6IGh0dHBzOi8vYXgtZnJhbWV3b3JrLmdpdGJvb2suaW8vd2lraS9vdmVydmlldy9leGlzdGluZy11c2VycwogICAgLSBCcmluZyBZb3VyIE93biBQcm92aXNpb25lcjogaHR0cHM6Ly9heC1mcmFtZXdvcmsuZ2l0Ym9vay5pby93aWtpL2Z1bmRhbWVudGFscy9icmluZy15b3VyLW93bi1wcm92aXNpb25lciAKICAgIC0gRmlsZXN5c3RlbSBVdGlsaXRpZXM6IGh0dHBzOi8vYXgtZnJhbWV3b3JrLmdpdGJvb2suaW8vd2lraS9mdW5kYW1lbnRhbHMvZmlsZXN5c3RlbS11dGlsaXRpZXMKICAgIC0gRmxlZXRzOiBodHRwczovL2F4LWZyYW1ld29yay5naXRib29rLmlvL3dpa2kvZnVuZGFtZW50YWxzL2ZsZWV0cwogICAgLSBTY2FuczogaHR0cHM6Ly9heC1mcmFtZXdvcmsuZ2l0Ym9vay5pby93aWtpL2Z1bmRhbWVudGFscy9zY2FuCg==\" | base64 -d", 83 | "chown root:root /etc/sudoers /etc/sudoers.d -R" 84 | ], "inline_shebang": "/bin/sh -x", 85 | "type": "shell" 86 | } 87 | ] 88 | } 89 | -------------------------------------------------------------------------------- /images/pkr.hcl/builders/aws.pkr.hcl: -------------------------------------------------------------------------------- 1 | variable "golang_version" { 2 | type = string 3 | } 4 | 5 | variable "variant" { 6 | type = string 7 | } 8 | 9 | variable "op_random_password" { 10 | type = string 11 | } 12 | 13 | variable "snapshot_name" { 14 | type = string 15 | } 16 | 17 | source "amazon-ebs" "packer" { 18 | access_key = var.aws_access_key 19 | secret_key = var.aws_secret_access_key 20 | region = var.region 21 | ami_name = var.snapshot_name 22 | instance_type = var.default_size 23 | 24 | launch_block_device_mappings { 25 | device_name = "/dev/sda1" 26 | volume_type = "gp2" 27 | volume_size = 20 28 | encrypted = true 29 | delete_on_termination = true 30 | } 31 | 32 | source_ami_filter { 33 | filters = { 34 | "virtualization-type" = "hvm" 35 | "name" = "ubuntu/images/*ubuntu-focal-20.04-amd64-server-*" 36 | "root-device-type" = "ebs" 37 | } 38 | owners = ["099720109477"] 39 | most_recent = true 40 | } 41 | 42 | ssh_username = "ubuntu" 43 | temporary_key_pair_type = "ed25519" 44 | } 45 | 46 | build { 47 | sources = ["source.amazon-ebs.packer"] 48 | 49 | -------------------------------------------------------------------------------- /images/pkr.hcl/builders/azure.pkr.hcl: -------------------------------------------------------------------------------- 1 | variable "golang_version" { 2 | type = string 3 | } 4 | 5 | variable "variant" { 6 | type = string 7 | } 8 | 9 | variable "op_random_password" { 10 | type = string 11 | } 12 | 13 | variable "snapshot_name" { 14 | type = string 15 | } 16 | 17 | source "azure-arm" "packer" { 18 | client_id = var.client_id 19 | client_secret = var.client_secret 20 | tenant_id = var.tenant_id 21 | subscription_id = var.subscription_id 22 | 23 | managed_image_resource_group_name = var.resource_group 24 | managed_image_name = var.snapshot_name 25 | 26 | build_resource_group_name = var.resource_group # Use your existing resource group name 27 | 28 | os_type = "Linux" 29 | image_publisher = "Canonical" 30 | image_offer = "0001-com-ubuntu-server-focal-daily" 31 | image_sku = "20_04-daily-lts-gen2" 32 | vm_size = var.default_size 33 | 34 | } 35 | 36 | build { 37 | sources = [ 38 | "source.azure-arm.packer" 39 | ] 40 | 41 | -------------------------------------------------------------------------------- /images/pkr.hcl/builders/do.pkr.hcl: -------------------------------------------------------------------------------- 1 | variable "golang_version" { 2 | type = string 3 | } 4 | 5 | variable "variant" { 6 | type = string 7 | } 8 | 9 | variable "op_random_password" { 10 | type = string 11 | } 12 | 13 | variable "snapshot_name" { 14 | type = string 15 | } 16 | 17 | source "digitalocean" "packer" { 18 | ssh_username = "root" 19 | snapshot_name = var.snapshot_name 20 | api_token = var.do_key 21 | image = "ubuntu-20-04-x64" 22 | region = var.region 23 | size = var.default_size 24 | } 25 | 26 | build { 27 | sources = [ 28 | "source.digitalocean.packer" 29 | ] 30 | 31 | -------------------------------------------------------------------------------- /images/pkr.hcl/builders/exoscale.pkr.hcl: -------------------------------------------------------------------------------- 1 | variable "golang_version" { 2 | type = string 3 | } 4 | 5 | variable "variant" { 6 | type = string 7 | } 8 | 9 | variable "op_random_password" { 10 | type = string 11 | } 12 | 13 | variable "snapshot_name" { 14 | type = string 15 | } 16 | 17 | source "exoscale" "packer" { 18 | api_key = var.api_key 19 | api_secret = var.api_secret 20 | instance_template = "Linux Ubuntu 20.04 LTS 64-bit" 21 | instance_type = var.default_size 22 | instance_security_groups = [var.security_group_name] 23 | template_zones = [var.region] 24 | template_name = var.snapshot_name 25 | template_username = "op" 26 | ssh_username = "root" 27 | } 28 | 29 | build { 30 | sources = ["source.exoscale.packer"] 31 | 32 | -------------------------------------------------------------------------------- /images/pkr.hcl/builders/gcp.pkr.hcl: -------------------------------------------------------------------------------- 1 | variable "golang_version" { 2 | type = string 3 | } 4 | 5 | variable "variant" { 6 | type = string 7 | } 8 | 9 | variable "op_random_password" { 10 | type = string 11 | } 12 | 13 | variable "snapshot_name" { 14 | type = string 15 | } 16 | 17 | source "googlecompute" "packer" { 18 | project_id = var.project 19 | region = var.physical_region 20 | zone = var.region 21 | machine_type = var.default_size 22 | image_name = var.snapshot_name 23 | image_family = "axiom-images" 24 | source_image_family = "ubuntu-2004-lts" 25 | ssh_username = "root" 26 | credentials_file = var.service_account_key 27 | network = "default" # Specify your network or use the default 28 | subnetwork = "default" # Specify your subnetwork if required 29 | use_internal_ip = false # Disable internal IP to avoid networking issues 30 | disk_size = 20 # Increase disk size if needed 31 | disk_type = "pd-ssd" # Specify disk type (pd-ssd or pd-standard) 32 | ssh_timeout = "10m" # Increase the SSH connection timeout 33 | } 34 | 35 | build { 36 | sources = [ 37 | "source.googlecompute.packer" 38 | ] 39 | -------------------------------------------------------------------------------- /images/pkr.hcl/builders/hetzner.pkr.hcl: -------------------------------------------------------------------------------- 1 | variable "golang_version" { 2 | type = string 3 | } 4 | 5 | variable "variant" { 6 | type = string 7 | } 8 | 9 | variable "op_random_password" { 10 | type = string 11 | } 12 | 13 | variable "snapshot_name" { 14 | type = string 15 | } 16 | 17 | source "hcloud" "packer" { 18 | image = "ubuntu-24.04" 19 | server_type = var.default_size 20 | location = var.region 21 | token = var.hetzner_key 22 | ssh_username = "root" 23 | snapshot_name = var.snapshot_name 24 | } 25 | 26 | build { 27 | sources = ["source.hcloud.packer"] 28 | -------------------------------------------------------------------------------- /images/pkr.hcl/builders/ibm-classic.pkr.hcl: -------------------------------------------------------------------------------- 1 | variable "golang_version" { 2 | type = string 3 | } 4 | 5 | variable "variant" { 6 | type = string 7 | } 8 | 9 | variable "op_random_password" { 10 | type = string 11 | } 12 | 13 | variable "snapshot_name" { 14 | type = string 15 | } 16 | 17 | 18 | source "ibmcloud-classic" "packer" { 19 | api_key = var.sl_key 20 | username = var.username 21 | datacenter_name = var.region 22 | base_os_code = "UBUNTU_20_64" 23 | image_name = var.snapshot_name 24 | instance_name = "packer-${timestamp()}" 25 | image_description = "Axiom full image built at ${timestamp()}" 26 | image_type = "standard" 27 | instance_domain = "ax.private" 28 | instance_network_speed = 1000 29 | instance_flavor = var.default_size 30 | ssh_username = "root" 31 | ssh_port = 22 32 | instance_state_timeout = "25m" 33 | communicator = "ssh" 34 | } 35 | 36 | build { 37 | sources = ["source.ibmcloud-classic.packer"] 38 | -------------------------------------------------------------------------------- /images/pkr.hcl/builders/ibm-vpc.pkr.hcl: -------------------------------------------------------------------------------- 1 | variable "golang_version" { 2 | type = string 3 | } 4 | 5 | variable "variant" { 6 | type = string 7 | } 8 | 9 | variable "op_random_password" { 10 | type = string 11 | } 12 | 13 | variable "snapshot_name" { 14 | type = string 15 | } 16 | 17 | source "ibmcloud-vpc" "packer" { 18 | api_key = var.ibm_cloud_api_key 19 | region = var.physical_region 20 | subnet_id = var.subnet_id 21 | vsi_base_image_name = "ibm-ubuntu-22-04-4-minimal-amd64-4" 22 | communicator = "ssh" 23 | vsi_profile = var.default_size 24 | ssh_username = "root" 25 | image_name = var.snapshot_name 26 | timeout = "50m" 27 | } 28 | 29 | build { 30 | sources = ["source.ibmcloud-vpc.packer"] 31 | -------------------------------------------------------------------------------- /images/pkr.hcl/builders/linode.pkr.hcl: -------------------------------------------------------------------------------- 1 | variable "golang_version" { 2 | type = string 3 | } 4 | 5 | variable "variant" { 6 | type = string 7 | } 8 | 9 | variable "op_random_password" { 10 | type = string 11 | } 12 | 13 | variable "snapshot_name" { 14 | type = string 15 | } 16 | 17 | source "linode" "packer" { 18 | ssh_username = "root" 19 | image_label = var.snapshot_name 20 | instance_label = var.snapshot_name 21 | image_description = "Axiom image" 22 | linode_token = var.linode_key 23 | image = "linode/ubuntu20.04" 24 | region = var.region 25 | instance_type = var.default_size 26 | image_create_timeout = "60m" 27 | } 28 | 29 | build { 30 | sources = [ 31 | "source.linode.packer" 32 | ] 33 | 34 | -------------------------------------------------------------------------------- /images/pkr.hcl/builders/scaleway.pkr.hcl: -------------------------------------------------------------------------------- 1 | variable "golang_version" { 2 | type = string 3 | } 4 | 5 | variable "variant" { 6 | type = string 7 | } 8 | 9 | variable "op_random_password" { 10 | type = string 11 | } 12 | 13 | variable "snapshot_name" { 14 | type = string 15 | } 16 | 17 | source "scaleway" "packer" { 18 | project_id = var.default_project_id 19 | access_key = var.access_key 20 | secret_key = var.secret_key 21 | image = "ubuntu_focal" 22 | zone = var.region 23 | commercial_type = var.default_size 24 | ssh_username = "root" 25 | image_name = var.snapshot_name 26 | snapshot_name = var.snapshot_name 27 | remove_volume = "true" 28 | } 29 | 30 | build { 31 | sources = [ 32 | "source.scaleway.packer" 33 | ] 34 | -------------------------------------------------------------------------------- /images/pkr.hcl/provisioners/barebones.pkr.hcl: -------------------------------------------------------------------------------- 1 | provisioner "file" { 2 | source = "./configs" 3 | destination = "/tmp/configs" 4 | } 5 | 6 | provisioner "shell" { 7 | execute_command = "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'" 8 | inline = [ 9 | "echo 'Waiting for cloud-init to finish, this can take a few minutes please be patient...'", 10 | "/usr/bin/cloud-init status --wait", 11 | 12 | "fallocate -l 2G /swap && chmod 600 /swap && mkswap /swap && swapon /swap", 13 | "echo '/swap none swap sw 0 0' | sudo tee -a /etc/fstab", 14 | 15 | "echo 'Running dist-uprade'", 16 | "sudo apt update -qq", 17 | "DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew dist-upgrade -qq", 18 | 19 | "echo 'Installing ufw fail2ban net-tools zsh jq build-essential python3-pip unzip git p7zip libpcap-dev rubygems ruby-dev grc'", 20 | "sudo apt install fail2ban ufw net-tools zsh zsh-syntax-highlighting zsh-autosuggestions jq build-essential python3-pip unzip git p7zip libpcap-dev rubygems ruby-dev grc -y -qq", 21 | 22 | "ufw allow 22", 23 | "ufw allow 2266", 24 | "ufw --force enable", 25 | 26 | "echo 'Creating OP user'", 27 | "useradd -G sudo -s /usr/bin/zsh -m op", 28 | "mkdir -p /home/op/.ssh /home/op/c2 /home/op/recon/ /home/op/lists /home/op/go /home/op/bin /home/op/.config/ /home/op/.cache /home/op/work/ /home/op/.config/amass", 29 | "rm -rf /etc/update-motd.d/*", 30 | "/bin/su -l op -c 'wget -q https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O - | sh'", 31 | "chown -R op:users /home/op", 32 | "touch /home/op/.sudo_as_admin_successful", 33 | "touch /home/op/.cache/motd.legal-displayed", 34 | "chown -R op:users /home/op", 35 | "echo 'op:${var.op_random_password}' | chpasswd", 36 | "echo 'ubuntu:${var.op_random_password}' | chpasswd", 37 | "echo 'root:${var.op_random_password}' | chpasswd", 38 | 39 | "echo 'Moving Config files'", 40 | "mv /tmp/configs/sudoers /etc/sudoers", 41 | "pkexec chown root:root /etc/sudoers /etc/sudoers.d -R", 42 | "mv /tmp/configs/bashrc /home/op/.bashrc", 43 | "mv /tmp/configs/zshrc /home/op/.zshrc", 44 | "mv /tmp/configs/sshd_config /etc/ssh/sshd_config", 45 | "mv /tmp/configs/00-header /etc/update-motd.d/00-header", 46 | "mv /tmp/configs/authorized_keys /home/op/.ssh/authorized_keys", 47 | "mv /tmp/configs/tmux-splash.sh /home/op/bin/tmux-splash.sh", 48 | "/bin/su -l op -c 'sudo chmod 600 /home/op/.ssh/authorized_keys'", 49 | "chown -R op:users /home/op", 50 | "sudo service sshd restart", 51 | "chmod +x /etc/update-motd.d/00-header", 52 | 53 | "echo 'Installing Golang ${var.golang_version}'", 54 | "wget -q https://golang.org/dl/go${var.golang_version}.linux-amd64.tar.gz && sudo tar -C /usr/local -xzf go${var.golang_version}.linux-amd64.tar.gz && rm go${var.golang_version}.linux-amd64.tar.gz", 55 | "export GOPATH=/home/op/go", 56 | 57 | "echo 'Installing Docker'", 58 | "curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh && rm get-docker.sh", 59 | "sudo usermod -aG docker op", 60 | 61 | "echo 'Installing Interlace'", 62 | "git clone https://github.com/codingo/Interlace.git /home/op/recon/interlace && cd /home/op/recon/interlace/ && python3 setup.py install", 63 | 64 | "echo 'Optimizing SSH Connections'", 65 | "/bin/su -l root -c 'echo \"ClientAliveInterval 60\" | sudo tee -a /etc/ssh/sshd_config'", 66 | "/bin/su -l root -c 'echo \"ClientAliveCountMax 60\" | sudo tee -a /etc/ssh/sshd_config'", 67 | "/bin/su -l root -c 'echo \"MaxSessions 100\" | sudo tee -a /etc/ssh/sshd_config'", 68 | "/bin/su -l root -c 'echo \"net.ipv4.netfilter.ip_conntrack_max = 1048576\" | sudo tee -a /etc/sysctl.conf'", 69 | "/bin/su -l root -c 'echo \"net.nf_conntrack_max = 1048576\" | sudo tee -a /etc/sysctl.conf'", 70 | "/bin/su -l root -c 'echo \"net.core.somaxconn = 1048576\" | sudo tee -a /etc/sysctl.conf'", 71 | "/bin/su -l root -c 'echo \"net.ipv4.ip_local_port_range = 1024 65535\" | sudo tee -a /etc/sysctl.conf'", 72 | "/bin/su -l root -c 'echo \"1024 65535\" | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range'", 73 | "chmod 600 /home/op/.ssh/authorized_keys", 74 | 75 | "echo 'Installing nmap'", 76 | "sudo apt-get -qy --no-install-recommends install alien", 77 | "/bin/su -l op -c 'wget https://nmap.org/dist/nmap-7.94-1.x86_64.rpm -O /home/op/recon/nmap.rpm && cd /home/op/recon/ && sudo alien ./nmap.rpm && sudo dpkg -i ./nmap*.deb'", 78 | "/bin/su -l root -c 'apt-get clean'", 79 | "echo \"CkNvbmdyYXR1bGF0aW9ucywgeW91ciBidWlsZCBpcyBhbG1vc3QgZG9uZSEKCiDilojilojilojilojilojilZcg4paI4paI4pWXICDilojilojilZcgICAg4paI4paI4paI4paI4paI4paI4pWXIOKWiOKWiOKVlyAgIOKWiOKWiOKVl+KWiOKWiOKVl+KWiOKWiOKVlyAgICAg4paI4paI4paI4paI4paI4paI4pWXCuKWiOKWiOKVlOKVkOKVkOKWiOKWiOKVl+KVmuKWiOKWiOKVl+KWiOKWiOKVlOKVnSAgICDilojilojilZTilZDilZDilojilojilZfilojilojilZEgICDilojilojilZHilojilojilZHilojilojilZEgICAgIOKWiOKWiOKVlOKVkOKVkOKWiOKWiOKVlwrilojilojilojilojilojilojilojilZEg4pWa4paI4paI4paI4pWU4pWdICAgICDilojilojilojilojilojilojilZTilZ3ilojilojilZEgICDilojilojilZHilojilojilZHilojilojilZEgICAgIOKWiOKWiOKVkSAg4paI4paI4pWRCuKWiOKWiOKVlOKVkOKVkOKWiOKWiOKVkSDilojilojilZTilojilojilZcgICAgIOKWiOKWiOKVlOKVkOKVkOKWiOKWiOKVl+KWiOKWiOKVkSAgIOKWiOKWiOKVkeKWiOKWiOKVkeKWiOKWiOKVkSAgICAg4paI4paI4pWRICDilojilojilZEK4paI4paI4pWRICDilojilojilZHilojilojilZTilZ0g4paI4paI4pWXICAgIOKWiOKWiOKWiOKWiOKWiOKWiOKVlOKVneKVmuKWiOKWiOKWiOKWiOKWiOKWiOKVlOKVneKWiOKWiOKVkeKWiOKWiOKWiOKWiOKWiOKWiOKWiOKVl+KWiOKWiOKWiOKWiOKWiOKWiOKVlOKVnQrilZrilZDilZ0gIOKVmuKVkOKVneKVmuKVkOKVnSAg4pWa4pWQ4pWdICAgIOKVmuKVkOKVkOKVkOKVkOKVkOKVnSAg4pWa4pWQ4pWQ4pWQ4pWQ4pWQ4pWdIOKVmuKVkOKVneKVmuKVkOKVkOKVkOKVkOKVkOKVkOKVneKVmuKVkOKVkOKVkOKVkOKVkOKVnQoKTWFpbnRhaW5lcjogMHh0YXZpYW4KCvCdk7LwnZO38J2TvPCdk7nwnZOy8J2Tu/Cdk67wnZOtIPCdk6vwnZSCIPCdk6rwnZSB8J2TsvCdk7jwnZO2OiDwnZO98J2TsfCdk64g8J2TrfCdlILwnZO38J2TqvCdk7bwnZOy8J2TrCDwnZOy8J2Tt/Cdk6/wnZO78J2TqvCdk7zwnZO98J2Tu/Cdk77wnZOs8J2TvfCdk77wnZO78J2TriDwnZOv8J2Tu/Cdk6rwnZO28J2TrvCdlIDwnZO48J2Tu/Cdk7Qg8J2Tr/Cdk7jwnZO7IPCdk67wnZO/8J2TrvCdk7vwnZSC8J2Tq/Cdk7jwnZOt8J2UgiEgLSBA8J2TufCdk7vwnZSCMPCdk6zwnZOsIEAw8J2UgfCdk73wnZOq8J2Tv/Cdk7LwnZOq8J2TtwoKUmVhZCB0aGVzZSB3aGlsZSB5b3UncmUgd2FpdGluZyB0byBnZXQgc3RhcnRlZCA6KQoKICAgIC0gTmV3IFdpa2k6IGh0dHBzOi8vYXgtZnJhbWV3b3JrLmdpdGJvb2suaW8vd2lraS8KICAgIC0gRXhpc3RpbmcgVXNlcnM6IGh0dHBzOi8vYXgtZnJhbWV3b3JrLmdpdGJvb2suaW8vd2lraS9vdmVydmlldy9leGlzdGluZy11c2VycwogICAgLSBCcmluZyBZb3VyIE93biBQcm92aXNpb25lcjogaHR0cHM6Ly9heC1mcmFtZXdvcmsuZ2l0Ym9vay5pby93aWtpL2Z1bmRhbWVudGFscy9icmluZy15b3VyLW93bi1wcm92aXNpb25lciAKICAgIC0gRmlsZXN5c3RlbSBVdGlsaXRpZXM6IGh0dHBzOi8vYXgtZnJhbWV3b3JrLmdpdGJvb2suaW8vd2lraS9mdW5kYW1lbnRhbHMvZmlsZXN5c3RlbS11dGlsaXRpZXMKICAgIC0gRmxlZXRzOiBodHRwczovL2F4LWZyYW1ld29yay5naXRib29rLmlvL3dpa2kvZnVuZGFtZW50YWxzL2ZsZWV0cwogICAgLSBTY2FuczogaHR0cHM6Ly9heC1mcmFtZXdvcmsuZ2l0Ym9vay5pby93aWtpL2Z1bmRhbWVudGFscy9zY2FuCg==\" | base64 -d", 80 | "chown root:root /etc/sudoers /etc/sudoers.d -R" 81 | ] 82 | inline_shebang = "/bin/sh -x" 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /interact/account-helpers/aws.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | AXIOM_PATH="$HOME/.axiom" 4 | source "$AXIOM_PATH/interact/includes/vars.sh" 5 | 6 | token="" 7 | region="" 8 | provider="" 9 | size="" 10 | 11 | BASEOS="$(uname)" 12 | case $BASEOS in 13 | 'Linux') 14 | BASEOS='Linux' 15 | ;; 16 | 'FreeBSD') 17 | BASEOS='FreeBSD' 18 | alias ls='ls -G' 19 | ;; 20 | 'WindowsNT') 21 | BASEOS='Windows' 22 | ;; 23 | 'Darwin') 24 | BASEOS='Mac' 25 | ;; 26 | 'SunOS') 27 | BASEOS='Solaris' 28 | ;; 29 | 'AIX') ;; 30 | *) ;; 31 | esac 32 | 33 | installed_version=$(aws --version 2>/dev/null | cut -d ' ' -f 1 | cut -d '/' -f 2) 34 | 35 | # Check if the installed version matches the recommended version 36 | if [[ "$(printf '%s\n' "$installed_version" "$AWSCliVersion" | sort -V | head -n 1)" != "$AWSCliVersion" ]]; then 37 | echo -e "${Yellow}AWS CLI is either not installed or version is lower than the recommended version in ~/.axiom/interact/includes/vars.sh${Color_Off}" 38 | 39 | # Determine the OS type and handle installation accordingly 40 | if [[ $BASEOS == "Mac" ]]; then 41 | echo -e "${BGreen}Installing/Updating AWS CLI on macOS...${Color_Off}" 42 | curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg" 43 | sudo installer -pkg AWSCLIV2.pkg -target / 44 | rm AWSCLIV2.pkg 45 | 46 | elif [[ $BASEOS == "Linux" ]]; then 47 | if uname -a | grep -qi "Microsoft"; then 48 | OS="UbuntuWSL" 49 | else 50 | OS=$(lsb_release -i 2>/dev/null | awk '{ print $3 }') 51 | if ! command -v lsb_release &> /dev/null; then 52 | OS="unknown-Linux" 53 | BASEOS="Linux" 54 | fi 55 | fi 56 | 57 | # Install AWS CLI based on specific Linux distribution 58 | if [[ $OS == "Ubuntu" ]] || [[ $OS == "Debian" ]] || [[ $OS == "Linuxmint" ]] || [[ $OS == "Parrot" ]] || [[ $OS == "Kali" ]] || [[ $OS == "unknown-Linux" ]] || [[ $OS == "UbuntuWSL" ]]; then 59 | echo -e "${BGreen}Installing/Updating AWS CLI on $OS...${Color_Off}" 60 | curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "/tmp/awscliv2.zip" 61 | cd /tmp 62 | unzip awscliv2.zip 63 | sudo ./aws/install 64 | rm -rf /tmp/aws 65 | rm /tmp/awscliv2.zip 66 | elif [[ $OS == "Fedora" ]]; then 67 | echo -e "${BGreen}Installing/Updating AWS CLI on Fedora...${Color_Off}" 68 | sudo dnf install -y unzip 69 | curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "/tmp/awscliv2.zip" 70 | cd /tmp 71 | unzip awscliv2.zip 72 | sudo ./aws/install 73 | rm -rf /tmp/aws 74 | rm /tmp/awscliv2.zip 75 | else 76 | echo -e "${BRed}Unsupported Linux distribution: $OS${Color_Off}" 77 | fi 78 | fi 79 | 80 | echo "AWS CLI updated to version $AWSCliVersion." 81 | else 82 | echo "AWS CLI is already at or above the recommended version $AWSCliVersion." 83 | fi 84 | 85 | function awssetup(){ 86 | 87 | echo -e -n "${Green}Please enter your AWS Access Key ID (required): \n>> ${Color_Off}" 88 | read ACCESS_KEY 89 | while [[ "$ACCESS_KEY" == "" ]]; do 90 | echo -e "${BRed}Please provide an AWS Access KEY ID, your entry contained no input.${Color_Off}" 91 | echo -e -n "${Green}Please enter your token (required): \n>> ${Color_Off}" 92 | read ACCESS_KEY 93 | done 94 | 95 | echo -e -n "${Green}Please enter your AWS Secret Access Key (required): \n>> ${Color_Off}" 96 | read SECRET_KEY 97 | while [[ "$SECRET_KEY" == "" ]]; do 98 | echo -e "${BRed}Please provide an AWS Secret Access Key, your entry contained no input.${Color_Off}" 99 | echo -e -n "${Green}Please enter your token (required): \n>> ${Color_Off}" 100 | read SECRET_KEY 101 | done 102 | 103 | aws configure set aws_access_key_id "$ACCESS_KEY" 104 | aws configure set aws_secret_access_key "$SECRET_KEY" 105 | aws configure set output json 106 | 107 | default_region="us-west-2" 108 | echo -e -n "${Green}Please enter your default region (you can always change this later with axiom-region select \$region): Default '$default_region', press enter \n>> ${Color_Off}" 109 | read region 110 | if [[ "$region" == "" ]]; then 111 | echo -e "${Blue}Selected default option '$default_region'${Color_Off}" 112 | region="$default_region" 113 | fi 114 | echo -e -n "${Green}Please enter your default size (you can always change this later with axiom-sizes select \$size): Default 't2.medium', press enter \n>> ${Color_Off}" 115 | read size 116 | if [[ "$size" == "" ]]; then 117 | echo -e "${Blue}Selected default option 't2.medium'${Color_Off}" 118 | size="t2.medium" 119 | fi 120 | 121 | aws configure set default.region "$region" 122 | 123 | # Print available security groups 124 | echo -e "${BGreen}Printing Available Security Groups:${Color_Off}" 125 | ( 126 | echo -e "GroupName\tGroupId\tOwnerId\tVpcId\tFromPort\tToPort" 127 | aws ec2 describe-security-groups \ 128 | --query 'SecurityGroups[*].{GroupName:GroupName,GroupId:GroupId,OwnerId:OwnerId,VpcId:VpcId,FromPort:IpPermissions[0].FromPort,ToPort:IpPermissions[0].ToPort}' \ 129 | --output json | jq -r '.[] | [.GroupName, .GroupId, .OwnerId, .VpcId, .FromPort, .ToPort] | @tsv' 130 | ) | column -t 131 | 132 | # Prompt user to enter a security group name 133 | echo -e -n "${Green}Please enter a security group name above or press enter to create a new security group with a random name \n>> ${Color_Off}" 134 | read SECURITY_GROUP 135 | 136 | # Get all available AWS regions 137 | all_regions=$(aws ec2 describe-regions --query "Regions[].RegionName" --output text) 138 | 139 | echo -e "${BGreen}Creating or reusing the security group '$SECURITY_GROUP' in ALL AWS regions...${Color_Off}" 140 | 141 | # We will track the "last" group_id and group_owner_id found or created 142 | # so the script can still store them as before. 143 | last_group_id="" 144 | group_owner_id="" 145 | 146 | # If no security group name is provided, generate one (same name will be used in all regions) 147 | if [[ "$SECURITY_GROUP" == "" ]]; then 148 | axiom_sg_random="axiom-$(date +%m-%d_%H-%M-%S-%1N)" 149 | SECURITY_GROUP=$axiom_sg_random 150 | echo -e "${BGreen}No Security Group provided, will create a new one: '$SECURITY_GROUP' in each region.${Color_Off}" 151 | fi 152 | 153 | for r in $all_regions; do 154 | echo -e "\n${BGreen}--- Region: $r ---${Color_Off}" 155 | 156 | # Check if the security group already exists in this region 157 | existing_group_id=$(aws ec2 describe-security-groups \ 158 | --filters "Name=group-name,Values=$SECURITY_GROUP" \ 159 | --region "$r" \ 160 | --query "SecurityGroups[*].GroupId" \ 161 | --output text 2>/dev/null) 162 | 163 | if [[ "$existing_group_id" == "None" ]] || [[ -z "$existing_group_id" ]]; then 164 | # Create the security group in this region 165 | echo -e "${BGreen}Creating Security Group '$SECURITY_GROUP' in region $r...${Color_Off}" 166 | create_output=$(aws ec2 create-security-group \ 167 | --group-name "$SECURITY_GROUP" \ 168 | --description "Axiom SG" \ 169 | --region "$r" 2>&1) 170 | 171 | # If creation failed for any reason, log and continue to next region 172 | if [[ $? -ne 0 ]]; then 173 | echo -e "${BRed}Failed to create security group in region $r: $create_output${Color_Off}" 174 | continue 175 | fi 176 | 177 | new_group_id=$(echo "$create_output" | jq -r '.GroupId' 2>/dev/null) 178 | if [[ "$new_group_id" == "null" ]]; then 179 | echo -e "${BRed}Could not parse GroupId from creation output. Raw output:\n$create_output${Color_Off}" 180 | continue 181 | fi 182 | 183 | echo -e "${BGreen}Created Security Group: $new_group_id in region $r${Color_Off}" 184 | last_group_id="$new_group_id" 185 | else 186 | echo -e "${BGreen}Security Group '$SECURITY_GROUP' already exists in region $r (GroupId: $existing_group_id).${Color_Off}" 187 | last_group_id="$existing_group_id" 188 | fi 189 | 190 | # Attempt to add the rule (port 2266 for 0.0.0.0/0) 191 | # If it already exists, AWS will throw an error that we can catch 192 | group_rules=$(aws ec2 authorize-security-group-ingress \ 193 | --group-id "$last_group_id" \ 194 | --protocol tcp \ 195 | --port 2266 \ 196 | --cidr 0.0.0.0/0 \ 197 | --region "$r" 2>&1 198 | ) 199 | cmd_exit_status=$? 200 | 201 | if [[ $cmd_exit_status -ne 0 ]]; then 202 | # If AWS CLI returned an error code (non-zero), check if it's a duplicate rule 203 | if echo "$group_rules" | grep -q "InvalidPermission.Duplicate"; then 204 | echo -e "${BGreen}Ingress rule already exists in region $r.${Color_Off}" 205 | else 206 | echo -e "${BRed}Failed to add rule in region $r: $group_rules${Color_Off}" 207 | fi 208 | else 209 | # If $cmd_exit_status == 0, AWS CLI succeeded. 210 | # Even though you get output JSON, "Return": true means success. 211 | echo -e "${BGreen}Rule added successfully in region $r. Output:\n$group_rules${Color_Off}" 212 | fi 213 | 214 | # Fetch the owner ID for the newly found/created security group 215 | owner_id=$(aws ec2 describe-security-groups \ 216 | --group-ids "$last_group_id" \ 217 | --region "$r" \ 218 | --query "SecurityGroups[*].OwnerId" \ 219 | --output text 2>/dev/null) 220 | 221 | # We'll overwrite group_owner_id each time so that, after the last region, 222 | # we hold the last known group_owner_id. Typically, it's the same account ID. 223 | group_owner_id="$owner_id" 224 | done 225 | 226 | data="$(echo "{\"aws_access_key\":\"$ACCESS_KEY\",\"aws_secret_access_key\":\"$SECRET_KEY\",\"group_owner_id\":\"$group_owner_id\",\"security_group_name\":\"$SECURITY_GROUP\",\"security_group_id\":\"$last_group_id\",\"region\":\"$region\",\"provider\":\"aws\",\"default_size\":\"$size\"}")" 227 | 228 | echo -e "${BGreen}Profile settings below: ${Color_Off}" 229 | echo "$data" | jq '.aws_secret_access_key = "*************************************"' 230 | echo -e "${BWhite}Press enter if you want to save these to a new profile, type 'r' if you wish to start again.${Color_Off}" 231 | read ans 232 | 233 | if [[ "$ans" == "r" ]]; 234 | then 235 | $0 236 | exit 237 | fi 238 | 239 | echo -e -n "${BWhite}Please enter your profile name (e.g 'aws', must be all lowercase/no specials)\n>> ${Color_Off}" 240 | read title 241 | 242 | if [[ "$title" == "" ]]; then 243 | title="aws" 244 | echo -e "${BGreen}Named profile 'aws'${Color_Off}" 245 | fi 246 | 247 | echo "$data" | jq > "$AXIOM_PATH/accounts/$title.json" 248 | echo -e "${BGreen}Saved profile '$title' successfully!${Color_Off}" 249 | $AXIOM_PATH/interact/axiom-account "$title" 250 | 251 | } 252 | 253 | awssetup 254 | 255 | -------------------------------------------------------------------------------- /interact/account-helpers/azure.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | AXIOM_PATH="$HOME/.axiom" 4 | source "$AXIOM_PATH/interact/includes/vars.sh" 5 | 6 | client_id="" 7 | client_secret="" 8 | tenant_id="" 9 | sub_id="" 10 | token="" 11 | region="" 12 | provider="" 13 | size="" 14 | # Packer::Azure CLI auth will use the information from an active az login session to connect to Azure and set the subscription id and tenant id associated to the signed in account. 15 | # Packer::Azure CLI authentication will use the credential marked as isDefault 16 | use_azure_cli_auth="true" 17 | 18 | BASEOS="$(uname)" 19 | case $BASEOS in 20 | 'Linux') 21 | BASEOS='Linux' 22 | ;; 23 | 'FreeBSD') 24 | BASEOS='FreeBSD' 25 | alias ls='ls -G' 26 | ;; 27 | 'WindowsNT') 28 | BASEOS='Windows' 29 | ;; 30 | 'Darwin') 31 | BASEOS='Mac' 32 | ;; 33 | 'SunOS') 34 | BASEOS='Solaris' 35 | ;; 36 | 'AIX') ;; 37 | *) ;; 38 | esac 39 | 40 | installed_version=$(az version 2>/dev/null | jq -r '."azure-cli"') 41 | 42 | # Check if the installed version matches the recommended version 43 | if [[ "$(printf '%s\n' "$installed_version" "$AzureCliVersion" | sort -V | head -n 1)" != "$AzureCliVersion" ]]; then 44 | echo -e "${Yellow}Azure CLI is either not installed or version is lower than the recommended version in ~/.axiom/interact/includes/vars.sh${Color_Off}" 45 | 46 | # Handle macOS installation/update 47 | if [[ $BASEOS == "Mac" ]]; then 48 | whereis brew 49 | if [ ! $? -eq 0 ] || [[ ! -z ${AXIOM_FORCEBREW+x} ]]; then 50 | echo -e "${BGreen}Installing Homebrew...${Color_Off}" 51 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 52 | else 53 | echo -e "${BGreen}Checking for Homebrew... already installed.${Color_Off}" 54 | fi 55 | if ! [ -x "$(command -v az)" ]; then 56 | echo -e "${BGreen}Installing Azure CLI (az)...${Color_Off}" 57 | brew update && brew install azure-cli 58 | else 59 | echo -e "${BGreen}Updating Azure CLI (az)...${Color_Off}" 60 | brew update && brew upgrade azure-cli 61 | fi 62 | 63 | # Handle Linux installation/update 64 | elif [[ $BASEOS == "Linux" ]]; then 65 | echo -e "${BGreen}Installing Azure CLI (az)...${Color_Off}" 66 | sudo apt-get update -qq 67 | sudo apt-get install ca-certificates curl apt-transport-https lsb-release gnupg -y -qq 68 | 69 | if uname -a | grep -qi "Microsoft"; then 70 | OS="UbuntuWSL" 71 | else 72 | OS=$(lsb_release -i 2>/dev/null | awk '{ print $3 }') 73 | if ! command -v lsb_release &> /dev/null; then 74 | OS="unknown-Linux" 75 | BASEOS="Linux" 76 | fi 77 | fi 78 | 79 | AZ_REPO=$(lsb_release -cs) 80 | if [[ $AZ_REPO == "kali-rolling" ]]; then 81 | check_version=$(cat /proc/version | awk '{ print $6 $7 }' | tr -d '()' | cut -d . -f 1) 82 | case $check_version in 83 | Debian10) 84 | AZ_REPO="buster" 85 | ;; 86 | Debian11) 87 | AZ_REPO="bullseye" 88 | ;; 89 | Debian12) 90 | AZ_REPO="bookworm" 91 | ;; 92 | *) 93 | echo "Unknown Debian version. Exiting." 94 | exit 1 95 | ;; 96 | esac 97 | fi 98 | 99 | curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null 100 | echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | sudo tee /etc/apt/sources.list.d/azure-cli.list 101 | 102 | sudo apt-get update -qq 103 | sudo apt-get install azure-cli -y -qq 104 | 105 | elif [[ $OS == "Fedora" ]]; then 106 | echo "Needs Conversation for Fedora" 107 | fi 108 | 109 | echo "Azure CLI updated to version $AzureCliVersion." 110 | else 111 | echo "Azure CLI is already at or above the recommended version $AzureCliVersion." 112 | fi 113 | 114 | ########################################################################################################### 115 | # Login and get default user email 116 | # 117 | default_email=$(az login --use-device-code | jq -r '.[].user.name') 118 | 119 | ########################################################################################################### 120 | # get the sub_id or use user provided subscription_id 121 | # 122 | sub_id="$(az account show --query "{ subscription_id: id }" | jq -r .subscription_id)" 123 | echo -e -n "${Green}Please enter your subscription_id: (Default is $(echo $sub_id), press enter) \n>> ${Color_Off}" 124 | read user_sub_id 125 | if [[ "$user_sub_id" == "" ]]; then 126 | echo -e "${Blue}Selected default subscription_id $sub_id${Color_Off}" 127 | else 128 | sub_id=$user_sub_id 129 | fi 130 | 131 | ########################################################################################################### 132 | # get the region or use user provided region 133 | # 134 | echo -e -n "${Green}Please enter your default region (you can always change this later with axiom-region select \$region): Default 'eastus', press enter \n>> ${Color_Off}" 135 | read region 136 | 137 | if [[ "$region" == "" ]]; then 138 | echo -e "${Blue}Selected default option 'eastus'${Color_Off}" 139 | region="eastus" 140 | fi 141 | 142 | ########################################################################################################### 143 | # get the size of the vm to spinup or use user provded size 144 | # 145 | echo -e -n "${Green}Please enter your default size (you can always change this later with axiom-sizes select \$size): Default 'Standard_B1ls', press enter \n>> ${Color_Off}" 146 | read size 147 | 148 | if [[ "$size" == "" ]]; then 149 | echo -e "${Blue}Selected default option 'Standard_B1ls'${Color_Off}" 150 | size="Standard_B1ls" 151 | fi 152 | 153 | ########################################################################################################### 154 | # get the resource name or use user provided resorce name 155 | # 156 | echo -e -n "${Green}Please enter your resource group name: (Default 'axiom'), press enter) \n>> ${Color_Off}" 157 | read resource_group 158 | 159 | if [[ "$resource_group" == "" ]]; then 160 | echo -e "${Blue}Selected default option 'axiom'${Color_Off}" 161 | resource_group="axiom" 162 | fi 163 | 164 | ########################################################################################################### 165 | # get the azure email account or use user provided email 166 | # 167 | echo -e -n "${Green}Please enter your Azure email account: (Default is $default_email, press enter) \n>> ${Color_Off}" 168 | read email 169 | 170 | if [[ "$email" == "" ]]; then 171 | email="$default_email" 172 | fi 173 | 174 | az account set --subscription "$sub_id" 2>/dev/null 175 | az group create -l "$region" -n "$resource_group" 2>/dev/null 176 | #az configure --defaults group="$resource_group" 2>/dev/null 177 | az role assignment create --role "Owner" --assignee "$email" -g ${resource_group} 2>/dev/null 178 | az provider register --namespace 'Microsoft.Network' --accept-terms 2>/dev/null 179 | az provider register --namespace 'Microsoft.Compute' --accept-terms 2>/dev/null 180 | bac=$(az ad sp create-for-rbac --role Owner --scopes "/subscriptions/$sub_id/resourcegroups/${resource_group}" --name ${resource_group} --query "{ client_id: appId, client_secret: password, tenant_id: tenant }") 2>/dev/null 181 | client_id="$(echo $bac | jq -r '.client_id')" 182 | client_secret="$(echo $bac | jq -r '.client_secret')" 183 | tenant_id="$(echo $bac | jq -r '.tenant_id')" 184 | 185 | data="$(echo "{\"client_id\":\"$client_id\",\"client_secret\":\"$client_secret\",\"tenant_id\":\"$tenant_id\",\"subscription_id\":\"$sub_id\",\"region\":\"$region\",\"resource_group\":\"$resource_group\",\"provider\":\"azure\",\"default_size\":\"$size\",\"use_azure_cli_auth\":\"$use_azure_cli_auth\"}")" 186 | 187 | echo -e "${BGreen}Profile settings below: ${Color_Off}" 188 | echo $data | jq '.client_secret = "*************************************"' 189 | echo -e "${BWhite}Press enter if you want to save these to a new profile, type 'r' if you wish to start again.${Color_Off}" 190 | read ans 191 | 192 | if [[ "$ans" == "r" ]]; 193 | then 194 | $0 195 | exit 196 | fi 197 | 198 | echo -e -n "${BWhite}Please enter your profile name (e.g 'azure', must be all lowercase/no specials)\n>> ${Color_Off}" 199 | read title 200 | 201 | if [[ "$title" == "" ]]; then 202 | title="azure" 203 | echo -e "${BGreen}Named profile 'azure'${Color_Off}" 204 | fi 205 | 206 | echo $data | jq > "$AXIOM_PATH/accounts/$title.json" 207 | echo -e "${BGreen}Saved profile '$title' successfully!${Color_Off}" 208 | $AXIOM_PATH/interact/axiom-account $title 209 | -------------------------------------------------------------------------------- /interact/account-helpers/do.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | AXIOM_PATH="$HOME/.axiom" 4 | source "$AXIOM_PATH/interact/includes/vars.sh" 5 | 6 | token="" 7 | region="" 8 | provider="" 9 | size="" 10 | 11 | BASEOS="$(uname)" 12 | case $BASEOS in 13 | 'Linux') 14 | BASEOS='Linux' 15 | ;; 16 | 'FreeBSD') 17 | BASEOS='FreeBSD' 18 | alias ls='ls -G' 19 | ;; 20 | 'WindowsNT') 21 | BASEOS='Windows' 22 | ;; 23 | 'Darwin') 24 | BASEOS='Mac' 25 | ;; 26 | 'SunOS') 27 | BASEOS='Solaris' 28 | ;; 29 | 'AIX') ;; 30 | *) ;; 31 | esac 32 | 33 | installed_version=$(doctl version 2>/dev/null| grep version | cut -d ' ' -f 3 | cut -d '-' -f 1) 34 | # Check if the installed version matches the recommended version 35 | if [[ "$(printf '%s\n' "$installed_version" "$DoctlVersion" | sort -V | head -n 1)" != "$DoctlVersion" ]]; then 36 | echo -e "${Yellow}Doctl CLI is either not installed or version is lower than the recommended version in ~/.axiom/interact/includes/vars.sh${Color_Off}" 37 | echo "Installing/updating doctl to version $DoctlVersion..." 38 | 39 | # Handle macOS installation/update 40 | 41 | if [[ $BASEOS == "Mac" ]]; then 42 | wget https://github.com/digitalocean/doctl/releases/download/v${DoctlVersion}/doctl-${DoctlVersion}-darwin-amd64.tar.gz -qO- | tar -xzv -C /usr/local/bin/ 43 | echo "doctl updated to version $DoctlVersion." 44 | echo -e "${BGreen}Installing doctl packer plugin...${Color_Off}" 45 | packer plugins install github.com/digitalocean/digitalocean 46 | 47 | elif [[ $BASEOS == "Linux" ]]; then 48 | if uname -a | grep -qi "Microsoft"; then 49 | OS="UbuntuWSL" 50 | else 51 | OS=$(lsb_release -i | awk '{ print $3 }') 52 | if ! command -v lsb_release &> /dev/null; then 53 | OS="unknown-Linux" 54 | BASEOS="Linux" 55 | fi 56 | fi 57 | if [[ $OS == "Arch" ]] || [[ $OS == "ManjaroLinux" ]]; then 58 | sudo pacman -Syu doctl --noconfirm 59 | elif [[ $OS == "Ubuntu" ]] || [[ $OS == "Debian" ]] || [[ $OS == "Linuxmint" ]] || [[ $OS == "Parrot" ]] || [[ $OS == "Kali" ]] || [[ $OS == "unknown-Linux" ]] || [[ $OS == "UbuntuWSL" ]]; then 60 | wget https://github.com/digitalocean/doctl/releases/download/v${DoctlVersion}/doctl-${DoctlVersion}-linux-amd64.tar.gz -qO- | sudo tar -xzv -C /usr/local/bin/ 61 | echo "doctl updated to version $DoctlVersion." 62 | echo -e "${BGreen}Installing doctl packer plugin...${Color_Off}" 63 | packer plugins install github.com/digitalocean/digitalocean 64 | elif [[ $OS == "Fedora" ]]; then 65 | echo "Needs Conversation" 66 | fi 67 | fi # baseOS 68 | fi 69 | 70 | function dosetup(){ 71 | 72 | echo -e "${BGreen}Sign up for an account using this link for 200\$ free credit: https://m.do.co/c/541daa5b4786\nObtain personal access token from: https://cloud.digitalocean.com/account/api/tokens${Color_Off}" 73 | echo -e -n "${BGreen}Do you already have a DigitalOcean account? y/n ${Color_Off}" 74 | read acc 75 | 76 | if [[ "$acc" == "n" ]]; then 77 | echo -e "${BGreen}Launching browser with signup page...${Color_Off}" 78 | if [ $BASEOS == "Mac" ]; then 79 | open "https://m.do.co/c/541daa5b4786" 80 | else 81 | sudo apt install xdg-utils -y 82 | xdg-open "https://m.do.co/c/541daa5b4786" 83 | fi 84 | fi 85 | echo -e -n "${Green}Please enter your token (required): \n>> ${Color_Off}" 86 | read token 87 | while [[ "$token" == "" ]]; do 88 | echo -e "${BRed}Please provide a token, your entry contained no input.${Color_Off}" 89 | echo -e -n "${Green}Please enter your token (required): \n>> ${Color_Off}" 90 | read token 91 | done 92 | 93 | doctl auth init -t "$token" | grep -vi "using token" 94 | 95 | echo -e -n "${Green}Listing available regions with axiom-regions ls \n${Color_Off}" 96 | doctl compute region list | grep -v false 97 | 98 | default_region=nyc1 99 | echo -e -n "${Green}Please enter your default region (you can always change this later with axiom-region select \$region): Default '$default_region', press enter \n>> ${Color_Off}" 100 | read region 101 | if [[ "$region" == "" ]]; then 102 | echo -e "${Blue}Selected default option '$default_region'${Color_Off}" 103 | region="$default_region" 104 | fi 105 | echo -e -n "${Green}Please enter your default size (you can always change this later with axiom-sizes select \$size): Default 's-1vcpu-1gb', press enter \n>> ${Color_Off}" 106 | read size 107 | if [[ "$size" == "" ]]; then 108 | echo -e "${Blue}Selected default option 's-1vcpu-1gb'${Color_Off}" 109 | size="s-1vcpu-1gb" 110 | fi 111 | 112 | data="$(echo "{\"do_key\":\"$token\",\"region\":\"$region\",\"provider\":\"do\",\"default_size\":\"$size\"}")" 113 | 114 | echo -e "${BGreen}Profile settings below: ${Color_Off}" 115 | echo "$data" | jq '.do_key = "************************************************************************"' 116 | echo -e "${BWhite}Press enter if you want to save these to a new profile, type 'r' if you wish to start again.${Color_Off}" 117 | read ans 118 | 119 | if [[ "$ans" == "r" ]]; 120 | then 121 | $0 122 | exit 123 | fi 124 | 125 | echo -e -n "${BWhite}Please enter your profile name (e.g 'do', must be all lowercase/no specials)\n>> ${Color_Off}" 126 | read title 127 | 128 | if [[ "$title" == "" ]]; then 129 | title="do" 130 | echo -e "${BGreen}Named profile 'do'${Color_Off}" 131 | fi 132 | 133 | echo $data | jq > "$AXIOM_PATH/accounts/$title.json" 134 | echo -e "${BGreen}Saved profile '$title' successfully!${Color_Off}" 135 | $AXIOM_PATH/interact/axiom-account $title 136 | 137 | } 138 | 139 | dosetup 140 | -------------------------------------------------------------------------------- /interact/account-helpers/hetzner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | AXIOM_PATH="$HOME/.axiom" 4 | source "$AXIOM_PATH/interact/includes/vars.sh" 5 | 6 | token="" 7 | region="" 8 | provider="" 9 | size="" 10 | 11 | BASEOS="$(uname)" 12 | case $BASEOS in 13 | 'Linux') 14 | BASEOS='Linux' 15 | ;; 16 | 'FreeBSD') 17 | BASEOS='FreeBSD' 18 | alias ls='ls -G' 19 | ;; 20 | 'WindowsNT') 21 | BASEOS='Windows' 22 | ;; 23 | 'Darwin') 24 | BASEOS='Mac' 25 | ;; 26 | 'SunOS') 27 | BASEOS='Solaris' 28 | ;; 29 | 'AIX') ;; 30 | *) ;; 31 | esac 32 | 33 | installed_version=$(hcloud version 2>/dev/null| cut -d ' ' -f 2) 34 | 35 | # Check if the installed version matches the recommended version 36 | if [[ "$(printf '%s\n' "$installed_version" "$HetznerCliVersion" | sort -V | head -n 1)" != "$HetznerCliVersion" ]]; then 37 | echo -e "${Yellow}hcloud-cli is either not installed or version is lower than the recommended version in ~/.axiom/interact/includes/vars.sh${Color_Off}" 38 | 39 | # Handle macOS installation/update 40 | if [[ $BASEOS == "Mac" ]]; then 41 | whereis brew 42 | if [ ! $? -eq 0 ] || [[ ! -z ${AXIOM_FORCEBREW+x} ]]; then 43 | echo -e "${BGreen}Installing Homebrew...${Color_Off}" 44 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 45 | else 46 | echo -e "${BGreen}Checking for Homebrew... already installed.${Color_Off}" 47 | fi 48 | if ! [ -x "$(command -v hcloud)" ]; then 49 | echo -e "${BGreen}Installing hetzner-cloud CLI (hcloud)...${Color_Off}" 50 | brew install hcloud 51 | echo -e "${BGreen}Installing Hetzner Packer plugin...${Color_Off}" 52 | packer plugins install github.com/hetznercloud/hcloud 53 | fi 54 | 55 | # Handle Linux installation/update 56 | elif [[ $BASEOS == "Linux" ]]; then 57 | if uname -a | grep -qi "Microsoft"; then 58 | OS="UbuntuWSL" 59 | else 60 | OS=$(lsb_release -i 2>/dev/null | awk '{ print $3 }') 61 | if ! command -v lsb_release &> /dev/null; then 62 | OS="unknown-Linux" 63 | BASEOS="Linux" 64 | fi 65 | fi 66 | 67 | # Install or update hcloud on different Linux distributions 68 | if [[ $OS == "Arch" ]] || [[ $OS == "ManjaroLinux" ]]; then 69 | sudo pacman -Syu hcloud --noconfirm 70 | elif [[ $OS == "Ubuntu" ]] || [[ $OS == "Debian" ]] || [[ $OS == "Linuxmint" ]] || [[ $OS == "Parrot" ]] || [[ $OS == "Kali" ]] || [[ $OS == "unknown-Linux" ]] || [[ $OS == "UbuntuWSL" ]]; then 71 | if ! [ -x "$(command -v hcloud)" ]; then 72 | echo -e "${BGreen}Installing hetzner-cloud CLI (hcloud)...${Color_Off}" 73 | wget -q -O /tmp/hetzner-cli.tar.gz https://github.com/hetznercloud/cli/releases/download/v${HetznerCliVersion}/hcloud-linux-amd64.tar.gz 74 | tar -xvzf /tmp/hetzner-cli.tar.gz -C /tmp 75 | sudo mv /tmp/hcloud /usr/bin/hcloud 76 | rm /tmp/hetzner-cli.tar.gz 77 | fi 78 | elif [[ $OS == "Fedora" ]]; then 79 | echo "Needs Conversation for Fedora" 80 | fi 81 | fi 82 | 83 | echo "hcloud-cli updated to version $HetznerCliVersion." 84 | else 85 | echo "hcloud-cli is already at or above the recommended version $HetznerCliVersion." 86 | fi 87 | 88 | function hetznersetup(){ 89 | while true; do 90 | echo -e -n "${Green}Please enter your token (required): \n>> ${Color_Off}" 91 | read token 92 | while [[ "$token" == "" ]]; do 93 | echo -e "${BRed}Please provide a token, your entry contained no input.${Color_Off}" 94 | echo -e -n "${BGreen}Please enter your token (required): \n>> ${Color_Off}" 95 | read token 96 | done 97 | 98 | status_code=$(curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $token" https://api.hetzner.cloud/v1/servers) 99 | if [[ "$status_code" == "200" ]]; then 100 | echo -e "${BGreen}Token is valid.${Color_Off}" 101 | break 102 | else 103 | echo -e "${BRed}Token provided is invalid. Please enter a valid token.${Color_Off}" 104 | fi 105 | done 106 | 107 | default_region=nbg1 108 | echo -e "${BGreen}Listing regions${Color_Off}" 109 | 110 | hcloud location list --output json | jq -r ' 111 | sort_by(.country) 112 | | (["Name","Country","City"] | @tsv), 113 | (.[] 114 | | [ .name, .country, .city ] 115 | | @tsv 116 | ) 117 | ' | column -t -s $'\t' 118 | 119 | echo -e -n "${BGreen}Please enter your default region (you can always change this later with axiom-region select \$region): Default '$default_region', press enter \n>> ${Color_Off}" 120 | read region 121 | if [[ "$region" == "" ]]; then 122 | echo -e "${BGreen}Selected default option '$default_region'${Color_Off}" 123 | region="$default_region" 124 | fi 125 | 126 | echo -e "${BGreen}Listing Sizes${Color_Off}" 127 | echo -e "${BYellow}Recommended Architecture: ${Color_Off}'${BGreen}x86${Color_Off}'${BYellow}. Pick a size that is available in region: ${Color_Off}'${BGreen}${region}${Color_Off}'${BYellow}.${Color_Off}" 128 | hcloud server-type list --output json | jq -r ' 129 | [ 130 | "Name","Cores","Memory (GB)","Disk (GB)", 131 | "CPU Type","Architecture","Price (€/Month)", 132 | "Price (€/Hour)","Price per TB Traffic (€/TB)","Locations" 133 | ], 134 | ( 135 | .[] | [ 136 | .name,.cores, .memory, .disk, .cpu_type, .architecture, 137 | (.prices[0].price_monthly.net | tonumber), 138 | (.prices[0].price_hourly.net | tonumber), 139 | (.prices[0].price_per_tb_traffic.net | tonumber), 140 | ([ .prices[].location ] | unique | sort | join(", ")) 141 | ] 142 | ) 143 | | @tsv 144 | ' | iconv -c -t UTF-8 | column -t -s $'\t' 145 | echo -e -n "${BGreen}Please enter your default size (you can always change this later with axiom-sizes select \$size): Default 'cx22', press enter \n>> ${Color_Off}" 146 | read size 147 | if [[ "$size" == "" ]]; then 148 | echo -e "${BGreen}Selected default option 'cx22'${Color_Off}" 149 | size="cx22" 150 | fi 151 | 152 | data="$(echo "{\"hetzner_key\":\"$token\",\"region\":\"$region\",\"provider\":\"hetzner\",\"default_size\":\"$size\"}")" 153 | 154 | echo -e "${BGreen}Profile settings below: ${Color_Off}" 155 | echo $data | jq '.hetzner_key = "****************************************************************"' 156 | echo -e "${BWhite}Press enter if you want to save these to a new profile, type 'r' if you wish to start again.${Color_Off}" 157 | read ans 158 | 159 | if [[ "$ans" == "r" ]]; 160 | then 161 | $0 162 | exit 163 | fi 164 | 165 | echo -e -n "${BWhite}Please enter your profile name (e.g 'hetzner', must be all lowercase/no specials)\n>> ${Color_Off}" 166 | read title 167 | 168 | if [[ "$title" == "" ]]; then 169 | title="hetzner" 170 | echo -e "${BGreen}Named profile 'hetzner'${Color_Off}" 171 | fi 172 | 173 | echo -e "${BGreen}Creating hetzner context and config file in ${Color_Off}'${BGreen}$HOME/.config/hcloud/cli.toml${Color_Off}'" 174 | mkdir -p $HOME/.config/hcloud/ 175 | cat < $(echo "$HOME/.config/hcloud/cli.toml") 176 | active_context = "$title" 177 | 178 | [[contexts]] 179 | name = "$title" 180 | token = "$token" 181 | EOT 182 | 183 | echo $data | jq > "$AXIOM_PATH/accounts/$title.json" 184 | echo -e "${BGreen}Saved profile '$title' successfully!${Color_Off}" 185 | $AXIOM_PATH/interact/axiom-account $title 186 | } 187 | 188 | hetznersetup 189 | -------------------------------------------------------------------------------- /interact/account-helpers/ibm-classic.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | AXIOM_PATH="$HOME/.axiom" 4 | source "$AXIOM_PATH/interact/includes/vars.sh" 5 | 6 | token="" 7 | region="" 8 | provider="" 9 | size="" 10 | username="" 11 | ibm_cloud_api_key="" 12 | 13 | BASEOS="$(uname)" 14 | case $BASEOS in 15 | 'Linux') 16 | BASEOS='Linux' 17 | ;; 18 | 'FreeBSD') 19 | BASEOS='FreeBSD' 20 | alias ls='ls -G' 21 | ;; 22 | 'WindowsNT') 23 | BASEOS='Windows' 24 | ;; 25 | 'Darwin') 26 | BASEOS='Mac' 27 | ;; 28 | 'SunOS') 29 | BASEOS='Solaris' 30 | ;; 31 | 'AIX') ;; 32 | *) ;; 33 | esac 34 | 35 | 36 | installed_version=$(ibmcloud version 2>/dev/null | cut -d ' ' -f 2 | cut -d + -f 1 | head -n 1) 37 | 38 | # Check if the installed version matches the recommended version 39 | if [[ "$(printf '%s\n' "$installed_version" "$IBMCloudCliVersion" | sort -V | head -n 1)" != "$IBMCloudCliVersion" ]]; then 40 | echo -e "${Yellow}ibmcloud cli is either not installed or version is lower than the recommended version in ~/.axiom/interact/includes/vars.sh${Color_Off}" 41 | 42 | if [[ $BASEOS == "Mac" ]]; then 43 | # macOS installation/update 44 | echo -e "${BGreen}Installing/updating ibmcloud-cli on macOS...${Color_Off}" 45 | whereis brew 46 | if [ ! $? -eq 0 ] || [[ ! -z ${AXIOM_FORCEBREW+x} ]]; then 47 | echo -e "${BGreen}Installing Homebrew...${Color_Off}" 48 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 49 | else 50 | echo -e "${BGreen}Checking for Homebrew... already installed.${Color_Off}" 51 | fi 52 | echo -e "${BGreen}Installing ibmcloud-cli...${Color_Off}" 53 | curl -fsSL https://clis.cloud.ibm.com/install/osx | sh 54 | elif [[ $BASEOS == "Linux" ]]; then 55 | if uname -a | grep -qi "Microsoft"; then 56 | OS="UbuntuWSL" 57 | else 58 | OS=$(lsb_release -i | awk '{ print $3 }') 59 | if ! command -v lsb_release &> /dev/null; then 60 | OS="unknown-Linux" 61 | BASEOS="Linux" 62 | fi 63 | fi 64 | if [[ $OS == "Arch" ]] || [[ $OS == "ManjaroLinux" ]]; then 65 | echo "Needs Conversation for Arch or ManjaroLinux" 66 | elif [[ $OS == "Ubuntu" ]] || [[ $OS == "Debian" ]] || [[ $OS == "Linuxmint" ]] || [[ $OS == "Parrot" ]] || [[ $OS == "Kali" ]] || [[ $OS == "unknown-Linux" ]] || [[ $OS == "UbuntuWSL" ]]; then 67 | echo -e "${BGreen}Installing ibmcloud-cli on Linux...${Color_Off}" 68 | curl -fsSL https://clis.cloud.ibm.com/install/linux | sh 69 | echo -e "${BGreen}Installing ibmcloud sl (SoftLayer) plugin...${Color_Off}" 70 | ibmcloud plugin install sl -q -f 71 | elif [[ $OS == "Fedora" ]]; then 72 | echo "Needs Conversation for Fedora" 73 | fi 74 | fi 75 | 76 | echo "ibmcloud-cli updated to version $IBMCloudCliVersion." 77 | else 78 | echo "ibmcloud-cli is already at or above the recommended version $IBMCloudCliVersion." 79 | fi 80 | 81 | # Install IBM Cloud CLI SoftLayer Plugin 82 | echo -e "${BGreen}Installing ibmcloud sl (SoftLayer) plugin...${Color_Off}" 83 | ibmcloud plugin install sl -q -f 84 | 85 | # Install IBM Cloud Packer Plugin 86 | echo -e "${BGreen}Installing IBM Cloud Packer Builder Plugin${Color_Off}" 87 | packer plugins install github.com/IBM/ibmcloud 88 | 89 | # Functions to handle IBM Cloud API keys and configurations 90 | function getUsernameAPIkey { 91 | email=$(cat ~/.bluemix/config.json | grep Owner | cut -d '"' -f 4) 92 | username=$(ibmcloud sl user list | grep -i $email | tr -s ' ' | cut -d ' ' -f 2) 93 | accountnumber=$(ibmcloud sl user list | grep -i $email | tr -s ' ' | cut -d ' ' -f 1) 94 | token=$(ibmcloud sl user detail $accountnumber --keys | grep APIKEY | tr -s ' ' | cut -d ' ' -f 2) 95 | if [ -z "$token" ]; then 96 | echo -e -n "${Green}Create an IBM Cloud Classic Infrastructure (SoftLayer) API key (for Packer) here: https://cloud.ibm.com/iam/apikeys (required): \n>> ${Color_Off}" 97 | read token 98 | while [[ "$token" == "" ]]; do 99 | echo -e "${BRed}Please provide a valid IBM Cloud Classic API key.${Color_Off}" 100 | read token 101 | done 102 | fi 103 | } 104 | 105 | function apikeys { 106 | echo -e -n "${Green}Create an IBM Cloud IAM API key (for ibmcloud cli) here: https://cloud.ibm.com/iam/apikeys (required): \n>> ${Color_Off}" 107 | read ibm_cloud_api_key 108 | while [[ "$ibm_cloud_api_key" == "" ]]; do 109 | echo -e "${BRed}Please provide a valid IBM Cloud API key.${Color_Off}" 110 | read ibm_cloud_api_key 111 | done 112 | ibmcloud login --apikey=$ibm_cloud_api_key --no-region 113 | getUsernameAPIkey 114 | } 115 | 116 | function create_apikey { 117 | echo -e -n "${Green}Creating an IAM API key for this profile \n>> ${Color_Off}" 118 | name="axiom-$(date +%FT%T%z)" 119 | key_details=$(ibmcloud iam api-key-create "$name" --output json) 120 | ibm_cloud_api_key=$(echo "$key_details" | jq -r .apikey) 121 | ibmcloud login --apikey=$ibm_cloud_api_key --no-region 122 | } 123 | 124 | function specs { 125 | echo -e -n "${Green}Printing available regions..\n${Color_Off}" 126 | ibmcloud sl vs options --output json | jq .locations 127 | echo -e -n "${BGreen}Please enter your default region (you can always change this later with axiom-region select \$region); Defqult is 'dal13'. press enter \n>> ${Color_Off}" 128 | read region 129 | region=${region:-dal13} 130 | 131 | echo -e -n "${Green}Printing available sizes..\n${Color_Off}" 132 | ibmcloud sl vs options --output json | jq -r .sizes | jq 'keys' 133 | echo -e -n "${Green}Please enter your default size (you can always change this later with axiom-sizes select \$size): Default 'C1_2x2x25', press enter \n>> ${Color_Off}" 134 | read size 135 | size=${size:-C1_2X2X25} 136 | } 137 | 138 | function setprofile { 139 | data="{\"sl_key\":\"$token\",\"ibm_cloud_api_key\":\"$ibm_cloud_api_key\",\"region\":\"$region\",\"provider\":\"ibm-classic\",\"default_size\":\"$size\",\"username\":\"$username\"}" 140 | echo -e "${BGreen}Profile settings below:${Color_Off}" 141 | echo $data | jq '.sl_key = "****************************************************************" | .ibm_cloud_api_key = "********************************************"' 142 | echo -e "${BWhite}Press enter to save these to a new profile, type 'r' to start over.${Color_Off}" 143 | read ans 144 | if [[ "$ans" == "r" ]]; then 145 | $0 146 | exit 147 | fi 148 | echo -e -n "${BWhite}Please enter your profile name (e.g. 'ibm'):\n>> ${Color_Off}" 149 | read title 150 | title=${title:-ibm} 151 | echo $data | jq > "$AXIOM_PATH/accounts/$title.json" 152 | echo -e "${BGreen}Saved profile '$title' successfully!${Color_Off}" 153 | $AXIOM_PATH/interact/axiom-account $title 154 | } 155 | 156 | prompt="Choose how to authenticate to IBM Cloud:" 157 | PS3=$prompt 158 | types=("SSO" "Username & Password" "API Keys") 159 | select opt in "${types[@]}" 160 | do 161 | case $opt in 162 | "SSO") 163 | echo "Attempting to authenticate with SSO!" 164 | ibmcloud login --no-region --sso 165 | getUsernameAPIkey 166 | create_apikey 167 | specs 168 | setprofile 169 | break 170 | ;; 171 | "Username & Password") 172 | ibmcloud login --no-region 173 | getUsernameAPIkey 174 | create_apikey 175 | specs 176 | setprofile 177 | break 178 | ;; 179 | "API Keys") 180 | apikeys 181 | specs 182 | setprofile 183 | break 184 | ;; 185 | *) 186 | echo "Invalid option $REPLY" 187 | ;; 188 | esac 189 | done 190 | -------------------------------------------------------------------------------- /interact/account-helpers/ibm-vpc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | AXIOM_PATH="$HOME/.axiom" 4 | source "$AXIOM_PATH/interact/includes/vars.sh" 5 | 6 | region="" 7 | provider="" 8 | profile="" 9 | ibm_cloud_api_key="" 10 | vpc="" 11 | zone="" 12 | 13 | BASEOS="$(uname)" 14 | case $BASEOS in 15 | 'Linux') 16 | BASEOS='Linux' 17 | ;; 18 | 'FreeBSD') 19 | BASEOS='FreeBSD' 20 | alias ls='ls -G' 21 | ;; 22 | 'WindowsNT') 23 | BASEOS='Windows' 24 | ;; 25 | 'Darwin') 26 | BASEOS='Mac' 27 | ;; 28 | 'SunOS') 29 | BASEOS='Solaris' 30 | ;; 31 | 'AIX') ;; 32 | *) ;; 33 | esac 34 | 35 | installed_version=$(ibmcloud version 2>/dev/null | cut -d ' ' -f 2 | cut -d + -f 1 | head -n 1) 36 | 37 | # Check if the installed version matches the recommended version 38 | if [[ "$(printf '%s\n' "$installed_version" "$IBMCloudCliVersion" | sort -V | head -n 1)" != "$IBMCloudCliVersion" ]]; then 39 | echo -e "${Yellow}ibmcloud cli is either not installed or version is lower than the recommended version in ~/.axiom/interact/includes/vars.sh${Color_Off}" 40 | 41 | if [[ $BASEOS == "Mac" ]]; then 42 | # macOS installation/update 43 | echo -e "${BGreen}Installing/updating ibmcloud-cli on macOS...${Color_Off}" 44 | whereis brew 45 | if [ ! $? -eq 0 ] || [[ ! -z ${AXIOM_FORCEBREW+x} ]]; then 46 | echo -e "${BGreen}Installing Homebrew...${Color_Off}" 47 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 48 | else 49 | echo -e "${BGreen}Checking for Homebrew... already installed.${Color_Off}" 50 | fi 51 | echo -e "${BGreen}Installing ibmcloud-cli...${Color_Off}" 52 | curl -fsSL https://clis.cloud.ibm.com/install/osx | sh 53 | elif [[ $BASEOS == "Linux" ]]; then 54 | if uname -a | grep -qi "Microsoft"; then 55 | OS="UbuntuWSL" 56 | else 57 | OS=$(lsb_release -i | awk '{ print $3 }') 58 | if ! command -v lsb_release &> /dev/null; then 59 | OS="unknown-Linux" 60 | BASEOS="Linux" 61 | fi 62 | fi 63 | if [[ $OS == "Arch" ]] || [[ $OS == "ManjaroLinux" ]]; then 64 | echo "Needs Conversation for Arch or ManjaroLinux" 65 | elif [[ $OS == "Ubuntu" ]] || [[ $OS == "Debian" ]] || [[ $OS == "Linuxmint" ]] || [[ $OS == "Parrot" ]] || [[ $OS == "Kali" ]] || [[ $OS == "unknown-Linux" ]] || [[ $OS == "UbuntuWSL" ]]; then 66 | echo -e "${BGreen}Installing ibmcloud-cli on Linux...${Color_Off}" 67 | curl -fsSL https://clis.cloud.ibm.com/install/linux | sh 68 | elif [[ $OS == "Fedora" ]]; then 69 | echo "Needs Conversation for Fedora" 70 | fi 71 | fi 72 | 73 | echo "ibmcloud-cli updated to version $IBMCloudCliVersion." 74 | else 75 | echo "ibmcloud-cli is already at or above the recommended version $IBMCloudCliVersion." 76 | fi 77 | 78 | # Install IBM Cloud VPC Plugin 79 | echo -e "${BGreen}Installing ibmcloud vpc plugin...${Color_Off}" 80 | ibmcloud plugin install vpc-infrastructure -q -f 81 | 82 | # Install IBM Cloud Packer Plugin 83 | echo -e "${BGreen}Installing IBM Cloud Packer Builder Plugin${Color_Off}" 84 | packer plugins install github.com/IBM/ibmcloud 85 | 86 | function apikeys { 87 | echo -e -n "${Green}Create an IBM Cloud IAM API key (for ibmcloud cli) here: https://cloud.ibm.com/iam/apikeys (required): \n>> ${Color_Off}" 88 | read ibm_cloud_api_key 89 | while [[ "$ibm_cloud_api_key" == "" ]]; do 90 | echo -e "${BRed}Please provide a valid IBM Cloud API key.${Color_Off}" 91 | read ibm_cloud_api_key 92 | done 93 | ibmcloud login --apikey=$ibm_cloud_api_key --no-region 94 | } 95 | 96 | function create_apikey { 97 | echo -e -n "${Green}Creating an IAM API key for this profile \n>> ${Color_Off}" 98 | name="axiom-$(date +%FT%T%z)" 99 | key_details=$(ibmcloud iam api-key-create "$name" --output json) 100 | ibm_cloud_api_key=$(echo "$key_details" | jq -r .apikey) 101 | ibmcloud login --apikey=$ibm_cloud_api_key --no-region 102 | } 103 | 104 | function specs { 105 | echo -e "${BGreen}Printing available resource groups...\n${Color_Off}" 106 | ibmcloud resource groups 107 | echo -e -n "${BGreen}Please enter the resource groups to use (press enter for 'Default'): \n>> ${Color_Off}" 108 | read resource_group 109 | resource_group=${resource_group:-Default} 110 | 111 | echo -e "${Green}Printing available regions..\n${Color_Off}" 112 | ibmcloud regions 113 | echo -e -n "${BGreen}Please enter your default region (press enter for 'us-south'): \n>> ${Color_Off}" 114 | read region 115 | region=${region:-us-south} 116 | ibmcloud target -r $region -g $resource_group 117 | 118 | echo -e "${Green}Printing available zones in region selected..\n${Color_Off}" 119 | ibmcloud is zones 120 | echo -e -n "${BGreen}Please enter your default zone for $region (press enter for '$region-1'): \n>> ${Color_Off}" 121 | read zone 122 | zone=${zone:-$region-1} 123 | 124 | echo -e "${BGreen}Printing available instance profiles in zone/region...\n${Color_Off}" 125 | (echo -e "Name\tArchitecture\tvCPUs\tMemory(GiB)\tBandwidth"; \ 126 | ibmcloud is instance-profiles --output json | jq -r '.[] | select(.os_architecture.values[0] == "amd64") | 127 | [ 128 | .name, 129 | .os_architecture.values[0], 130 | .vcpu_count.value, 131 | .memory.value, 132 | .bandwidth.value 133 | ] | @tsv') | column -t 134 | 135 | echo -e -n "${BGreen}Please enter instance profile for your device to use (press enter for 'cx2-2x4'): \n>> ${Color_Off}" 136 | read profile 137 | profile=${profile:-cx2-2x4} 138 | } 139 | 140 | function setVPC { 141 | echo -e "${Green}Printing IBM Cloud VPCs ${Color_Off}" 142 | ibmcloud is vpcs 143 | echo -e -n "${Green}Enter the VPC name you like to use (press enter to create a new one): \n>> ${Color_Off}" 144 | read vpc 145 | if [[ "$vpc" == "" ]]; then 146 | name="axiom-$(date +%m-%d-%H-%M-%S-%1N)" 147 | new_vpc_data=$(ibmcloud is vpcc $name --output json) 148 | echo -e "${Green}Created VPC${Color_Off}" 149 | echo $new_vpc_data | jq 150 | vpc=$(echo $new_vpc_data | jq -r .name) 151 | else 152 | vpc=$vpc 153 | fi 154 | 155 | echo -e "${Green}Creating subnets in all zones in $region ${Color_Off}" 156 | subnet_name="$vpc-subnet-$region" 157 | for i in $(seq 1 3); do 158 | ibmcloud is subnet-create $subnet_name-$i $vpc --ipv4-address-count 256 --zone $region-$i --output json --resource-group-name $resource_group >/dev/null 2>&1 159 | done 160 | subnet_id=$(ibmcloud is subnets --vpc $vpc --output json | jq -r '.[] | select(.name == "'$subnet_name-1'") | .id') 161 | 162 | echo -e "${BGreen}Printing Available Security Groups for VPC $vpc${Color_Off}" 163 | ibmcloud is security-groups --vpc $vpc --resource-group-name $resource_group 164 | 165 | # Prompt user to enter a security group name 166 | echo -e -n "${Green}Please enter a security group name above or press enter to create a new security group with a random name \n>> ${Color_Off}" 167 | read SECURITY_GROUP 168 | 169 | # If no security group name is provided, create a new one with a random name 170 | if [[ "$SECURITY_GROUP" == "" ]]; then 171 | axiom_sg_random="axiom-$(date +%m-%d-%H-%M-%S-%1N)" 172 | SECURITY_GROUP=$axiom_sg_random 173 | echo -e "${BGreen}Creating an Axiom Security Group: ${Color_Off}" 174 | ibmcloud is security-group-delete "$SECURITY_GROUP" --force > /dev/null 2>&1 175 | sc=$(ibmcloud is security-group-create $SECURITY_GROUP $vpc --resource-group-name $resource_group --output JSON) 176 | group_name=$(echo "$sc" | jq -r .name ) 177 | echo -e "${BGreen}Created Security Group: $group_name ${Color_Off}" 178 | else 179 | # Use the existing security group 180 | echo -e "${BGreen}Using Security Group: $SECURITY_GROUP ${Color_Off}" 181 | group_name=$SECURITY_GROUP 182 | 183 | if [ -z "$group_name" ]; then 184 | echo -e "${BGreen}Security Group '$SECURITY_GROUP' not found. Exiting.${Color_Off}" 185 | exit 1 186 | fi 187 | fi 188 | 189 | # Attempt to add the rule 190 | ibmcloud is security-group-rule-add $group_name inbound tcp --port-min 1 --port-max 65535 --vpc $vpc --output JSON | jq -r .id 2>&1 && ibmcloud is security-group-rule-add $group_name outbound all --vpc $vpc --output JSON | jq -r .id 2>&1 191 | } 192 | 193 | function setprofile { 194 | data="{\"ibm_cloud_api_key\":\"$ibm_cloud_api_key\",\"default_size\":\"$profile\",\"resource_group\":\"$resource_group\",\"physical_region\":\"$region\",\"region\":\"$zone\",\"provider\":\"ibm-vpc\",\"vpc\":\"$vpc\",\"security_group\":\"$group_name\",\"subnet_id\":\"$subnet_id\"}" 195 | echo -e "${BGreen}Profile settings below:${Color_Off}" 196 | echo $data | jq ' .ibm_cloud_api_key = "********************************************"' 197 | echo -e "${BWhite}Press enter to save these to a new profile, type 'r' to start over.${Color_Off}" 198 | read ans 199 | if [[ "$ans" == "r" ]]; then 200 | $0 201 | exit 202 | fi 203 | echo -e -n "${BWhite}Please enter your profile name (e.g. 'ibm-vpc'):\n>> ${Color_Off}" 204 | read title 205 | title=${title:-ibm-vpc} 206 | echo $data | jq > "$AXIOM_PATH/accounts/$title.json" 207 | echo -e "${BGreen}Saved profile '$title' successfully!${Color_Off}" 208 | $AXIOM_PATH/interact/axiom-account $title 209 | } 210 | 211 | prompt="Choose how to authenticate to IBM Cloud:" 212 | PS3=$prompt 213 | types=("SSO" "Username & Password" "API Keys") 214 | select opt in "${types[@]}" 215 | do 216 | case $opt in 217 | "SSO") 218 | echo "Attempting to authenticate with SSO!" 219 | ibmcloud login --no-region --sso 220 | create_apikey 221 | specs 222 | setVPC 223 | setprofile 224 | break 225 | ;; 226 | "Username & Password") 227 | ibmcloud login --no-region 228 | create_apikey 229 | specs 230 | setVPC 231 | setprofile 232 | break 233 | ;; 234 | "API Keys") 235 | apikeys 236 | specs 237 | setVPC 238 | setprofile 239 | break 240 | ;; 241 | *) 242 | echo "Invalid option $REPLY" 243 | ;; 244 | esac 245 | done 246 | -------------------------------------------------------------------------------- /interact/account-helpers/linode.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | AXIOM_PATH="$HOME/.axiom" 4 | source "$AXIOM_PATH/interact/includes/vars.sh" 5 | 6 | token="" 7 | region="" 8 | provider="" 9 | size="" 10 | 11 | BASEOS="$(uname)" 12 | case $BASEOS in 13 | 'Linux') 14 | BASEOS='Linux' 15 | ;; 16 | 'FreeBSD') 17 | BASEOS='FreeBSD' 18 | alias ls='ls -G' 19 | ;; 20 | 'WindowsNT') 21 | BASEOS='Windows' 22 | ;; 23 | 'Darwin') 24 | BASEOS='Mac' 25 | ;; 26 | 'SunOS') 27 | BASEOS='Solaris' 28 | ;; 29 | 'AIX') ;; 30 | *) ;; 31 | esac 32 | 33 | echo -e "${Green}Checking linode-cli version...\n${Color_Off}" 34 | 35 | # Get the currently installed version of linode-cli 36 | installed_version=$(linode-cli --version 2>/dev/null| grep linode-cli | cut -d ' ' -f 2 | cut -d v -f 2-) 37 | 38 | # Check if the installed version matches the desired version 39 | if [[ "$(printf '%s\n' "$installed_version" "$LinodeCliVersion" | sort -V | head -n 1)" != "$LinodeCliVersion" ]]; then 40 | echo -e "${Yellow}linode-cli is either not installed or version is lower than the recommended version in ~/.axiom/interact/includes/vars.sh${Color_Off}" 41 | echo "Installing/updating linode-cli to version $LinodeCliVersion..." 42 | 43 | # Try to install or upgrade linode-cli and handle externally-managed-environment 44 | output=$(pip3 install linode-cli --upgrade 2>&1) 45 | 46 | if echo "$output" | grep -q "externally-managed-environment"; then 47 | echo "Detected an externally managed environment. Retrying with --break-system-packages..." 48 | pip3 install linode-cli --upgrade --break-system-packages 49 | else 50 | echo "linode-cli updated successfully or no externally managed environment detected." 51 | fi 52 | else 53 | echo "linode-cli is already at or above the recommended version $LinodeCliVersion." 54 | fi 55 | 56 | if [[ $BASEOS == "Mac" ]]; then 57 | echo -e "${BGreen}Installing linode packer plugin...${Color_Off}" 58 | packer plugins install github.com/linode/linode 59 | fi 60 | 61 | 62 | function setuplinode(){ 63 | echo -e "${BGreen}Sign up for an account using this link for \$100 free credit: https://www.linode.com/lp/refer/?r=71f79f7e02534d6f673cbc8a17581064e12ac27d\nObtain a personal access token from: https://cloud.linode.com/profile/tokens${Color_Off}" 64 | echo -e -n "${BGreen}Do you already have a Linode account? y/n ${Color_Off}" 65 | read acc 66 | 67 | if [[ "$acc" == "n" ]]; then 68 | echo -e "${BGreen}Launching browser with signup page...${Color_Off}" 69 | if [ $BASEOS == "Mac" ]; then 70 | open "https://www.linode.com/lp/refer/?r=71f79f7e02534d6f673cbc8a17581064e12ac27d" 71 | elif [ $BASEOS == "Linux" ]; then 72 | OS=$(lsb_release -i 2>/dev/null | awk '{ print $3 }') 73 | if ! command -v lsb_release &> /dev/null; then 74 | OS="unknown-Linux" 75 | BASEOS="Linux" 76 | fi 77 | if [ $OS == "Arch" ] || [ $OS == "ManjaroLinux" ]; then 78 | sudo pacman -Syu xdg-utils --noconfirm 79 | else 80 | sudo apt install xdg-utils -y 81 | fi 82 | xdg-open "https://www.linode.com/lp/refer/?r=71f79f7e02534d6f673cbc8a17581064e12ac27d" 83 | fi 84 | fi 85 | 86 | echo -e -n "${Green}Please enter your token (required): \n>> ${Color_Off}" 87 | read token 88 | while [[ "$token" == "" ]]; do 89 | echo -e "${BRed}Please provide a token, your entry contained no input.${Color_Off}" 90 | echo -e -n "${Green}Please enter your token (required): \n>> ${Color_Off}" 91 | read token 92 | done 93 | 94 | echo -e -n "${BGreen}Please enter your default region (you can always change this later with axiom-region select \$region): Default 'us-east', press enter \n>> ${Color_Off}" 95 | read region 96 | if [[ "$region" == "" ]]; then 97 | echo -e "${Blue}Selected default option 'us-east'${Color_Off}" 98 | region="us-east" 99 | fi 100 | echo -e -n "${BGreen}Please enter your default size (you can always change this later with axiom-sizes select \$size): Default 'g6-standard-1', press enter \n>> ${Color_Off}" 101 | read size 102 | if [[ "$size" == "" ]]; then 103 | echo -e "${Blue}Selected default option 'g6-standard-1'${Color_Off}" 104 | size="g6-standard-1" 105 | fi 106 | 107 | data="$(echo "{\"linode_key\":\"$token\",\"region\":\"$region\",\"provider\":\"linode\",\"default_size\":\"$size\"}")" 108 | 109 | 110 | echo -e "${BGreen}Profile settings below: ${Color_Off}" 111 | echo $data | jq '.linode_key = "*******************************************************"' 112 | echo -e "${BWhite}Press enter if you want to save these to a new profile, type 'r' if you wish to start again.${Color_Off}" 113 | read ans 114 | 115 | if [[ "$ans" == "r" ]]; 116 | then 117 | $0 118 | exit 119 | fi 120 | 121 | echo -e -n "${BWhite}Please enter your profile name (e.g 'linode', must be all lowercase/no specials)\n>> ${Color_Off}" 122 | read title 123 | 124 | if [[ "$title" == "" ]]; then 125 | title="linode" 126 | echo -e "${BGreen}Named profile 'linode'${Color_Off}" 127 | fi 128 | 129 | echo $data | jq > "$AXIOM_PATH/accounts/$title.json" 130 | echo -e "${BGreen}Saved profile '$title' successfully!${Color_Off}" 131 | $AXIOM_PATH/interact/axiom-account $title 132 | echo -e -n "${Yellow}Would you like me to open a ticket to get an image increase to 75GB for you (you only need to do this once)?${Color_Off} [y]/n >> " 133 | read acc 134 | 135 | if [[ "$acc" == "" ]]; then 136 | acc="y" 137 | fi 138 | 139 | if [[ "$acc" == "y" ]]; then 140 | 141 | curl https://api.linode.com/v4/support/tickets -H "Content-Type: application/json" -H "Authorization: Bearer $token" -X POST -d '{ "description": "Hello! I have recently installed the Ax Framework https://github.com/attacksurge/ax and would like to request an image increase to 75GB please for the purposes of bulding the packer image. Thank you have a great day! - This request was automatically generated by the Ax Framework", "summary": "Image increase request to 75GB for Ax" }' 142 | echo "" 143 | echo -e "${Green}Opened a ticket with Linode support! Please wait patiently for a few hours and when you get an increase run 'axiom-build'!${Color_Off}" 144 | echo "View open tickets at: https://cloud.linode.com/support/tickets" 145 | fi 146 | } 147 | 148 | setuplinode 149 | 150 | -------------------------------------------------------------------------------- /interact/account-helpers/scaleway.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | AXIOM_PATH="$HOME/.axiom" 4 | source "$AXIOM_PATH/interact/includes/vars.sh" 5 | 6 | token="" 7 | region="" 8 | provider="" 9 | size="" 10 | 11 | BASEOS="$(uname)" 12 | case $BASEOS in 13 | 'Linux') 14 | BASEOS='Linux' 15 | ;; 16 | 'FreeBSD') 17 | BASEOS='FreeBSD' 18 | alias ls='ls -G' 19 | ;; 20 | 'WindowsNT') 21 | BASEOS='Windows' 22 | ;; 23 | 'Darwin') 24 | BASEOS='Mac' 25 | ;; 26 | 'SunOS') 27 | BASEOS='Solaris' 28 | ;; 29 | 'AIX') ;; 30 | *) ;; 31 | esac 32 | 33 | get_region_info() { 34 | echo -e -n "${Green}Listing regions...\n${Color_Off}" 35 | 36 | zones="fr-par-1 fr-par-2 fr-par-3 nl-ams-1 nl-ams-2 pl-waw-1 pl-waw-2" 37 | 38 | echo -e -n "${Blue}$zones${Color_Off}\n" | tr ' ' '\n' 39 | 40 | default_region="fr-par-1" 41 | echo -e -n "${Green}Please enter your default region (you can always change this later with axiom-region select \$region): Default '$default_region', press enter \n>> ${Color_Off}" 42 | 43 | read region 44 | if [[ "$region" == "" ]]; then 45 | echo -e "${Blue}Using default region: '$default_region'${Color_Off}" 46 | region="$default_region" 47 | fi 48 | physical_region=$(echo $region | rev | cut -d '-' -f 2- | rev) 49 | 50 | } 51 | 52 | # Check if Scaleway CLI version is up to date 53 | installed_version=$(scw version -o json 2>/dev/null | jq -r .version) 54 | if [[ "$(printf '%s\n' "$installed_version" "$ScalewayCliVersion" | sort -V | head -n 1)" != "$ScalewayCliVersion" ]]; then 55 | if [[ $BASEOS == "Mac" ]]; then 56 | if ! command -v brew &> /dev/null || [[ ! -z ${AXIOM_FORCEBREW+x} ]]; then 57 | echo -e "${BGreen}Installing Homebrew...${Color_Off}" 58 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 59 | else 60 | echo -e "${BGreen}Homebrew is already installed.${Color_Off}" 61 | fi 62 | echo -e "${BGreen}Installing Scaleway CLI (scw)...${Color_Off}" 63 | brew install scw 64 | elif [[ $BASEOS == "Linux" ]]; then 65 | if uname -a | grep -qi "Microsoft"; then 66 | OS="UbuntuWSL" 67 | else 68 | OS=$(lsb_release -i 2>/dev/null | awk '{ print $3 }') 69 | if ! command -v lsb_release &> /dev/null; then 70 | OS="unknown-Linux" 71 | fi 72 | fi 73 | 74 | # Install or update Scaleway CLI for Linux 75 | if [[ $OS == "Arch" ]] || [[ $OS == "ManjaroLinux" ]]; then 76 | sudo pacman -S scaleway-cli 77 | elif [[ $OS == "Ubuntu" ]] || [[ $OS == "Debian" ]] || [[ $OS == "Linuxmint" ]] || [[ $OS == "Parrot" ]] || [[ $OS == "Kali" ]] || [[ $OS == "unknown-Linux" ]] || [[ $OS == "UbuntuWSL" ]]; then 78 | echo -e "${BGreen}Installing Scaleway Cloud CLI (scw)...${Color_Off}" 79 | curl -s https://raw.githubusercontent.com/scaleway/scaleway-cli/master/scripts/get.sh | sudo sh 80 | elif [[ $OS == "Fedora" ]]; then 81 | echo "Fedora installation requires additional setup." 82 | fi 83 | fi 84 | fi 85 | 86 | function scalewaysetup() { 87 | echo -e "${BGreen}Sign up for an account: https://www.scaleway.com/en/signup/\nObtain your API token from: https://console.scaleway.com/project/credentials${Color_Off}" 88 | echo -e -n "${BGreen}Do you already have a Scaleway account? y/n ${Color_Off}" 89 | read acc 90 | 91 | if [[ "$acc" == "n" ]]; then 92 | echo -e "${BGreen}Launching browser with signup page...${Color_Off}" 93 | if [ $BASEOS == "Mac" ]; then 94 | open "https://www.scaleway.com/en/signup/" 95 | else 96 | sudo apt install xdg-utils -y 97 | xdg-open "https://www.scaleway.com/en/signup/" 98 | fi 99 | fi 100 | 101 | prompt="Choose how to authenticate to Scaleway:" 102 | PS3=$prompt 103 | types=("SSO" "API Keys") 104 | select opt in "${types[@]}" 105 | do 106 | case $opt in 107 | "SSO") 108 | echo "Starting interactive Scaleway login..." 109 | yes | scw login | grep -v "unsupported shell 'y'" 110 | # Extract credentials from config.yaml 111 | access_key=$(grep -e ^access_key $HOME/.config/scw/config.yaml | cut -d ' ' -f 2) 112 | default_organization_id=$(grep -e ^default_organization_id $HOME/.config/scw/config.yaml | cut -d ' ' -f 2) 113 | default_project_id=$(grep -e ^default_project_id $HOME/.config/scw/config.yaml | cut -d ' ' -f 2) 114 | secret_key=$(grep -e ^secret_key $HOME/.config/scw/config.yaml | cut -d ' ' -f 2) 115 | get_region_info 116 | echo "Interactive login completed." 117 | break 118 | ;; 119 | "API Keys") 120 | echo -e "${BGreen}Go to https://console.scaleway.com/iam/api-keys and click Generate API key${Color_Off}" 121 | echo -e "${BGreen}After the API key is created, you need to expand 'Add API keys to your environment' to get the required information${Color_Off}" 122 | 123 | read -p "Enter your SCW_ACCESS_KEY: " access_key 124 | read -p "Enter your SCW_SECRET_KEY: " secret_key 125 | read -p "Enter your SCW_DEFAULT_ORGANIZATION_ID: " default_organization_id 126 | read -p "Enter your SCW_DEFAULT_PROJECT_ID: " default_project_id 127 | 128 | data=$(cat < "$HOME/.config/scw/config.yaml" 142 | scw config set access-key="$access_key" secret-key="$secret_key" default-region="$physical_region" default-zone="$region" 143 | 144 | echo "API credentials configured successfully." 145 | break 146 | ;; 147 | *) 148 | echo "Invalid option $REPLY" 149 | ;; 150 | esac 151 | done 152 | 153 | echo -e -n "${Green}Listing instance types in $region...\n${Color_Off}" 154 | scw instance server-type list zone=$region 155 | echo -e -n "${Green}Please enter your default size (you can always change this later with axiom-sizes select \$size): Default 'DEV1-S', press enter \n>> ${Color_Off}" 156 | 157 | read size 158 | if [[ "$size" == "" ]]; then 159 | echo -e "${Blue}Using default size: 'DEV1-S'${Color_Off}" 160 | size="DEV1-S" 161 | fi 162 | 163 | data=$(cat <> ${Color_Off}" 188 | read title 189 | 190 | if [[ "$title" == "" ]]; then 191 | title="scaleway" 192 | echo -e "${BGreen}Profile named 'scaleway'${Color_Off}" 193 | fi 194 | 195 | echo "$data" | jq > "$AXIOM_PATH/accounts/$title.json" 196 | echo -e "${BGreen}Saved profile '$title' successfully!${Color_Off}" 197 | $AXIOM_PATH/interact/axiom-account $title 198 | } 199 | 200 | scalewaysetup 201 | -------------------------------------------------------------------------------- /interact/ax: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ########################################################################################################### 4 | # Header 5 | # 6 | AXIOM_PATH="$HOME/.axiom" 7 | source "$AXIOM_PATH/interact/includes/ax-completion.sh" 8 | source "$AXIOM_PATH/interact/includes/vars.sh" 9 | source "$AXIOM_PATH/interact/includes/functions.sh" 10 | source "$AXIOM_PATH/interact/includes/system-notification.sh" 11 | begin=$(date +%s) 12 | start="$(pwd)" 13 | BASEOS="$(uname)" 14 | case $BASEOS in 15 | 'Darwin') 16 | PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH" 17 | ;; 18 | *) ;; 19 | esac 20 | 21 | ########################################################################################################### 22 | # Help Menu 23 | # 24 | help() { 25 | echo -e "${BGreen}Ax Framework - Distributed Cloud Scanning Platform${Color_Off}" 26 | echo -e "${BGreen}Usage:${Color_Off} ax [options]" 27 | echo -e "Use 'ax --help' to get more details on a specific command." 28 | echo 29 | echo -e "${BGreen}Setup & Configuration:${Color_Off}" 30 | echo -e " account-setup Start interactive account setup wizard" 31 | echo -e " account [name] Switch to a different cloud account" 32 | echo -e " configure Run Ax configuration (install dependencies, set up environment)" 33 | echo -e " build [provisioner] Build a base image with pre-installed tools (using Packer)" 34 | echo 35 | echo -e "${BGreen}Instance Management:${Color_Off}" 36 | echo -e " init [options] Launch a single cloud instance (use --run to auto-generate a random name)" 37 | echo -e " fleet [options] Spin up a fleet of multiple instances (with optional count, regions)" 38 | echo -e " fleet2 [options] A faster but experimental axiom-fleet" 39 | echo -e " deploy Deploy instances from a profile (in ~/.axiom/profiles)" 40 | echo -e " ls List all active instances in current account" 41 | echo -e " select Select instances matching pattern for subsequent operations" 42 | echo -e " ssh SSH into the specified instance" 43 | echo -e " exec Run a shell command on selected instances in parallel" 44 | echo -e " rm Terminate (destroy) instances matching name or pattern" 45 | echo -e " power Power on or off instances matching pattern" 46 | echo 47 | echo -e "${BGreen}Image & Size Management:${Color_Off}" 48 | echo -e " images Manage instance snapshots (list, create, select, delete images)" 49 | echo -e " sizes Manage default instance size (list, select, restore default size)" 50 | echo 51 | echo -e "${BGreen}Regions:${Color_Off}" 52 | echo -e " region Manage default region (list available, select default)" 53 | echo 54 | echo -e "${BGreen}File Operations:${Color_Off}" 55 | echo -e " scp Transfer files to/from instances in parallel (uses SCP-style syntax with patterns)" 56 | echo -e " sync Sync an instance's home directory to local (download via rsync)" 57 | echo 58 | echo -e "${BGreen}Scanning:${Color_Off}" 59 | echo -e " scan Run distributed scans using configured modules across fleet" 60 | echo 61 | echo -e "${BGreen}System Operations:${Color_Off}" 62 | echo -e " update Update Ax to the latest version (git pull in ~/.axiom)" 63 | echo -e " --help Display this help menu" 64 | echo 65 | echo -e "${BGreen}Examples:${Color_Off}" 66 | echo -e " ax configure --setup --shell zsh --unattended # Run initial configuration (no prompts, zsh shell)" 67 | echo -e " ax account-setup # Start interactive account setup wizard" 68 | echo -e " ax account linode # Switch to 'linode' cloud account" 69 | echo -e " ax build default # Build base image using 'default' provisioner" 70 | echo -e " ax init mybox1 # Launch one instance named 'mybox1'" 71 | echo -e " ax fleet -i 5 -r nyc1,nyc3,fra1 myfleet # Launch 5 instances across regions (prefix 'myfleet')" 72 | echo -e " ax ls # List running instances" 73 | echo -e " ax ssh mybox1 # SSH into instance 'mybox1'" 74 | echo -e " ax select myfleet* # Select all 'myfleet' instances" 75 | echo -e " ax exec 'uptime' # Run 'uptime' on all selected instances" 76 | echo -e " ax scp wordlist.txt 'myfleet*':/tmp/wordlist.txt --split # Split and upload a wordlist to all 'myfleet' instances" 77 | echo -e " ax scan targets.txt -m nuclei -o out.txt # Run a Nuclei scan on targets (distributed)" 78 | echo -e " ax rm myfleet* # Terminate all 'myfleet' instances" 79 | echo 80 | } 81 | 82 | ########################################################################################################### 83 | # Display axiom banner and authors 84 | # 85 | banner() { 86 | cat << EOF >&2 87 | 88 | █████╗ ██╗ ██╗ 89 | ██╔══██╗╚██╗██╔╝ 90 | ███████║ ╚███╔╝ 91 | ██╔══██║ ██╔██╗ 92 | ██║ ██║██╔╝ ██╗ 93 | ╚═╝ ╚═╝╚═╝ ╚═╝ 94 | 95 | Maintainer: 0xtavian 96 | EOF 97 | echo '' 98 | echo ' 99 | "𝓲𝓷𝓼𝓹𝓲𝓻𝓮𝓭 𝓫𝔂 𝓪𝔁𝓲𝓸𝓶: 𝓽𝓱𝓮 𝓭𝔂𝓷𝓪𝓶𝓲𝓬 𝓲𝓷𝓯𝓻𝓪𝓼𝓽𝓻𝓾𝓬𝓽𝓾𝓻𝓮 𝓯𝓻𝓪𝓶𝓮𝔀𝓸𝓻𝓴 𝓯𝓸𝓻 𝓮𝓿𝓮𝓻𝔂𝓫𝓸𝓭𝔂! - @𝓹𝓻𝔂0𝓬𝓬 @0𝔁𝓽𝓪𝓿𝓲𝓪𝓷" 100 | "𝓽𝓱𝓮 𝓬𝓸𝓷𝓽𝓲𝓷𝓾𝓪𝓽𝓲𝓸𝓷 𝓸𝓯 𝓪𝔁𝓲𝓸𝓶: 𝓽𝓱𝓮 𝓭𝔂𝓷𝓪𝓶𝓲𝓬 𝓲𝓷𝓯𝓻𝓪𝓼𝓽𝓻𝓾𝓬𝓽𝓾𝓻𝓮 𝓯𝓻𝓪𝓶𝓮𝔀𝓸𝓻𝓴 𝓯𝓸𝓻 𝓮𝓿𝓮𝓻𝔂𝓫𝓸𝓭𝔂! - @𝓹𝓻𝔂0𝓬𝓬 @0𝔁𝓽𝓪𝓿𝓲𝓪𝓷" 101 | "𝓬𝓸𝓷𝓽𝓲𝓷𝓾𝓮𝓭 𝓯𝓻𝓸𝓶 𝓪𝔁𝓲𝓸𝓶: 𝓽𝓱𝓮 𝓭𝔂𝓷𝓪𝓶𝓲𝓬 𝓲𝓷𝓯𝓻𝓪𝓼𝓽𝓻𝓾𝓬𝓽𝓾𝓻𝓮 𝓯𝓻𝓪𝓶𝓮𝔀𝓸𝓻𝓴 𝓯𝓸𝓻 𝓮𝓿𝓮𝓻𝔂𝓫𝓸𝓭𝔂! - @𝓹𝓻𝔂0𝓬𝓬 @0𝔁𝓽𝓪𝓿𝓲𝓪𝓷" 102 | "𝓫𝓪𝓼𝓲𝓬𝓪𝓵𝓵𝔂, 𝓪𝔁𝓲𝓸𝓶: 𝓽𝓱𝓮 𝓭𝔂𝓷𝓪𝓶𝓲𝓬 𝓲𝓷𝓯𝓻𝓪𝓼𝓽𝓻𝓾𝓬𝓽𝓾𝓻𝓮 𝓯𝓻𝓪𝓶𝓮𝔀𝓸𝓻𝓴 𝓯𝓸𝓻 𝓮𝓿𝓮𝓻𝔂𝓫𝓸𝓭𝔂! - @𝓹𝓻𝔂0𝓬𝓬 @0𝔁𝓽𝓪𝓿𝓲𝓪𝓷 " 103 | "𝓶𝓲𝓰𝓱𝓽 𝓪𝓼 𝔀𝓮𝓵𝓵 𝓫𝓮 𝓪𝔁𝓲𝓸𝓶: 𝓽𝓱𝓮 𝓭𝔂𝓷𝓪𝓶𝓲𝓬 𝓲𝓷𝓯𝓻𝓪𝓼𝓽𝓻𝓾𝓬𝓽𝓾𝓻𝓮 𝓯𝓻𝓪𝓶𝓮𝔀𝓸𝓻𝓴 𝓯𝓸𝓻 𝓮𝓿𝓮𝓻𝔂𝓫𝓸𝓭𝔂! - @𝓹𝓻𝔂0𝓬𝓬 @0𝔁𝓽𝓪𝓿𝓲𝓪𝓷" 104 | "𝓪𝓵𝓻𝓲𝓰𝓱𝓽, 𝔂𝓸𝓾 𝓰𝓸𝓽 𝓶𝓮, 𝓲𝓽𝓼 𝓳𝓾𝓼𝓽 𝓪𝔁𝓲𝓸𝓶: 𝓽𝓱𝓮 𝓭𝔂𝓷𝓪𝓶𝓲𝓬 𝓲𝓷𝓯𝓻𝓪𝓼𝓽𝓻𝓾𝓬𝓽𝓾𝓻𝓮 𝓯𝓻𝓪𝓶𝓮𝔀𝓸𝓻𝓴 𝓯𝓸𝓻 𝓮𝓿𝓮𝓻𝔂𝓫𝓸𝓭𝔂! - @𝓹𝓻𝔂0𝓬𝓬 @0𝔁𝓽𝓪𝓿𝓲𝓪𝓷" 105 | "𝓼𝓽𝓸𝓵𝓮𝓷 𝓯𝓻𝓸𝓶 𝓪𝔁𝓲𝓸𝓶: 𝓽𝓱𝓮 𝓭𝔂𝓷𝓪𝓶𝓲𝓬 𝓲𝓷𝓯𝓻𝓪𝓼𝓽𝓻𝓾𝓬𝓽𝓾𝓻𝓮 𝓯𝓻𝓪𝓶𝓮𝔀𝓸𝓻𝓴 𝓯𝓸𝓻 𝓮𝓿𝓮𝓻𝔂𝓫𝓸𝓭𝔂! - @𝓹𝓻𝔂0𝓬𝓬 @0𝔁𝓽𝓪𝓿𝓲𝓪𝓷" 106 | ' | xargs shuf -n1 -e 107 | echo '' 108 | 109 | help 110 | } 111 | 112 | ########################################################################################################### 113 | # Parse command line arguments 114 | # 115 | if [ $# -eq 0 ]; then 116 | banner 117 | exit 0 118 | fi 119 | 120 | # Capture the first argument (input) 121 | input="$1" 122 | 123 | # Check if the corresponding axiom script exists and run it with remaining arguments 124 | if test -f "$AXIOM_PATH/interact/axiom-$input"; then 125 | axiom-$input "${@:2}" 126 | else 127 | echo -e "${Red}Error: ${White}axiom-$input${Color_Off}${Red} script does not exist in ~/.axiom/interact${Color_Off}" 128 | fi 129 | -------------------------------------------------------------------------------- /interact/axiom-account-setup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | AXIOM_PATH="$HOME/.axiom" 4 | source "$AXIOM_PATH/interact/includes/vars.sh" 5 | 6 | echo -e "${BWhite}Axiom Account Setup${Color_Off}" 7 | echo -e "${BGreen}You can use this wizard to add new accounts, once made, use axiom-account to switch between profiles${Color_Off}" 8 | 9 | # Get the list of account helpers, modify ibm-classic and ibm-vpc to ibm 10 | account_helpers=$(find "$AXIOM_PATH/interact/account-helpers" -name "*.sh" -exec basename -s '.sh' {} + | sed -e 's/ibm-classic/ibm/' -e 's/ibm-vpc/ibm/' | sort -u) 11 | account_str=$(echo $account_helpers | sed 's/ /, /g') 12 | echo -e -n "${Green}Please enter your provider ($account_str): \n>> ${Color_Off}" 13 | read -e provider 14 | provider_path="$AXIOM_PATH/interact/account-helpers/$provider.sh" 15 | 16 | # IBM-specific logic: If provider is 'ibm', ask for Classic or VPC choice 17 | ibm_function() { 18 | if [[ "$provider" == "ibm" ]]; then 19 | echo -e -n "${Green}Please choose the infrastructure provider:\n1) Classic\n2) VPC\n>> ${Color_Off}" 20 | read -e choice 21 | 22 | case $choice in 23 | 1) 24 | provider_path="$AXIOM_PATH/interact/account-helpers/ibm-classic.sh" 25 | ;; 26 | 2) 27 | provider_path="$AXIOM_PATH/interact/account-helpers/ibm-vpc.sh" 28 | ;; 29 | *) 30 | echo -e "${Red}Invalid choice. Please choose either 1 for Classic or 2 for VPC.${Color_Off}" 31 | exit 1 32 | ;; 33 | esac 34 | fi 35 | } 36 | ibm_function 37 | # For all other providers, check if the provider file exists 38 | while [[ ! -f "$provider_path" ]]; do 39 | echo -e -n "${Green}This is not a valid provider, please enter a valid provider ($account_str): \n>> ${Color_Off}" 40 | read -e provider 41 | # If the provider is IBM, ask for the infrastructure choice 42 | if [[ "$provider" == "ibm" ]]; then 43 | ibm_function 44 | else 45 | provider_path="$AXIOM_PATH/interact/account-helpers/$provider.sh" 46 | fi 47 | done 48 | 49 | # Finally, execute the provider's script 50 | bash "$provider_path" 51 | -------------------------------------------------------------------------------- /interact/axiom-deploy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | profile="$1" 4 | query="$2" 5 | type="install" 6 | cache="" 7 | 8 | AXIOM_PATH="$HOME/.axiom" 9 | source "$AXIOM_PATH/interact/includes/vars.sh" 10 | source "$AXIOM_PATH/interact/includes/functions.sh" 11 | 12 | function help() { 13 | echo -e "${BWhite}Usage:${Color_Off}" 14 | echo -e " axiom-deploy [OPTIONS] " 15 | echo -e "" 16 | echo -e " Name of the deployment profile to apply (profiles in ~/.axiom/profiles)" 17 | echo -e " Name of the target instance to deploy to" 18 | echo -e "" 19 | echo -e "${BWhite}Options:${Color_Off}" 20 | echo -e " --cache Use SSH cache (if instance was recently accessed)" 21 | echo -e " --remove Uninstall the profile from the instance" 22 | echo -e " --list List all available profiles" 23 | echo -e " --help Display this help menu" 24 | echo -e "" 25 | echo -e "${BWhite}Example:${Color_Off}" 26 | echo -e " ${BGreen}axiom-deploy openvpn jerry01${Color_Off} # Deploy 'openvpn' profile to instance 'jerry01'" 27 | echo -e "" 28 | } 29 | 30 | for var in "$@" 31 | do 32 | if [[ "$var" == "--remove" ]]; then 33 | type="uninstall" 34 | fi 35 | 36 | if [[ "$var" == "--cache" ]]; then 37 | cache="true" 38 | fi 39 | 40 | if [[ "$var" == "--help" ]] || [[ "$var" == "-h" ]]; then 41 | help 42 | exit 0 43 | fi 44 | 45 | if [[ "$var" == "--list" ]]; then 46 | echo -e "${BWhite}Deployment profiles${Color_Off}" 47 | (echo '"ID","Description"'; cat "$AXIOM_PATH/profiles/"* | jq -r '[.name,.description] | @csv') | column -t -s, | tr -d '"' | perl -pe '$_ = "\033[0;37m$_\033[0;34m" if($. % 2)' 48 | exit 0 49 | fi 50 | done 51 | 52 | if [[ -z "$1" ]]; then 53 | help 54 | echo -e "${Red}Error: first argument must be a deployment profile, list all profiles with ${Green}ax deploy --list${Color_Off}" 55 | exit 56 | fi 57 | 58 | if [[ -z "$2" ]]; then 59 | echo -e "${Red}Error: second argument must be an instance name, list all instances with ${Green}ax ls${Color_Off}" 60 | exit 0 61 | fi 62 | 63 | if [[ "$profile" == "" ]]; then 64 | help 65 | else 66 | name="${type}ing" 67 | prof_path="$AXIOM_PATH/profiles/$profile.json" 68 | 69 | if [[ -f "$prof_path" ]]; then 70 | echo -e "${BWhite}$name '$profile' : '$query'" 71 | 72 | [[ "$cache" == "" ]] && generate_sshconfig 73 | 74 | count=$(query_instances_cache "$query" | wc -c) 75 | id="$RANDOM" 76 | script="$AXIOM_PATH/tmp/$id.sh" 77 | 78 | jq -r ".$type[]" "$prof_path" > "$script" 79 | chmod +x "$script" 80 | 81 | if [[ "$count" -gt 1 ]]; then 82 | echo -e "${BWhite}Uploading profile to '$query'${Color_Off}${BGreen}" 83 | axiom-scp "$script" "$query":"/tmp/$id.sh" --cache 84 | axiom-exec "/tmp/$id.sh" -i "$query" --cache 85 | echo -e "${BGreen}Installation Successful!${Color_Off}" 86 | echo -e "${BWhite}Notes${Color_Off}${BGreen}" 87 | jq -r ".notes" "$prof_path" 88 | echo -e -n "${Color_Off}" 89 | else 90 | echo -e "${BRed}Error no instances found...${Color_Off}" 91 | fi 92 | else 93 | echo -e "${BRed}Error: Profile '$profile' does not exist.${Color_Off}" 94 | fi 95 | fi 96 | -------------------------------------------------------------------------------- /interact/axiom-images: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ################################################################### 4 | # Title : axiom-images 5 | # Author : 0xtavian 6 | # Github : https://github.com/0xtavian 7 | ################################################################### 8 | 9 | ################################################################### 10 | # Header 11 | # 12 | AXIOM_PATH="$HOME/.axiom" 13 | source "$AXIOM_PATH/interact/includes/vars.sh" 14 | source "$AXIOM_PATH/interact/includes/functions.sh" 15 | source "$AXIOM_PATH/interact/includes/system-notification.sh" 16 | begin=$(date +%s) 17 | start="$(pwd)" 18 | BASEOS="$(uname)" 19 | account_path=$(ls -la $AXIOM_PATH/axiom.json | rev | cut -d " " -f 1 | rev) 20 | accounts=$(ls -l "$AXIOM_PATH/accounts/" | grep "json" | grep -v 'total ' | awk '{ print $9 }' | sed 's/\.json//g') 21 | current=$(ls -lh ~/.axiom/axiom.json | awk '{ print $11 }' | tr '/' '\n' | grep json | sed 's/\.json//g') > /dev/null 2>&1 22 | provisioner="$(jq -r ".provisioner" "$AXIOM_PATH/axiom.json")" 23 | provider="$(jq -r ".provider" "$AXIOM_PATH/axiom.json")" 24 | 25 | ########################################################################################################### 26 | # Help Menu: 27 | # 28 | function usage() { 29 | echo -e "${BWhite}Usage:${Color_Off} axiom-images [COMMAND] [OPTIONS]" 30 | echo 31 | echo -e "${BWhite}Description:${Color_Off}" 32 | echo -e " Manage images (snapshots) created from Axiom instances and Axiom build." 33 | echo -e " Supports listing, creating, selecting, and deleting images used for axiom-init or axiom-fleet." 34 | echo 35 | echo -e "${BWhite}Commands:${Color_Off}" 36 | echo -e " ls List all images on the current account" 37 | echo -e " get Print current image settings from ~/.axiom/axiom.json" 38 | echo -e " create [instance] Create image from instance (or use wizard if instance is omitted)" 39 | echo -e " select Set image as default for future axiom-init / axiom-fleet" 40 | echo -e " rm Delete specified image from the account" 41 | echo 42 | echo -e "${BWhite}Options:${Color_Off}" 43 | echo -e " --debug Enable debug output (very verbose)" 44 | echo -e " --help Show this help menu" 45 | echo 46 | echo -e "${BWhite}Examples:${Color_Off}" 47 | echo -e " ${BGreen}axiom-images ls${Color_Off} # List all available images" 48 | echo -e " ${BGreen}axiom-images get${Color_Off} # Show current image config" 49 | echo -e " ${BGreen}axiom-images create${Color_Off} # Start interactive image creation wizard" 50 | echo -e " ${BGreen}axiom-images create testy01${Color_Off} # Create image from instance 'testy01'" 51 | echo -e " ${BGreen}axiom-images select axiom-default-1709878237${Color_Off} # Select image for future init/fleet" 52 | echo -e " ${BGreen}axiom-images rm axiom-default-1709878237${Color_Off} # Delete image by name" 53 | echo 54 | 55 | } 56 | 57 | ########################################################################################################### 58 | # Declare defaut variables 59 | # 60 | list=false 61 | help=true 62 | rm=false 63 | use=false 64 | create_snapshot=false 65 | 66 | ########################################################################################################### 67 | # Parse command line arguments 68 | # 69 | if [[ "$@" == "--help" ]] || [[ "$@" == "-h" ]] || [[ "$@" == "" ]]; then 70 | usage 71 | exit 72 | fi 73 | i=0 74 | for arg in "$@" 75 | do 76 | i=$((i+1)) 77 | if [[ ! " ${pass[@]} " =~ " ${i} " ]]; then 78 | set=false 79 | if [[ "$arg" == "--debug" ]]; then 80 | set -xv 81 | set=true 82 | pass+=($i) 83 | fi 84 | if [[ "$arg" == "rm" ]]; then 85 | n=$((i+1)) 86 | rm=true 87 | snapshot=$(echo ${!n}) 88 | set=true 89 | pass+=($i) 90 | pass+=($n) 91 | fi 92 | if [[ "$arg" == "select" ]] ||[[ "$arg" == "set" ]] || [[ "$arg" == "use" ]] ; then 93 | n=$((i+1)) 94 | use=true 95 | snapshot=$(echo ${!n}) 96 | set=true 97 | pass+=($i) 98 | pass+=($n) 99 | fi 100 | if [[ "$arg" == "ls" ]]; then 101 | list="true" 102 | set=true 103 | pass+=($i) 104 | fi 105 | if [[ "$arg" == "--help" ]] || [[ "$arg" == "-h" ]] || [[ "$arg" == "help" ]]; then 106 | usage 107 | exit 108 | set=true 109 | pass+=($i) 110 | fi 111 | if [[ "$arg" == "get" ]] ; then 112 | get="true" 113 | set=true 114 | pass+=($i) 115 | fi 116 | if [[ "$arg" == "create" ]] ; then 117 | n=$((i+1)) 118 | create_snapshot="true" 119 | instance_name=$(echo ${!n}) 120 | set=true 121 | pass+=($i) 122 | pass+=($n) 123 | fi 124 | if [[ "$set" != "true" ]]; then 125 | args="$args $arg" 126 | fi 127 | 128 | fi 129 | done 130 | 131 | # Get the image in /.axiom/accout/account.json 132 | # 133 | if [[ "$get" == "true" ]]; then 134 | echo -e "${Green}Displaying Account Info from: $current${Color_Off}" 135 | cat $(echo $account_path) 136 | exit 1 137 | fi 138 | 139 | # List Snapshots 140 | # 141 | if [[ "$list" == "true" ]]; then 142 | echo -e "${Green}Listing Available Snapshots in Account: $current${Color_Off}" 143 | get_snapshots 144 | exit 1 145 | fi 146 | 147 | # Delete Snapshot by its name 148 | # 149 | if [[ "$rm" == "true" ]]; then 150 | if [ -z ${snapshot:+x} ]; then 151 | echo -e "${Red}Snapshot name not supplied. To list all snapshots run axiom-images ls${Color_Off}" 152 | exit 1 153 | fi 154 | echo -e "${Green}Deleting Snapshot by name: $(echo $snapshot)${Color_Off}" 155 | delete_snapshot $snapshot || { echo -e "${Red}Failed to find snapshot with name: "$snapshot"... exiting${Color_Off}" ; exit 1; } 156 | echo -e "${Green}Successfully deleted snapshot!${Color_Off}" 157 | fi 158 | 159 | # Use Snapshot by name. Run axiom-init or axiom-fleet to use after updating 160 | # 161 | if [[ "$use" == "true" ]]; then 162 | 163 | # Check if snapshot is unset or emtpy 164 | if [ -z "${snapshot+x}" ] || [ -z "$snapshot" ]; then 165 | echo -e "${Red}No image provided, unable to select image.. exiting${Color_Off}" 166 | exit 167 | fi 168 | old="$(cat "$AXIOM_PATH/axiom.json" | jq -r '.imageid')" 169 | jq '.imageid="'$snapshot'"' <"$account_path">"$AXIOM_PATH"/tmp.json ; mv "$AXIOM_PATH"/tmp.json "$account_path" 170 | get_snapshots | grep $snapshot || { echo -e "${Red}Failed to find snapshot with name: "$snapshot"... exiting${Color_Off}" ; exit 1; } 171 | echo -e "${Green}Successfully updated imageid $old with new imageid in $snapshot in account: $current${Color_Off}" 172 | echo -e "${Green}Run axiom-init or axiom-fleet to use it!${Color_Off}" 173 | fi 174 | 175 | # Create a snapshot from an existing axiom instance to use for future axiom-fleet axiom-init 176 | # 177 | if [[ "$create_snapshot" == "true" ]]; then 178 | 179 | if [[ "$provider" == "azure" ]]; then 180 | 181 | echo -e -n "${Red}Error: at this moment we dont support taking snapshots with azure :/" 182 | echo -e -n "${Red}Open a issue showing the az cli commands needed to take a snapshot and we'll look into it!" 183 | echo -e -n "${Red}Exiting..." 184 | exit 1 185 | 186 | fi 187 | 188 | if [ -z "$instance_name" ]; then 189 | axiom-ls 190 | echo -e -n "${BGreen}Enter the instance name to make a snapshot/image and use that image for axiom-init/axiom-fleet \n>> ${Color_Off}" 191 | read instance_name 192 | fi 193 | 194 | if [ -z $(instance_ip $instance_name) ]; then 195 | echo -e "${BRed}could not find instance name ${Color_Off}[ ${BBlue}$instance_name ${Color_Off}]${BRed} on account, exiting.." 196 | echo -e "${BRed}did you enter a valid instance name from ${Color_Off}[ ${BBlue}axiom-ls ${Color_Off}]${BRed}?" 197 | exit 198 | fi 199 | new_image_name=axiom-"$instance_name"-$(date +%s) 200 | instance_ip 201 | echo -e "${BGreen}Creating new image/snapshot from ${Color_Off}[ ${BBlue}$instance_name ${Color_Off}]${BGreen}...${Color_Off}" 202 | create_snapshot "$instance_name" "$new_image_name" 203 | sleep 5 204 | 205 | 206 | if [[ "$provider" == "hetzner" ]]; then 207 | echo -e "${BGreen}If the command above was sucessful, the snapshot ${Color_Off}[ ${BBlue}$new_image_name ${Color_Off}] ${BGreen}should be created" 208 | echo -e "${BGreen}...printing available images with ${Color_Off}[ ${BBlue}axiom-image ls ${Color_Off}]" 209 | echo -e "${BGreen}Selecting snapshot ${Color_Off}[ ${BBlue}$new_image_name ${Color_Off}] ${BGreen} now with ${Color_Off}[ ${BBlue}axiom-images select $new_image_name ${Color_Off}]" 210 | ax images select "$new_image_name" 211 | else 212 | echo -e "" 213 | echo -e "${BGreen}If the command above was sucessful, the snapshot ${Color_Off}[ ${BBlue}$new_image_name ${Color_Off}] ${BGreen}should be in the process of being created..." 214 | echo -e "${BYellow}creating a snapshot takes some time and could be anywhere from 10 to 30 minutes depending on the size and regions${Color_Off}" 215 | echo -e "${BGreen}you can monitor the creation of the snapshot by logging into the cloud console${Color_Off}" 216 | echo -e "${BYellow}or you can use ${Color_Off}[ ${BBlue}axiom-images ls ${Color_Off}] ${BYellow}to print available images${Color_Off}" 217 | echo -e "${BGreen}...printing available images with ${Color_Off}[ ${BBlue}axiom-image ls ${Color_Off}] ${BGreen}now, but its unlikely the snapshot ${Color_Off}[ ${BBlue}$new_image_name ${Color_Off}] ${BGreen}is created yet.." 218 | sleep 5 219 | axiom-images ls 220 | echo -e "" 221 | echo -e "${BYellow}when the snapshot name ${Color_Off}[ ${BBlue}$new_image_name ${Color_Off}]${BYellow} is available in ${Color_Off}[ ${BBlue}axiom-images ls ${Color_Off}] " 222 | echo -e "${BGreen}you will have to select the snapshot to use it for axiom-fleet/axiom-init ${Color_Off}[ ${BBlue}axiom-images select $new_image_name${Color_Off} ]" 223 | echo -e "${BYellow}please run ${Color_Off}[ ${BBlue}axiom-images ls ${Color_Off}]${BYellow} every few minutes until you see the snapshot name ${Color_Off}[ ${BBlue}$new_image_name${Color_Off}]" 224 | echo -e "${BGreen}once the snapshot is created, run ${Color_Off}[ ${BBlue}axiom-images select $new_image_name${Color_Off} ]${BGreen} to select it and use it for axiom-fleet/axiom-init!" 225 | fi 226 | fi 227 | -------------------------------------------------------------------------------- /interact/axiom-ls: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | AXIOM_PATH="$HOME/.axiom" 4 | source "$AXIOM_PATH/interact/includes/vars.sh" 5 | source "$AXIOM_PATH/interact/includes/functions.sh" 6 | current=$(readlink -f "$AXIOM_PATH/axiom.json" | rev | cut -d / -f 1 | rev | cut -d . -f 1) 7 | echo -e "${BWhite}Listing instances in account: $(echo $current)${Color_Off}" 8 | 9 | 10 | if [ -z $1 ]; then 11 | 12 | instance_pretty | perl -pe '$_ = "\033[37m$_\033[0m" if($. % 2); $_ = "\033[32m$_\033[0m" unless ($. % 2)' 13 | 14 | else 15 | if [[ "$1" == "--json" ]]; then 16 | instances 17 | elif [[ "$1" == "--list" ]]; then 18 | instance_list 19 | elif [[ "$1" == "--appliance" ]]; then 20 | pretty_appliances 21 | else 22 | resp=$(query_instances "$1") 23 | count=$(echo $resp | tr ' ' '\n' | wc -l | awk '{ print $1 }') 24 | 25 | if [[ "$count" -gt 1 ]]; then 26 | i=1 27 | for name in $resp; do 28 | echo "$i:$name" 29 | i=$((i + 1)) 30 | done 31 | else 32 | instance_ip "$1" 33 | fi 34 | fi 35 | fi 36 | -------------------------------------------------------------------------------- /interact/axiom-power: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | AXIOM_PATH="$HOME/.axiom" 4 | source "$AXIOM_PATH/interact/includes/vars.sh" 5 | source "$AXIOM_PATH/interact/includes/functions.sh" 6 | source "$AXIOM_PATH/interact/includes/system-notification.sh" 7 | begin=$(date +%s) 8 | start="$(pwd)" 9 | BASEOS="$(uname)" 10 | account_path=$(ls -la $AXIOM_PATH/axiom.json | rev | cut -d " " -f 1 | rev) 11 | accounts=$(ls -l "$AXIOM_PATH/accounts/" | grep "json" | grep -v 'total ' | awk '{ print $9 }' | sed 's/\.json//g') 12 | current=$(readlink -f "$AXIOM_PATH/axiom.json" | rev | cut -d / -f 1 | rev | cut -d . -f 1)> /dev/null 2>&1 13 | 14 | function usage() { 15 | echo -e "${BWhite}Usage:${Color_Off} axiom-power " 16 | echo 17 | echo -e "${BWhite}Description:${Color_Off}" 18 | echo -e " Power on, off, or reboot one or more Axiom instances by name or pattern." 19 | echo 20 | echo -e "${BWhite}Commands:${Color_Off}" 21 | echo -e " on Power on instance(s) matching name or wildcard" 22 | echo -e " off Power off instance(s) matching name or wildcard" 23 | echo -e " reboot Reboot instance(s) matching name or wildcard" 24 | echo -e " help, --help, -h Show this help menu" 25 | echo 26 | echo -e "${BWhite}Examples:${Color_Off}" 27 | echo -e " ${BGreen}axiom-power on 'rez*'${Color_Off} # Power on all instances starting with 'rez'" 28 | echo -e " ${BGreen}axiom-power off '*'${Color_Off} # Power off all instances" 29 | echo -e " ${BGreen}axiom-power reboot test01${Color_Off} # Reboot instance named 'test01'" 30 | echo 31 | } 32 | 33 | ########################################################################################################### 34 | # Declare defaut variables 35 | on=false 36 | help=true 37 | off=false 38 | reboot=false 39 | force=false 40 | 41 | # Parse command line arguments 42 | # 43 | i=0 44 | for arg in "$@" 45 | do 46 | i=$((i+1)) 47 | if [[ ! " ${pass[@]} " =~ " ${i} " ]]; then 48 | set=false 49 | if [[ "$i" == 1 ]]; then 50 | input="$1" 51 | set=true 52 | pass+=($i) 53 | fi 54 | if [[ "$arg" == "on" ]]; then 55 | n=$((i+1)) 56 | on=true 57 | instance=$(echo ${!n}) 58 | set=true 59 | pass+=($i) 60 | pass+=($n) 61 | fi 62 | if [[ "$arg" == "off" ]]; then 63 | n=$((i+1)) 64 | off=true 65 | instance=$(echo ${!n}) 66 | set=true 67 | pass+=($i) 68 | pass+=($n) 69 | fi 70 | if [[ "$arg" == "reboot" ]]; then 71 | n=$((i+1)) 72 | reboot=true 73 | instance=$(echo ${!n}) 74 | set=true 75 | pass+=($i) 76 | pass+=($n) 77 | fi 78 | if [[ "$arg" == "--help" ]] || [[ "$arg" == "-h" ]] || [[ "$arg" == "help" ]]; then 79 | usage 80 | exit 81 | set=true 82 | pass+=($i) 83 | fi 84 | if [[ "$arg" == "--force" ]] || [[ "$arg" == "-f" ]]; then 85 | force=true 86 | set=true 87 | pass+=($i) 88 | fi 89 | if [[ "$arg" == "--debug" ]]; then 90 | debug="true" 91 | set=true 92 | pass+=($i) 93 | fi 94 | if [[ "$set" != "true" ]]; then 95 | args="$args $arg" 96 | fi 97 | 98 | fi 99 | done 100 | 101 | # Display Help Menu 102 | # 103 | if [[ "$@" == "--help" ]] || [[ "$@" == "-h" ]] || [[ "$@" == "" ]] || [[ "$@" == "help" ]]; then 104 | usage 105 | exit 106 | fi 107 | 108 | # Power Off Snapshots 109 | # 110 | if [[ "$off" == "true" ]]; then 111 | instances=$(query_instances "$@"|sort -u|tr ' ' '\n') 112 | 113 | if [[ ${#instances} == 0 ]];then 114 | usage 115 | exit 116 | fi 117 | for i in $(echo $instances); 118 | do 119 | echo -e "${Yellow}Powering off instance: $i${Color_Off}" 120 | poweroff $i $force; 121 | done 122 | fi 123 | 124 | # Power On Snapshots 125 | # 126 | if [[ "$on" == "true" ]]; then 127 | instances=$(query_instances "$@"|sort -u|tr ' ' '\n') 128 | 129 | if [[ ${#instances} == 0 ]];then 130 | usage 131 | exit 132 | fi 133 | 134 | for i in $(echo $instances); 135 | do 136 | echo -e "${Yellow}Powering on instance: $i${Color_Off}" 137 | poweron $i $force; 138 | done 139 | fi 140 | 141 | # Reboot Snapshots 142 | # 143 | if [[ "$reboot" == "true" ]]; then 144 | instances=$(query_instances "$@"|sort -u|tr ' ' '\n') 145 | 146 | if [[ ${#instances} == 0 ]];then 147 | usage 148 | exit 149 | fi 150 | 151 | for i in $(echo $instances); 152 | do 153 | echo -e "${Yellow}Rebooting instance: $i${Color_Off}" 154 | reboot $i $force; 155 | done 156 | fi 157 | -------------------------------------------------------------------------------- /interact/axiom-provider: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | AXIOM_PATH="$HOME/.axiom" 4 | if [ -f "$AXIOM_PATH/interact/includes/vars.sh" ] ; then 5 | source "$AXIOM_PATH/interact/includes/vars.sh" 6 | fi 7 | if [ -f "$AXIOM_PATH/interact/includes/functions.sh" ] ; then 8 | source "$AXIOM_PATH/interact/includes/functions.sh" 9 | fi 10 | 11 | INCLUDE_PATH="$AXIOM_PATH/providers/" 12 | SRC_FUNCTIONS="$AXIOM_PATH/interact/includes/functions.sh" 13 | provisioner="$(jq -r '.provisioner' "$AXIOM_PATH"/axiom.json)" 14 | 15 | options=$(ls -l "$INCLUDE_PATH" | grep "\-functions.sh" | awk '{ print $9 }' | sed 's/\-functions\.sh//g') 16 | choice=false 17 | 18 | if [ ! -z $1 ] 19 | then 20 | choice="$1" 21 | fi 22 | 23 | if [[ "$choice" != "false" ]] 24 | then 25 | CHOICE_FUNCTIONS="$INCLUDE_PATH/$choice-functions.sh" 26 | 27 | if [ -f "$CHOICE_FUNCTIONS" ] 28 | then 29 | echo -e "${BWhite}Setting axiom provider to '$choice'${Color_Off}" 30 | "$AXIOM_PATH/interact/generate_packer" "$choice" "$provisioner" > /dev/null 2>&1 31 | 32 | if [ -f "$SRC_FUNCTIONS" ] ; then 33 | rm "$SRC_FUNCTIONS" 34 | fi 35 | ln -s "$CHOICE_FUNCTIONS" "$SRC_FUNCTIONS" 36 | echo -e "${BGreen}Provider set successfully${Color_Off}" 37 | fi 38 | else 39 | echo $options | tr ' ' '\n' 40 | fi 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /interact/axiom-region: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | AXIOM_PATH="$HOME/.axiom" 4 | provider="$(jq -r '.provider' "$AXIOM_PATH"/axiom.json)" 5 | source "$AXIOM_PATH/interact/includes/vars.sh" 6 | source "$AXIOM_PATH/interact/includes/functions.sh" 7 | account_path=$(ls -la $AXIOM_PATH/axiom.json | rev | cut -d " " -f 1 | rev) 8 | 9 | if [ "$1" == "ls" ] 10 | then 11 | list_regions 12 | elif [ "$1" == "select" ] 13 | then 14 | region_json=$(regions) 15 | lines=$(echo $region_json | grep "$2" | wc -l | awk '{ print $1 }') 16 | 17 | if [ "$lines" -gt 0 ] 18 | then 19 | cat $AXIOM_PATH/axiom.json | jq -r ".region=\"$2\"" | jq -r > $AXIOM_PATH/axiom.json.new 20 | if [ "$provider" = "gcp" ]; then 21 | physical_region=$(echo $2| rev | cut -d '-' -f2- | rev) 22 | availability_zones=$(echo "$region_json" | jq -r '.[].name') 23 | # Check if selected availability zone is in the list of valid availability zones 24 | if ! echo "$2" | grep -qw "$availability_zones"; then 25 | echo -e "${BRed}Error: for GCP you must select an availability zone as a region${Color_Off}" 26 | echo -e "${BRed}List all availability zones with ax region ls.. exiting${Color_Off}" 27 | exit 28 | fi 29 | cat $AXIOM_PATH/axiom.json | jq -r ".physical_region=\"$physical_region\"" | jq -r ".region=\"$2\"" |jq -r > $AXIOM_PATH/axiom.json.new 30 | fi 31 | 32 | if [ "$provider" = "ibm-vpc" ]; then 33 | physical_region=$(echo $2| rev | cut -d '-' -f2- | rev) 34 | availability_zones=$(list_regions) 35 | # Check if selected availability zone is in the list of valid availability zones 36 | if ! echo "$2" | grep -qw "$availability_zones"; then 37 | echo -e "${BRed}Error: for IBM Cloud VPC you must select an availability zone as a region${Color_Off}" 38 | echo -e "${BRed}List all availability zones with ax region ls.. exiting${Color_Off}" 39 | exit 40 | fi 41 | cat $AXIOM_PATH/axiom.json | jq -r ".physical_region=\"$physical_region\"" | jq -r ".region=\"$2\"" |jq -r > $AXIOM_PATH/axiom.json.new 42 | ibmcloud target -r $physical_region -g "$(jq -r '.resource_group' "$AXIOM_PATH"/axiom.json)" -q 43 | fi 44 | 45 | if [ "$provider" = "aws" ]; then 46 | aws configure set region $2 47 | fi 48 | 49 | if [ "$provider" = "exoscale" ]; then 50 | if [[ $(uname) == "Darwin" ]]; then 51 | CONFIG_PATH="$HOME/Library/Application Support/exoscale" 52 | else 53 | CONFIG_PATH="$HOME/.config/exoscale" 54 | fi 55 | tmp_file=$(mktemp) 56 | sed "s/defaultZone = '[^']*'/defaultZone = '$2'/g" "$CONFIG_PATH/exoscale.toml" > "$tmp_file" && cp "$tmp_file" "$CONFIG_PATH/exoscale.toml" && rm "$tmp_file" 57 | fi 58 | 59 | mv $AXIOM_PATH/axiom.json.new $account_path 60 | echo -e "${BWhite}Selected region $2${Color_Off}" 61 | fi 62 | else 63 | echo -e "${BWhite}Usage:${Color_Off} axiom-region [COMMAND]" 64 | echo 65 | echo -e "${BWhite}Description:${Color_Off}" 66 | echo -e " List or select the default region used for instance creation." 67 | echo 68 | echo -e "${BWhite}Commands:${Color_Off}" 69 | echo -e " ls List all available regions for the current provider" 70 | echo -e " select Set the default region (e.g. nyc3, us-west, eu-central)" 71 | echo 72 | echo -e "${BWhite}Examples:${Color_Off}" 73 | echo -e " ${BGreen}axiom-region ls${Color_Off} # Show all available regions" 74 | echo -e " ${BGreen}axiom-region select nyc3${Color_Off} # Set 'nyc3' as the default region" 75 | echo 76 | fi 77 | -------------------------------------------------------------------------------- /interact/axiom-rm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | AXIOM_PATH="$HOME/.axiom" 4 | source "$AXIOM_PATH/interact/includes/vars.sh" 5 | source "$AXIOM_PATH/interact/includes/functions.sh" 6 | output="${Red}No instance supplied or instance not found. Run 'ax ls' to list all instances or 'ax rm --help' for more options.${Color_Off}" 7 | 8 | ########################################################################################################### 9 | # Help Menu 10 | # 11 | function usage() { 12 | echo -e "${BWhite}Usage:${Color_Off} axiom-rm [OPTIONS]" 13 | echo 14 | echo -e "${BWhite}Description:${Color_Off}" 15 | echo -e " Delete one or more Axiom instances by name or pattern." 16 | echo -e " Supports wildcards to match instance prefixes, suffixes, or substrings." 17 | echo 18 | echo -e "${BWhite}Arguments:${Color_Off}" 19 | echo -e " Name or glob pattern to match instances (e.g. testy01, 'prefix*', '*sub*')" 20 | echo 21 | echo -e "${BWhite}Options:${Color_Off}" 22 | echo -e " -f, --force Skip confirmation prompts" 23 | echo -e " -m, --multi Enable multi-delete via API when supported" 24 | echo -e " --debug Enable debug output (very verbose)" 25 | echo -e " --help Show this help menu" 26 | echo 27 | echo -e "${BWhite}Examples:${Color_Off}" 28 | echo -e " ${BGreen}axiom-rm testy01${Color_Off} # Delete a single instance by name" 29 | echo -e " ${BGreen}axiom-rm 'testy*'${Color_Off} # Delete all instances starting with 'testy'" 30 | echo -e " ${BGreen}axiom-rm '*tess*'${Color_Off} # Delete instances with 'tess' in their name" 31 | echo -e " ${BGreen}axiom-rm '*' --force --multi${Color_Off} # Delete all instances without prompts using multi-delete" 32 | echo 33 | } 34 | 35 | if [ -z "$1" ]; then 36 | usage 37 | exit 38 | fi 39 | 40 | force="false" 41 | query="" 42 | instance_names="" 43 | multi=false 44 | 45 | for var in "$@"; do 46 | case "$var" in 47 | -f|--force) 48 | force=true 49 | ;; 50 | -m|--multi) 51 | multi=true 52 | ;; 53 | --debug) 54 | set -xv 55 | ;; 56 | *) 57 | var=$(echo "$var" | sed 's/\\\*/\*/g') # Convert \* to * 58 | query="$query '$var'" 59 | ;; 60 | esac 61 | done 62 | 63 | instance_names=$(eval query_instances "$query") 64 | 65 | if [[ "$instance_names" ]]; then 66 | if [ "$multi" == "true" ]; then 67 | delete_instances "$instance_names" "$force" 68 | else 69 | for instance in $instance_names; do 70 | echo -e "${Red}Deleting '$instance'...${Color_Off}" 71 | delete_instance "$instance" "$force" 72 | done 73 | fi 74 | else 75 | >&2 echo -e "$output ${Color_Off}" 76 | exit 77 | fi 78 | -------------------------------------------------------------------------------- /interact/axiom-select: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | AXIOM_PATH="$HOME/.axiom" 4 | source "$AXIOM_PATH/interact/includes/vars.sh" 5 | source "$AXIOM_PATH/interact/includes/functions.sh" 6 | 7 | 8 | function help() { 9 | echo -e "${BWhite}Usage of axiom-select${Color_Off}" 10 | echo -e "Example Usage: ${BGreen}axiom-select fleet* || axiom-select --auto ${Color_Off}" 11 | echo -e " string" 12 | echo -e " List of axiom instances, or supply instance prefix and wildcard (i.e axiom-select elion* or axiom-select elion01 elion02 elion03)" 13 | echo -e " --auto (optional)" 14 | echo -e " Automatically select fleet" 15 | } 16 | 17 | if [ "$1" == "--auto" ]; then 18 | instance_list | grep -P '^[a-z]{2,6}[0-9]{2}$' | sort -u > "$AXIOM_PATH/selected.conf" 19 | 20 | elif [[ "$@" == "--help" ]] || [[ "$@" == "-h" ]]; then 21 | help 22 | exit 23 | 24 | elif [[ ! -z "$1" ]]; then 25 | query_instances "$@" | sort -u | tr ' ' '\n' > "$AXIOM_PATH/selected.conf" 26 | 27 | fi 28 | 29 | echo -e "${BWhite}Selected: ${Color_Off}[${BGreen} "$(cat $AXIOM_PATH/selected.conf | sed 's/\n/ /g') ${Color_Off}]"" 30 | -------------------------------------------------------------------------------- /interact/axiom-sizes: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ################################################################### 4 | # Header 5 | # 6 | AXIOM_PATH="$HOME/.axiom" 7 | source "$AXIOM_PATH/interact/includes/vars.sh" 8 | source "$AXIOM_PATH/interact/includes/functions.sh" 9 | source "$AXIOM_PATH/interact/includes/system-notification.sh" 10 | begin=$(date +%s) 11 | start="$(pwd)" 12 | BASEOS="$(uname)" 13 | account_path=$(ls -la $AXIOM_PATH/axiom.json | rev | cut -d " " -f 1 | rev) 14 | accounts=$(ls -l "$AXIOM_PATH/accounts/" | grep "json" | grep -v 'total ' | awk '{ print $9 }' | sed 's/\.json//g') 15 | current=$(ls -lh ~/.axiom/axiom.json | awk '{ print $11 }' | tr '/' '\n' | grep json | sed 's/\.json//g') > /dev/null 2>&1 16 | provider="$(jq -r ".provider" "$AXIOM_PATH/axiom.json")" 17 | 18 | ################################################################### 19 | # Get default instance size if ax sizes default is used 20 | # 21 | get_default_size() { 22 | if [[ "$provider" == "azure" ]]; then 23 | default_size="Standard_B1ls" 24 | 25 | elif [[ "$provider" == "aws" ]]; then 26 | default_size="t2.medium" 27 | 28 | elif [[ "$provider" == "do" ]]; then 29 | default_size="s-1vcpu-1gb" 30 | 31 | elif [[ "$provider" == "ibm-classic" ]]; then 32 | default_size="C1_2X2X25" 33 | 34 | elif [[ "$provider" == "ibm-vpc" ]]; then 35 | default_size="cx2-2x4" 36 | 37 | elif [[ "$provider" == "linode" ]]; then 38 | default_size="g6-standard-1" 39 | 40 | elif [[ "$provider" == "gcp" ]]; then 41 | default_size="n1-standard-1" 42 | 43 | elif [[ "$provider" == "hetzner" ]]; then 44 | default_size="cx22" 45 | 46 | elif [[ "$provider" == "scaleway" ]]; then 47 | default_size="DEV1-S" 48 | 49 | elif [[ "$provider" == "exoscale" ]]; then 50 | default_size="standard.medium" 51 | 52 | else 53 | echo "Error: Unknown provider '$provider'" 54 | exit 1 55 | fi 56 | } 57 | 58 | ########################################################################################################### 59 | # Help Menu: 60 | # 61 | function usage() { 62 | echo -e "${BWhite}Usage:${Color_Off} axiom-sizes [COMMAND] [OPTIONS]" 63 | echo 64 | echo -e "${BWhite}Description:${Color_Off}" 65 | echo -e " Manage the default instance size used by axiom-init and axiom-fleet." 66 | echo -e " You can list, select, restore, or print the currently selected size." 67 | echo 68 | echo -e "${BWhite}Commands:${Color_Off}" 69 | echo -e " ls List all available instance sizes" 70 | echo -e " get Print the current default instance size from axiom.json" 71 | echo -e " select Set a new default size (must be a valid option from 'ls')" 72 | echo -e " default Restore the original default size" 73 | echo 74 | echo -e "${BWhite}Options:${Color_Off}" 75 | echo -e " --debug Enable debug output (very verbose)" 76 | echo -e " --help Show this help menu" 77 | echo 78 | echo -e "${BWhite}Examples:${Color_Off}" 79 | echo -e " ${BGreen}axiom-sizes ls${Color_Off} # List sizes available from provider" 80 | echo -e " ${BGreen}axiom-sizes get${Color_Off} # Show the currently selected size" 81 | echo -e " ${BGreen}axiom-sizes select s-4vcpu-8gb${Color_Off} # Set 's-4vcpu-8gb' as the default" 82 | echo -e " ${BGreen}axiom-sizes default${Color_Off} # Reset to original default size" 83 | echo 84 | } 85 | 86 | ########################################################################################################### 87 | # Declare defaut variables 88 | # 89 | list="false" 90 | help="true" 91 | use="false" 92 | default_size="false" 93 | 94 | ########################################################################################################### 95 | # Parse command line arguments 96 | # 97 | if [[ "$@" == "--help" ]] || [[ "$@" == "-h" ]] || [[ "$@" == "" ]]; then 98 | usage 99 | exit 100 | fi 101 | i=0 102 | for arg in "$@" 103 | do 104 | i=$((i+1)) 105 | if [[ ! " ${pass[@]} " =~ " ${i} " ]]; then 106 | set=false 107 | if [[ "$arg" == "--debug" ]]; then 108 | set -xv 109 | set=true 110 | pass+=($i) 111 | fi 112 | if [[ "$arg" == "default" ]]; then 113 | restore_default_size=true 114 | set=true 115 | pass+=($i) 116 | fi 117 | if [[ "$arg" == "select" ]] ||[[ "$arg" == "set" ]] || [[ "$arg" == "use" ]] ; then 118 | n=$((i+1)) 119 | use=true 120 | new_size=$(echo ${!n}) 121 | set=true 122 | pass+=($i) 123 | pass+=($n) 124 | fi 125 | if [[ "$arg" == "ls" ]] || [[ "$arg" == "list" ]]; then 126 | list="true" 127 | set=true 128 | pass+=($i) 129 | fi 130 | if [[ "$arg" == "--help" ]] || [[ "$arg" == "-h" ]] || [[ "$arg" == "help" ]]; then 131 | usage 132 | exit 133 | set=true 134 | pass+=($i) 135 | fi 136 | if [[ "$arg" == "get" ]] ; then 137 | get="true" 138 | set=true 139 | pass+=($i) 140 | fi 141 | if [[ "$set" != "true" ]]; then 142 | args="$args $arg" 143 | fi 144 | 145 | fi 146 | done 147 | 148 | # Get the default size in /.axiom/accout/account.json 149 | # 150 | if [[ "$get" == "true" ]]; then 151 | echo -e "${Green}Displaying Account Info from: $current${Color_Off}" 152 | cat $(echo $account_path) 153 | exit 1 154 | 155 | # List sizes 156 | # 157 | elif [[ "$list" == "true" ]]; then 158 | echo -e "${Green}Listing Available Instance Sizes for Cloud provider in Account: $current${Color_Off}" 159 | sizes_list 160 | exit 1 161 | 162 | # Use new instance size by name. Run axiom-init or axiom-fleet to use after updating 163 | # 164 | elif [[ "$use" == "true" ]]; then 165 | # Check if size is unset or emtpy 166 | if [ -z "${new_size+x}" ] || [ -z "$new_size" ]; then 167 | echo -e "${Red}No size provided, unable to select size.. exiting${Color_Off}" 168 | exit 169 | fi 170 | 171 | old="$(cat "$AXIOM_PATH/axiom.json" | jq -r '.default_size')" 172 | sizes_list | grep -q -w $new_size || { echo -e "${Red}Failed to find instance size with name: "$new_size"... exiting${Color_Off}" ; \ 173 | echo -e "${Red}To print all available intance sizes, run ax sizes ls${Color_Off}" ; exit 1; } 174 | jq '.default_size="'$new_size'"' <"$account_path">"$AXIOM_PATH"/tmp.json ; mv "$AXIOM_PATH"/tmp.json "$account_path" 175 | echo -e "${Green}Successfully updated default_size $old with new instance size $new_size in account: $current${Color_Off}" 176 | echo -e "${Green}Run axiom-init or axiom-fleet to use it!${Color_Off}" 177 | 178 | # Restore default size if ax sizes default is used 179 | ## 180 | elif [[ "$restore_default_size" == "true" ]]; then 181 | get_default_size 182 | if [[ "$provider" == "ibm-classic" ]]; then 183 | ram="$(echo $default_size | cut -d , -f 1)" 184 | cpu="$(echo $default_size | cut -d , -f 2)" 185 | jq '.default_size="'$ram'"' <"$account_path">"$AXIOM_PATH"/tmp.json ; mv "$AXIOM_PATH"/tmp.json "$account_path" 186 | jq '.cpu="'$cpu'"' <"$account_path">"$AXIOM_PATH"/tmp.json ; mv "$AXIOM_PATH"/tmp.json "$account_path" 187 | echo -e "${Green}Successfully restored default size, updated ~/.axiom/axiom.json to use ram: $ram and cpu: $cpu in account: $current${Color_Off}" 188 | echo -e "${Green}Run axiom-init or axiom-fleet to use it!${Color_Off}" 189 | else 190 | jq '.default_size="'$default_size'"' <"$account_path">"$AXIOM_PATH"/tmp.json ; mv "$AXIOM_PATH"/tmp.json "$account_path" 191 | echo -e "${Green}Successfully restored default size, updated ~/.axiom/axiom.json with default instance size $default_size in account: $current${Color_Off}" 192 | echo -e "${Green}Run axiom-init or axiom-fleet to use it!${Color_Off}" 193 | fi 194 | 195 | # Valid command not provided 196 | ## 197 | else 198 | usage 199 | fi 200 | -------------------------------------------------------------------------------- /interact/axiom-ssh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ########################################################################################################### 4 | # Header 5 | # 6 | AXIOM_PATH="$HOME/.axiom" 7 | source "$AXIOM_PATH/interact/includes/vars.sh" 8 | source "$AXIOM_PATH/interact/includes/functions.sh" 9 | source "$AXIOM_PATH/interact/includes/system-notification.sh" 10 | begin=$(date +%s) 11 | start="$(pwd)" 12 | BASEOS="$(uname)" 13 | account_path=$(ls -la $AXIOM_PATH/axiom.json | rev | cut -d " " -f 1 | rev) 14 | accounts=$(ls -l "$AXIOM_PATH/accounts/" | grep "json" | grep -v 'total ' | awk '{ print $9 }' | sed 's/\.json//g') 15 | current=$(ls -lh ~/.axiom/axiom.json | awk '{ print $11 }' | tr '/' '\n' | grep json | sed 's/\.json//g') > /dev/null 2>&1 16 | case $BASEOS in 17 | 'Darwin') 18 | PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH" 19 | ;; 20 | *) ;; 21 | esac 22 | 23 | ########################################################################################################### 24 | # Declare defaut variables 25 | # 26 | ssh_config="$AXIOM_PATH/.sshconfig" 27 | use_tmux=false 28 | attachonly=false 29 | spawn=true 30 | use_mosh=false 31 | tmux_session="main" 32 | connected=false 33 | cache=false 34 | just_generate=false 35 | args="-F $ssh_config" 36 | toggle=false 37 | 38 | ########################################################################################################### 39 | # Help Menu: 40 | # 41 | function usage() { 42 | echo -e "${BWhite}Usage:${Color_Off} axiom-ssh [OPTIONS] []" 43 | echo 44 | echo -e "${BWhite}Description:${Color_Off}" 45 | echo -e " Dynamically generate Axiom's SSH config and connect to instances." 46 | echo -e " Supports public/private IPs, tmux sessions, mosh, and SSH port forwarding." 47 | echo -e " All extra args are passed directly to the ssh command." 48 | echo 49 | echo -e "${BWhite}Connection Options:${Color_Off}" 50 | echo -e " Name of the instance to connect to (required)" 51 | echo -e " --mosh, -m Connect using mosh instead of ssh" 52 | echo -e " --cache Use cached SSH config without regenerating" 53 | echo -e " --debug Enable debug output" 54 | echo 55 | echo -e "${BWhite}Tmux Options:${Color_Off}" 56 | echo -e " --tmux Start or attach to a tmux session (default: 'main')" 57 | echo -e " --tmux-attach, -t Only attach if tmux session exists; do not create it" 58 | echo 59 | echo -e "${BWhite}SSH Config Generation:${Color_Off}" 60 | echo -e " --just-generate Generate SSH config and exit (default: use public IPs)" 61 | echo -e " --just-generate private Generate config using private IPs" 62 | echo -e " --just-generate cache Lock cached config to avoid regeneration" 63 | echo 64 | echo -e "${BWhite}Examples:${Color_Off}" 65 | echo -e " ${BGreen}axiom-ssh testy01${Color_Off} # Connect to instance 'testy01'" 66 | echo -e " ${BGreen}axiom-ssh testy01 --tmux mysession${Color_Off} # Start/attach to tmux session 'mysession'" 67 | echo -e " ${BGreen}axiom-ssh --just-generate private${Color_Off} # Generate SSH config with private IPs only" 68 | echo -e " ${BGreen}axiom-ssh testy01 -L 8080:127.0.0.1:8080 -D 4040${Color_Off} # Forward ports using ssh args" 69 | echo 70 | } 71 | 72 | ########################################################################################################### 73 | # Parse command line arguments 74 | # 75 | i=0 76 | for arg in "$@" 77 | do 78 | i=$((i+1)) 79 | if [[ ! " ${pass[@]} " =~ " ${i} " ]]; then 80 | set=false 81 | if [[ "$i" == 1 ]]; then 82 | instance="$1" 83 | set=true 84 | pass+=($i) 85 | fi 86 | if [[ "$arg" == "--debug" ]]; then 87 | set -xv 88 | set=true 89 | pass+=($i) 90 | fi 91 | if [[ "$arg" == "--tmux" ]]; then 92 | n=$((i+1)) 93 | tmux_session=$(echo ${!n}) 94 | use_tmux=true 95 | set=true 96 | pass+=($i) 97 | pass+=($n) 98 | fi 99 | 100 | if [[ "$arg" == "--tmux-attach" ]] || [[ "$arg" == "-t" ]] || [[ "$arg" == "-t=" ]]; then 101 | n=$((i+1)) 102 | attachonly=true 103 | tmux_session=$(echo ${!n}) 104 | set=true 105 | pass+=($i) 106 | pass+=($n) 107 | fi 108 | if [[ "$arg" == "--just-generate" ]]; then 109 | n=$((i+1)) 110 | just_generate=true 111 | toggle=$(echo ${!n}) 112 | set=true 113 | pass+=($i) 114 | pass+=($n) 115 | fi 116 | if [[ "$arg" == "--mosh" ]]; then 117 | n=$((i+1)) 118 | use_mosh=true 119 | instance=$(echo ${!n}) 120 | set=true 121 | pass+=($i) 122 | pass+=($n) 123 | fi 124 | if [[ "$arg" == "--help" ]] || [[ "$arg" == "-h" ]] || [[ "$arg" == "help" ]]; then 125 | usage 126 | exit 127 | set=true 128 | pass+=($i) 129 | fi 130 | if [[ "$arg" == "--cache" ]]; then 131 | cache=true 132 | set=true 133 | pass+=($i) 134 | fi 135 | if [[ "$set" != "true" ]]; then 136 | args="$args $arg" 137 | fi 138 | fi 139 | done 140 | 141 | ########################################################################################################### 142 | # Display Help Menu 143 | # 144 | if [[ "$*" == "--help" ]] || [[ "$*" == "-h" ]] || [[ "$*" == "" ]] || [[ "$*" == "help" ]]; then 145 | usage 146 | exit 147 | fi 148 | 149 | ########################################################################################################### 150 | # if --tmux is provided without a name, default to 'main' 151 | # 152 | if [ -z ${tmux_session:+x} ]; then 153 | tmux_session="main" 154 | fi 155 | 156 | ########################################################################################################### 157 | # SSH generate toggle and store toggle in account.json 158 | # 159 | if [[ "$toggle" == "public" ]] || [[ "$toggle" == "Public" ]] || [[ "$toggle" == "PUBLIC" || $toggle == "" ]]; then 160 | jq '.generate_sshconfig="public"' <"$account_path">"$AXIOM_PATH"/tmp.json ; mv "$AXIOM_PATH"/tmp.json "$account_path" 161 | fi 162 | 163 | if [[ "$toggle" == "private" ]] || [[ "$toggle" == "Private" ]] || [[ "$toggle" == "PRIVATE" ]]; then 164 | jq '.generate_sshconfig="private"' <"$account_path">"$AXIOM_PATH"/tmp.json ; mv "$AXIOM_PATH"/tmp.json "$account_path" 165 | fi 166 | 167 | if [[ "$toggle" == "cache" ]] || [[ "$toggle" == "Cache" ]] || [[ "$toggle" == "CACHE" ]] || [[ "$toggle" == "Lock" ]]|| [[ "$toggle" == "lock" ]]; then 168 | jq '.generate_sshconfig="cache"' <"$account_path">"$AXIOM_PATH"/tmp.json ; mv "$AXIOM_PATH"/tmp.json "$account_path" 169 | fi 170 | 171 | ########################################################################################################### 172 | # If --cache flag isnt provided, regenerate axiom's SSH config 173 | # 174 | if [ $cache != true ] 175 | then 176 | generate_sshconfig 177 | fi 178 | 179 | ########################################################################################################### 180 | # If --tmux is in the command, connect to instance and spawn a new tmux session 181 | # 182 | if [ $use_tmux == true ] 183 | then 184 | args="$args -t 'tmux new-session -t $tmux_session'" 185 | fi 186 | 187 | ########################################################################################################### 188 | # Attach to tmux session by name, if session isnt created this will error 189 | # 190 | if [ $attachonly == true ] 191 | then 192 | args="$args -t 'tmux attach -t $tmux_session'" 193 | fi 194 | 195 | ########################################################################################################### 196 | # If --mosh is in the command, connect to instance via mosh 197 | # 198 | if [ $use_mosh == true ] 199 | then 200 | new_args="" 201 | for i in $args 202 | do 203 | if [[ "$i" != "$1" ]] && [[ ! "$i" =~ "-t" ]] 204 | then 205 | new_args="$new_args $i" 206 | fi 207 | done 208 | cmd="mosh --ssh='ssh -o StrictHostKeyChecking=no -o PasswordAuthentication=no $instance $new_args' $2 -- tmux attach -t $tmux_session -d" 209 | echo $cmd 210 | else 211 | 212 | ########################################################################################################### 213 | # Command to run whenever mosh isnt used 214 | # 215 | cmd="ssh -o StrictHostKeyChecking=no -o PasswordAuthentication=no $instance $args" 216 | fi 217 | 218 | ########################################################################################################### 219 | # Execute command unless --just-generate is supplied 220 | # 221 | if [ "$just_generate" == "false" ] 222 | then 223 | bash -c "$cmd" 224 | fi 225 | -------------------------------------------------------------------------------- /interact/axiom-sync: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | AXIOM_PATH="$HOME/.axiom" 4 | source "$AXIOM_PATH/interact/includes/vars.sh" 5 | source "$AXIOM_PATH/interact/includes/functions.sh" 6 | instance="" 7 | 8 | # help menu 9 | function help() { 10 | echo -e "${BWhite}Usage:${Color_Off} axiom-sync [INSTANCE ...] [OPTIONS]" 11 | echo 12 | echo -e "${BWhite}Description:${Color_Off}" 13 | echo -e " Sync the home directory from one or more Axiom instances to your local machine." 14 | echo 15 | echo -e "${BWhite}Arguments:${Color_Off}" 16 | echo -e " One or more instance names to sync from" 17 | echo 18 | echo -e "${BWhite}Options:${Color_Off}" 19 | echo -e " --help Show this help menu" 20 | echo 21 | echo -e "${BWhite}Examples:${Color_Off}" 22 | echo -e " ${BGreen}axiom-sync instance01${Color_Off} # Sync from 'instance01'" 23 | echo -e " ${BGreen}axiom-sync instance01 instance02${Color_Off} # Sync from multiple instances" 24 | echo 25 | } 26 | 27 | # take one arugment and downloads the home dir of the instance supplied 28 | function sync() { 29 | generate_sshconfig 30 | sync_path="$AXIOM_PATH/boxes/$1" 31 | if [ ! -d "$sync_path" ] 32 | then 33 | mkdir -p "$AXIOM_PATH/sync/$1" 34 | fi 35 | 36 | echo -e "${BWhite}Syncing $instance to local file system... ${Color_Off}" 37 | echo -n -e "${BGreen}" 38 | rsync -avzr -e "ssh -F $AXIOM_PATH/.sshconfig" --progress --include-from="$AXIOM_PATH"/interact/includes/backup-files.txt "$instance":~/ "$AXIOM_PATH"/boxes/"$instance"/ 39 | echo -n -e "${Color_Off}" 40 | echo -e "${BGreen}Instance '$instance' home directory successfully downloaded to $AXIOM_PATH/sync/$1 !${Color_Off}" 41 | } 42 | 43 | # if no arguments are specified print help menu 44 | if [ "$1" == "" ]; then 45 | help 46 | exit 47 | fi 48 | 49 | # if arguments --help or -h are specified print help 50 | if [[ "$@" == "--help" ]] || [[ "$@" == "-h" ]]; then 51 | help 52 | exit 53 | fi 54 | 55 | # iterate over the instance supplied and download the home dir recursively 56 | if [[ ! -z "$1" ]]; then 57 | mkdir -p $AXIOM_PATH/boxes 58 | for var in "$@" 59 | do 60 | instance=$var 61 | sync $1 62 | done 63 | fi 64 | -------------------------------------------------------------------------------- /interact/axiom-update: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd ~/.axiom/ 4 | git pull 5 | -------------------------------------------------------------------------------- /interact/expand_cidr.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import ipaddress 4 | import argparse 5 | 6 | def expand_subnets(ip_list, silent=False): 7 | expanded_list = [] 8 | 9 | for item in ip_list: 10 | item_stripped = item.strip() 11 | try: 12 | # Check if item is a single IP 13 | if ipaddress.ip_address(item_stripped): 14 | expanded_list.append(item_stripped) 15 | continue 16 | except ValueError: 17 | pass 18 | 19 | try: 20 | # Check if item is a subnet 21 | subnet = ipaddress.ip_network(item_stripped, strict=False) 22 | if subnet.prefixlen != 32: 23 | if not silent: # Only print if not in silent mode 24 | print(f"Expanding subnet {subnet}") 25 | expanded_list.extend([str(ip) for ip in subnet]) 26 | else: 27 | expanded_list.append(item_stripped) 28 | except ValueError: 29 | # Item is not a subnet 30 | if not silent: # Only print if not in silent mode 31 | print(f"'{item_stripped}' is not a subnet.") 32 | expanded_list.append(item_stripped) 33 | 34 | return expanded_list 35 | 36 | def main(): 37 | parser = argparse.ArgumentParser(description="Expand subnets from a file.") 38 | parser.add_argument("filepath", help="Path to the file containing subnets or IPs.") 39 | parser.add_argument("--replace", action="store_true", help="Replace file content with expanded subnets.") 40 | parser.add_argument("--silent", action="store_true", help="Only return the expanded subnets.") 41 | 42 | args = parser.parse_args() 43 | 44 | with open(args.filepath, 'r') as f: 45 | lines = f.readlines() 46 | 47 | expanded = expand_subnets(lines, args.silent) 48 | 49 | if args.replace: 50 | with open(args.filepath, 'w') as f: 51 | for ip in expanded: 52 | f.write(f"{ip}\n") 53 | elif not args.silent: 54 | for ip in expanded: 55 | print(ip) 56 | else: 57 | # In silent mode, just print the expanded list without any status messages. 58 | print('\n'.join(expanded)) 59 | 60 | if __name__ == "__main__": 61 | main() 62 | 63 | -------------------------------------------------------------------------------- /interact/generate_packer: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Set the AXIOM_PATH 4 | AXIOM_PATH="$HOME/.axiom" 5 | AXIOM_JSON="$AXIOM_PATH/axiom.json" 6 | source "$AXIOM_PATH/interact/includes/vars.sh" 7 | 8 | # Get builder and provisioner from arguments 9 | builder=$1 10 | provisioner=$2 11 | extension=$3 12 | 13 | # Set the paths to builder and provisioner files 14 | packer_builder_path="$AXIOM_PATH/images/$extension/builders/$builder.$extension" 15 | packer_provisioner_path="$AXIOM_PATH/images/$extension/provisioners/$provisioner.$extension" 16 | packer_output_path="$AXIOM_PATH/images/$extension/axiom.$extension" 17 | 18 | # Check if the builder file exists 19 | if [ -f "$packer_builder_path" ]; then 20 | 21 | if [[ "$extension" == "json" ]]; then 22 | 23 | # Read the provisioner and builder JSON files and merge them 24 | builder_data=$(jq '.builders' "$packer_builder_path") 25 | provisioner_data=$(jq '.' "$packer_provisioner_path") 26 | 27 | # Merge the builder data into the provisioner data 28 | merged_data=$(echo "$provisioner_data" | jq --argjson builders "$builder_data" '.builders = $builders') 29 | 30 | # Write the merged data to axiom.json 31 | echo "$merged_data" | jq '.' > "$packer_output_path" 32 | echo "Merged Packer JSON data written to $packer_output_path" 33 | 34 | elif [[ "$extension" == "pkr.hcl" ]]; then 35 | 36 | # Create beginning of Packer pkr.hcl file 37 | jq -r 'keys[]' "$AXIOM_JSON" | while read -r key; do 38 | cat <> "$packer_output_path" 39 | variable "$key" { 40 | type = string 41 | 42 | } 43 | 44 | EOF 45 | done 46 | 47 | # cat the builder and provisioner fata into final packer pkr.hcl 48 | cat "$packer_builder_path" "$packer_provisioner_path" >> "$packer_output_path" 49 | echo "Merged Packer pkr.hcl data written to $packer_output_path" 50 | 51 | fi 52 | else 53 | echo -e "${Red}Builder does not exist at $packer_builder_path${Color_Off}" 54 | fi 55 | -------------------------------------------------------------------------------- /interact/includes/ax-completion.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Define the function that generates completions 4 | _ax_completions() 5 | { 6 | # The first word is the command itself (ax) 7 | local command="${COMP_WORDS[1]}" 8 | 9 | # The current word (what the user has typed so far) 10 | local cur_word="${COMP_WORDS[COMP_CWORD]}" 11 | 12 | # List of commands that should trigger file completion 13 | local file_completion_commands="account account account-setup build configure deploy exec fleet fleet2 images init ls power provider region rm scan scp select sizes ssh sync update" 14 | 15 | # Check if the current command is in the list of those that should trigger file completion 16 | if [[ " ${file_completion_commands} " =~ " ${command} " ]]; then 17 | # Use file and directory completion 18 | COMPREPLY=($(compgen -f -- ${cur_word})) 19 | else 20 | # List of all available commands for the 'ax' command 21 | local commands="account account account-setup build configure deploy exec fleet fleet2 images init ls power provider region rm scan scp select sizes ssh sync update" 22 | 23 | # Generate possible completion matches for commands and store them in COMPREPLY 24 | COMPREPLY=($(compgen -W "${commands}" -- ${cur_word})) 25 | fi 26 | 27 | return 0 28 | } 29 | 30 | # Use complete to apply the _ax_completions function for the 'ax' command 31 | complete -F _ax_completions ax 32 | -------------------------------------------------------------------------------- /interact/includes/backup-files.txt: -------------------------------------------------------------------------------- 1 | + .zsh_history 2 | + .zshrc 3 | + .ssh 4 | + .tmux.conf 5 | + .oh-my-zsh 6 | + .crobatrc 7 | + .config/nvim 8 | + .z 9 | + go/bin 10 | + lists/seclists/.git/config 11 | + .local/share/nvim/rplugin.vim 12 | + .tmux.conf.local 13 | + .gf 14 | - .* 15 | - recon 16 | - go 17 | - lists 18 | - c2 19 | - hashes 20 | - down 21 | - .git 22 | + * 23 | -------------------------------------------------------------------------------- /interact/includes/system-notification.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | NOTIFY_CMD=notify 4 | BASEOS="$(uname)" 5 | 6 | # method issuing notifications for at least most ubuntu like systems 7 | # expects a title as first and a notification as second argument 8 | function notify { 9 | [ -x "$(command -v notify-send)" ] && notify-send "$1" "$2" 10 | } 11 | 12 | # method issuing notifications in place of notify-send on OSX 13 | # expects a title as first and a notification as second argument 14 | function notifyOSX { 15 | osascript -e "display notification \"$2\" with title \"$1\"" 16 | } 17 | 18 | if [ $BASEOS == "Darwin" ]; then NOTIFY_CMD=notifyOSX; fi 19 | -------------------------------------------------------------------------------- /interact/includes/vars.sh: -------------------------------------------------------------------------------- 1 | AXIOM_PATH="$HOME/.axiom" 2 | 3 | # Random Names to Use for Fleet and Init 4 | names=("amir" "aspen" "austin" "bango" "banzai" "bartik" "bassi" "batman" "beaver" "bell" "benz" "borg" "bose" "buck" "cannon" "cerf" "chell" "clarke" "codingo" "cori" "cray" "ctbb" "darwin" "dawgyg" "diffie" "dirac" "elion" "ellis" "euler" "failopen" "fire" "fisher" "fox" "gates" "gauss" "ghost" "gould" "haddix" "haibt" "hakluke" "hertz" "hickey" "hunt" "iambouali" "jang" "jarvis" "jepsen" "jobs" "joliot" "jones" "kalam" "kare" "keller" "kepler" "kilby" "kirch" "knox" "knuth" "lamar" "lamp" "lande" "leaky" "leder" "leman" "lewin" "liskov" "loka" "lupin" "martho" "mato" "max" "mayer" "mclean" "medin" "mendel" "merkle" "mog" "moore" "morse" "moser" "murdo" "nagli" "nahamsec" "napier" "nash" "nat" "neum" "newton" "nishant" "nobel" "noyce" "octavian" "ofjaaah" "omnom" "pani" "pare" "pasa" "payne" "pdelteil" "pdteam" "perl" "pikpikcu" "poba" "pry" "raman" "rez" "rhodes" "rich" "ride" "robin" "rubin" "rt-bast" "saha" "sammet" "sandeep" "samogod" "securibee" "six2dez" "sml555" "snyder" "stok" "stone" "sumgr0" "tesla" "tess" "theo" "thl" "thomp" "todayisnew" "tu" "turing" "victoni" "vince" "wright" "wu" "xpn" "zonduu") 5 | 6 | # Reset 7 | Color_Off='\033[0m' # Text Reset 8 | 9 | # Regular Colors 10 | export Black='\033[0;30m' # Black 11 | export Red='\033[0;31m' # Red 12 | export Green='\033[0;32m' # Green 13 | export Yellow='\033[0;33m' # Yellow 14 | export Blue='\033[0;34m' # Blue 15 | export Purple='\033[0;35m' # Purple 16 | export Cyan='\033[0;36m' # Cyan 17 | export White='\033[0;37m' # White 18 | 19 | # Bold 20 | export BBlack='\033[1;30m' # Black 21 | export BRed='\033[1;31m' # Red 22 | export BGreen='\033[1;32m' # Green 23 | export BYellow='\033[1;33m' # Yellow 24 | export BBlue='\033[1;34m' # Blue 25 | export BPurple='\033[1;35m' # Purple 26 | export BCyan='\033[1;36m' # Cyan 27 | export BWhite='\033[1;37m' # White 28 | 29 | # Required Go Version - gets interpolated during axiom-build and axiom-configure 30 | export GolangVersion='1.23.0' 31 | 32 | # Recommended Cloud provider CLI versions 33 | # Only updates if the installed version is lower than recommended version 34 | export DoctlVersion='1.112.0' 35 | export LinodeCliVersion='5.56.3' 36 | export IBMCloudCliVersion='2.27.0' 37 | export HetznerCliVersion='1.47.0' 38 | export AzureCliVersion="2.64.0" 39 | export AWSCliVersion="2.17.45" 40 | export GCloudCliVersion="493.0.0" 41 | export PackerVersion="1.11.2" 42 | export ScalewayCliVersion="2.34.0" 43 | export ExoscaleCliVersion="1.84.0" 44 | 45 | # Auto Update Option 46 | [ -f $AXIOM_PATH/interact/includes/.auto_update ] && source $AXIOM_PATH/interact/includes/.auto_update 47 | 48 | # Shared function across all proviers, since these functions only query an ssh configuration file 49 | # check if instance name is in .sshconfig 50 | # used by axiom-scan 51 | instance_ip_cache() { 52 | name="$1" 53 | config="$2" 54 | ssh_config="$AXIOM_PATH/.sshconfig" 55 | 56 | if [[ "$config" != "" ]]; then 57 | ssh_config="$config" 58 | fi 59 | cat "$ssh_config" | grep -A 1 "$name" | awk '{ print $2 }' 60 | } 61 | 62 | # check if instances are in .sshconfig 63 | # used by axiom-scan axiom-exec axiom-scp 64 | query_instances_cache() { 65 | ssh_conf="$AXIOM_PATH/.sshconfig" 66 | selected="" 67 | 68 | for var in "$@"; do 69 | if [[ "$var" =~ "-F=" ]]; then 70 | ssh_conf="$(echo "$var" | cut -d '=' -f 2)" 71 | continue 72 | fi 73 | 74 | if [[ "$var" == "\\*" ]]; then 75 | var="*" 76 | fi 77 | 78 | if [[ "$var" == *"*"* ]]; then 79 | var=$(echo "$var" | sed 's/*/.*/g') 80 | matches=$(grep -E "Host " "$ssh_conf" | awk '{ print $2 }' | grep -E "^${var}$") 81 | else 82 | matches=$(grep -E "Host " "$ssh_conf" | awk '{ print $2 }' | grep -w -E "^${var}$") 83 | fi 84 | 85 | if [[ -n "$matches" ]]; then 86 | selected="$selected $matches" 87 | fi 88 | done 89 | 90 | selected=$(echo "$selected" | tr ' ' '\n' | sort -u | tr '\n' ' ') 91 | echo -n "${selected}" | xargs 92 | } 93 | 94 | -------------------------------------------------------------------------------- /interact/nMap_Merger.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | #################################################################################### 3 | # 4 | # nMapMerge.py 5 | # 6 | # Description 7 | # Combine nMap xml files into one XML 8 | # 9 | # Example 10 | # python nMapMerge.py -f nmap_scan.xml 11 | # python nMapMerge.py -f ./nMap/ 12 | # 13 | # Author: 14 | # Hue B. Solutions LLC, CBHue 15 | # 16 | # 17 | #################################################################################### 18 | 19 | import os 20 | import re 21 | import time 22 | import logging 23 | import xml.etree.ElementTree as ET 24 | from argparse import ArgumentParser 25 | from xml.etree.ElementTree import ParseError 26 | from os.path import expanduser 27 | 28 | def merge_nMap(xmlFile,mf): 29 | HOSTS = 0 30 | with open(mf, mode = 'a', encoding='utf-8') as mergFile: 31 | with open(xmlFile) as f: 32 | try: 33 | nMapXML = ET.parse(f) 34 | for host in nMapXML.findall('host'): 35 | HOSTS = HOSTS + 1 36 | cHost = ET.tostring(host, encoding='unicode', method='xml') 37 | mergFile.write(cHost) 38 | mergFile.flush() 39 | except: 40 | print("failed to parse") 41 | 42 | return HOSTS 43 | 44 | def addHeader(f): 45 | nMap_Header = '' 46 | nMap_Header += '' 47 | nMap_Header += '' 48 | nMap_Header += '' 49 | nMap_Header += '' 50 | nMap_Header += '' 51 | nMap_Header += '' 52 | nMap_Header += '' 53 | 54 | mFile = open(f, "w") 55 | mFile.write(nMap_Header) 56 | mFile.close() 57 | 58 | def addFooter(f, h): 59 | nMap_Footer = '' 60 | nMap_Footer += '' 61 | nMap_Footer += '' 62 | 63 | mFile = open(f, "a") 64 | mFile.write(nMap_Footer) 65 | mFile.close() 66 | 67 | def htmlER(mergeFile): 68 | import os 69 | cmd = '/usr/bin/xsltproc' 70 | if os.path.isfile(cmd): 71 | out = mergeFile + ".html" 72 | cmd = cmd + " -o " + out + " " + mergeFile 73 | os.system(cmd) 74 | print ("Output HTML File:", os.path.abspath(out)) 75 | else: 76 | print(cmd, "does not exits") 77 | 78 | # 79 | # If you want to use this as a module you need to pass a set of nmap xmls 80 | # 81 | # nmapSET = set() 82 | # nmapSET.add('/nmap-Dir/nmap_10.10.10.10.xml') 83 | # 84 | # Then call the main function passing the set: 85 | # main_nMapMerger(nmapSET) 86 | # 87 | def main_nMapMerger(xmlSet, name): 88 | HOSTS = 0 89 | 90 | # Check to ensute we have work to do 91 | if not xmlSet: 92 | print("No XML files were found ... No work to do") 93 | exit() 94 | 95 | # Create the Merged filename 96 | from datetime import datetime 97 | dtNow = datetime.now() 98 | dt = re.sub(r"\s+", '-', str(dtNow)) 99 | dt = re.sub(r":", '-', str(dt)) 100 | mergeFile = name 101 | 102 | # Add Header to mergefile 103 | addHeader(mergeFile) 104 | 105 | for xml in xmlSet: 106 | if xml.endswith('.xml'): 107 | logging.debug("Parsing: %r", xml) 108 | H = merge_nMap(xml,mergeFile) 109 | HOSTS = HOSTS + H 110 | 111 | # Add Footer to mergefile 112 | addFooter(mergeFile, HOSTS) 113 | print('') 114 | print ("Output XML File:", os.path.abspath(mergeFile)) 115 | 116 | # Convert merged XML to html 117 | htmlER(mergeFile) 118 | 119 | if __name__ == "__main__": 120 | 121 | import sys 122 | if sys.version_info <= (3, 0): 123 | sys.stdout.write("This script requires Python 3.x\n") 124 | sys.exit(1) 125 | 126 | parser = ArgumentParser() 127 | parser.add_argument("-f", "--file", dest="filename", help="parse FILE", metavar="FILE") 128 | parser.add_argument("-o", "--output", dest="outfile", help="parse FILE", metavar="FILE") 129 | parser.add_argument("-d", "--dir", dest="directory", help="Parse all xml in directory", metavar="DIR") 130 | parser.add_argument("-q", "--quiet", dest="verbose", action="store_false", default=True, help="don't print status messages to stdout") 131 | args = parser.parse_args() 132 | 133 | s = set() 134 | 135 | if args.verbose: 136 | logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s') 137 | print('Debug On') 138 | 139 | if args.filename is not None: 140 | f = args.filename 141 | if f.endswith('.xml'): 142 | logging.debug("Adding: %r", f) 143 | s.add(f) 144 | 145 | elif args.directory is not None: 146 | if os.path.isdir(args.directory): 147 | path = args.directory 148 | 149 | for f in os.listdir(path): 150 | # For now we assume xml is nMap 151 | if f.endswith('.xml'): 152 | fullname = os.path.join(path, f) 153 | logging.debug("Adding: %r", fullname) 154 | s.add(fullname) 155 | else: 156 | logging.warn("Not a directory: %r", args.directory) 157 | else : 158 | print ("usage issues =(") 159 | parser.print_help() 160 | exit() 161 | 162 | # Pass set of xml files to main 163 | main_nMapMerger(s, args.outfile) 164 | -------------------------------------------------------------------------------- /modules/amass.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/usr/bin/amass enum -df input -o output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/aquatone.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /usr/bin/aquatone -out output", 4 | "ext": "" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/arjun.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/usr/local/bin/arjun -i input -oT output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/asm.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": [ 4 | "cat input", 5 | "| subfinder -json -o output/host.json", 6 | "| jq --unbuffered -r '.host'", 7 | "| dnsx -json -o output/dns.json", 8 | "| jq --unbuffered -r '.host'", 9 | "| httpx -json -o output/http.json", 10 | "| jq --unbuffered -r '.url'" 11 | ], 12 | "ext": "dir" 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /modules/assetfinder.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | assetfinder --subs-only | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/cero.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "docker run --rm -i --mount type=bind,source=\"$(pwd)\",target=/data axiom/cero < input | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/cngo.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/home/op/go/bin/cngo -f input | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/commix.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "docker run --rm -i --mount type=bind,source=\"$(pwd)\",target=/data axiom/commix --batch -m /data/input --output-dir /data/output", 4 | "ext": "dir" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/corsy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "python3 /home/op/recon/Corsy/corsy.py -i input | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/crlfuzz.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/home/op/go/bin/crlfuzz -l input -o output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/crobat.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/home/op/go/bin/crobat -s _target_ -u | tee output/_cleantarget_", 4 | "ext": "txt", 5 | "threads": "1" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /modules/ctfr.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "python3 -u /home/op/recon/ctfr/ctfr.py -d _target_ -o output/_cleantarget_", 4 | "ext": "txt", 5 | "threads": "1" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /modules/dalfox.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/home/op/go/bin/dalfox file input -o output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/dirdar.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/go/bin/dirdar -only-ok | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/dnscewl.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/usr/bin/DNSCewl --tL input -p /home/op/lists/permutations.txt --subs --no-color | tail -n +14 | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/dnsgen.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | docker run --rm -i --mount type=bind,source=\"$(pwd)\",target=/data axiom/dnsgen | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/dnsrecon.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "docker run -t --rm -i --mount type=bind,source=\"$(pwd)\",target=/data axiom/dnsrecon -d _target_ -a -j /data/output/_cleantarget_", 4 | "ext": "dir", 5 | "threads": "1" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /modules/dnsvalidator.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/usr/local/bin/dnsvalidator -tL input -o output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/dnsx.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/go/bin/dnsx -r /home/op/lists/resolvers.txt -o output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/erlpopper-brute.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "python3 /home/op/recon/ERLPopper/erl_brute_by_seed_interval.py input --processes 64 --output output --quiet", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/exclude-cdn.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/go/bin/exclude-cdn | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/exec.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/bin/bash input | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/feroxbuster.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/usr/bin/feroxbuster -u _target_ -w _wordlist_ -o output/_cleantarget_", 4 | "wordlist": "/home/op/lists/seclists/Discovery/Web-Content/raft-medium-directories.txt", 5 | "threads": "2", 6 | "ext": "" 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /modules/fff.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/go/bin/fff | tee output", 4 | "ext": "txt" 5 | }, 6 | { 7 | "command": "cat input | /home/op/go/bin/fff -S --output output", 8 | "ext": "dir" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /modules/ffuf.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/home/op/go/bin/ffuf -w _wordlist_ -u _target_/FUZZ -of csv -o output/_cleantarget_ -ac", 4 | "wordlist": "/home/op/lists/seclists/Discovery/Web-Content/big.txt", 5 | "ext": "csv", 6 | "threads": "1" 7 | }, 8 | { 9 | "command": "/home/op/go/bin/ffuf -w _wordlist_ -u _target_/FUZZ -of all -o output/_cleantarget_ -ac", 10 | "wordlist": "/home/op/lists/seclists/Discovery/Web-Content/big.txt", 11 | "ext": "dir", 12 | "threads": "1" 13 | }, 14 | { 15 | "command": "/home/op/go/bin/ffuf -w _wordlist_ -u _target_/FUZZ -of json -o output/_cleantarget_ -ac", 16 | "wordlist": "/home/op/lists/seclists/Discovery/Web-Content/big.txt", 17 | "ext": "jsonl", 18 | "threads": "1" 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /modules/ffuf_base.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/home/op/go/bin/ffuf -w _wordlist_ -u _target_/FUZZ -o output/_cleantarget_ ", 4 | "wordlist": "/home/op/lists/seclists/Discovery/Web-Content/big.txt", 5 | "ext": "txt", 6 | "threads": "1" 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /modules/ffuz.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/bin/ffuz -s -o output", 4 | "ext": "csv" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/findomain.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/usr/bin/findomain -q -f input -u output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/gau.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/go/bin/gau --verbose --o output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/gauplus.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/go/bin/gauplus -t 20 -subs -random-agent -o output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/github-endpoints.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/home/op/go/bin/github-endpoints -d _target_ -o output/_cleantarget_", 4 | "ext": "txt", 5 | "threads": "1" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /modules/github-subdomains.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/home/op/go/bin/github-subdomains -d _target_ -o output/_cleantarget_", 4 | "ext": "txt", 5 | "threads": "1" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /modules/gobuster-dir.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/usr/bin/gobuster dir -q -w input -o output -u ", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/gobuster-dns.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/usr/bin/gobuster dns -q -w input -o output -d ", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/gorgo.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "docker run -it --rm --mount type=bind,source=\"$(pwd)\",target=/data axiom/gorgo -U usernames.txt -P passwords.txt -H /data/input --protocols ftp:21,ssh:22 --generate -o /data/output", 4 | "ext": "csv" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/gospider.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/go/bin/gospider -S - --depth 3 -v -t 50 -c 3 -o output", 4 | "ext": "" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/gospider_base.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/go/bin/gospider -S - -v -o output", 4 | "ext": "" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/gowitness.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/home/op/go/bin/gowitness scan file -f input --screenshot-path output --write-db", 4 | "ext": "" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/gxss.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/go/bin/Gxss -c 100 -p Xss | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/hakrawler.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/go/bin/hakrawler | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/hakrevdns.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/go/bin/hakrevdns | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/http2smugl.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "http2smugl detect --targets input --csv-log output", 4 | "ext": "csv" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/httprobe.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/go/bin/httprobe | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/httpx.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/go/bin/httpx -o output", 4 | "ext": "txt" 5 | }, 6 | { 7 | "command": "cat input | /home/op/go/bin/httpx -json -o output", 8 | "ext": "jsonl" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /modules/ipcdn.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "docker run -it --rm --mount type=bind,source=\"$(pwd)\",target=/data axiom/ipcdn -c \"cat data/input | /bin/ipcdn -m not | tee data/output\"", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/jaeles.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/go/bin/jaeles scan -s /home/op/.jaeles/base-signatures -o output", 4 | "ext": "dir" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/katana.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/home/op/go/bin/katana -u _target_ -o output/_cleantarget_", 4 | "ext": "txt", 5 | "threads": "3" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /modules/krbrute.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/usr/bin/kr brute input -o text | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/krscan.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/usr/bin/kr scan input -o text | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/kxss.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/go/bin/kxss | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/linkfinder.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "docker run -t --rm -i --mount type=bind,source=\"$(pwd)\",target=/data axiom/linkfinder -d -i _target_ -o cli | tee -a output/_cleantarget_", 4 | "ext": "dir", 5 | "threads": "3" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /modules/mantra.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/go/bin/mantra -s | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/masscan.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "sudo masscan -iL input -oG output", 4 | "ext": "txt" 5 | }, 6 | { 7 | "command": "sudo masscan -iL input -oX output", 8 | "ext": "xml" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /modules/massdns.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "sudo /usr/bin/massdns -r /home/op/lists/resolvers.txt -t A -o F input -w output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/meg.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/home/op/go/bin/meg -v _wordlist_ input output", 4 | "wordlist": "/", 5 | "ext": "" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /modules/naabu-nmap.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "[ ! -s input ] && exit 1; mkdir output ;cat input | sudo /home/op/go/bin/naabu -o output/naabu.txt", 4 | "ext": "" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/naabu.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "[ ! -s input ] && exit 1; cat input | sudo /home/op/go/bin/naabu -o output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/nmap.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "sudo nmap -iL input -oN output", 4 | "ext": "txt" 5 | }, 6 | { 7 | "command": "sudo nmap -iL input -oG output", 8 | "ext": "oG" 9 | }, 10 | { 11 | "command": "sudo nmap -iL input -oX output", 12 | "ext": "xml" 13 | }, 14 | { 15 | "command": "sudo nmap -iL input -oA output/output", 16 | "ext": "dir" 17 | }, 18 | { 19 | "command": "mkdir output ; sudo nmap -iL input -oA output/output", 20 | "ext": "none" 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /modules/nmapx.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "sudo nmap -v _target_ -oN output/_cleantarget_.txt", 4 | "ext": "txt", 5 | "threads": 15 6 | }, 7 | { 8 | "command": "sudo nmap -v _target_ -oX output/_cleantarget_.xml", 9 | "ext": "xml", 10 | "threads": 15 11 | }, 12 | { 13 | "command": "sudo nmap -v _target_ -oG output/_cleantarget_", 14 | "ext": "oG", 15 | "threads": 15 16 | }, 17 | { 18 | "command": "sudo nmap -v _target_ -oA output/_cleantarget_", 19 | "ext": "dir", 20 | "threads": 15 21 | }, 22 | { 23 | "command": "sudo nmap -v _target_ -oA output/_cleantarget_", 24 | "ext": "none", 25 | "threads": 15 26 | } 27 | ] 28 | -------------------------------------------------------------------------------- /modules/nuclei-screenshots.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/home/op/go/bin/nuclei -update -silent ; /home/op/go/bin/nuclei -l input -headless -id screenshot -V dir='output'", 4 | "ext": "" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/nuclei.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/home/op/go/bin/nuclei -update -silent ; cat input | /home/op/go/bin/nuclei -t _folder_ -o output", 4 | "ext": "txt", 5 | "folder": "/home/op/nuclei-templates" 6 | }, 7 | { 8 | "command": "/home/op/go/bin/nuclei -update -silent ; cat input | /home/op/go/bin/nuclei -t _folder_ -jsonl -o output", 9 | "ext": "jsonl", 10 | "folder": "/home/op/nuclei-templates" 11 | } 12 | ] 13 | -------------------------------------------------------------------------------- /modules/openredirex.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "docker run -t --rm -i --mount type=bind,source=\"$(pwd)\",target=/data axiom/openredirex -l /data/input --keyword FUZZ -p _wordlist_ | tee output", 4 | "wordlist": "/home/op/recon/OpenRedireX/payloads.txt", 5 | "ext": "txt" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /modules/paramspider.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "docker run -t --rm -i --mount type=bind,source=\"$(pwd)\",target=/data axiom/paramspider -d _target_ -s | tee output/_cleantarget_", 4 | "ext": "", 5 | "threads": "1" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /modules/puredns-bruteforce.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/home/op/go/bin/puredns bruteforce _wordlist_ _target_ -r /home/op/lists/resolvers.txt | tee output/_cleantarget_", 4 | "ext": "txt", 5 | "wordlist": "/home/op/lists/seclists/Discovery/DNS/dns-Jhaddix.txt", 6 | "threads": "1" 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /modules/puredns-resolve.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/home/op/go/bin/puredns resolve input --resolvers /home/op/lists/resolvers.txt | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/puredns-single.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/home/op/go/bin/puredns bruteforce input --resolvers /home/op/lists/resolvers.txt | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/rustscan.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/usr/bin/rustscan -a input -g | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/s3scanner.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "s3scanner -bucket-file input | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/scrying.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "sudo xvfb-run scrying -f input --output output", 4 | "ext": "" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/shuffledns.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/home/op/go/bin/shuffledns -v -d _target_ -r /home/op/lists/resolvers.txt -w _wordlist_ -o output/_cleantarget_ -mode bruteforce", 4 | "ext": "txt", 5 | "wordlist": "/home/op/lists/seclists/Discovery/DNS/bitquark-subdomains-top100000.txt", 6 | "threads": "2" 7 | }, 8 | { 9 | "command": "/home/op/go/bin/shuffledns -v -d _target_ -r /home/op/lists/resolvers.txt -w _wordlist_ -o output/_cleantarget_ -mode bruteforce", 10 | "ext": "dir", 11 | "wordlist": "/home/op/lists/seclists/Discovery/DNS/bitquark-subdomains-top100000.txt", 12 | "threads": "2" 13 | }, 14 | { 15 | "command": "/home/op/go/bin/shuffledns -v -d _target_ -r /home/op/lists/resolvers.txt -w _wordlist_ -json -o output/_cleantarget_ -mode bruteforce", 16 | "ext": "jsonl", 17 | "wordlist": "/home/op/lists/seclists/Discovery/DNS/bitquark-subdomains-top100000.txt", 18 | "threads": "2" 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /modules/soxy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/bin/soxy | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/sqlmap.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/home/op/recon/sqlmap-dev/sqlmap.py -m input -b --batch --disable-coloring --random-agent --results-file output", 4 | "ext": "csv", 5 | "threads": "1" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /modules/subfinder.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/home/op/go/bin/subfinder -d _target_ -o output/_cleantarget_", 4 | "ext": "txt", 5 | "threads": "3" 6 | }, 7 | { 8 | "command": "/home/op/go/bin/subfinder -d _target_ -o output/_cleantarget_", 9 | "ext": "dir", 10 | "threads": "3" 11 | }, 12 | { 13 | "command": "/home/op/go/bin/subfinder -d _target_ -oJ -o output/_cleantarget_", 14 | "ext": "jsonl", 15 | "threads": "3" 16 | } 17 | ] 18 | -------------------------------------------------------------------------------- /modules/subjs.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/go/bin/subjs | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/testssl.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/home/op/recon/testssl.sh/testssl.sh -U -iL input | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/tlscout.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/go/bin/tlscout -o output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/tlsx.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/go/bin/tlsx -o output", 4 | "ext": "txt" 5 | }, 6 | { 7 | "command": "cat input | /home/op/go/bin/tlsx -json -o output", 8 | "ext": "jsonl" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /modules/trufflehog.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "sudo trufflehog github --org=_target_ | tee output/_cleantarget_", 4 | "ext": "dir", 5 | "threads": "1" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /modules/unimap.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "sudo unimap -f input | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/wafw00f.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/usr/local/bin/wafw00f -i input -o output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/waybackurls.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "cat input | /home/op/go/bin/waybackurls | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/waymore.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "python3 /home/op/recon/waymore/waymore.py -mode U -i input | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/webscreenshot.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/home/op/.local/bin/webscreenshot --no-xserver -r chrome -i input -o output", 4 | "ext": "" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /modules/whois.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/usr/bin/whois _target_ | tee output/_cleantarget_", 4 | "ext": "dir", 5 | "threads": "10" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /modules/wpscan.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "/usr/local/bin/wpscan --url _target_ -f cli-no-colour -o output/_cleantarget_ ", 4 | "ext": "dir", 5 | "threads": "1" 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /modules/xnlinkfinder.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "python3 /home/op/recon/xnLinkFinder/xnLinkFinder.py -i input -o cli | tee output", 4 | "ext": "txt" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /profiles/covenant.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"covenant", 3 | "description":"Covenant C2 Server", 4 | "install": [ 5 | "sudo killall caddy", 6 | "git clone --recurse-submodules https://github.com/cobbr/Covenant /home/op/c2/Covenant", 7 | "cd /home/op/c2/Covenant/Covenant && docker build -t covenant .", 8 | "cd /home/op/c2/Covenant/Covenant && docker run -d -p 7443:7443 -p 80:80 -p 443:443 --name covenant -v /home/op/c2/Covenant/Covenant/Data:/app/Data covenant" 9 | ], 10 | "uninstall":[ 11 | "docker rm -f covenant", 12 | "sudo rm -r /home/op/c2/Covenant" 13 | ], 14 | "notes":"Your server will be accessible at https://ip:7443/ for setup." 15 | } 16 | -------------------------------------------------------------------------------- /profiles/desktop.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"desktop", 3 | "description":"Ubuntu Desktop VNC over SSH", 4 | "install": [ 5 | "/usr/bin/cloud-init status --wait", 6 | "sudo apt-get update -qq && sudo apt-get upgrade -y -qq && sudo apt --fix-broken install -qq", 7 | "sudo DEBIAN_FRONTEND=noninteractive apt-get install xfce4 xfce4-goodies ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal -y -qq", 8 | "sudo apt --fix-broken install -qq", 9 | "sudo apt install tightvncserver -y -qq", 10 | "mkdir -p /home/op/.vnc/", 11 | "curl -sL https://raw.githubusercontent.com/attacksurge/ax/master/configs/xstartup > /home/op/.vnc/xstartup", 12 | "sudo chmod +x /home/op/.vnc/xstartup", 13 | "echo $(cat /dev/urandom| base64 | tr -d '+=-' | tr -d '\n' | tr -d / | head -c 8) | tee /home/op/vncpass | vncpasswd -f | sudo tee /home/op/.vnc/passwd > /dev/null", 14 | "sudo chown -R op:op /home/op/.vnc", 15 | "chmod 0600 /home/op/.vnc/passwd", 16 | "sudo killall Xtightvnc > /dev/null", 17 | "vncserver -localhost -geometry 1024x768", 18 | "echo ''", 19 | "echo 'Password for VNC is:' $(cat /home/op/vncpass)" 20 | ], 21 | "uninstall":[ 22 | "sudo apt-get purge xfce4 xfce4-goodies ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal -y" 23 | ], 24 | "notes":"Password for VNC is in the output above. To port forward VNC run: axiom-ssh testy01 -L 5901:localhost:5901" 25 | } 26 | -------------------------------------------------------------------------------- /profiles/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"example", 3 | "description":"Example axiom deployment profile.", 4 | "install": [ 5 | "cat /etc/os-release | tee -a /home/op/log.txt", 6 | "uname -a | tee -a /home/op/log.txt" 7 | ], 8 | "uninstall":[ 9 | "rm /home/op/log.txt" 10 | ], 11 | "notes":"Example profile deployed" 12 | } 13 | -------------------------------------------------------------------------------- /profiles/openvpn.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"openvpn", 3 | "description":"OpenVPN Server", 4 | "install": [ 5 | "mkdir -p /home/op/vpn", 6 | "sudo apt-get update && sudo apt --fix-broken install -y", 7 | "wget -O /home/op/vpn/openvpn.sh https://gist.githubusercontent.com/pry0cc/0a464e11dd15acc7b3e82fd4565f94ba/raw/64739cdad670f520dbb91ccfd44ab23c3abd6ca3/openvpn-install.sh", 8 | "chmod +x /home/op/vpn/openvpn.sh", 9 | "sudo ufw allow 443", 10 | "sudo /home/op/vpn/openvpn.sh", 11 | "sudo cp /root/client.ovpn /home/op/vpn/client.ovpn", 12 | "sudo chown op:users /home/op/vpn/client.ovpn" 13 | ], 14 | "uninstall":[ 15 | "echo \"3\nY\" | sudo /home/op/vpn/openvpn.sh", 16 | "rm -rf /home/op/vpn" 17 | ], 18 | "notes":"Use the command 'axiom-vpn ' to download and connect to the VPN server." 19 | } 20 | -------------------------------------------------------------------------------- /profiles/squid.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"squid", 3 | "description":"Squid Proxy Server", 4 | "variables": [], 5 | "commands": [ 6 | "sudo apt-get -y install squid", 7 | "sudo sed -i 's/http_port 3128/http_port 2525/g' /etc/squid/squid.conf", 8 | "sudo sed -i 's/http_access deny all/http_access allow all/g' /etc/squid/squid.conf", 9 | "sudo ufw allow 2525", 10 | "sudo systemctl enable squid", 11 | "sudo systemctl restart squid" 12 | ], 13 | "remove_commands":[ 14 | "sudo apt remove -y squid" 15 | ], 16 | "success_message":"echo \"Squid Proxy has been set up on port 2525\"" 17 | } 18 | -------------------------------------------------------------------------------- /profiles/wireguard.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"wireguard", 3 | "description":"Wireguard Server", 4 | "install": [ 5 | "mkdir -p /home/op/vpn", 6 | "sudo apt-get update && sudo apt --fix-broken install -y && sudo apt-get -y install wireguard", 7 | "cd /home/op/vpn && git clone https://github.com/pry0cc/awh && cd awh && ./generate.sh", 8 | "cp /home/op/vpn/awh/client/client.conf /home/op/vpn/client.conf" 9 | ], 10 | "uninstall":[ 11 | "rm -rf /home/op/vpn", 12 | "sudo systemctl stop wg-quick@wg0" 13 | ], 14 | "notes":"Use the command 'axiom-vpn ' to download and connect to the VPN server." 15 | } 16 | -------------------------------------------------------------------------------- /screenshots/aws.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/attacksurge/ax/fd5580326aa114b0c9da60c25b450dd0195425a7/screenshots/aws.png -------------------------------------------------------------------------------- /screenshots/axbanner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/attacksurge/ax/fd5580326aa114b0c9da60c25b450dd0195425a7/screenshots/axbanner.png -------------------------------------------------------------------------------- /screenshots/axiom-fleet.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/attacksurge/ax/fd5580326aa114b0c9da60c25b450dd0195425a7/screenshots/axiom-fleet.gif -------------------------------------------------------------------------------- /screenshots/azure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/attacksurge/ax/fd5580326aa114b0c9da60c25b450dd0195425a7/screenshots/azure.png -------------------------------------------------------------------------------- /screenshots/digitalocean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/attacksurge/ax/fd5580326aa114b0c9da60c25b450dd0195425a7/screenshots/digitalocean.png -------------------------------------------------------------------------------- /screenshots/exoscale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/attacksurge/ax/fd5580326aa114b0c9da60c25b450dd0195425a7/screenshots/exoscale.png -------------------------------------------------------------------------------- /screenshots/gcp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/attacksurge/ax/fd5580326aa114b0c9da60c25b450dd0195425a7/screenshots/gcp.png -------------------------------------------------------------------------------- /screenshots/hetzner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/attacksurge/ax/fd5580326aa114b0c9da60c25b450dd0195425a7/screenshots/hetzner.png -------------------------------------------------------------------------------- /screenshots/ibm_cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/attacksurge/ax/fd5580326aa114b0c9da60c25b450dd0195425a7/screenshots/ibm_cloud.png -------------------------------------------------------------------------------- /screenshots/linode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/attacksurge/ax/fd5580326aa114b0c9da60c25b450dd0195425a7/screenshots/linode.png -------------------------------------------------------------------------------- /screenshots/read-the-docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/attacksurge/ax/fd5580326aa114b0c9da60c25b450dd0195425a7/screenshots/read-the-docs.png -------------------------------------------------------------------------------- /screenshots/scaleway.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/attacksurge/ax/fd5580326aa114b0c9da60c25b450dd0195425a7/screenshots/scaleway.png --------------------------------------------------------------------------------