i want to make a time capturing limit of airodump-ng using the timeout command of UNIX
but it just gave a empty terminal screen!

Heres the simple perl script


use strict;
use warnings;

my $interface="eth1";
my $moninterface="prism0";

open(FILE, ">result.txt") or die "Failed to create a file!\n";
print FILE `iwlist $interface scan`;

open(FILE1, "<result.txt") or die "Failed to open file!\n";
    chomp $_;
    if($_=~m/essid: \w+/i or $_=~m/\w+$/i){
        print "$_\n";
    }if($_=~m/address: \w+/i){
        print "$_";
    }if($_=~m/channel: \w+/i){
        print "$_";
my $bssid=<STDIN>;
my $channel=<STDIN>;
my $filename=<STDIN>;
chomp($bssid, $channel, $filename);

system(`timeout 10 airodump-ng --bssid $bssid --channel $channel --write $filename --ignore-negative-one $moninterface`);


The first question I would ask is does these UNIX commands you gave work from your CLI to start with that is on their own? If no, then, make sure you get to make it work first before putting it in a script.

Secondly, in line 30, am wondering, why you are putting the "backtick" i.e `` in a system "function" in your perl script.

lastly, make sure the interface, eth1 you specified is up and working. More so, why ask the user to input BSSID, and CHANNEL when you are gettiing some from your script. What are you doing with those you got from the script?

This one-liner script works for me:

iwlist wlan0 scan | perl -wnle '
print $_ if/address:|channel:|essid:/i;'
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.