Skip to content

A WiFi security auditing software

feat: version 0.5.0 (#34)

Martin Olivieradc347ee997a
diff --git a/.fpm b/.fpm
index ac7a23b..1f6ef46 100644
--- a/.fpm
+++ b/.fpm
@@ -1,7 +1,7 @@
-s dir ./target/release/airgorah ./icons/app_icon.png package README.md LICENSE
--name airgorah
--license MIT
---version 0.4.2
+--version 0.5.0
--description "A WiFi auditing software that can perform deauth attacks and passwords cracking"
--url "https://github.com/martin-olivier/airgorah"
--maintainer "Martin Olivier <[email protected]>"
diff --git a/.github/assets/illustration.png b/.github/assets/illustration.png
old mode 100644
new mode 100755
index da62655..6290ccd
Binary files a/.github/assets/illustration.png and b/.github/assets/illustration.png differ
diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml
index 62ab830..df22b53 100644
--- a/.github/workflows/CI.yml
+++ b/.github/workflows/CI.yml
@@ -64,6 +64,16 @@ jobs:
steps:
- uses: actions/checkout@v3
+ - uses: actions/cache@v3
+ with:
+ path: |
+ ~/.cargo/bin/
+ ~/.cargo/registry/index/
+ ~/.cargo/registry/cache/
+ ~/.cargo/git/db/
+ target/
+ key: linux_${{ matrix.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
+ restore-keys: linux_${{ matrix.arch }}-cargo-
- name: Install dependencies
run: >
@@ -121,7 +131,7 @@ jobs:
run: >
fpm -t pacman -p airgorah_${{ matrix.arch }}.pkg.tar.zst --architecture native
--depends polkit
- --depends "gtk4 (>= 4.6.0)"
+ --depends gtk4
--depends dbus
--depends wireshark-cli
--depends iproute2
@@ -134,21 +144,25 @@ jobs:
path: ./airgorah_${{ matrix.arch }}.pkg.tar.zst
if-no-files-found: error
- - name: Name packages for release
+ - name: Get release version
+ id: 'tag'
+ if: github.event_name == 'release'
+ run: echo "tag=${{ github.ref_name }}" | sed 's/v//' >> $GITHUB_OUTPUT
+
+ - name: Rename packages
if: github.event_name == 'release'
run: |
- echo "RELEASE_VERSION=${{ github.ref_name }}" | sed 's/v//' >> $GITHUB_ENV
- cp ./airgorah_${{ matrix.arch }}.deb ./airgorah_$RELEASE_VERSION_${{ matrix.arch }}.deb
- cp ./airgorah_${{ matrix.arch }}.rpm ./airgorah_$RELEASE_VERSION_${{ matrix.arch }}.rpm
- cp ./airgorah_${{ matrix.arch }}.pkg.tar.zst ./airgorah_$RELEASE_VERSION_${{ matrix.arch }}.pkg.tar.zst
+ cp ./airgorah_${{ matrix.arch }}.deb ./airgorah_${{ steps.tag.outputs.tag }}_${{ matrix.arch }}.deb
+ cp ./airgorah_${{ matrix.arch }}.rpm ./airgorah_${{ steps.tag.outputs.tag }}_${{ matrix.arch }}.rpm
+ cp ./airgorah_${{ matrix.arch }}.pkg.tar.zst ./airgorah_${{ steps.tag.outputs.tag }}_${{ matrix.arch }}.pkg.tar.zst
- name: Upload packages
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: |
- ./airgorah_$RELEASE_VERSION_${{ matrix.arch }}.deb
- ./airgorah_$RELEASE_VERSION_${{ matrix.arch }}.rpm
- ./airgorah_$RELEASE_VERSION_${{ matrix.arch }}.pkg.tar.zst
+ ./airgorah_${{ steps.tag.outputs.tag }}_${{ matrix.arch }}.deb
+ ./airgorah_${{ steps.tag.outputs.tag }}_${{ matrix.arch }}.rpm
+ ./airgorah_${{ steps.tag.outputs.tag }}_${{ matrix.arch }}.pkg.tar.zst
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/Cargo.lock b/Cargo.lock
index 17bcf8b..895e1af 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -19,7 +19,7 @@ dependencies = [
[[package]]
name = "airgorah"
-version = "0.4.2"
+version = "0.5.0"
dependencies = [
"csv",
"ctrlc",
@@ -32,7 +32,7 @@ dependencies = [
"serde",
"serde_json",
"sudo",
- "toml 0.8.0",
+ "toml 0.8.1",
"ureq",
"which",
]
@@ -495,9 +495,9 @@ dependencies = [
[[package]]
name = "gtk4"
-version = "0.7.2"
+version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3b095b26f2a2df70be1805d3590eeb9d7a05ecb5be9649b82defc72dc56228c"
+checksum = "5aeb51aa3e9728575a053e1f43543cd9992ac2477e1b186ad824fd4adfb70842"
dependencies = [
"cairo-rs",
"field-offset",
@@ -1120,14 +1120,14 @@ dependencies = [
[[package]]
name = "toml"
-version = "0.8.0"
+version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c226a7bba6d859b63c92c4b4fe69c5b6b72d0cb897dbc8e6012298e6154cb56e"
+checksum = "1bc1433177506450fe920e46a4f9812d0c211f5dd556da10e731a0a3dfa151f0"
dependencies = [
"serde",
"serde_spanned",
"toml_datetime 0.6.3",
- "toml_edit 0.20.0",
+ "toml_edit 0.20.1",
]
[[package]]
@@ -1158,9 +1158,9 @@ dependencies = [
[[package]]
name = "toml_edit"
-version = "0.20.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ff63e60a958cefbb518ae1fd6566af80d9d4be430a33f3723dfc47d1d411d95"
+checksum = "ca676d9ba1a322c1b64eb8045a5ec5c0cfb0c9d08e15e9ff622589ad5221c8fe"
dependencies = [
"indexmap 2.0.0",
"serde",
diff --git a/Cargo.toml b/Cargo.toml
index eb180bc..d9969df 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "airgorah"
-version = "0.4.2"
+version = "0.5.0"
edition = "2021"
license = "MIT"
description = "A WiFi auditing software that can perform deauth attacks and passwords cracking"
@@ -13,11 +13,11 @@ readme = "README.md"
exclude = ["/.github", "/package"]
[dependencies]
-gtk4 = { version = "0.7.2", features = ["v4_6"] }
+gtk4 = { version = "0.7.3", features = ["v4_6"] }
glib = "0.18.2"
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.107"
-toml = "0.8.0"
+toml = "0.8.1"
csv = "1.2.2"
sudo = "0.6.0"
ctrlc = "3.4.1"
diff --git a/README.md b/README.md
index 37adebc..1701e55 100644
--- a/README.md
+++ b/README.md
@@ -4,18 +4,25 @@
</a>
</h1>
-<h4 align="center">A WiFi auditing software that can perform deauth attacks and passwords cracking</h4>
+<p align="center">
+ <span>A WiFi auditing software that can perform deauth attacks and passwords cracking</span>
+</p>
+
+<p align="center">
+ <a href="#installation">Installation</a>
+ &nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
+ <a href="#usage">Usage</a>
+ &nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
+ <a href="#contributing">Contributing</a>
+</p>
<p align="center">
- <a href="https://github.com/martin-olivier/airgorah/releases/tag/v0.4.2">
- <img src="https://img.shields.io/badge/Release-v0.4.2-blue.svg" alt="version"/>
+ <a href="https://github.com/martin-olivier/airgorah/releases/tag/v0.5.0">
+ <img src="https://img.shields.io/badge/Release-v0.5.0-blue.svg" alt="version"/>
</a>
<a href="https://github.com/martin-olivier/airgorah/blob/main/LICENSE">
<img src="https://img.shields.io/badge/License-MIT-darkgreen.svg" alt="license"/>
</a>
- <a href="https://www.rust-lang.org/">
- <img src="https://img.shields.io/badge/Language-Rust-orange.svg" alt="lang"/>
- </a>
<a href="https://github.com/martin-olivier/airgorah/actions/workflows/CI.yml">
<img src="https://github.com/martin-olivier/airgorah/actions/workflows/CI.yml/badge.svg" alt="ci"/>
</a>
@@ -52,7 +59,7 @@ You will also need a wireless network card that supports `monitor mode` and `pac
The installation instructions are available [here](https://github.com/martin-olivier/airgorah/wiki/Installation).
-## Documentation
+## Usage
The documentation about the usage of the application is available [here](https://github.com/martin-olivier/airgorah/wiki/Usage).
@@ -60,7 +67,7 @@ The documentation about the usage of the application is available [here](https:/
This project is released under [MIT](LICENSE) license.
-## Community
+## Contributing
If you have any question about the usage of the application, do not hesitate to open a [discussion](https://github.com/martin-olivier/airgorah/discussions)
diff --git a/icons/app_icon.png b/icons/app_icon.png
index 07177ed..e68eb2c 100644
Binary files a/icons/app_icon.png and b/icons/app_icon.png differ
diff --git a/src/error.rs b/src/error.rs
index 706e81e..a7510b2 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -5,8 +5,6 @@ pub struct Error {
impl Error {
pub fn new(message: &str) -> Self {
- log::error!("{}", message.to_lowercase());
-
Self {
message: message.to_string(),
}
diff --git a/src/frontend/connections/app.rs b/src/frontend/connections/app.rs
index d4bed67..4e12d18 100755
--- a/src/frontend/connections/app.rs
+++ b/src/frontend/connections/app.rs
@@ -92,6 +92,123 @@ fn connect_settings_button(app_data: Rc<AppData>) {
}));
}
+fn connect_hopping_button(app_data: Rc<AppData>) {
+ app_data
+ .app_gui
+ .hopping_but
+ .connect_clicked(clone!(@strong app_data => move |_| {
+ app_data.app_gui.channel_filter_entry.set_text("");
+ }));
+}
+
+fn connect_focus_button(app_data: Rc<AppData>) {
+ app_data
+ .app_gui
+ .focus_but
+ .connect_clicked(clone!(@strong app_data => move |_| {
+ if let Some((_, iter)) = app_data.app_gui.aps_view.selection().selected() {
+ let channel = list_store_get!(app_data.app_gui.aps_model, &iter, 3, i32);
+ app_data.app_gui.channel_filter_entry.set_text(&channel.to_string());
+ }
+ }));
+}
+
+fn connect_previous_button(app_data: Rc<AppData>) {
+ app_data
+ .app_gui
+ .previous_but
+ .connect_clicked(clone!(@strong app_data => move |_| {
+ let iter = match app_data.app_gui.aps_view.selection().selected() {
+ Some((_, iter)) => iter,
+ None => return,
+ };
+
+ let prev_iter = iter;
+ if !app_data.app_gui.aps_model.iter_previous(&prev_iter) {
+ return;
+ }
+
+ let path = app_data.app_gui.aps_model.path(&prev_iter);
+ app_data.app_gui.aps_view.selection().select_iter(&prev_iter);
+ app_data.app_gui.aps_view.scroll_to_cell(Some(&path), None, false, 0.0, 0.0);
+ app_data.app_gui.cli_model.clear();
+
+ app_data.app_gui.focus_but.set_sensitive(true);
+ app_data.app_gui.deauth_but.set_sensitive(true);
+ }));
+}
+
+fn connect_next_button(app_data: Rc<AppData>) {
+ app_data
+ .app_gui
+ .next_but
+ .connect_clicked(clone!(@strong app_data => move |_| {
+ let iter = match app_data.app_gui.aps_view.selection().selected() {
+ Some((_, iter)) => iter,
+ None => return,
+ };
+
+ let next_iter = iter;
+ if !app_data.app_gui.aps_model.iter_next(&next_iter) {
+ return;
+ }
+
+ let path = app_data.app_gui.aps_model.path(&next_iter);
+ app_data.app_gui.aps_view.selection().select_iter(&next_iter);
+ app_data.app_gui.aps_view.scroll_to_cell(Some(&path), None, false, 0.0, 0.0);
+ app_data.app_gui.cli_model.clear();
+
+ app_data.app_gui.focus_but.set_sensitive(true);
+ app_data.app_gui.deauth_but.set_sensitive(true);
+ }));
+}
+
+fn connect_top_button(app_data: Rc<AppData>) {
+ app_data
+ .app_gui
+ .top_but
+ .connect_clicked(clone!(@strong app_data => move |_| {
+ let first_iter = match app_data.app_gui.aps_model.iter_first() {
+ Some(iter) => iter,
+ None => return,
+ };
+
+ let path = app_data.app_gui.aps_model.path(&first_iter);
+ app_data.app_gui.aps_view.selection().select_iter(&first_iter);
+ app_data.app_gui.aps_view.scroll_to_cell(Some(&path), None, false, 0.0, 0.0);
+ app_data.app_gui.cli_model.clear();
+
+ app_data.app_gui.focus_but.set_sensitive(true);
+ app_data.app_gui.deauth_but.set_sensitive(true);
+ }));
+}
+
+fn connect_bottom_button(app_data: Rc<AppData>) {
+ app_data
+ .app_gui
+ .bottom_but
+ .connect_clicked(clone!(@strong app_data => move |_| {
+ let iter = match app_data.app_gui.aps_model.iter_first() {
+ Some(iter) => iter,
+ None => return,
+ };
+
+ let mut last_iter = iter;
+
+ while app_data.app_gui.aps_model.iter_next(&iter) {
+ last_iter = iter;
+ }
+
+ let path = app_data.app_gui.aps_model.path(&last_iter);
+ app_data.app_gui.aps_view.selection().select_iter(&last_iter);
+ app_data.app_gui.aps_view.scroll_to_cell(Some(&path), None, false, 0.0, 0.0);
+ app_data.app_gui.cli_model.clear();
+
+ app_data.app_gui.focus_but.set_sensitive(true);
+ app_data.app_gui.deauth_but.set_sensitive(true);
+ }));
+}
+
fn start_app_refresh(app_data: Rc<AppData>) {
glib::timeout_add_local(
Duration::from_millis(100),
@@ -103,11 +220,9 @@ fn start_app_refresh(app_data: Rc<AppData>) {
match attack_pool.contains_key(&bssid) {
true => {
- app_data.app_gui.deauth_but.set_label("Stop Attack");
app_data.app_gui.deauth_but.set_icon(globals::STOP_ICON);
}
false => {
- app_data.app_gui.deauth_but.set_label("Deauth Attack");
app_data.app_gui.deauth_but.set_icon(globals::DEAUTH_ICON);
}
}
@@ -118,19 +233,28 @@ fn start_app_refresh(app_data: Rc<AppData>) {
}
}
None => {
- app_data.app_gui.deauth_but.set_label("Deauth Attack");
app_data.app_gui.deauth_but.set_icon(globals::DEAUTH_ICON);
}
};
match backend::get_aps().is_empty() {
true => {
- app_data.app_gui.clear_but.set_sensitive(false);
+ app_data.app_gui.restart_but.set_sensitive(false);
app_data.app_gui.export_but.set_sensitive(false);
+ app_data.app_gui.report_but.set_sensitive(false);
+ app_data.app_gui.top_but.set_sensitive(false);
+ app_data.app_gui.bottom_but.set_sensitive(false);
+ app_data.app_gui.previous_but.set_sensitive(false);
+ app_data.app_gui.next_but.set_sensitive(false);
}
false => {
- app_data.app_gui.clear_but.set_sensitive(true);
+ app_data.app_gui.restart_but.set_sensitive(true);
app_data.app_gui.export_but.set_sensitive(true);
+ app_data.app_gui.report_but.set_sensitive(true);
+ app_data.app_gui.top_but.set_sensitive(true);
+ app_data.app_gui.bottom_but.set_sensitive(true);
+ app_data.app_gui.previous_but.set_sensitive(true);
+ app_data.app_gui.next_but.set_sensitive(true);
}
}
@@ -220,6 +344,10 @@ fn start_app_refresh(app_data: Rc<AppData>) {
(5, &background_color.to_str()),
],
);
+
+ if app_data.deauth_gui.window.is_visible() && list_store_find(app_data.deauth_gui.store.as_ref(), 1, cli.mac.as_str()).is_none() {
+ app_data.deauth_gui.store.set(&app_data.deauth_gui.store.append(), &[(0, &false), (1, &cli.mac)]);
+ }
}
}
@@ -368,10 +496,17 @@ pub fn connect(app_data: Rc<AppData>) {
connect_decrypt_button(app_data.clone());
connect_settings_button(app_data.clone());
+ connect_previous_button(app_data.clone());
+ connect_next_button(app_data.clone());
+ connect_top_button(app_data.clone());
+ connect_bottom_button(app_data.clone());
+
start_app_refresh(app_data.clone());
start_handshake_refresh();
start_update_checker();
+ connect_hopping_button(app_data.clone());
+ connect_focus_button(app_data.clone());
connect_deauth_button(app_data.clone());
connect_capture_button(app_data);
}
diff --git a/src/frontend/connections/scan.rs b/src/frontend/connections/scan.rs
index 19c992f..632037b 100644
--- a/src/frontend/connections/scan.rs
+++ b/src/frontend/connections/scan.rs
@@ -1,10 +1,13 @@
use crate::backend;
use crate::frontend::interfaces::*;
use crate::frontend::*;
+use crate::types::*;
use glib::clone;
use gtk4::prelude::*;
use gtk4::*;
+use std::fs::File;
+use std::io::Write;
use std::rc::Rc;
fn run_scan(app_data: &AppData) {
@@ -77,10 +80,10 @@ fn connect_scan_button(app_data: Rc<AppData>) {
);
}
-fn connect_clear_button(app_data: Rc<AppData>) {
+fn connect_restart_button(app_data: Rc<AppData>) {
app_data
.app_gui
- .clear_but
+ .restart_but
.connect_clicked(clone!(@strong app_data => move |this| {
backend::stop_scan_process().ok();
backend::get_aps().clear();
@@ -89,14 +92,12 @@ fn connect_clear_button(app_data: Rc<AppData>) {
app_data.app_gui.cli_model.clear();
this.set_sensitive(false);
- app_data
- .app_gui
- .scan_but
- .set_icon_name("media-playback-start-symbolic");
+
+ run_scan(&app_data);
}));
}
-fn connect_save_button(app_data: Rc<AppData>) {
+fn connect_export_button(app_data: Rc<AppData>) {
app_data
.app_gui
.export_but
@@ -150,6 +151,41 @@ fn connect_save_button(app_data: Rc<AppData>) {
}));
}
+fn connect_report_button(app_data: Rc<AppData>) {
+ app_data
+ .app_gui
+ .report_but
+ .connect_clicked(clone!(@strong app_data => move |_| {
+ if backend::get_aps().is_empty() {
+ return;
+ }
+
+ let aps = backend::get_aps().values().cloned().collect::<Vec<AP>>();
+
+ let json_data = serde_json::to_string::<Vec<AP>>(&aps).unwrap();
+
+ let file_chooser_dialog = Rc::new(FileChooserDialog::new(
+ Some("Save capture report"),
+ Some(&app_data.app_gui.window),
+ FileChooserAction::Save,
+ &[("Save", ResponseType::Accept)],
+ ));
+
+ file_chooser_dialog.set_current_name("report.json");
+ file_chooser_dialog.run_async(move |this, response| {
+ if response == ResponseType::Accept {
+ let gio_file = match this.file() {
+ Some(file) => file,
+ None => return,
+ };
+ let mut file = File::create(gio_file.path().unwrap()).unwrap();
+ file.write_all(json_data.as_bytes()).unwrap();
+ }
+ this.close();
+ });
+ }));
+}
+
fn connect_ghz_2_4_button(app_data: Rc<AppData>) {
app_data
.app_gui
@@ -244,9 +280,11 @@ fn connect_cursor_changed(app_data: Rc<AppData>) {
.connect_cursor_changed(clone!(@strong app_data => move |this| {
match this.selection().selected().is_some() {
true => {
+ app_data.app_gui.focus_but.set_sensitive(true);
app_data.app_gui.deauth_but.set_sensitive(true);
}
false => {
+ app_data.app_gui.focus_but.set_sensitive(false);
app_data.app_gui.deauth_but.set_sensitive(false);
app_data.app_gui.capture_but.set_sensitive(false);
}
@@ -257,8 +295,9 @@ fn connect_cursor_changed(app_data: Rc<AppData>) {
pub fn connect(app_data: Rc<AppData>) {
connect_scan_button(app_data.clone());
- connect_clear_button(app_data.clone());
- connect_save_button(app_data.clone());
+ connect_restart_button(app_data.clone());
+ connect_export_button(app_data.clone());
+ connect_report_button(app_data.clone());
connect_ghz_2_4_button(app_data.clone());
connect_ghz_5_button(app_data.clone());
diff --git a/src/frontend/interfaces/app.rs b/src/frontend/interfaces/app.rs
index 2991cc1..bd6fb76 100755
--- a/src/frontend/interfaces/app.rs
+++ b/src/frontend/interfaces/app.rs
@@ -33,15 +33,89 @@ fn build_settings_button() -> Button {
.build()
}
-pub fn build_header_bar() -> HeaderBar {
- HeaderBar::builder().show_title_buttons(true).build()
+fn build_scan_button() -> Button {
+ Button::builder()
+ .icon_name("media-playback-start-symbolic")
+ .tooltip_text("Start / Pause the scan")
+ .build()
+}
+
+fn build_restart_button() -> Button {
+ Button::builder()
+ .icon_name("view-refresh-symbolic")
+ .tooltip_text("Clear results and restarts the scan")
+ .sensitive(false)
+ .build()
+}
+
+fn build_export_button() -> Button {
+ Button::builder()
+ .icon_name("media-floppy-symbolic")
+ .tooltip_text("Save captured packets as .cap file")
+ .sensitive(false)
+ .build()
+}
+
+fn build_report_button() -> Button {
+ Button::builder()
+ .icon_name("text-x-generic-symbolic")
+ .tooltip_text("Save captured data as .json file")
+ .sensitive(false)
+ .build()
+}
+
+fn build_hopping_button() -> Button {
+ Button::builder()
+ .icon_name("edit-select-all-symbolic")
+ .tooltip_text("Hop on all channels of the selected bands")
+ .build()
+}
+
+fn build_focus_button() -> Button {
+ Button::builder()
+ .icon_name("edit-select-symbolic")
+ .tooltip_text("Focus the channel of the selected access point")
+ .sensitive(false)
+ .build()
+}
+
+fn build_previous_but() -> Button {
+ Button::builder()
+ .icon_name("go-up-symbolic")
+ .tooltip_text("Previous access point")
+ .sensitive(false)
+ .build()
+}
+
+fn build_next_but() -> Button {
+ Button::builder()
+ .icon_name("go-down-symbolic")
+ .tooltip_text("Next access point")
+ .sensitive(false)
+ .build()
+}
+
+fn build_top_but() -> Button {
+ Button::builder()
+ .icon_name("go-top-symbolic")
+ .tooltip_text("First access point")
+ .sensitive(false)
+ .build()
+}
+
+fn build_bottom_but() -> Button {
+ Button::builder()
+ .icon_name("go-bottom-symbolic")
+ .tooltip_text("Last access point")
+ .sensitive(false)
+ .build()
}
fn build_window(app: &Application) -> ApplicationWindow {
let window = ApplicationWindow::builder()
.application(app)
- .title("Airgorah")
- .default_width(1300)
+ .title("")
+ .default_width(1240)
.default_height(620)
.build();
@@ -195,112 +269,62 @@ pub struct AppGui {
pub ghz_5_but: CheckButton,
pub channel_filter_entry: Entry,
pub scan_but: Button,
- pub clear_but: Button,
+ pub restart_but: Button,
pub export_but: Button,
- pub deauth_but: IconTextButton,
- pub capture_but: IconTextButton,
+ pub report_but: Button,
+ pub previous_but: Button,
+ pub next_but: Button,
+ pub top_but: Button,
+ pub bottom_but: Button,
+ pub hopping_but: Button,
+ pub focus_but: Button,
+ pub deauth_but: IconButton,
+ pub capture_but: IconButton,
}
impl AppGui {
pub fn new(app: &Application) -> Self {
let window = build_window(app);
- let header_bar = build_header_bar();
+ let header_bar = HeaderBar::new();
window.set_titlebar(Some(&header_bar));
+ let scan_but = build_scan_button();
+ let restart_but = build_restart_button();
+ let export_but = build_export_button();
+ let report_but = build_report_button();
+
+ let hopping_but = build_hopping_button();
+ let focus_but = build_focus_button();
+
+ let previous_but = build_previous_but();
+ let next_but = build_next_but();
+ let top_but = build_top_but();
+ let bottom_but = build_bottom_but();
+
let about_button = build_about_button();
- let update_button = build_update_button();
let decrypt_button = build_decrypt_button();
let settings_button = build_settings_button();
-
- header_bar.pack_start(&about_button);
- header_bar.pack_start(&decrypt_button);
- header_bar.pack_start(&settings_button);
- header_bar.pack_start(&update_button);
+ let update_button = build_update_button();
update_button.hide();
- // Left View (Access Points and Clients)
-
- let aps_model = build_aps_model();
- let aps_view = build_aps_view();
- let aps_scroll = build_aps_scroll();
-
- aps_scroll.set_child(Some(&aps_view));
- aps_view.set_model(Some(&aps_model));
-
- let cli_model = build_cli_model();
- let cli_view = build_cli_view();
- let cli_scroll = build_cli_scroll();
-
- cli_scroll.set_child(Some(&cli_view));
- cli_view.set_model(Some(&cli_model));
-
- // Scan, Stop and Save Buttons
-
- let scan_but = Button::builder()
- .icon_name("media-playback-start-symbolic")
- .tooltip_text("Start / Pause the scan")
- .build();
-
- let clear_but = Button::builder()
- .icon_name("edit-delete-symbolic")
- .sensitive(false)
- .tooltip_text("Stop the scan and clear results")
- .build();
-
- let export_but = Button::builder()
- .icon_name("media-floppy-symbolic")
- .tooltip_text("Save the capture")
- .build();
-
- let top_but_box = CenterBox::new();
- top_but_box.set_margin_start(10);
- top_but_box.set_margin_end(10);
- top_but_box.set_margin_top(10);
- top_but_box.set_start_widget(Some(&scan_but));
- top_but_box.set_center_widget(Some(&clear_but));
- top_but_box.set_end_widget(Some(&export_but));
-
// Interface Display
let iface_ico = Image::from_icon_name("network-wired");
let iface_label = Label::new(Some("None"));
-
- let iface_box = Box::new(Orientation::Horizontal, 6);
- iface_box.append(&iface_ico);
- iface_box.append(&iface_label);
-
- iface_box.set_margin_top(4);
- iface_box.set_margin_start(6);
- iface_box.set_margin_end(6);
- iface_box.set_margin_bottom(4);
-
- let iface_frame = Frame::new(None);
- iface_frame.set_tooltip_text(Some("Wireless interface used for scans and attacks"));
- iface_frame.set_child(Some(&iface_box));
+ iface_label.set_tooltip_text(Some("Wireless interface used for scans and attacks"));
// Scan filters
let ghz_2_4_but = CheckButton::builder().active(true).label("2.4 GHz").build();
let ghz_5_but = CheckButton::builder().active(false).label("5 GHz").build();
- let but_box = Box::new(Orientation::Horizontal, 10);
- but_box.append(&ghz_2_4_but);
- but_box.append(&ghz_5_but);
-
- but_box.set_margin_start(6);
- but_box.set_margin_end(6);
- but_box.set_margin_bottom(4);
-
- let band_frame = Frame::new(Some("Band"));
- band_frame.set_child(Some(&but_box));
+ // Channel
let channel_filter_entry = Entry::builder()
- .placeholder_text("ex: 1,6,11")
- .margin_start(4)
- .margin_end(4)
- .margin_bottom(4)
+ .placeholder_text("Channel (ex: 1,6,11)")
+ .hexpand(true)
.build();
let css_provider = CssProvider::new();
@@ -319,39 +343,72 @@ impl AppGui {
let style_context = channel_filter_entry.style_context();
style_context.add_provider(&css_provider, gtk4::STYLE_PROVIDER_PRIORITY_APPLICATION);
- let channel_frame = Frame::new(Some("Channel"));
- channel_frame.set_child(Some(&channel_filter_entry));
-
- let separator = Separator::new(Orientation::Vertical);
- separator.set_vexpand(true);
- separator.set_opacity(0.0);
+ // Actions
- let deauth_but = IconTextButton::new(globals::DEAUTH_ICON, "Deauth Attack");
+ let deauth_but = IconButton::new(globals::DEAUTH_ICON);
deauth_but.set_tooltip_text(Some(
"Perform (or stop) a deauth attack on the selected access point",
));
deauth_but.set_sensitive(false);
- let capture_but = IconTextButton::new(globals::CAPTURE_ICON, "Decrypt Handshake");
+ let capture_but = IconButton::new(globals::CAPTURE_ICON);
capture_but.set_tooltip_text(Some(
"Decrypt a handshake captured on the selected access point",
));
capture_but.set_sensitive(false);
- capture_but.set_margin_bottom(10);
- let scan_box = Box::new(Orientation::Vertical, 10);
- scan_box.append(&iface_frame);
- scan_box.append(&band_frame);
- scan_box.append(&channel_frame);
- scan_box.append(&top_but_box);
- scan_box.append(&separator);
- scan_box.append(&deauth_but.handle);
- scan_box.append(&capture_but.handle);
+ // Header Bar
+
+ header_bar.pack_start(&scan_but);
+ header_bar.pack_start(&restart_but);
+ header_bar.pack_start(&export_but);
+ header_bar.pack_start(&report_but);
+
+ header_bar.pack_start(&Separator::new(Orientation::Vertical));
+
+ header_bar.pack_start(&previous_but);
+ header_bar.pack_start(&next_but);
+ header_bar.pack_start(&top_but);
+ header_bar.pack_start(&bottom_but);
- scan_box.set_hexpand(false);
+ header_bar.pack_start(&Separator::new(Orientation::Vertical));
- scan_box.set_margin_top(10);
- scan_box.set_margin_end(10);
+ header_bar.pack_start(&deauth_but.handle);
+ header_bar.pack_start(&capture_but.handle);
+
+ header_bar.pack_start(&Separator::new(Orientation::Vertical));
+
+ header_bar.pack_start(&decrypt_button);
+ header_bar.pack_start(&settings_button);
+ header_bar.pack_start(&about_button);
+ header_bar.pack_start(&update_button);
+
+ header_bar.pack_end(&iface_label);
+ header_bar.pack_end(&iface_ico);
+
+ header_bar.pack_end(&ghz_5_but);
+ header_bar.pack_end(&ghz_2_4_but);
+
+ header_bar.pack_end(&channel_filter_entry);
+
+ header_bar.pack_end(&hopping_but);
+ header_bar.pack_end(&focus_but);
+
+ // Left View (Access Points and Clients)
+
+ let aps_model = build_aps_model();
+ let aps_view = build_aps_view();
+ let aps_scroll = build_aps_scroll();
+
+ aps_scroll.set_child(Some(&aps_view));
+ aps_view.set_model(Some(&aps_model));
+
+ let cli_model = build_cli_model();
+ let cli_view = build_cli_view();
+ let cli_scroll = build_cli_scroll();
+
+ cli_scroll.set_child(Some(&cli_view));
+ cli_view.set_model(Some(&cli_model));
// Set main window child
@@ -360,11 +417,7 @@ impl AppGui {
panned.set_start_child(Some(&aps_scroll));
panned.set_end_child(Some(&cli_scroll));
- let main_box = Box::new(Orientation::Horizontal, 10);
- main_box.append(&panned);
- main_box.append(&scan_box);
-
- window.set_child(Some(&main_box));
+ window.set_child(Some(&panned));
Self {
// Header bar
@@ -383,8 +436,15 @@ impl AppGui {
ghz_5_but,
channel_filter_entry,
scan_but,
- clear_but,
+ restart_but,
export_but,
+ report_but,
+ previous_but,
+ next_but,
+ top_but,
+ bottom_but,
+ hopping_but,
+ focus_but,
deauth_but,
capture_but,
}
diff --git a/src/frontend/interfaces/deauth.rs b/src/frontend/interfaces/deauth.rs
index 42722c2..f47f15e 100755
--- a/src/frontend/interfaces/deauth.rs
+++ b/src/frontend/interfaces/deauth.rs
@@ -22,7 +22,7 @@ impl DeauthGui {
.title("Deauth")
.hide_on_close(true)
.default_width(300)
- .default_height(340)
+ .default_height(400)
.resizable(false)
.transient_for(parent)
.modal(true)
@@ -31,6 +31,9 @@ impl DeauthGui {
let aireplay_but = ToggleButton::with_label("aireplay-ng");
let mdk4_but = ToggleButton::with_label("mdk4");
+ aireplay_but.set_hexpand(true);
+ mdk4_but.set_hexpand(true);
+
aireplay_but.set_active(true);
mdk4_but.set_group(Some(&aireplay_but));
@@ -38,8 +41,12 @@ impl DeauthGui {
soft_box.append(&aireplay_but);
soft_box.append(&mdk4_but);
- let soft_box_center = CenterBox::new();
- soft_box_center.set_center_widget(Some(&soft_box));
+ soft_box.set_margin_start(10);
+ soft_box.set_margin_end(10);
+ soft_box.set_margin_bottom(10);
+
+ let backend_frame = Frame::new(Some("Backend"));
+ backend_frame.set_child(Some(&soft_box));
let all_cli_but = CheckButton::with_label("Deauth all clients");
let sel_cli_but = CheckButton::with_label("Deauth selected clients");
@@ -87,7 +94,7 @@ impl DeauthGui {
let attack_but = Button::with_label("Deauth");
let main_box = Box::new(Orientation::Vertical, 10);
- main_box.append(&soft_box_center);
+ main_box.append(&backend_frame);
main_box.append(&deauth_frame);
main_box.append(&attack_but);
diff --git a/src/frontend/widgets/dialog.rs b/src/frontend/widgets/dialog.rs
index a929628..4052f9f 100644
--- a/src/frontend/widgets/dialog.rs
+++ b/src/frontend/widgets/dialog.rs
@@ -4,10 +4,10 @@ use gtk4::*;
pub struct ErrorDialog;
impl ErrorDialog {
- pub fn spawn(parent: &impl IsA<Window>, title: &str, content: &str) {
+ pub fn spawn(parent: &impl IsA<Window>, title: &str, message: &str) {
let dialog = MessageDialog::builder()
.text(title)
- .secondary_text(content)
+ .secondary_text(message)
.decorated(true)
.message_type(MessageType::Error)
.buttons(ButtonsType::Close)
@@ -15,6 +15,8 @@ impl ErrorDialog {
.transient_for(parent)
.build();
+ log::error!("{}", message.to_lowercase());
+
dialog.connect_response(move |this, _| {
this.close();
});
@@ -36,6 +38,8 @@ impl PanicDialog {
.transient_for(parent)
.build();
+ log::error!("{}", message.to_lowercase());
+
dialog.connect_response(move |this, _| {
this.close();
std::process::exit(1);
diff --git a/src/globals.rs b/src/globals.rs
index a3af350..b8f5871 100644
--- a/src/globals.rs
+++ b/src/globals.rs
@@ -7,7 +7,7 @@ use std::sync::Mutex;
use std::thread::JoinHandle;
pub static APP_ID: &str = "com.molivier.airgorah";
-pub static VERSION: &str = "v0.4.2";
+pub static VERSION: &str = "v0.5.0";
pub static LIVE_SCAN_PATH: &str = "/tmp/airgorah_live_scan";
pub static OLD_SCAN_PATH: &str = "/tmp/airgorah_old_scan";