Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bcd95f464a | |||
| 313af54dca | |||
| 731db5a504 | |||
| 7a8246905d | |||
| 0c0a081493 | |||
| 6cc8e9bfe3 | |||
| 768ad21449 | |||
| 584be272dd | |||
| e1a5b5c8c1 | |||
| 18ab70c299 | |||
| a703ec3149 | |||
| 1d7764bc80 | |||
| f5ffee38e1 | |||
| 35cdc2620d | |||
| af07944166 | |||
| 7dfdf92d19 | |||
| 8052f1389c | |||
| c956655d7d |
Generated
+1713
-556
File diff suppressed because it is too large
Load Diff
+4
-1
@@ -1,12 +1,15 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "champ"
|
name = "champ"
|
||||||
version = "0.1.0"
|
version = "2025.3.6"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
native-dialog = { version = "0.7.0", features = ["windows_dpi_awareness", "windows_visual_styles"] }
|
||||||
reqwest = { version = "0.12.12", features = ["blocking"] }
|
reqwest = { version = "0.12.12", features = ["blocking"] }
|
||||||
serde_json = "1.0.137"
|
serde_json = "1.0.137"
|
||||||
|
simple-ldap = "2.1.1"
|
||||||
slint = "1.9.2"
|
slint = "1.9.2"
|
||||||
|
tokio = { version = "1.43.0", features = ["full"] }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
slint-build = "1.9.2"
|
slint-build = "1.9.2"
|
||||||
|
|||||||
@@ -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
|
- Useful tools to other departments in an organization like Cyber Security or Incident Response Teams
|
||||||
## Roadmap
|
## Roadmap
|
||||||
|
|
||||||
- Themes
|
- [Roadmap](https://git.racooncity.org/brotoskyj/CHAMP/projects/1)
|
||||||
|
|
||||||
|
|
||||||
## Acknowledgements
|
## Acknowledgements
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 9.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
@@ -1,5 +1,4 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
let config = slint_build::CompilerConfiguration::new()
|
let config = slint_build::CompilerConfiguration::new().with_style("fluent-dark".into());
|
||||||
.with_style("fluent-dark".into());
|
|
||||||
slint_build::compile_with_config("ui/template.slint", config).unwrap();
|
slint_build::compile_with_config("ui/template.slint", config).unwrap();
|
||||||
}
|
}
|
||||||
+27
-31
@@ -1,43 +1,39 @@
|
|||||||
|
use slint::ComponentHandle;
|
||||||
|
use native_dialog::FileDialog;
|
||||||
slint::slint!();
|
slint::slint!();
|
||||||
slint::include_modules!();
|
slint::include_modules!();
|
||||||
use reqwest;
|
pub mod utils;
|
||||||
use serde_json::Value;
|
|
||||||
use slint::ToSharedString;
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
utils::othertoolmodules::update();
|
||||||
let app: MainWindow = MainWindow::new().unwrap();
|
let app: MainWindow = MainWindow::new().unwrap();
|
||||||
let othertoolmodulecallbacks = app.global::<OtherToolCallbacks>();
|
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();
|
||||||
|
}
|
||||||
|
});
|
||||||
othertoolmodulecallbacks.on_ipapi({
|
othertoolmodulecallbacks.on_ipapi({
|
||||||
let app_weak = app.as_weak();
|
let app_weak = app.as_weak();
|
||||||
move || {
|
move || {
|
||||||
let app = app_weak.unwrap();
|
let app: MainWindow = app_weak.unwrap();
|
||||||
let mut url = String::from("http://ip-api.com/json/");
|
utils::othertoolmodules::ip_gelocate_api(app);
|
||||||
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();
|
app.run().unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn geolocateapi(data: &String) -> Value {
|
|
||||||
let parsed: Value = serde_json::from_str(data).unwrap();
|
|
||||||
return (parsed).clone();
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
pub mod computermodules;
|
||||||
|
pub mod othertoolmodules;
|
||||||
|
pub mod usermodules;
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
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");
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
pub fn username_search() {
|
||||||
|
println!("Test");
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn lastname_search() {
|
||||||
|
println!("Test");
|
||||||
|
}
|
||||||
@@ -1,5 +1,15 @@
|
|||||||
import { AboutSlint, VerticalBox, GridBox, Button, LineEdit, HorizontalBox, TextEdit, SpinBox } from "std-widgets.slint";
|
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 {
|
export component ComputerModules inherits Window {
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
spacing: 5px;
|
spacing: 5px;
|
||||||
@@ -15,6 +25,9 @@ export component ComputerModules inherits Window {
|
|||||||
|
|
||||||
LineEdit {
|
LineEdit {
|
||||||
height: 35px;
|
height: 35px;
|
||||||
|
edited(text) => {
|
||||||
|
ComputerModuleCallbacks.computername = self.text;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,6 +37,9 @@ export component ComputerModules inherits Window {
|
|||||||
spacing: 5px;
|
spacing: 5px;
|
||||||
Button {
|
Button {
|
||||||
text: "Computer File Explorer";
|
text: "Computer File Explorer";
|
||||||
|
clicked => {
|
||||||
|
ComputerModuleCallbacks.CFE();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import { AboutSlint, VerticalBox, GridBox, Button, LineEdit, HorizontalBox, TextEdit, SpinBox, StandardListView } from "std-widgets.slint";
|
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 {
|
export component UserModules inherits Window {
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
spacing: 5px;
|
spacing: 5px;
|
||||||
@@ -29,6 +33,9 @@ export component UserModules inherits Window {
|
|||||||
Button {
|
Button {
|
||||||
text: "Search";
|
text: "Search";
|
||||||
primary: true;
|
primary: true;
|
||||||
|
clicked => {
|
||||||
|
UserModuleCallbacks.searchUser();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -4,12 +4,14 @@ import { ComputerModules } from "pages/computermodules.slint";
|
|||||||
import { OtherTools } from "pages/othertools.slint";
|
import { OtherTools } from "pages/othertools.slint";
|
||||||
import { SettingsModules } from "pages/settings.slint";
|
import { SettingsModules } from "pages/settings.slint";
|
||||||
import { SideBar } from "sidebar.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 { OtherToolCallbacks } from "pages/othertools.slint";
|
||||||
|
|
||||||
export component MainWindow inherits Window {
|
export component MainWindow inherits Window {
|
||||||
title: @tr("CHAMP");
|
title: @tr("CHAMP");
|
||||||
preferred-width: 984px;
|
preferred-width: 584px;
|
||||||
preferred-height: 661px;
|
preferred-height: 561px;
|
||||||
HorizontalLayout {
|
HorizontalLayout {
|
||||||
side-bar := SideBar {
|
side-bar := SideBar {
|
||||||
title: @tr("Menu");
|
title: @tr("Menu");
|
||||||
|
|||||||
Reference in New Issue
Block a user