Page 1 of 1

How to start Wireless Sniffer in a script?

Posted: Mon Apr 13, 2015 9:16 am
by rwrocket
Title says it all

I cannot find any information on how to run the Wireless Packet Sniffer any other way than clicking on the start button.

Re: How to start Wireless Sniffer in a script?

Posted: Mon Apr 13, 2015 1:41 pm
by boen_robot
The equivalent of pressing the start button in script is "/tool sniffer start", and of course, "/tool sniffer stop" for stopping.

See this manual page for all packet sniffer related commands and settings.

EDIT: Wait, I'm sorry... You meant "Wireless sniffer", not "Packet sniffer". I got confused by the combined "Wireless Packet Sniffer"...

For that, see this portion of the Wireless manual page for the settings, and as for the command... It's called "sniff", in that very menu ("/interface wireless sniffer"). It works pretty much the same as how "print" works, except that the list is filled gradually.

Re: How to start Wireless Sniffer in a script?

Posted: Tue Apr 14, 2015 2:26 am
by rwrocket
Great that was what I needed, the sniff command.

Now if only I could run it with a filter? but as far as I have read so far there is no filter commands for the wireless sniffer like there is for the other packet sniffer?

Re: How to start Wireless Sniffer in a script?

Posted: Tue Apr 14, 2015 4:47 am
by rwrocket
Can anyone advise me on how I can script this to run for a time period then stop?

I see the sniff commands can be run with the following attributes but I am also not sure what they do.

<interface> --
append --
as-value --
do --
file --
interval --
once --
without-paging

I can press Q to stop it running in the terminal but I am not sure how to script Q after a delay
:delay 10
q doesn't seem to work

Re: How to start Wireless Sniffer in a script?

Posted: Tue Apr 14, 2015 6:37 pm
by boen_robot
Huh. Most other similar commands have "duration", which does just that, but here...

I guess you could use "once", which should in turn only sniff whatever can be immediately seen, and stop sniffing afterwards (rather than wait, and keep the list "fresh"). If you want to apply something for each network (e.g. check it against some criteria), you can use the "do" argument. It contains variables identifying the particular item. While inside the script, press "$", and tab, to see the possible variables.