about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-03-18 22:10:30 +0000
committerManuel Palenzuela <manuelpalenzuelamerino@gmail.com>2019-03-18 22:10:30 +0000
commit0c47019ed9af99eb7d3e8f42e8bd3dc67696393e (patch)
tree6d68ef2262ed070636cc12a37590a81057e8725b
parentFix Readme v2 (diff)
downloadGhostNET-v2-0c47019ed9af99eb7d3e8f42e8bd3dc67696393e.tar.gz
GhostNET-v2-0c47019ed9af99eb7d3e8f42e8bd3dc67696393e.tar.bz2
GhostNET-v2-0c47019ed9af99eb7d3e8f42e8bd3dc67696393e.zip
Fixed mac adress not changing
-rwxr-xr-xghostnet21
1 files 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)
 
@@ -102,6 +104,17 @@ class Faded:
 			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))
 		with open('/opt/flush_iptables.sh','w+') as script:
@@ -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))