feat: reading from a file
This commit is contained in:
parent
862c872b73
commit
591e8fc9d5
12
src/main.rs
12
src/main.rs
|
@ -1,12 +1,18 @@
|
||||||
use owo_colors::OwoColorize;
|
use owo_colors::OwoColorize;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
use std::fs;
|
||||||
|
|
||||||
fn main() -> std::io::Result<()> {
|
fn main() -> std::io::Result<()> {
|
||||||
let ports = [80, 443, 8448];
|
let file: Vec<String> = fs::read_to_string("sage.txt")
|
||||||
for port in ports {
|
.unwrap()
|
||||||
|
.lines()
|
||||||
|
.map(String::from)
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
for port in &file[1..file.len()] {
|
||||||
let netcat = Command::new("nc")
|
let netcat = Command::new("nc")
|
||||||
.arg("-vz")
|
.arg("-vz")
|
||||||
.arg("devraza.giize.com")
|
.arg(format!("{}", file[0]))
|
||||||
.arg(format!("{}", port))
|
.arg(format!("{}", port))
|
||||||
.output()?;
|
.output()?;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue