|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
-
- namespace App\Commands;
-
- use Illuminate\Console\Scheduling\Schedule;
- use LaravelZero\Framework\Commands\Command;
- use Illuminate\Support\Facades\Process;
-
- class Detalle_wifi extends Command
- {
- /**
- * The signature of the command.
- *
- * @var string
- */
- protected $signature = 'detalle_wifi';
-
- /**
- * The description of the command.
- *
- * @var string
- */
- protected $description = 'Este comando te dara una descripcion detallada de la red';
-
- /**
- * Execute the console command.
- *
- * @return mixed
- */
- //lo que debo obtener con la red del parceo es lo siguiente:
-
- //1-. nombre de la red
- //2-. tipo de encriptacion
- //3-. canal en el que esta
- //4-. Frecuencia
- public function handle()
- {
- /*$result = Process::run('netsh wlan show networks mode=Bssid');
- $salidascanwifi = $result->output();*/
- $salidascanwifi = file_get_contents('scanwifi.txt');
- //preg_match_all("/SSID \d+ :/", $salidascanwifi, $parsescanwifi);
- $parsescanwifi = explode('BSSID ', $salidascanwifi);
- dd($parsescanwifi);
- //Primero hay que separar por cada uno de los ssid
- //Luego hay que sacar la informacion de cada uno de los BSSID
- $parsescanwifi = end($parsescanwifi);
- $parsescanwifi = explode("\n", trim($parsescanwifi, "\n\r"));
- $scanwifi = [];
- return $scanwifi;
- }
- /**
- * Define the command's schedule.
- *
- * @param \Illuminate\Console\Scheduling\Schedule $schedule
- * @return void
- */
- public function schedule(Schedule $schedule): void
- {
- // $schedule->command(static::class)->everyMinute();
- }
- }
|