Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving from sysctl.conf to sysctl.d/kali-anonsurf.conf #109

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a876eef
Suggestion to prefer /etc/sysctl.d/kali-anonsurf.conf
UmbraDeorum Oct 25, 2024
9d67ffd
Update anonsurf
UmbraDeorum Oct 25, 2024
e6d8fa0
Update anonsurf
UmbraDeorum Oct 25, 2024
d67a726
Merge branch 'master' into UmbraDeorum-etc_sysctl.d_kali-anonsurf.conf
Und3rf10w Dec 23, 2024
55a4688
feat(ci): Add test application workflow
Und3rf10w Dec 23, 2024
90c60d0
feat(version): Version bump
Und3rf10w Dec 23, 2024
4f726e6
tweak(ci): Modify test application workflow
Und3rf10w Dec 23, 2024
66bf0a4
tweak(ci): Modify test application workflow
Und3rf10w Dec 23, 2024
566edd0
tweak(ci): Modify test application workflow
Und3rf10w Dec 23, 2024
5fde42c
Update anonsurf
UmbraDeorum Dec 23, 2024
2780454
tweak(ci): Do build and install and test in one workflow
Und3rf10w Dec 23, 2024
5842e96
Merge branch 'UmbraDeorum-etc_sysctl.d_kali-anonsurf.conf' of github.…
Und3rf10w Dec 23, 2024
052b47a
fix(ci): Add secure-delete package to test workflow
Und3rf10w Dec 23, 2024
abb83ee
fix(ci): Run installer instead of build on test workflow
Und3rf10w Dec 23, 2024
1354a07
fix(ci): Yaml fix
Und3rf10w Dec 23, 2024
0036947
tweak(ci): we'll try one more ci tweak
Und3rf10w Dec 23, 2024
3a182df
tweak(ci): No sudo
Und3rf10w Dec 23, 2024
47fea6a
tweak(ci): Okay, no runtime test in worker
Und3rf10w Dec 23, 2024
23418eb
tweak(ci): Rename workflow
Und3rf10w Dec 23, 2024
d307aaf
fix(sysctl): kali-anonsurf.conf in sysctl.d to 98-kali-anonsurf.conf
Und3rf10w Dec 23, 2024
4ccc7ad
fix(systctl): Remove 98-kali-anonsurf.conf on `anonsurf stop`
Und3rf10w Dec 24, 2024
3d6fed5
fix(sysctl): Modify the way ipv6 handling works with sysctl
Und3rf10w Dec 24, 2024
2134c85
Update control
Und3rf10w Dec 26, 2024
36552e1
Merge branch 'master' into UmbraDeorum-etc_sysctl.d_kali-anonsurf.conf
Und3rf10w Dec 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/test_application.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion kali-anonsurf-deb-src/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: kali-anonsurf
Version: 1.2.5.0
Version: 1.2.6.0
Architecture: all
Maintainer: Und3rf10w
Installed-Size: 64
Expand Down
77 changes: 64 additions & 13 deletions kali-anonsurf-deb-src/etc/init.d/anonsurf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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"

Expand Down Expand Up @@ -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"
}
Expand Down
Loading