Skip to content

Commit

Permalink
fixed mac spoofing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bissito committed Feb 22, 2022
1 parent 879082c commit 9f50911
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 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 macchanger 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 macchanger 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
8 changes: 2 additions & 6 deletions torall.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,14 @@ 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('ip link set ' + iface + ' down >/dev/null')
os.system('macchanger -r ' + iface + ' >/dev/null 2>&1')
os.system('ip link set ' + iface + ' up >/dev/null')


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('ip link set ' + iface + ' down >/dev/null')
os.system('macchanger -p ' + iface + ' >/dev/null 2>&1')
os.system('ip link set ' + iface + ' up >/dev/null')


def start_daemon():
Expand Down Expand Up @@ -213,10 +209,10 @@ def start_torall():
print(MARGIN + clr.GREEN + clr.BOLD + 'STARTING TorAll...' + clr.END)
if os.system('systemctl is-active --quiet tor') == 0:
stop_daemon()
# spoof_mac_addresses()
switch_nameservers()
backup_sysctl()
disable_ipv6()
spoof_mac_addresses()
start_daemon()
disable_firewall()
set_iptables()
Expand All @@ -234,7 +230,7 @@ def stop_torall():
restore_sysctl()
flush_iptables()
stop_daemon()
# revert_mac_addresses()
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 9f50911

Please sign in to comment.