Skip to content

Setup Metasploit in Termux Docker #42

Setup Metasploit in Termux Docker

Setup Metasploit in Termux Docker #42

Workflow file for this run

name: Setup Metasploit in Termux Docker
on:
workflow_dispatch:
push:
branches:
- main
- feature/*
pull_request:
branches:
- main
- feature/*
jobs:
checkout-dns: # nslookup github.com outside of docker
runs-on: ubuntu-latest
steps:
- name: Wait for DNS
run: |
sudo apt update
sudo apt install -y dnsutils
# List of hostnames
hostnames=("packages.termux.dev" "raw.githubusercontent.com" "packages-cf.termux.dev" "termux.dev")
# Output file
output_file="hosts_output.txt"
# Clear or create the output file
> "$output_file"
# Loop through each hostname
for hostname in "${hostnames[@]}"; do
# Perform nslookup and extract the IP address
ip=$(nslookup -type=A $hostname | grep -m 1 'Address: ' | awk '{ print $2 }')
if [ -n "$ip" ]; then
# Append to file in hosts file format
echo "$ip $hostname" >> "$output_file"
else
echo "No IP found for $hostname" >> "$output_file"
fi
done
# Display the contents of the output file
cat "$output_file"
# - name: Upload hosts file
# uses: actions/upload-artifact@v3
# with:
# name: hosts-file
# path: hosts_output.txt
setup-metasploit:
needs: checkout-dns
runs-on: ubuntu-latest
# container:
# image: termux/termux-docker:x86_64
# options: --privileged --cap-add=cap_net_admin
steps:
# - name: Download hosts file
# uses: actions/download-artifact@v3
# with:
# name: hosts-file
# path: .
# - name: Checkout repository
# uses: actions/checkout@v1
# - name: Set terminal environment variable
# run: export TERM=xterm
- name: Install dependencies
run: |
tee -a ./hosts > /dev/null << EOF
5.75.242.194 packages.termux.dev
185.199.110.133 raw.githubusercontent.com
188.114.96.2 packages-cf.termux.dev
185.199.109.153 termux.dev
EOF
- run: docker run -v ./hosts:/system/etc/hosts -d -t termux/termux-docker:x86_64
- run: |
id=$(docker ps -alq)
docker exec -u system $id bash -c "curl -O -fsSL https://raw.githubusercontent.com/gushmazuko/metasploit_in_termux/feature/github-actions/metasploit.sh"
docker exec -u system $id bash -c "chmod +x metasploit.sh"
docker exec -u system $id bash -c "bash metasploit.sh"
# docker cp $id:/data/data/com.termux/files/home/target/release/deno deno