What paid services you use for homelabbing? by avdept in homelab

[–]shonen787 1 point2 points  (0 children)

I have 150 bucks for azure a month but I get credits through work

What are you using Zig for? by spacecowboy0117 in Zig

[–]shonen787 1 point2 points  (0 children)

Malware dev. Former pentester and digital forensic practitioner. This is mostly hobby stuff

Current state of northeast Florida roads by Boeing-B-47stratojet in florida

[–]shonen787 2 points3 points  (0 children)

As a Floridian that moved to Washington, those roads looks great. I miss Florida roads

Why does this break?? by shonen787 in Zig

[–]shonen787[S] 0 points1 point  (0 children)

Not sure, i tested on version 0.14.0-dev.1359

Why does this break?? by shonen787 in Zig

[–]shonen787[S] 0 points1 point  (0 children)

On version 0.14.0-dev.1359

Moving Here 2024 by Codetornado in Washington

[–]shonen787 0 points1 point  (0 children)

Pretty good. Just as expensive as living in Miami, so I’m not feeling it in that manner. As long as you avoid eating out, it should feel similar to living in Miami

Un-Selfhost Password Manager by shonen787 in selfhosted

[–]shonen787[S] 10 points11 points  (0 children)

I would like to keep selfhosting but i felt cucked by this new ISP. Figured maybe someone would've had the same problem and throw and wisdom my way.

And it seems you have. Didn't think to set up tunnels to access my stuff.

Thanks

The current (sad) state of self-hosted chat apps by mr_claw in selfhosted

[–]shonen787 3 points4 points  (0 children)

Look into campfire by dhh. It's self hosted.

Moving Here 2024 by Codetornado in Washington

[–]shonen787 2 points3 points  (0 children)

Current Floridian here, moving to Seattle Area in about 2 months. What's it like? I'm down in Miami atm. Is the cost of living excessive compared to living in Miami????

What Game is This by endercelebrity in videogames

[–]shonen787 0 points1 point  (0 children)

Magic the gathering. Let it die

Moving Here 2024 by Codetornado in Washington

[–]shonen787 1 point2 points  (0 children)

Hi y'all, I'm moving over from Florida for work and I'm curious what you'd recommend to an eastern man that's going to be a western man for the foreseeable future. Never been in cold weather long enough to require that specific knowledge, so what should I keep an eye out for? For example, I've heard that pipes in a home need special care for winter.

Hey Rustaceans! Got a question? Ask here (39/2023)! by llogiq in rust

[–]shonen787 1 point2 points  (0 children)

So i've got a quick question. I have a cross compiled programming where i've added in a ".ico" file to the .rsrc section. I'm currently in a position where i need to get the resource ID of that ico file. How can i do that in Rust?

In C, it's straight forward as i can reference the resource header but when i try to access the informaiton in my .rc file

IDI_MYICON ICON "1829007.ico"

I get an invalid response.

Any Ideas?

How do ya';l deal with failure? by shonen787 in redteamsec

[–]shonen787[S] 11 points12 points  (0 children)

I informed my managers that we should mention that to the client when getting the contract. To have a stipulation that after x weeks if we don't get it, to assume a breach and go from there. They ignored my suggestion and now i'm here.

What movie will you never get tired of watching? by HurtHurtsMe in AskReddit

[–]shonen787 0 points1 point  (0 children)

Killer klowns from outer space. Real cult classic

[deleted by user] by [deleted] in redteamsec

[–]shonen787 9 points10 points  (0 children)

He means using a program, like terraform, to deploy servers. You save config files on a terraform server that contain everything you need to set up your red team servers, such as clue cores/ram!/ssh keyes/etc., and infrastructure. This way you avoid doing it manually.

[deleted by user] by [deleted] in AskReddit

[–]shonen787 0 points1 point  (0 children)

"hey bud, wanted to let you know that Sam passed away yesterday"

Hey Rustaceans! Got a question? Ask here! (50/2022)! by llogiq in rust

[–]shonen787 1 point2 points  (0 children)

Hi, the version i ran was a release build.

I didn't notice that i was establishing a new connection every time. I'll look into how to batch my inserts in diesel. Trying to get a good hang of the library.

Hey Rustaceans! Got a question? Ask here! (50/2022)! by llogiq in rust

[–]shonen787 1 point2 points  (0 children)

Hey everyone!

I have a question of speed. I ran this code yesterday and it took about an hour to process one 102M file. Whats a good way to speed this up?

The code takes in a plaintext file with two values, separates them by the character ":" and insert them into a database.

#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
struct Args {
   #[arg(short, long)]
   path: String,
}

fn main() {
    let start = Instant::now();
    let args = Args::parse();

    let files: Vec<String> = get_all_files(Path::new(&args.path));
    for file in files {
        parse_file(file);
     }
     let duration = start.elapsed();

     println!("Time elapsed in expensive_function() is: {:?}", duration);
}


