Skip to content

Commit

Permalink
Bug fixes - Making progress
Browse files Browse the repository at this point in the history
Having issues with system links
  • Loading branch information
LimesKey authored Sep 8, 2023
1 parent 5f50e97 commit 1b9c74c
Showing 1 changed file with 30 additions and 20 deletions.
50 changes: 30 additions & 20 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use utils::PwnedAPI::pass_check;
use round::round;
use std::io::{BufRead, BufReader, Result, Write, Read};
use std::io;
use std::os::windows::fs::FileExt;
use std::fs;
use lnk::ShellLink;
//use tokio;
// Entire file calculates the entropy

Expand Down Expand Up @@ -100,31 +102,39 @@ fn password_list(password: String) -> bool {
let paths: fs::ReadDir = fs::read_dir(dir).unwrap();

for file in paths {
let file = file.unwrap();
let mut file = file.unwrap();
if file.file_name() == "RockYou.lnk"
{
println!("Found test!");
let test = lnk::ShellLink::open(file.path()).unwrap();
println!("test: {:#?}", test);
//if file.path().to_string_lossy(). {
println!("Found symlink!");
let file = file.path().canonicalize().unwrap();

let file = File::open(file.path());
let mut reader = BufReader::new(file.unwrap());
// mut file_content = Vec::new();

for passwords in reader.lines() {
println!("jhjhj {:?}", passwords);
match passwords {
Ok(passwords) => {
if passwords == password {
println!("Password found in test!");
return true;
println!("Symlink: {:?}", file);
let file = File::open(file);
let reader = BufReader::new(file.unwrap());

for passwords in reader.lines() {
println!("jhjhj {:?}", passwords);
match passwords {
Ok(passwords) => {
if passwords == password {
println!("Password found in test!");
return true;
}
}
Err(err) => {
eprintln!("Error reading line: {}", err);
}
}
Err(err) => {
eprintln!("Error reading line: {}", err);
}
}
}

}

}
//}
else {
println!("Couldn't find symlink!");
}
return false;
}
return false;
}

0 comments on commit 1b9c74c

Please sign in to comment.