AV detection of simple reqwest program compiled from Linux

Hello,
Windows defender shows that a simple reqwest app compiled from Linux Mint x86 for Windows using the windows 64 target is a trojan: wacatac.b This issue seems to be known in few languages but not in rust. An option is that a crate I am using has been hacked (Which is strange since I only use well known crates) and contains this trojan, the compiler produces malware-like code or my compiler is a malicious one (This is also quite strange since I'm using the built-in gcc in Linux Mint).
Here the toml:

[dependencies]
reqwest = {version = "*", default-features = false,features = ["blocking","rustls-tls"]}
serde = {version ="*", features = ["derive"]}
serde_json = "*"
anyhow = "*"

[profile.release]
opt-level = 3
lto = "on"

And here is the code:

use std::{collections::HashSet, time::Duration};

use anyhow::*;

fn main() {
    let mut current = HashSet::new();
    loop {
        std::thread::sleep(Duration::from_secs(5));
        match scrap() {
            Ok(e) => {
                for i in &e {
                    if !current.contains(&i.url) {
                        current.insert(i.url.to_owned());
                        reqwest::blocking::Client::new().post("A discord webhook").header("content-type","application/json").body(format!("{{\"content\":\"[{}]({}) - {}\"}}",i.url,i.url,i.name)).send().unwrap().text().unwrap();
                    }
                }
                current.retain(|x| {
                    e.iter().any(|xx| &xx.url == x)
                });
            },
            Err(e) => {
                println!("ERROR: {}",e);
            }
        }
        println!("Scrapped")
    }
}

#[derive(Debug)]
struct Valid {
    name: String,
    location: Location,
    url: String,
}

fn scrap() -> Result<Vec<Valid>> {
    let string = reqwest::blocking::get("example.com")?.text()?;
    let vaccines = serde_json::from_str::<DataSheet>(&string)?;
    Ok(vaccines.centres_disponibles.iter().map(|vaccine| {
        if contains(&vaccine.vaccine_type, &Vacine::Moderna) || contains(&vaccine.vaccine_type, &Vacine::PfizerBioNTech) {
            vaccine.appointment_schedules.iter().flat_map(|i| {
                if i.name == "chronodose" && i.total > 0 {
                    Some(Valid {
                        name: vaccine.nom.to_owned(),
                        location: vaccine.location.clone(),
                        url: vaccine.url.to_owned()
                    })
                } else {
                    None
                }
            }).collect()
        } else {
            vec![]
        }
    }).flatten().collect())
}

fn contains<T: PartialEq>(vec: &[T], object: &T) -> bool {
    for x in vec {
        if x == object {
            return true;
        }
    }
    return false;
}

#[derive(serde::Deserialize, Debug)]
struct DataSheet {
    version: u8,
    last_updated: String,
    centres_disponibles: Vec<Center>
}

#[derive(serde::Deserialize, Debug)]
struct Center {
    departement: String,
    nom: String,
    url: String,
    location:Location,
    prochain_rdv: String,
    plateforme: Plateforme,
    vaccine_type: Vec<Vacine>,
    appointment_schedules: Vec<Schedules>
}

#[derive(serde::Deserialize, Debug)]
struct Schedules {
    name: String,
    from: String,
    to: String,
    total: u16,
}

#[derive(serde::Deserialize, Debug, PartialEq)]
enum Vacine {
    AstraZeneca,
    #[serde(rename = "Pfizer-BioNTech")]
    PfizerBioNTech,
    Moderna
}

#[derive(serde::Deserialize, Debug)]
enum Plateforme {
    Doctolib,
}

#[derive(serde::Deserialize, Debug, Clone)]
struct Location {
    longitude: f32,
    latitude: f32,
    city: String,
    cp: String,
}

Here the generated exe file: Gofile - Free file sharing and storage platform
If you have any idea.
Thanks for helping;
ccgauche.

It's a false positive.

Can you explain how you're sure of this?

I've read your code and know the crates.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.