2 Commits

Author SHA1 Message Date
brotoskyj 353a1ec628 Started Rust Development (#10)
Reviewed-on: brotoskyj/CHAMP#10
Co-authored-by: brotoskyj <jbrotosky@gmail.com>
Co-committed-by: brotoskyj <jbrotosky@gmail.com>
2025-01-28 15:36:14 -05:00
brotoskyj d65ac84d29 Added Kill all Local Cherwell Processes under Tools section
closes #5

Reviewed-on: brotoskyj/CHAMP#7
Co-authored-by: brotoskyj <jbrotosky@gmail.com>
Co-committed-by: brotoskyj <jbrotosky@gmail.com>
2025-01-03 15:23:07 -05:00
17 changed files with 584 additions and 1864 deletions
Generated
+546 -1703
View File
File diff suppressed because it is too large Load Diff
+1 -4
View File
@@ -1,15 +1,12 @@
[package]
name = "champ"
version = "2025.3.6"
version = "0.1.0"
edition = "2021"
[dependencies]
native-dialog = { version = "0.7.0", features = ["windows_dpi_awareness", "windows_visual_styles"] }
reqwest = { version = "0.12.12", features = ["blocking"] }
serde_json = "1.0.137"
simple-ldap = "2.1.1"
slint = "1.9.2"
tokio = { version = "1.43.0", features = ["full"] }
[build-dependencies]
slint-build = "1.9.2"
+1 -1
View File
@@ -37,7 +37,7 @@ CHAMP is a program that allows support staff of enterprise helpdesks to centrall
- Useful tools to other departments in an organization like Cyber Security or Incident Response Teams
## Roadmap
- [Roadmap](https://git.racooncity.org/brotoskyj/CHAMP/projects/1)
- Themes
## Acknowledgements
Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

+3 -2
View File
@@ -1,4 +1,5 @@
fn main() {
let config = slint_build::CompilerConfiguration::new().with_style("fluent-dark".into());
let config = slint_build::CompilerConfiguration::new()
.with_style("fluent-dark".into());
slint_build::compile_with_config("ui/template.slint", config).unwrap();
}
}
+31 -27
View File
@@ -1,39 +1,43 @@
use slint::ComponentHandle;
use native_dialog::FileDialog;
slint::slint!();
slint::include_modules!();
pub mod utils;
use reqwest;
use serde_json::Value;
use slint::ToSharedString;
fn main() {
utils::othertoolmodules::update();
let app: MainWindow = MainWindow::new().unwrap();
let usermodulecallbacks: UserModuleCallbacks<'_> = app.global::<UserModuleCallbacks>();
usermodulecallbacks.on_searchUser({
move || {
utils::usermodules::username_search();
}
});
let computermodulecallbacks: ComputerModuleCallbacks<'_> =
app.global::<ComputerModuleCallbacks>();
computermodulecallbacks.on_CFE({
let app_weak = app.as_weak();
move || {
let app: MainWindow = app_weak.unwrap();
utils::computermodules::computer_file_explorer(app);
}
});
let othertoolmodulecallbacks: OtherToolCallbacks<'_> = app.global::<OtherToolCallbacks>();
othertoolmodulecallbacks.on_killCherwell({
move || {
utils::othertoolmodules::kill_cherwell();
}
});
let othertoolmodulecallbacks = app.global::<OtherToolCallbacks>();
othertoolmodulecallbacks.on_ipapi({
let app_weak = app.as_weak();
move || {
let app: MainWindow = app_weak.unwrap();
utils::othertoolmodules::ip_gelocate_api(app);
let app = app_weak.unwrap();
let mut url = String::from("http://ip-api.com/json/");
url.push_str(&app.global::<OtherToolCallbacks>().get_ipaddressbar());
let resp: String = reqwest::blocking::get(url)
.unwrap()
.text()
.ok()
.unwrap()
.into();
let apitest = geolocateapi(&resp);
let isp = apitest["isp"].to_shared_string();
let country = apitest["country"].to_shared_string();
let region = apitest["regionName"].to_shared_string();
let city = apitest["city"].to_shared_string();
app.global::<OtherToolCallbacks>()
.set_isp(slint::SharedString::from(isp));
app.global::<OtherToolCallbacks>()
.set_country(slint::SharedString::from(country));
app.global::<OtherToolCallbacks>()
.set_state(slint::SharedString::from(region));
app.global::<OtherToolCallbacks>()
.set_city(slint::SharedString::from(city));
}
});
app.run().unwrap();
}
fn geolocateapi(data: &String) -> Value {
let parsed: Value = serde_json::from_str(data).unwrap();
return (parsed).clone();
}
-3
View File
@@ -1,3 +0,0 @@
pub mod computermodules;
pub mod othertoolmodules;
pub mod usermodules;
-46
View File
@@ -1,46 +0,0 @@
use crate::{ComputerModuleCallbacks, MainWindow};
use native_dialog::FileDialog;
use slint::ComponentHandle;
pub fn computer_file_explorer(app: MainWindow) {
let computername = &app.global::<ComputerModuleCallbacks>().get_computername();
let computername: String = computername.to_string();
let mut path = String::new();
path.push_str(r"\\");
path.push_str(&computername);
path.push_str(r"\C$\");
let dialog = FileDialog::new()
.set_location(&path)
.show_open_single_dir()
.unwrap();
println!("{}", &dialog);
}
pub fn current_logged_on_user(app: MainWindow) {
let computername = &app.global::<ComputerModuleCallbacks>().get_computername();
println!("Test");
}
pub fn laps_password_viewer(app: MainWindow) {
let computername = &app.global::<ComputerModuleCallbacks>().get_computername();
println!("Test");
}
pub fn remote_to_computer(app: MainWindow) {
let computername = &app.global::<ComputerModuleCallbacks>().get_computername();
println!("Test");
}
pub fn reboot_with_remote(app: MainWindow) {
let computername = &app.global::<ComputerModuleCallbacks>().get_computername();
println!("Test");
}
pub fn sccm_log_parse(app: MainWindow) {
let computername = &app.global::<ComputerModuleCallbacks>().get_computername();
println!("Test");
}
fn path_validate() {
println!("Finding Path");
}
-44
View File
@@ -1,44 +0,0 @@
use crate::{MainWindow, OtherToolCallbacks};
use reqwest;
use serde_json::Value;
use slint::{ComponentHandle, ToSharedString};
pub fn kill_cherwell() {
println!("Test");
}
pub fn ip_gelocate_api(app: MainWindow) {
let mut url: String = String::from("http://ip-api.com/json/");
url.push_str(&app.global::<OtherToolCallbacks>().get_ipaddressbar());
let resp: Result<reqwest::blocking::Response, reqwest::Error> = reqwest::blocking::get(url);
match &resp {
Err(_e) => {
app.global::<OtherToolCallbacks>()
.set_isp(slint::SharedString::from("Failed to resolve IP/URL"));
app.global::<OtherToolCallbacks>()
.set_country(slint::SharedString::from("Failed to resolve IP/URL"));
app.global::<OtherToolCallbacks>()
.set_state(slint::SharedString::from("Failed to resolve IP/URL"));
app.global::<OtherToolCallbacks>()
.set_city(slint::SharedString::from("Failed to resolve IP/URL"));
}
Ok(_t) => {
let result: String = resp.unwrap().text().unwrap();
let parsed: Value = serde_json::from_str(&result).unwrap();
let isp: slint::SharedString = parsed["isp"].to_shared_string();
let country: slint::SharedString = parsed["country"].to_shared_string();
let region: slint::SharedString = parsed["regionName"].to_shared_string();
let city: slint::SharedString = parsed["city"].to_shared_string();
app.global::<OtherToolCallbacks>().set_isp(isp);
app.global::<OtherToolCallbacks>().set_country(country);
app.global::<OtherToolCallbacks>().set_state(region);
app.global::<OtherToolCallbacks>().set_city(city);
}
}
}
pub fn update() {
println!("Checking for Updates!");
let version: &str = env!("CARGO_PKG_VERSION");
println!("{}", version);
}
-7
View File
@@ -1,7 +0,0 @@
pub fn username_search() {
println!("Test");
}
pub fn lastname_search() {
println!("Test");
}
-16
View File
@@ -1,15 +1,5 @@
import { AboutSlint, VerticalBox, GridBox, Button, LineEdit, HorizontalBox, TextEdit, SpinBox } from "std-widgets.slint";
export global ComputerModuleCallbacks {
pure callback CFE();
pure callback CLU();
pure callback LAPS();
pure callback RTC();
pure callback RRTC();
pure callback SLP();
in-out property <string> computername;
}
export component ComputerModules inherits Window {
VerticalLayout {
spacing: 5px;
@@ -25,9 +15,6 @@ export component ComputerModules inherits Window {
LineEdit {
height: 35px;
edited(text) => {
ComputerModuleCallbacks.computername = self.text;
}
}
}
@@ -37,9 +24,6 @@ export component ComputerModules inherits Window {
spacing: 5px;
Button {
text: "Computer File Explorer";
clicked => {
ComputerModuleCallbacks.CFE();
}
}
Button {
-7
View File
@@ -1,9 +1,5 @@
import { AboutSlint, VerticalBox, GridBox, Button, LineEdit, HorizontalBox, TextEdit, SpinBox, StandardListView } from "std-widgets.slint";
export global UserModuleCallbacks {
pure callback searchUser();
}
export component UserModules inherits Window {
VerticalLayout {
spacing: 5px;
@@ -33,9 +29,6 @@ export component UserModules inherits Window {
Button {
text: "Search";
primary: true;
clicked => {
UserModuleCallbacks.searchUser();
}
}
}
+2 -4
View File
@@ -4,14 +4,12 @@ import { ComputerModules } from "pages/computermodules.slint";
import { OtherTools } from "pages/othertools.slint";
import { SettingsModules } from "pages/settings.slint";
import { SideBar } from "sidebar.slint";
export { UserModuleCallbacks } from "pages/usermodules.slint";
export { ComputerModuleCallbacks } from "pages/computermodules.slint";
export { OtherToolCallbacks } from "pages/othertools.slint";
export component MainWindow inherits Window {
title: @tr("CHAMP");
preferred-width: 584px;
preferred-height: 561px;
preferred-width: 984px;
preferred-height: 661px;
HorizontalLayout {
side-bar := SideBar {
title: @tr("Menu");