diff --git a/.github/workflows/test_application.yml b/.github/workflows/test_application.yml new file mode 100644 index 0000000..76291d9 --- /dev/null +++ b/.github/workflows/test_application.yml @@ -0,0 +1,36 @@ +name: Test AnonSurf Installation on kali-rolling + +on: + pull_request: # Trigger on all pull requests + branches: + - '**' # All branches for pull requests + push: # Trigger on pushes to specific branches + branches: + - master # Only on merges to master + +jobs: + test-script: + runs-on: ubuntu-latest + container: + image: kalilinux/kali-rolling:latest # Use a Kali Linux environment + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install dependencies + run: | + export DEBIAN_FRONTEND=noninteractive + apt-get update + apt-get install -y ca-certificates curl bleachbit tor iptables + + - name: Run Installer Script + run: | + chmod +x installer.sh + ./installer.sh + + - name: Verify Installation + run: | + which anonsurf || { echo "ERROR: anonsurf is not installed."; exit 1; } + +# We can't test anonsurf in a runner due to the way the runner is configured, but at least this tests the build and install in kali-rolling diff --git a/kali-anonsurf-deb-src/DEBIAN/control b/kali-anonsurf-deb-src/DEBIAN/control index 8d9d45c..e0b0406 100644 --- a/kali-anonsurf-deb-src/DEBIAN/control +++ b/kali-anonsurf-deb-src/DEBIAN/control @@ -1,5 +1,5 @@ Package: kali-anonsurf -Version: 1.2.5.0 +Version: 1.2.6.0 Architecture: all Maintainer: Und3rf10w Installed-Size: 64 diff --git a/kali-anonsurf-deb-src/etc/init.d/anonsurf b/kali-anonsurf-deb-src/etc/init.d/anonsurf index cba333c..c5497c2 100755 --- a/kali-anonsurf-deb-src/etc/init.d/anonsurf +++ b/kali-anonsurf-deb-src/etc/init.d/anonsurf @@ -108,6 +108,68 @@ function stopi2p { fi } +function disable_ipv6() { + echo -e "\n$GREEN[$BLUE i$GREEN ]$BLUE Stopping IPv6 services:$RESETCOLOR\n" + + # Remove current IPv6 settings if it exists + if [ -f /etc/sysctl.d/98-kali-anonsurf.conf ]; then + rm /etc/sysctl.d/98-kali-anonsurf.conf + fi + + # Add comprehensive IPv6 disable configuration + cat << EOF >> /etc/sysctl.d/98-kali-anonsurf.conf +# Disable IPv6 - Added by kali-anonsurf +net.ipv6.conf.all.disable_ipv6 = 1 #kali-anonsurf +net.ipv6.conf.default.disable_ipv6 = 1 #kali-anonsurf +net.ipv6.conf.lo.disable_ipv6 = 1 #kali-anonsurf +EOF + + # Apply settings + if ! sysctl -p /etc/sysctl.d/98-kali-anonsurf.conf > /dev/null; then + echo -e "$RED Error applying sysctl settings$RESETCOLOR" + return 1 + fi + + # Verify IPv6 is disabled + if [ "$(cat /proc/sys/net/ipv6/conf/all/disable_ipv6)" != "1" ]; then + echo -e "$RED Failed to disable IPv6$RESETCOLOR" + return 1 + fi + + echo -e "$GREEN IPv6 successfully disabled$RESETCOLOR" + return 0 +} + +function enable_ipv6() { + echo -e "\n$GREEN[$BLUE i$GREEN ]$BLUE Reenabling IPv6 services:$RESETCOLOR\n" + + # Remove the config file if it exists + if [ -f /etc/sysctl.d/backup/98-kali-anonsurf ]; then + rm -f /etc/sysctl.d/98-kali-anonsurf.conf + echo -e "$GREEN Removed anonsurf sysctl config$RESETCOLOR" + fi + + # Reload all sysctl settings + if ! sysctl --system > /dev/null; then + echo -e "$RED Error reloading sysctl settings$RESETCOLOR" + return 1 + fi + + # Verify IPv6 is enabled + if [ "$(cat /proc/sys/net/ipv6/conf/all/disable_ipv6)" != "0" ]; then + echo -e "$RED Failed to forcibly reenable IPv6$RESETCOLOR" + # return 1 + fi + + # Restart network services + service network-manager force-reload > /dev/null 2>&1 + service nscd start > /dev/null 2>&1 + service dnsmasq start > /dev/null 2>&1 + + echo -e "$GREEN IPv6 successfully enabled$RESETCOLOR" + return 0 +} + function ip { @@ -134,13 +196,7 @@ function start { exit 1 fi - # Kill IPv6 services - echo -e "\n$GREEN[$BLUE i$GREEN ]$BLUE Stopping IPv6 services:$RESETCOLOR\n" - sed -i '/^.*\#kali-anonsurf$/d' /etc/sysctl.conf #delete lines containing #kali-anonsurf in /etc/sysctl.conf - # add lines to sysctl.conf that will kill ipv6 services - echo "net.ipv6.conf.all.disable_ipv6 = 1 #kali-anonsurf" >> /etc/sysctl.conf - echo "net.ipv6.conf.default.disable_ipv6=1 #kali-anonsurf" >> /etc/sysctl.conf - sysctl -p > /dev/null # have sysctl reread /etc/sysctl.conf + disable_ipv6 echo -e "\n$GREEN[$BLUE i$GREEN ]$BLUE Starting anonymous mode:$RESETCOLOR\n" @@ -248,12 +304,7 @@ function stop { echo -e "\n$GREEN[$BLUE i$GREEN ]$BLUE Reenabling IPv6 services:$RESETCOLOR\n" # reenable IPv6 services - sed -i '/^.*\#kali-anonsurf$/d' /etc/sysctl.conf #delete lines containing #kali-anonsurf in /etc/sysctl.conf - sysctl -p # have sysctl reread /etc/sysctl.conf - - service network-manager force-reload > /dev/null 2>&1 - service nscd start > /dev/null 2>&1 - service dnsmasq start > /dev/null 2>&1 + enable_ipv6 echo -e " $GREEN*$BLUE Anonymous mode stopped$RESETCOLOR\n" }