Skip to content

Commit

Permalink
Merge branch 'testing' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
bissito committed Feb 22, 2022
2 parents b3e91e4 + 9f50911 commit 83ed2bc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
10 changes: 4 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,14 @@ prerequisites() {
info "Starting TorAll Installer v1.5"
info "Installing prerequisites "
if command -v pacman > /dev/null; then
pacman -S --quiet --noconfirm --needed tor python-pip cython gcc
info "Installing dependencies "
pip3 install requests
pacman -S --quiet --noconfirm --needed tor macchanger cython gcc python-pip
elif command -v apt > /dev/null; then
apt -y --quiet install tor python3-pip cython3 gcc
info "Installing dependencies "
pip3 install requests
apt -y --quiet install tor macchanger cython3 gcc python3-pip
else
err "Unknown distro! TorAll currently supports only Arch and Debian based distros."
fi
info "Installing dependencies "
pip3 install requests -q
}

create_torallrc() {
Expand Down
16 changes: 16 additions & 0 deletions torall.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,20 @@ def restore_nameservers():
os.system('mv /var/lib/torall/resolv.conf.bak /etc/resolv.conf')


def spoof_mac_addresses():
print(MARGIN + clr.BLUE + 'Spoofing mac addresses...' + clr.END)
for iface in os.listdir('/sys/class/net/'):
if iface != 'lo':
os.system('macchanger -r ' + iface + ' >/dev/null 2>&1')


def revert_mac_addresses():
print(MARGIN + clr.BLUE + 'Reverting mac addresses...' + clr.END)
for iface in os.listdir('/sys/class/net/'):
if iface != 'lo':
os.system('macchanger -p ' + iface + ' >/dev/null 2>&1')


def start_daemon():
print(MARGIN + clr.BLUE + 'Starting new tor daemon...' + clr.END)
os.system('sudo -u ' + TORUID + ' tor -f /etc/tor/torallrc >/dev/null')
Expand Down Expand Up @@ -198,6 +212,7 @@ def start_torall():
switch_nameservers()
backup_sysctl()
disable_ipv6()
spoof_mac_addresses()
start_daemon()
disable_firewall()
set_iptables()
Expand All @@ -215,6 +230,7 @@ def stop_torall():
restore_sysctl()
flush_iptables()
stop_daemon()
revert_mac_addresses()
enable_firewall()
restart_network_manager()
print(MARGIN + clr.BLUE + 'Fetching current IP... ' + clr.END + ip() + '\n')
Expand Down

0 comments on commit 83ed2bc

Please sign in to comment.