0

I want to use the mac address stored in a file in aireplay-ng command. I want this command to be executed once with each mac address in the file. Can you please tell me how to do it?

sudo aireplay-ng -1 0 -e VMC_AP -a  D4:4C:24:2B:EE:80 -h CC:AF:78:B3:E5:0F mon0 --ignore-negative-one  

I want -h CC:AF:78:B3:E5:0F to be replaced by different mac address stored in a file .

Thank you!

2 Answers 2

2

Use the following command:

user@host:~# cat file | awk '{printf "sudo aireplay-ng -1 0 -e VMC_AP -a  D4:4C:24:2B:EE:80 -h %s mon0 --ignore-negative-one\n", $1}' | bash

Where file looks like this:

user@host:~# cat file
AA:BB:CC:DD:EE:FF
AA:BB:CC:DD:EE:FF
AA:BB:CC:DD:EE:FF
AA:BB:CC:DD:EE:FF
1

Using pure shell

while read line
do
  sudo aireplay-ng -1 0 -e VMC_AP -a  D4:4C:24:2B:EE:80 -h "${line}" mon0 --ignore-negative-one 
done

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .