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

#!/usr/bin/perl

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`;
close(FILE);

open(FILE1, "<result.txt") or die "Failed to open file!\n";
while(<FILE1>){
    chomp $_;
    if($_=~m/essid: \w+/i or $_=~m/\w+$/i){
        print "$_\n";
    }if($_=~m/address: \w+/i){
        print "$_";
    }if($_=~m/channel: \w+/i){
        print "$_";
    }
}
close(FILE1);
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`);

#GIVING A EMPTY TERMINAL SCREEN SHIT

Hi,
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 meeting, networking, learning, and sharing knowledge.