r3dlight / keysas

USB virus cleaning station
https://keysas.fr
GNU General Public License v3.0
45 stars 2 forks source link

usb firewall issues #61

Closed Werewolfman77 closed 4 months ago

Werewolfman77 commented 6 months ago

hopefully i managed to build usbfilter driver (usbfilter.cat, usbfilter.inf, usbfilter.sys ) and minifilter driver (keysasminifilter.cat, keysasminifilter.inf, keysasminifilter.sys)

this is how the output should be...right ?

as for the daemon and tray app i can't seem to be able to build them ...help is appreciated as i am not a developer

i tried "cargo build"after sudo apt-get install mingw-w64

but i get the following :

keysas@Keysas-USB:~/keysas/keysas-firewall/daemon$ cargo build Updating crates.io index Locking 185 packages to latest compatible versions Adding base64 v0.21.7 (latest: v0.22.1) Adding bindgen v0.68.1 (latest: v0.69.4) Adding bitflags v1.3.2 (latest: v2.5.0) Adding generic-array v0.14.7 (latest: v1.0.0) Adding linux-raw-sys v0.4.13 (latest: v0.6.4) Adding peeking_take_while v0.1.2 (latest: v1.0.0) Adding radium v0.7.0 (latest: v1.1.0) Adding serde-big-array v0.4.1 (latest: v0.5.1) Adding simple_logger v4.3.3 (latest: v5.0.0) Adding syn v1.0.109 (latest: v2.0.60) Adding toml v0.7.8 (latest: v0.8.12) Adding toml_edit v0.19.15 (latest: v0.22.12) Adding wasi v0.11.0+wasi-snapshot-preview1 (latest: v0.13.0+wasi-0.2.0) Adding which v4.4.2 (latest: v6.0.1) Adding windows v0.48.0 (latest: v0.56.0) Adding windows-service v0.6.0 (latest: v0.7.0) Adding windows-sys v0.45.0 (latest: v0.52.0) Adding windows-sys v0.48.0 (latest: v0.52.0) Adding windows-targets v0.42.2 (latest: v0.52.5) Adding windows-targets v0.48.5 (latest: v0.52.5) Adding windows_aarch64_gnullvm v0.42.2 (latest: v0.52.5) Adding windows_aarch64_gnullvm v0.48.5 (latest: v0.52.5) Adding windows_aarch64_msvc v0.42.2 (latest: v0.52.5) Adding windows_aarch64_msvc v0.48.5 (latest: v0.52.5) Adding windows_i686_gnu v0.42.2 (latest: v0.52.5) Adding windows_i686_gnu v0.48.5 (latest: v0.52.5) Adding windows_i686_msvc v0.42.2 (latest: v0.52.5) Adding windows_i686_msvc v0.48.5 (latest: v0.52.5) Adding windows_x86_64_gnu v0.42.2 (latest: v0.52.5) Adding windows_x86_64_gnu v0.48.5 (latest: v0.52.5) Adding windows_x86_64_gnullvm v0.42.2 (latest: v0.52.5) Adding windows_x86_64_gnullvm v0.48.5 (latest: v0.52.5) Adding windows_x86_64_msvc v0.42.2 (latest: v0.52.5) Adding windows_x86_64msvc v0.48.5 (latest: v0.52.5) Adding winnow v0.5.40 (latest: v0.6.7) Adding wyz v0.5.1 (latest: v0.6.1) Compiling libmailslot v0.1.0 (/home/keysas/keysas/keysas-firewall/libmailslot) Compiling eventlog v0.2.2 **error[E0433]: failed to resolve: could not findwindowsinos``_** --> /home/keysas/.cargo/registry/src/index.crates.io-6f17d22bba15001f/eventlog-0.2.2/src/lib.rs:7:15 7 use std::{os::windows::ffi::OsStrExt, ptr::null_mut}; ^^^^^^^ could not find windows in os

note: found an item that was configured out --> /rustc/ef8b9dcf23700f2e2265317611460d3a65c19eff/library/std/src/os/mod.rs:53:9 note: found an item that was configured out --> /rustc/ef8b9dcf23700f2e2265317611460d3a65c19eff/library/std/src/os/mod.rs:100:9

error[E0433]: failed to resolve: could not find shared in winapi --> /home/keysas/.cargo/registry/src/index.crates.io-6f17d22bba15001f/eventlog-0.2.2/src/lib.rs:12:5 | 12 | shared::ntdef::HANDLE, | ^^^^^^ could not find shared in winapi

