zsh: permission denied



When you are running the script I made a couple of changes to it - this will remind you to add an IP address if you run it without one
==========================================
#!/bin/bash

if [ "$1" == "" ]
then
echo "Did you forget the IP Address!"
echo "Syntax: sudo bash ./ipsweeper.sh 192.168.0.1"

else
for ip in {1..254}; do
ping -c 1 $1.$ip | grep "64 bytes" | cut -d " " -f 4 | tr -d ":" &
done
fi
=================================================
you have to remember to add the IP address when you run it
Code:
sudo bash ./ipsweeper.sh 192.168.0.1
you can use any IP address that your machine is using to list which IP address you can run
Code:
ip -4 addr
or
Code:
ip -6 addr
to get IP Address

If you use this copy what is in between the ======= into your text editor and save as ipsweeper.sh
PS - I just made a minor edit so it is correct now
 
Last edited by a moderator:
Hey man hope you didn't give up, but I'm taking the same course you put your sequence in single quotations and not tildas it doesn't seem like anyone else caught that but I did that and ran it with sudo bash and it worked what it looks like works with an ip too
20230902_103332.jpg
 
It might be a zsh setting that prevents executing from certain directories. I just can't recall which one or where it's set.
 
you're missing a space between ping and -c. And some more after that. Plese post the script as a code block.
 
Tengo acceso root, pero al intentar ejecutar ./ipsweeper.sh, aparece "zsh: permiso denegado"... Probé otras cosas, pero no consigo que funcione. Por favor, diganme cómo solucionarlo.
Hi, it's late, but it might be helpful to other people, like me. I'm taking the same course through Hacker X and I'm having the same problem. After searching and finding this thread, I was able to solve it as follows:

┌──(kali㉿kali)-[~]
└─$ sudo bash '/home/kali/Desktop/ipsweep.sh' xxx.xxx.xx
64 bytes from xxx.xxx.xx.xxx icmp_seq=1 ttl=255 time=2.50 ms
64 bytes from xxx.xxx.xx.xxx icmp_seq=1 ttl=255 time=420 ms

PS: I had to drag the file to the terminal. It's not ideal, but take note of the person who recommends starting by learning the environment.

#!/bin/bash
for ip in {1..250};
ping -c 1 $1.$ip | grep "64 bytes" | cut -d "" -f 4 | tr -d ":" and
ready
 
Last edited:
English only, please.
 


Follow Linux.org

Members online


Latest posts

Top