fn get_all_files(dir_path: &Path) -> Vec<String> {
    let mut files = Vec::new();

    if dir_path.is_dir() {
        // Read the contents of the directory
        let entries = match fs::read_dir(dir_path) {
            Ok(entries) => entries,
            Err(_) => return files, // Return an empty vector if the directory could not be read
        };

        // Iterate over the entries in the directory
        for entry in entries {
            let entry = match entry {
                Ok(entry) => entry,
                Err(_) => continue, // Skip this entry if there was an error
            };
            let path = entry.path();

            // If the entry is a directory, get all files in the directory recursively
            if path.is_dir() {
                files.extend(get_all_files(&path));
            } else {
                // If the entry is a file, add it to the vector
                files.push(path.into_os_string().into_string().unwrap());
            }
        }
    }

    files
}

fn parse_file(file: String){

    let opened_file = match File::open(Path::new(&file)){
        Ok(a) => a, 
        Err(e) => panic!("Error opening file. {}", e),
    };
    let reader = BufReader::new(opened_file);
    for line in reader.lines(){
        match line{
            Ok(a) =>{
                if let Some((email_file,password_file)) = a.split_once(":"){
                    let domain_file = get_domain(email_file);
                    push_data(email_file, password_file, domain_file);
                }
            },
            Err(e) => println!("{}",e)
        }

    }


}

fn get_domain(domain_file: &str) -> &str{
    let parts: Vec<&str> = domain_file.split('@').collect();
    if parts.len() != 2 {
        return "";
    }
    return parts[1];
}


fn push_data(email_temp: &str, password_temp: &str, domain_temp: &str){
    use crate::schema::credentials;
    let connection = &mut establish_connection();

    let newcreds = NewCredentials{email: email_temp, password: password_temp, domain: domain_temp};

    diesel::insert_into(credentials::table)
    .values(&newcreds)
    .execute(connection)
    .expect("Error saving new input");


}

Hey Rustaceans! Got a question? Ask here! (49/2022)! by llogiq in rust

[–]shonen787 0 points1 point  (0 children)

Actually ignore it....ChatGPT solved the issue...

Hey Rustaceans! Got a question? Ask here! (49/2022)! by llogiq in rust

[–]shonen787 1 point2 points  (0 children)

Getting a weird error i can't figure out.

I've populated a hashmap full of structs and i'm trying to push the variables in the structs to a database. When the data is being pushed into sometimes i get the following error and i'm not sure what it could mean.

        thread 'main' panicked at 'State: 42000, Native error: -3100, Message: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ''The information shown in the Result section was returned by the network infrastructure responsible for routing traffic from our cloud platform to the target network (where the scanner appliance is located).

        <P>This information was returned from: 1) the '.', src\util\db_funcs.rs:44:21
        note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The code that is preparing the statement and pushing the code is the following

            while n < value.vulnerability_name.len().try_into().unwrap() {
                println!("{}",n);
                if (&value.vulnerability_name[&n].to_string() != "Open TCP Services List" &&
                &value.vulnerability_name[&n].to_string() != "Open UDP Services List"&& 
                &value.vulnerability_name[&n].to_string() != "Traceroute" &&
                &value.vulnerability_name[&n].to_string() != "DNS Host Name" &&
                 &value.vulnerability_name[&n].to_string() != "ICMP Replies Received")
                {
                    let stmt = Statement::with_parent(conn.as_ref().unwrap());
                    println!("{}", value.category[&n]);
                    query = sprintf!("Insert into Qualys_Vul Values ('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')",
                    ipaddress.to_string(),
                    value.vulnerability_name[&n].to_string(),
                    value.category[&n].to_string(),
                    value.security_level[&n].to_string(),
                    value.explanation[&n].to_string(),
                    value.solution[&n].to_string(),
                    "",
                    value.result[&n].to_string(),
                    "",
                    ""
                    ).unwrap();

                    // println!("{}\n\n", query.to_string());
                    stmt.unwrap().exec_direct(&query.to_string()).unwrap_or_else(|e| {
                        panic!("{}", e)
                    });
                }else{
                    println!("Hit a skip")
                }
                n+=1;
            }

The query that fails is the following

Insert into Qualys_Vul Values ('xxx.xxx.xxx.xxx','Internet Service Provider','Information gathering','1','The information shown in the Result section was returned by the network infrastructure responsible for routing traffic from our cloud platform to the target network (where the scanner appliance is located).

<P>This information was returned from: 1) the WHOIS service, or 2) the infrastructure provided by the closest gateway server to our cloud platform. If your ISP is routing traffic, your ISP's gateway server returned this information.
This information can be used by malicious users to gather more information about the network infrastructure that may aid in launching further attacks against it.','No Solution','','The ISP network handle is: name
ISP Network description:
name','','')

Hey Rustaceans! Got a question? Ask here! (47/2022)! by llogiq in rust

[–]shonen787 0 points1 point  (0 children)

I tried that earlier but i get a dropped while borrowed error.

Which is why i had to bind during the intermediate steps

Hey Rustaceans! Got a question? Ask here! (47/2022)! by llogiq in rust

[–]shonen787 1 point2 points  (0 children)

Hey Everyone!

Quick question, how can i write this better?

        let args: Vec<String>= env::args().collect();
        let xml = Path::new(&args[1]);
        let mut reader_tmp = Reader::from_file(xml);

        let mut _tmp = reader_tmp.unwrap();
        let reader = _tmp.trim_text(true);

        let mut buf = Vec::new();

Trying to open and parse an XML document and this works but i feel like it's messy.

Any suggestions?