Issue with parrotOS and net scanner

Briefly describe your issue below:

Hello! I recently decided to try out parrotOS for fun. I installed it an an old Lenovo yoga 2 laptop. The issue is that, when I run a simple network scanner program which I created myself (written in Python), the computer seemingly loses access to the internet after it returns all of the devices on my network. It almost looks like a DDoS attack, as in the computer says I am connected and everything is working fine. But. I am unable to connect to any websites! I am also unable to run any terminal commands which rely on access to the internet, such as ping and traceroute. (when using ping google.com I get “Temporary failure in name resolution” error)

Furthermore, doing a service network-manager restart fixes the issue, and the internet connection is back up and running. However, it is quite annoying to have to do this after running every script. On another note, running the same code on my Kali Linux VM causes absolutely no issues. SO I am at a complete loss as to what is happening. This problem has taken me all of today up to this point to figure out.

What version of Parrot are you running? (include version (e.g. 4.6), edition(e.g. Home//KDE/OVA, etc.), and architecture (currently we only support amd64)

I have the latest version of parrotOS (4.6) and I installed it just last night. It is the security edition from the parrot website. Architecture is x86_64

The OS runs way better than the windows 8 this computer had before, and the UI is awesome.

What method did you use to install Parrot? (Debian Standard / Debian GTK / parrot-experimental)

I used a usb flash drive with an ISO (set up with Etcher)

Configured to multiboot with other systems? (yes / no)

No

If there are any similar issues or solutions, link to them below:

Couldn’t find anything that sounded exactly like this issue after hours of searching unfortunately :frowning:

If there are any error messages or relevant logs, post them below:

ill post the code I am running for the network scanner here… I don’t think its the problem but you never know:

#!/usr/bin/env python
import scapy.all as scapy
import argparse

def get_args():
	parser = argparse.ArgumentParser(description="Use to scan for IPs and MACs internally")
	parser.add_argument("-t", "--target", dest="targets", help="specify target IP(s)")
	options = parser.parse_args()

	return options.targets

def scan(ip_adr):
	# send an ARP packet to the broadcast MAC address 'ff:ff:ff..'
	arp_request = scapy.ARP(pdst=ip_adr)
	# set broadcast MAC in the packet. Packet is an Ethernet frame.
	broadcast = scapy.Ether(dst="ff:ff:ff:ff:ff:ff")
	# combine ARP packet with the Ethernet packet into one
	arp_request_broadcast = broadcast/arp_request
	# use scapy to send the packet 
	# .srp allows us to send packets with a custom Ethernet part
	# the response is captured in the variables
	answered_list = scapy.srp(arp_request_broadcast, timeout=1, verbose=False)[0]

	clients_list = []
	for element in answered_list:
		target_client = {}
		target_client["IP"] = element[1].psrc
		target_client["MAC"] = element[1].hwsrc
		clients_list.append(target_client)

	return clients_list

def print_result(results_list):

	print("IP\t\t\tMAC address\n-------------------------------")
	for client in results_list:
		print(client["IP"] +"\t\t" + client["MAC"])

ip_address=get_args()
scan_result = scan(ip_address)
print_result(scan_result)

can you check your DNS option please? Please run this command cat /etc/resolv.conf
In previous version, our leader decided remove default DNS config because there are users don’t want to use our DNS config. They complained about DNS Leak problem.

DNS options @ /etc/resolv.conf are:

nameserver 192.168.1.1

Yes so it means you are having no DNS address and the address of yours is your gateway.
I am very sorry for my lately reply but you can fix this easily by click on menu Applications on top left pane, -> Anonsurf then select Set / Unset OpenNIC DNS service. The problem should be fixed.

Hi dmknght. I really appreciate your response!

So I followed your advice. Unfortunately, this has not fixed the issue. Now, when I do cat /etc/resolv.config, I get “no such file or directory” …

Another interesting thing - when I run that script, with just the router IP 192.168.1.1, I get the returned MAC and the internet still works. However, when I add /24 at the end to scan the entire network, internet connection craps out again unless I restart network-manager…

Hi. The right command is cat /etc/resolv.conf, .config is a wrong extension. Can you check it again?
For your netmask problem, are you sure your script support netmask converting? I mean maybe you have to write a fucntion / command to convert netmask to all IP address before scan

You’re right on about the .conf… I was completely messing it up haha. My mistake.

Anyway, I get a list of nameservers now.

nameserver 185.121.177.177
nameserver 169.239.202.202
nameserver 198.251.90.108
nameserver 198.251.90.109
nameserver 198.251.90.110

Also these lines -

#Round Robin
options rotate

As for the script… it works perfectly on my kali linux and Ubunutu VMs with no issues. Only seems to be messing up on ParrotOS.

DO you think this could possibly be some kind of permissions issue?

If your script runs perfectly on Kali, so you can try run your script with with root permisison with sudo
sudo python script.py.
It is possibly scapy requires root permission for packet crafting.

I have run it with sudo and as root and still the same issue :frowning:

That is weird. Can you debug your code and verify variables? for example, try print ip address that the script gonna scan inside loop. My idea is your input, for example 192.168.100.0/24 is a string, so for loop gonna take each character in string -> bug

The script appears to be fine… It runs well on the Kali and Ubuntu VMs. Don’t understand why it wont work on Parrot. Maybe this computer is just too old to run the OS effectively.

Other scripts run fine…arp spoofing and packet sniffing all work. It’s just this net scanner script that seems to be giving problems.

So I can’t find any reason. Let me try your script on my system.

Sadly, it runs well on my system with root permission (root is required)

Very interesting. And you are able to access the internet just fine afterwards?

I am leaning towards the onboard network card firmware being not the best…

Even more interesting…I fully reinstalled Parrot to see if I inadvertently messed up some network settings and the issue still persists!

Sorry for lately reply. I have no issue at all. What is your network interface? Maybe you are using wireless (possibly) and network driver worked badly?

I am using wireless. wlan0. I think the network card firmware might be bad for this model laptop.

Yes it is possibly. There were days that I used BCM43142 and restart network-manager service multiple time crashes that firmware driver lol. So I suggest you try this script on a Parrot OS inside VM to make sure it is wireless driver problem.

Your script design for do that
That’s why python-scapy module do
Chnage your code a bit
Amzkill-core-module-0-1.log (2.9 KB)

Note:- This is oldest module, new module i will push in sometime