feat: reading from a file

This commit is contained in:
Muhammad Nauman Raza 2024-05-27 00:08:29 +01:00
parent 862c872b73
commit 591e8fc9d5

View file

@ -1,12 +1,18 @@
use owo_colors::OwoColorize;
use std::process::Command;
use std::fs;
fn main() -> std::io::Result<()> {
let ports = [80, 443, 8448];
for port in ports {
let file: Vec<String> = fs::read_to_string("sage.txt")
.unwrap()
.lines()
.map(String::from)
.collect();
for port in &file[1..file.len()] {
let netcat = Command::new("nc")
.arg("-vz")
.arg("devraza.giize.com")
.arg(format!("{}", file[0]))
.arg(format!("{}", port))
.output()?;