From 0c47019ed9af99eb7d3e8f42e8bd3dc67696393e Mon Sep 17 00:00:00 2001 From: Manuel Palenzuela Date: Mon, 18 Mar 2019 22:10:30 +0000 Subject: Fixed mac adress not changing --- ghostnet | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/ghostnet b/ghostnet index 47abbd4..79ea1c0 100755 --- a/ghostnet +++ b/ghostnet @@ -56,14 +56,16 @@ class Faded: break if ask == "" or ask == "y" or ask == "yes": if job == "start": - proc = os.popen("ifconfig %s down" % Faded._iface).read() + proc = os.popen("ifconfig %s down | tail -n 1 | sed 's/ //g'" % Faded._iface).read() proc = os.popen("macchanger -A %s | tail -n 1 | sed 's/ //g'" % Faded._iface).read() - proc = os.popen("ifconfig %s up" % Faded._iface).read() + proc = os.popen("ifconfig %s up | tail -n 1 | sed 's/ //g'" % Faded._iface).read() os.popen("ip link set %s up" % Faded._iface) else: + proc = os.popen("ifconfig %s down | tail -n 1 | sed 's/ //g'" % Faded._iface).read() proc = os.popen("macchanger -p %s | tail -n 1 | sed 's/ //g'" % Faded._iface).read() + proc = os.popen("ifconfig %s up | tail -n 1 | sed 's/ //g'" % Faded._iface).read() os.popen("ip link set %s up" % Faded._iface) - log('|-- {}'.format(str(proc).strip('\n')),resp=True,end=True) + log('|-- Mac adress succesfully changed!'.format(str(proc).strip('\n')),resp=True,end=True) else: log('[-- Mac address not changed!!!',warn=True,end=True) @@ -101,6 +103,17 @@ class Faded: call(['systemctl','stop','tor'],stdout=fnull,stderr=fnull) log('done',resp=True,end=True) + @staticmethod + def fixNetworkManagerStart(): + os.popen('echo \"[main]\ndns=none\" > /etc/NetworkManager/NetworkManager.conf') + log('[{0}] Fixed network manager to dns=none --> done'.format(timed()),resp=True,end=True) + + @staticmethod + def fixNetworkManagerStop(): + os.popen('rm /etc/NetworkManager/NetworkManager.conf') + os.popen('touch /etc/NetworkManager/NetworkManager.conf') + log('[{0}] Fixed network manager to blank --> done'.format(timed()),resp=True,end=True) + @staticmethod def _flush_iptables(): log('[{0}] Flush iptables rules --> '.format(timed(),warn=True)) @@ -156,6 +169,7 @@ class DoJob(Faded): DoJob.check_torrc_configs() DoJob.redirect_to_tor() DoJob.handle_tor("start") + DoJob.fixNetworkManagerStart(); DoJob.handle_networkmanager('start') DoJob.update_resolv() except KeyboardInterrupt: @@ -170,6 +184,7 @@ class DoJob(Faded): DoJob.change_mac("stop") DoJob.handle_tor("stop") DoJob._flush_iptables() + DoJob.fixNetworkManagerStop() DoJob.handle_networkmanager("start") except KeyboardInterrupt: sys.exit(log('[-] You stoped the program.',err=True)) -- cgit 1.4.1