error[E0433]: failed to resolve: could not find um in winapi --> /home/keysas/.cargo/registry/src/index.crates.io-6f17d22bba15001f/eventlog-0.2.2/src/lib.rs:13:5 | 13 | um::{ | ^^ could not find um in winapi

error[E0432]: unresolved imports registry::Data, registry::Hive, registry::Security --> /home/keysas/.cargo/registry/src/index.crates.io-6f17d22bba15001f/eventlog-0.2.2/src/lib.rs:10:16 10 use registry::{Data, Hive, Security}; ^^^^ ^^^^ ^^^^^^^^ no Security in the root
no Hive in the root
no Data in the root

error[E0433]: failed to resolve: could not find key in registry --> /home/keysas/.cargo/registry/src/index.crates.io-6f17d22bba15001f/eventlog-0.2.2/src/lib.rs:32:30 | 32 | RegKey(#[from] registry::key::Error), | ^^^ could not find key in registry

error[E0433]: failed to resolve: could not find value in registry --> /home/keysas/.cargo/registry/src/index.crates.io-6f17d22bba15001f/eventlog-0.2.2/src/lib.rs:35:32 | 35 | RegValue(#[from] registry::value::Error), | ^^^^^ could not find value in registry

error[E0433]: failed to resolve: could not find key in registry --> /home/keysas/.cargo/registry/src/index.crates.io-6f17d22bba15001f/eventlog-0.2.2/src/lib.rs:67:55 | 67 | pub fn deregister(name: &str) -> Result<(), registry::key::Error> { | ^^^ could not find key in registry

error[E0433]: failed to resolve: could not find windows in os --> /home/keysas/keysas/keysas-firewall/libmailslot/src/lib.rs:37:39 37 use std::{ffi::OsStr, iter::once, os::windows::ffi::OsStrExt}; ^^^^^^^ could not find windows in os

note: found an item that was configured out --> /rustc/ef8b9dcf23700f2e2265317611460d3a65c19eff/library/std/src/os/mod.rs:53:9 note: found an item that was configured out --> /rustc/ef8b9dcf23700f2e2265317611460d3a65c19eff/library/std/src/os/mod.rs:100:9

warning: lint private_in_public has been removed: replaced with another group of lints, see RFC https://rust-lang.github.io/rfcs/2145-type-privacy.html for more information --> /home/keysas/keysas/keysas-firewall/libmailslot/src/lib.rs:20:11 20 #![forbid(private_in_public)] ^^^^^^^^^^^^^^^^^

= note: #[warn(renamed_and_removed_lints)] on by default

error[E0599]: no method named encode_wide found for reference &OsStr in the current scope --> /home/keysas/.cargo/registry/src/index.crates.io-6f17d22bba15001f/eventlog-0.2.2/src/lib.rs:48:19 | 48 | OsStr::new(s).encode_wide().chain(once(0)).collect() | ^^^^^^^^^^^ method not found in &OsStr

Some errors have detailed explanations: E0432, E0433, E0599. For more information about an error, try rustc --explain E0432. error: could not compile eventlog (lib) due to 8 previous errors warning: build failed, waiting for other jobs to finish... error[E0599]: no method named encode_wide found for reference &OsStr in the current scope --> /home/keysas/keysas/keysas-firewall/libmailslot/src/lib.rs:54:48 | 54 | let slot_name: Vec = OsStr::new(name).encode_wide().chain(once(0)).collect(); | ^^^^^^^^^^^ method not found in &OsStr

error[E0599]: no method named encode_wide found for reference &OsStr in the current scope --> /home/keysas/keysas/keysas-firewall/libmailslot/src/lib.rs:200:48 | 200 | let slot_name: Vec = OsStr::new(name).encode_wide().chain(once(0)).collect(); | ^^^^^^^^^^^ method not found in &OsStr

Some errors have detailed explanations: E0433, E0599. For more information about an error, try rustc --explain E0433. warning: libmailslot (lib) generated 1 warning error: could not compile libmailslot (lib) due to 3 previous errors; 1 warning emitted

Werewolfman77 commented 6 months ago

same for tray app error[E0433]: failed to resolve: could not find windowsinos` no method named encode_wide found for reference &OsStr in the current scope

Werewolfman77 commented 6 months ago

latest update:

i managed to compile both tray app and daemon using visual studio code with some warnings... .. (i couldn't get it to work on debian...) Capture2 Capture4

once i compile the app is working..when i close the visual studio code and run the exe....the app runs but give content unreachable Capture

also when running daemon exe it gives error Capture1

lb-anssi commented 5 months ago

Hello,

Regarding the compilation issue, it might be due to cargo or rustup version used. You could try updating them.

Once compiled, it should be installed via the installer to correctly install the daemon as a Windows Service (it cannot be run directly from the command line) and set the registers. You can find all the steps used for the installation in keysas/keysas-firewall/installer /keysas_firewall_install.iss in sections [Registry] and [Run]. Beware that the USB firewall is still experimental.

Hope this helps.

r3dlight commented 4 months ago

No feedback, closing.