A WiFi security auditing software
feat: fourth beta version of the application (#24)
Martin Olivier96696e1e1f68
diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.ymlindex b32fc37..511c436 100644--- a/.github/workflows/CI.yml+++ b/.github/workflows/CI.yml@@ -6,31 +6,33 @@ on:- mainpaths:- src/*- - .github/workflows/CI.yml+ - icons/*+ - package/*+ - .github/workflows/*.yml- Cargo.tomlpull_request:branches:- mainpaths:- src/*- - .github/workflows/CI.yml+ - icons/*+ - package/*+ - .github/workflows/*.yml- Cargo.toml--defaults:- run:- shell: bash+ release:+ types: [published]jobs:- conventional_commits:- name: conventional commits- runs-on: ubuntu-22.04+ commits:+ name: commits+ runs-on: ubuntu-lateststeps:- uses: actions/checkout@v3- - uses: webiny/[email protected]+ - uses: webiny/[email protected]linter:name: linter- runs-on: ubuntu-22.04+ runs-on: ubuntu-lateststeps:- uses: actions/checkout@v3@@ -44,26 +46,35 @@ jobs:- name: Formatrun: cargo fmt --all -- --check- ci:+ build:+ name: ubuntu-latest+ runs-on: ubuntu-latestneeds: linter- strategy:- fail-fast: false- matrix:- build: ['', --release]- include:- - build: ''- profile: debug- - build: --release- profile: release-- name: ${{ matrix.profile }} build- runs-on: ubuntu-22.04+ permissions: write-allsteps:- uses: actions/checkout@v3- - name: Install dependencies+ - name: Install build dependenciesrun: sudo apt update && sudo apt install -y libgtk-4-dev libglib2.0-dev+ - name: Install cargo-deb+ run: cargo install cargo-deb+- name: Build project- run: cargo build ${{ matrix.build }}+ run: cargo deb++ - name: Save artifact+ uses: actions/upload-artifact@v3+ with:+ name: airgorah_amd64.deb+ path: ./target/debian/*.deb+ if-no-files-found: error++ - name: Upload binary+ if: github.event_name == 'release'+ uses: softprops/action-gh-release@v1+ with:+ files: ./target/debian/*.deb+ env:+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymldeleted file mode 100644index aa81faa..0000000--- a/.github/workflows/release.yml+++ /dev/null@@ -1,31 +0,0 @@-name: "Release"--on:- push:- tags:- - "v*"--jobs:- release:- name: "Deploy"- runs-on: "ubuntu-22.04"- permissions: write-all-- steps:- - uses: actions/checkout@v3-- - name: Install dependencies- run: sudo apt update && sudo apt install -y libgtk-4-dev libglib2.0-dev-- - name: Install cargo-deb- run: cargo install cargo-deb-- - name: Build project- run: cargo deb-- - name: Deploy release- uses: softprops/action-gh-release@v1- with:- files: ./target/debian/*.deb- env:- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}diff --git a/Cargo.lock b/Cargo.lockindex b204795..1acde0a 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -10,16 +10,16 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"[[package]]name = "aho-corasick"-version = "0.7.20"+version = "1.0.5"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac"+checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783"dependencies = ["memchr",][[package]]name = "airgorah"-version = "0.3.0"+version = "0.4.0"dependencies = ["csv","ctrlc",@@ -30,7 +30,7 @@ dependencies = ["serde","serde_json","sudo",- "toml 0.7.3",+ "toml 0.7.6","ureq","which",]@@ -49,9 +49,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"[[package]]name = "base64"-version = "0.13.1"+version = "0.21.3"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"+checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53"[[package]]name = "bitflags"@@ -59,6 +59,12 @@ version = "1.3.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"+[[package]]+name = "bitflags"+version = "2.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635"+[[package]]name = "bumpalo"version = "3.12.0"@@ -67,11 +73,11 @@ checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535"[[package]]name = "cairo-rs"-version = "0.17.0"+version = "0.18.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "a8af54f5d48af1226928adc1f57edd22f5df1349e7da1fc96ae15cf43db0e871"+checksum = "d859b656775a6b1dd078d3e5924884e6ea88aa649a7fdde03d5b2ec56ffcc10b"dependencies = [- "bitflags",+ "bitflags 2.4.0","cairo-sys-rs","glib","libc",@@ -81,9 +87,9 @@ dependencies = [[[package]]name = "cairo-sys-rs"-version = "0.17.0"+version = "0.18.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "f55382a01d30e5e53f185eee269124f5e21ab526595b872751278dfbb463594e"+checksum = "bd4d115132e01c0165e3bf5f56aedee8980b0b96ede4eb000b693c05a8adb8ff"dependencies = ["glib-sys","libc",@@ -122,9 +128,9 @@ dependencies = [[[package]]name = "csv"-version = "1.2.1"+version = "1.2.2"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "0b015497079b9a9d69c02ad25de6c0a6edef051ea6360a327d0bd05802ef64ad"+checksum = "626ae34994d3d8d668f4269922248239db4ae42d538b14c398b74a52208e8086"dependencies = ["csv-core","itoa",@@ -143,9 +149,9 @@ dependencies = [[[package]]name = "ctrlc"-version = "3.2.5"+version = "3.4.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "bbcf33c2a618cbe41ee43ae6e9f2e48368cd9f9db2896f10167d8d762679f639"+checksum = "2a011bbe2c35ce9c1f143b7af6f94f29a167beb4cd1d29e6740ce836f723120e"dependencies = ["nix","windows-sys",@@ -157,6 +163,12 @@ version = "1.8.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91"+[[package]]+name = "equivalent"+version = "1.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"+[[package]]name = "field-offset"version = "0.3.4"@@ -251,11 +263,10 @@ dependencies = [[[package]]name = "gdk-pixbuf"-version = "0.17.0"+version = "0.18.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "b023fbe0c6b407bd3d9805d107d9800da3829dc5a676653210f1d5f16d7f59bf"+checksum = "bbc9c2ed73a81d556b65d08879ba4ee58808a6b1927ce915262185d6d547c6f3"dependencies = [- "bitflags","gdk-pixbuf-sys","gio","glib",@@ -265,9 +276,9 @@ dependencies = [[[package]]name = "gdk-pixbuf-sys"-version = "0.17.0"+version = "0.18.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "7b41bd2b44ed49d99277d3925652a163038bd5ed943ec9809338ffb2f4391e3b"+checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7"dependencies = ["gio-sys","glib-sys",@@ -278,11 +289,10 @@ dependencies = [[[package]]name = "gdk4"-version = "0.6.2"+version = "0.7.2"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "e5042053ee765aeef08d9d7e3f0f1e36a4d37f1659b3f93ad3d6997515dbb64a"+checksum = "6982d9815ed6ac95b0467b189e81f29dea26d08a732926ec113e65744ed3f96c"dependencies = [- "bitflags","cairo-rs","gdk-pixbuf","gdk4-sys",@@ -294,9 +304,9 @@ dependencies = [[[package]]name = "gdk4-sys"-version = "0.6.2"+version = "0.7.2"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "14f0fb00507af1e9299681dd09965f720e2b5ea95536d49a5681e8994ef10c7a"+checksum = "dbab43f332a3cf1df9974da690b5bb0e26720ed09a228178ce52175372dcfef0"dependencies = ["cairo-sys-rs","gdk-pixbuf-sys",@@ -311,11 +321,10 @@ dependencies = [[[package]]name = "gio"-version = "0.17.2"+version = "0.18.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "65acfc24267314eee46f49e0a531e08fd6c3025040d1cfb4a7cd8e41c5e06116"+checksum = "7884cba6b1c5db1607d970cadf44b14a43913d42bc68766eea6a5e2fe0891524"dependencies = [- "bitflags","futures-channel","futures-core","futures-io",@@ -331,9 +340,9 @@ dependencies = [[[package]]name = "gio-sys"-version = "0.17.0"+version = "0.18.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "b5d3076ecb86c8c3a672c9843d6232b3a344fb81d304d0ba1ac64b23343efa46"+checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2"dependencies = ["glib-sys","gobject-sys",@@ -344,11 +353,11 @@ dependencies = [[[package]]name = "glib"-version = "0.17.5"+version = "0.18.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "cfb53061756195d76969292c2d2e329e01259276524a9bae6c9b73af62854773"+checksum = "331156127e8166dd815cf8d2db3a5beb492610c716c03ee6db4f2d07092af0a7"dependencies = [- "bitflags",+ "bitflags 2.4.0","futures-channel","futures-core","futures-executor",@@ -367,24 +376,23 @@ dependencies = [[[package]]name = "glib-macros"-version = "0.17.6"+version = "0.18.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "32e73a9790e243f6d55d8e302426419f6084a1de7a84cd07f7268300408a19de"+checksum = "179643c50bf28d20d2f6eacd2531a88f2f5d9747dd0b86b8af1e8bb5dd0de3c0"dependencies = [- "anyhow","heck","proc-macro-crate","proc-macro-error","proc-macro2","quote",- "syn 1.0.108",+ "syn 2.0.29",][[package]]name = "glib-sys"-version = "0.17.2"+version = "0.18.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "72a0985cf568e18cf63b443c9a14f4bdaa947fed7437476000dba84926a20b25"+checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898"dependencies = ["libc","system-deps",@@ -392,9 +400,9 @@ dependencies = [[[package]]name = "gobject-sys"-version = "0.17.0"+version = "0.18.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "9a0155d388840c77d61b033b66ef4f9bc7f4133d83df83572d6b4fb234a3be7d"+checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44"dependencies = ["glib-sys","libc",@@ -403,9 +411,9 @@ dependencies = [[[package]]name = "graphene-rs"-version = "0.17.1"+version = "0.18.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "21cf11565bb0e4dfc2f99d4775b6c329f0d40a2cff9c0066214d31a0e1b46256"+checksum = "3b2228cda1505613a7a956cca69076892cfbda84fc2b7a62b94a41a272c0c401"dependencies = ["glib","graphene-sys",@@ -414,9 +422,9 @@ dependencies = [[[package]]name = "graphene-sys"-version = "0.17.0"+version = "0.18.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "cf80a4849a8d9565410a8fec6fc3678e9c617f4ac7be182ca55ab75016e07af9"+checksum = "cc4144cee8fc8788f2a9b73dc5f1d4e1189d1f95305c4cb7bd9c1af1cfa31f59"dependencies = ["glib-sys","libc",@@ -426,11 +434,10 @@ dependencies = [[[package]]name = "gsk4"-version = "0.6.2"+version = "0.7.2"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "2fa9cd285a72a95124b65c069a9cb1b8fb8e310be71783404c39fccf3bf7774c"+checksum = "cc25855255120f294d874acd6eaf4fbed7ce1cdc550e2d8415ea57fafbe816d5"dependencies = [- "bitflags","cairo-rs","gdk4","glib",@@ -442,9 +449,9 @@ dependencies = [[[package]]name = "gsk4-sys"-version = "0.6.2"+version = "0.7.2"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "5a445ae1e50cbf181a1d5c61b920a7e7e8657b96e0ecdbbf8911a86fad462a32"+checksum = "e1ecf3a63bf1223d68f80f72cc896c4d8c80482fbce1c9a12c66d3de7290ee46"dependencies = ["cairo-sys-rs","gdk4-sys",@@ -458,11 +465,10 @@ dependencies = [[[package]]name = "gtk4"-version = "0.6.4"+version = "0.7.2"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "1e30e124b5a605f6f5513db13958bfcd51d746607b20bc7bb718b33e303274ed"+checksum = "a3b095b26f2a2df70be1805d3590eeb9d7a05ecb5be9649b82defc72dc56228c"dependencies = [- "bitflags","cairo-rs","field-offset","futures-channel",@@ -475,15 +481,14 @@ dependencies = ["gtk4-macros","gtk4-sys","libc",- "once_cell","pango",][[package]]name = "gtk4-macros"-version = "0.6.0"+version = "0.7.2"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "db4676c4f90d8b010e88cb4558f61f47d76d6f6b8e6f6b89e62640f443907f61"+checksum = "d57ec49cf9b657f69a05bca8027cff0a8dfd0c49e812be026fc7311f2163832f"dependencies = ["anyhow","proc-macro-crate",@@ -495,9 +500,9 @@ dependencies = [[[package]]name = "gtk4-sys"-version = "0.6.2"+version = "0.7.2"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "65463dc801460e498d5e7ffa6e9ae2cfbed7d05fabd1ca5a8d024adbc89eeda6"+checksum = "7b0bdde87c50317b4f355bcbb4a9c2c414ece1b7c824fb4ad4ba8f3bdb2c6603"dependencies = ["cairo-sys-rs","gdk-pixbuf-sys",@@ -518,6 +523,12 @@ version = "0.12.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"+[[package]]+name = "hashbrown"+version = "0.14.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a"+[[package]]name = "heck"version = "0.4.1"@@ -541,7 +552,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399"dependencies = ["autocfg",- "hashbrown",+ "hashbrown 0.12.3",+]++[[package]]+name = "indexmap"+version = "2.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d"+dependencies = [+ "equivalent",+ "hashbrown 0.14.0",][[package]]@@ -610,7 +631,7 @@ version = "0.26.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a"dependencies = [- "bitflags",+ "bitflags 1.3.2","cfg-if","libc","static_assertions",@@ -633,11 +654,10 @@ checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"[[package]]name = "pango"-version = "0.17.0"+version = "0.18.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "243c048be90312220fb3bd578176eed8290568274a93c95040289d39349384bc"+checksum = "06a9e54b831d033206160096b825f2070cf5fda7e35167b1c01e9e774f9202d1"dependencies = [- "bitflags","gio","glib","libc",@@ -647,9 +667,9 @@ dependencies = [[[package]]name = "pango-sys"-version = "0.17.0"+version = "0.18.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "4293d0f0b5525eb5c24734d30b0ed02cd02aa734f216883f376b54de49625de8"+checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5"dependencies = ["glib-sys","gobject-sys",@@ -727,27 +747,39 @@ dependencies = [[[package]]name = "proc-macro2"-version = "1.0.53"+version = "1.0.66"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "ba466839c78239c09faf015484e5cc04860f88242cff4d03eb038f04b4699b73"+checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9"dependencies = ["unicode-ident",][[package]]name = "quote"-version = "1.0.26"+version = "1.0.33"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc"+checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"dependencies = ["proc-macro2",][[package]]name = "regex"-version = "1.7.3"+version = "1.9.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29"+dependencies = [+ "aho-corasick",+ "memchr",+ "regex-automata",+ "regex-syntax",+]++[[package]]+name = "regex-automata"+version = "0.3.7"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d"+checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629"dependencies = ["aho-corasick","memchr",@@ -756,9 +788,9 @@ dependencies = [[[package]]name = "regex-syntax"-version = "0.6.29"+version = "0.7.5"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"+checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"[[package]]name = "ring"@@ -786,14 +818,34 @@ dependencies = [[[package]]name = "rustls"-version = "0.20.8"+version = "0.21.7"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f"+checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8"dependencies = ["log","ring",+ "rustls-webpki 0.101.4","sct",- "webpki",+]++[[package]]+name = "rustls-webpki"+version = "0.100.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e98ff011474fa39949b7e5c0428f9b4937eda7da7848bbb947786b7be0b27dab"+dependencies = [+ "ring",+ "untrusted",+]++[[package]]+name = "rustls-webpki"+version = "0.101.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d"+dependencies = [+ "ring",+ "untrusted",][[package]]@@ -832,29 +884,29 @@ dependencies = [[[package]]name = "serde"-version = "1.0.158"+version = "1.0.188"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "771d4d9c4163ee138805e12c710dd365e4f44be8be0503cb1bb9eb989425d9c9"+checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e"dependencies = ["serde_derive",][[package]]name = "serde_derive"-version = "1.0.158"+version = "1.0.188"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "e801c1712f48475582b7696ac71e0ca34ebb30e09338425384269d9717c62cad"+checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2"dependencies = ["proc-macro2","quote",- "syn 2.0.8",+ "syn 2.0.29",][[package]]name = "serde_json"-version = "1.0.94"+version = "1.0.105"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea"+checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360"dependencies = ["itoa","ryu",@@ -863,9 +915,9 @@ dependencies = [[[package]]name = "serde_spanned"-version = "0.6.1"+version = "0.6.3"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4"+checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186"dependencies = ["serde",]@@ -920,9 +972,9 @@ dependencies = [[[package]]name = "syn"-version = "2.0.8"+version = "2.0.29"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "bcc02725fd69ab9f26eab07fad303e2497fad6fb9eba4f96c4d1687bdf704ad9"+checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a"dependencies = ["proc-macro2","quote",@@ -988,14 +1040,14 @@ dependencies = [[[package]]name = "toml"-version = "0.7.3"+version = "0.7.6"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "b403acf6f2bb0859c93c7f0d967cb4a75a7ac552100f9322faf64dc047669b21"+checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542"dependencies = ["serde","serde_spanned",- "toml_datetime 0.6.1",- "toml_edit 0.19.8",+ "toml_datetime 0.6.3",+ "toml_edit 0.19.14",][[package]]@@ -1006,9 +1058,9 @@ checksum = "4553f467ac8e3d374bc9a177a26801e5d0f9b211aa1673fb137a403afd1c9cf5"[[package]]name = "toml_datetime"-version = "0.6.1"+version = "0.6.3"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622"+checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b"dependencies = ["serde",]@@ -1019,21 +1071,21 @@ version = "0.18.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "56c59d8dd7d0dcbc6428bf7aa2f0e823e26e43b3c9aca15bbc9475d23e5fa12b"dependencies = [- "indexmap",+ "indexmap 1.9.2","nom8","toml_datetime 0.5.1",][[package]]name = "toml_edit"-version = "0.19.8"+version = "0.19.14"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13"+checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a"dependencies = [- "indexmap",+ "indexmap 2.0.0","serde","serde_spanned",- "toml_datetime 0.6.1",+ "toml_datetime 0.6.3","winnow",]@@ -1072,19 +1124,19 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"[[package]]name = "ureq"-version = "2.6.2"+version = "2.7.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "338b31dd1314f68f3aabf3ed57ab922df95ffcd902476ca7ba3c4ce7b908c46d"+checksum = "0b11c96ac7ee530603dcdf68ed1557050f374ce55a5a07193ebf8cbc9f8927e9"dependencies = ["base64","flate2","log","once_cell","rustls",+ "rustls-webpki 0.100.2","serde","serde_json","url",- "webpki","webpki-roots",]@@ -1175,23 +1227,13 @@ dependencies = ["wasm-bindgen",]-[[package]]-name = "webpki"-version = "0.22.0"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd"-dependencies = [- "ring",- "untrusted",-]-[[package]]name = "webpki-roots"-version = "0.22.6"+version = "0.23.1"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87"+checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338"dependencies = [- "webpki",+ "rustls-webpki 0.100.2",][[package]]@@ -1229,18 +1271,18 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"[[package]]name = "windows-sys"-version = "0.45.0"+version = "0.48.0"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"+checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"dependencies = ["windows-targets",][[package]]name = "windows-targets"-version = "0.42.1"+version = "0.48.5"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7"+checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"dependencies = ["windows_aarch64_gnullvm","windows_aarch64_msvc",@@ -1253,51 +1295,51 @@ dependencies = [[[package]]name = "windows_aarch64_gnullvm"-version = "0.42.1"+version = "0.48.5"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608"+checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"[[package]]name = "windows_aarch64_msvc"-version = "0.42.1"+version = "0.48.5"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7"+checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"[[package]]name = "windows_i686_gnu"-version = "0.42.1"+version = "0.48.5"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640"+checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"[[package]]name = "windows_i686_msvc"-version = "0.42.1"+version = "0.48.5"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605"+checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"[[package]]name = "windows_x86_64_gnu"-version = "0.42.1"+version = "0.48.5"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45"+checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"[[package]]name = "windows_x86_64_gnullvm"-version = "0.42.1"+version = "0.48.5"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463"+checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"[[package]]name = "windows_x86_64_msvc"-version = "0.42.1"+version = "0.48.5"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"+checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"[[package]]name = "winnow"-version = "0.4.1"+version = "0.5.15"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28"+checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc"dependencies = ["memchr",]diff --git a/Cargo.toml b/Cargo.tomlold mode 100755new mode 100644index 6887644..ebf9239--- a/Cargo.toml+++ b/Cargo.toml@@ -1,6 +1,6 @@[package]name = "airgorah"-version = "0.3.0"+version = "0.4.0"edition = "2021"license = "MIT"description = "A WiFi auditing software that can perform deauth attacks and passwords cracking"@@ -10,20 +10,20 @@ repository = "https://github.com/martin-olivier/airgorah"documentation = "https://github.com/martin-olivier/airgorah"keywords = ["networking", "pentest", "aircrack-ng", "gui", "linux"]readme = "README.md"-exclude = ["/.github", "/package", "/docs"]+exclude = ["/.github", "/package"][dependencies]-gtk4 = { version = "0.6.4", features = ["v4_6"] }-glib = "0.17.5"-serde = { version = "1.0.158", features = ["derive"] }-serde_json = "1.0.94"-toml = "0.7.3"-csv = "1.2.1"+gtk4 = { version = "0.7.2", features = ["v4_6"] }+glib = "0.18.1"+serde = { version = "1.0.188", features = ["derive"] }+serde_json = "1.0.105"+toml = "0.7.6"+csv = "1.2.2"sudo = "0.6.0"-ctrlc = "3.2.5"-regex = "1.7.3"+ctrlc = "3.4.0"+regex = "1.9.4"lazy_static = "1.4.0"-ureq = { version = "2.6.2", features = ["json"] }+ureq = { version = "2.7.1", features = ["json"] }which = "4.4.0"[package.metadata.deb]@@ -31,7 +31,7 @@ copyright = "2023, Martin Olivier"maintainer = "Martin Olivier <[email protected]>"license-file = ["LICENSE"]extended-description = "A WiFi auditing software that can perform deauth attacks and passwords cracking"-depends = "gnome-terminal, pkexec, libgtk-4-1 (>= 4.6.0), dbus-x11, net-tools, wireless-tools, aircrack-ng (>= 1.6), wireshark-common, macchanger"+depends = "gnome-terminal, pkexec, libgtk-4-1 (>= 4.6.0), dbus-x11, iproute2, iw, aircrack-ng (>= 1.6), mdk4, wireshark-common, macchanger, crunch"priority = "optional"section = "utility"assets = [diff --git a/README.md b/README.mdindex 2674565..5774fe7 100644--- a/README.md+++ b/README.md@@ -7,8 +7,8 @@<h4 align="center">A WiFi auditing software that can perform deauth attacks and passwords cracking</h4><p align="center">- <a href="https://github.com/martin-olivier/airgorah/releases/tag/v0.3.0">- <img src="https://img.shields.io/badge/Version-0.3.0_(beta)-blue.svg" alt="version"/>+ <a href="https://github.com/martin-olivier/airgorah/releases/tag/v0.4.0">+ <img src="https://img.shields.io/badge/Version-0.4.0_(beta)-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"/>@@ -44,10 +44,14 @@ You will also need a wireless network card that supports `monitor mode` and `pacYou can find pre-built releases for `Debian` based distributions [here](https://github.com/martin-olivier/airgorah/releases/latest) (Ubuntu, PopOS, Mint, Kali). You will just need to download the debian package and install it with the following command:```-sudo apt install ~/Downloads/airgorah_0.3.0_amd64.deb+sudo apt install ~/Downloads/airgorah_0.4.0_amd64.deb```-Otherwise, if you'd like to compile from source, you can follow this [guide](docs/build_from_source.md).+Otherwise, if you'd like to compile from source, you can follow this [guide](https://github.com/martin-olivier/airgorah/wiki/Build-from-source).++## Documentation++The documentation of this project are available on the [wiki](https://github.com/martin-olivier/airgorah/wiki)## License@@ -56,10 +60,3 @@ This project is released under [MIT](LICENSE) license.## ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.--## Future--- [ ] Provide usage documentation-- [ ] Improve the code quality and the documentation-- [ ] Provide releases for other linux distributions (Arch, Fedora, ...)-- [ ] Provide releases for other architectures (arm, ...)diff --git a/docs/build_from_source.md b/docs/build_from_source.mddeleted file mode 100644index 3a1e0d5..0000000--- a/docs/build_from_source.md+++ /dev/null@@ -1,32 +0,0 @@-# Build from source--## 1. Install Cargo--To build the project, you will need to install [cargo](https://www.rust-lang.org/tools/install), the rust compiler:--```sh-curl https://sh.rustup.rs -sSf | sh-```--## 2. Install Dependencies--Then, you will need to install `airgorah` dependencies:--### Debian (Ubuntu, PopOS, Mint, Kali)--```sh-sudo apt install dbus-x11 libgtk-4-dev libglib2.0-dev aircrack-ng net-tools wireless-tools gnome-terminal wireshark-common macchanger-```--### Fedora--```sh-sudo dnf install dbus-x11 gtk4-devel glib2-devel aircrack-ng net-tools wireless-tools-1 gnome-terminal wireshark-cli macchanger-```--## 3. Install Airgorah--After those steps, you will be able to:--- [Create a package and install it](packaging.md) (recommended)-- [Build and install from crates.io](installation.md)diff --git a/docs/installation.md b/docs/installation.mddeleted file mode 100644index 131f038..0000000--- a/docs/installation.md+++ /dev/null@@ -1,19 +0,0 @@-# Build and install Airgorah - crates.io--To build and install `airgorah` from crates.io, you can use the following command:--```sh-cargo install airgorah-```--Then, you will be able to run `airgorah` on your computer by typing the following command:--```sh-sudo ~/.cargo/bin/airgorah-```--If you want to uninstall `airgorah` from your computer, enter the following command:--```sh-cargo uninstall airgorah-```diff --git a/docs/packaging.md b/docs/packaging.mddeleted file mode 100644index e1f47ef..0000000--- a/docs/packaging.md+++ /dev/null@@ -1,27 +0,0 @@-# Build and install Airgorah - debian package--First, you will need to clone the project using the following command:--```sh-git clone https://github.com/martin-olivier/airgorah.git-cd airgorah-```--Then, you will be able to create a `debian` package by running the following commands:--```sh-cargo install cargo-deb-cargo deb-```--After those commands, a `.deb` package will be created in the `target/debian` folder. You can install it with the following command:--```sh-sudo apt install <path_to_deb_package>-```--If you want to uninstall `airgorah` from your computer, enter the following command:--```sh-sudo apt remove airgorah-```diff --git a/package/.desktop b/package/.desktopindex 7e0b424..9caaff9 100644--- a/package/.desktop+++ b/package/.desktop@@ -1,6 +1,6 @@[Desktop Entry]Encoding=UTF-8-Version=0.3.0+Version=0.4.0Type=ApplicationTerminal=falseExec=pkexec airgorahdiff --git a/src/backend/app.rs b/src/backend/app.rsindex ddf06b3..b069af0 100755--- a/src/backend/app.rs+++ b/src/backend/app.rs@@ -3,8 +3,6 @@ use crate::error::Error;use crate::globals::*;use crate::types::*;-use std::thread::JoinHandle;-/// Check if the user is root, and if all the dependencies are installedpub fn app_setup() -> Result<(), Error> {app_cleanup();@@ -24,16 +22,18 @@ pub fn app_setup() -> Result<(), Error> {check_dependencies(&["sh","service",+ "ip","iw",- "iwlist","awk","airmon-ng","airodump-ng","aireplay-ng","aircrack-ng",+ "mdk4","gnome-terminal","mergecap","macchanger",+ "crunch",])}@@ -79,20 +79,17 @@ pub fn check_dependencies(deps: &[&str]) -> Result<(), Error> {Ok(())}-/// Spawn a thread that will check if a new version is available-pub fn spawn_update_checker() -> JoinHandle<bool> {- std::thread::spawn(|| {- let url = "https://api.github.com/repos/martin-olivier/airgorah/releases/latest";+/// Check if a new version is available+pub fn check_update(current_version: &str) -> Option<String> {+ let url = "https://api.github.com/repos/martin-olivier/airgorah/releases/latest";- if let Ok(response) = ureq::get(url).call() {- if let Ok(json) = response.into_json::<serde_json::Value>() {- if json["tag_name"] != VERSION {- let new_version = json["tag_name"].as_str().unwrap_or("unknown");- *NEW_VERSION.lock().unwrap() = Some(new_version.to_string());- return true;- }+ if let Ok(response) = ureq::get(url).call() {+ if let Ok(json) = response.into_json::<serde_json::Value>() {+ if json["tag_name"] != current_version {+ let new_version = json["tag_name"].as_str().unwrap_or("unknown").to_owned();+ return Some(new_version);}}- false- })+ }+ None}diff --git a/src/backend/capture.rs b/src/backend/capture.rsindex e544c25..7f17770 100755--- a/src/backend/capture.rs+++ b/src/backend/capture.rs@@ -2,6 +2,7 @@ use super::*;use crate::error::Error;use crate::globals::*;+use regex::Regex;use std::process::Command;/// Update the handshake capture status of all APs@@ -28,6 +29,34 @@ pub fn update_handshakes() -> Result<(), Error> {Ok(())}+pub fn get_handshakes(path: &str) -> Result<Vec<(String, String)>, Error> {+ let capture_output = Command::new("aircrack-ng").args([path]).output()?;++ let stdout = String::from_utf8_lossy(&capture_output.stdout).to_string();+ let re =+ Regex::new(r"(\d+)\s+([\w:]+)\s+([\w\s]*)\s+WPA \((\d+)\s+handshake(?:.*?)\)").unwrap();++ let mut handshakes = vec![];++ for caps in re.captures_iter(&stdout) {+ let bssid = caps[2].to_string();+ let essid = caps[3].trim().to_string();+ let handshake_count = caps[4].to_string();++ if handshake_count.parse::<i32>().unwrap_or(0) > 0 {+ handshakes.push((+ bssid,+ match essid.is_empty() {+ true => "hidden".to_string(),+ false => essid,+ },+ ));+ }+ }++ Ok(handshakes)+}+/// Save the current capture to a filepub fn save_capture(path: &str) -> Result<(), Error> {std::fs::copy(OLD_SCAN_PATH.to_string() + "-01.cap", path)?;diff --git a/src/backend/deauth.rs b/src/backend/deauth.rsindex 29ba171..c9f73d9 100755--- a/src/backend/deauth.rs+++ b/src/backend/deauth.rs@@ -6,7 +6,11 @@ use std::process::{Command, Stdio};use std::sync::MutexGuard;/// Launch a deauth attack on a specific AP-pub fn launch_deauth_attack(ap: AP, specific_clients: Option<Vec<String>>) -> Result<(), Error> {+pub fn launch_deauth_attack(+ ap: AP,+ specific_clients: Option<Vec<String>>,+ software: AttackSoftware,+) -> Result<(), Error> {let iface = match get_iface() {Some(res) => res,None => return Err(Error::new("No interface set")),@@ -18,22 +22,43 @@ pub fn launch_deauth_attack(ap: AP, specific_clients: Option<Vec<String>>) -> ReSome(specific_clients) => {let mut cli_attack_targets = vec![];for cli in specific_clients {+ let (soft, args) = match software {+ AttackSoftware::Aireplay => (+ "aireplay-ng",+ vec!["-0", "0", "-D", "-a", &ap.bssid, "-c", &cli, &iface],+ ),+ AttackSoftware::Mdk4 => (+ "mdk4",+ vec![iface.as_str(), "d", "-B", &ap.bssid, "-S", &cli],+ ),+ };+cli_attack_targets.push((cli.to_owned(),- Command::new("aireplay-ng")- .args(["-0", "0", "-D", "-a", &ap.bssid, "-c", &cli, &iface])+ Command::new(soft)+ .args(args).stdout(Stdio::null()).spawn()?,));}AttackedClients::Selection(cli_attack_targets)}- None => AttackedClients::All(- Command::new("aireplay-ng")- .args(["-0", "0", "-D", "-a", &ap.bssid, &iface])- .stdout(Stdio::null())- .spawn()?,- ),+ None => {+ let (soft, args) = match software {+ AttackSoftware::Aireplay => (+ "aireplay-ng",+ vec!["-0", "0", "-D", "-a", &ap.bssid, &iface],+ ),+ AttackSoftware::Mdk4 => ("mdk4", vec![iface.as_str(), "d", "-B", &ap.bssid]),+ };++ AttackedClients::All(+ Command::new(soft)+ .args(args)+ .stdout(Stdio::null())+ .spawn()?,+ )+ }};attack_pool.insert(ap.bssid.to_string(), (ap, attack_targets));diff --git a/src/backend/decrypt.rs b/src/backend/decrypt.rsindex eb52de4..d4a0cd4 100755--- a/src/backend/decrypt.rs+++ b/src/backend/decrypt.rs@@ -2,16 +2,79 @@ use crate::error::Error;use std::process::{Command, Stdio};+const CRUNCH_LOWERCASE: &str = "abcdefghijklmnopqrstuvwxyz";+const CRUNCH_UPPERCASE: &str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";+const CRUNCH_NUMBERS: &str = "0123456789";+const CRUNCH_SYMBOLS: &str = "!#$%/=?{}[]-*:;";+/// Launch a new terminal window to run aircrack-ng to decrypt a handshake with the specified wordlist-pub fn run_decrypt_process(handshake: &str, wordlist: &str) -> Result<(), Error> {- let cmd = format!("aircrack-ng '{}' -w '{}' ; exec sh", handshake, wordlist);+pub fn run_decrypt_wordlist_process(+ handshake: &str,+ bssid: &str,+ essid: &str,+ wordlist: &str,+) -> Result<(), Error> {+ let cmd = format!(+ "aircrack-ng '{}' -b '{}' -w '{}' ; exec sh",+ handshake, bssid, wordlist+ );++ Command::new("gnome-terminal")+ .stdin(Stdio::piped())+ .args([+ "--hide-menubar",+ "--title",+ &format!("Handshake Decryption ({})", essid),+ "--",+ "sh",+ "-c",+ &cmd,+ ])+ .output()?;++ Ok(())+}++/// Launch a new terminal window to run aircrack-ng to decrypt a handshake using bruteforce+pub fn run_decrypt_bruteforce_process(+ handshake: &str,+ bssid: &str,+ essid: &str,+ low: bool,+ up: bool,+ num: bool,+ sym: bool,+) -> Result<(), Error> {+ let charset = format!(+ "{}{}{}{}",+ match low {+ true => CRUNCH_LOWERCASE,+ false => "",+ },+ match up {+ true => CRUNCH_UPPERCASE,+ false => "",+ },+ match num {+ true => CRUNCH_NUMBERS,+ false => "",+ },+ match sym {+ true => CRUNCH_SYMBOLS,+ false => "",+ },+ );+ let cmd = format!(+ "crunch 8 64 '{}' | aircrack-ng -w - -b '{}' '{}' ; exec sh",+ charset, bssid, handshake+ );Command::new("gnome-terminal").stdin(Stdio::piped()).args(["--hide-menubar","--title",- "Handshake Decryption",+ &format!("Handshake Decryption ({})", essid),"--","sh","-c",diff --git a/src/backend/interface.rs b/src/backend/interface.rsindex 3480e71..207b177 100644--- a/src/backend/interface.rs+++ b/src/backend/interface.rs@@ -20,7 +20,17 @@ pub fn get_interfaces() -> Result<Vec<String>, Error> {/// Check if an interface supports 5GHzpub fn is_5ghz_supported(iface: &str) -> Result<bool, Error> {- let check_band_cmd = Command::new("iwlist").args([iface, "freq"]).output()?;+ let phy_path = format!("/sys/class/net/{}/phy80211", iface);++ let phy_link = std::fs::read_link(phy_path)?;+ let phy_name = phy_link+ .file_name()+ .ok_or(Error::new("phy parsing error"))?;+ let phy_name_str = phy_name.to_str().ok_or(Error::new("phy parsing error"))?;++ let check_band_cmd = Command::new("iw")+ .args(["phy", phy_name_str, "info"])+ .output()?;if !check_band_cmd.status.success() {return Err(Error::new("No such interface"));@@ -28,7 +38,7 @@ pub fn is_5ghz_supported(iface: &str) -> Result<bool, Error> {let check_band_output = String::from_utf8(check_band_cmd.stdout)?;- if check_band_output.contains("Channel 36 : 5.18 GHz") {+ if check_band_output.contains("5200 MHz") {return Ok(true);}@@ -60,7 +70,9 @@ pub fn set_mac_address(iface: &str) -> Result<(), Error> {));}- Command::new("ifconfig").args([iface, "down"]).output()?;+ Command::new("ip")+ .args(["link", "set", "dev", iface, "down"])+ .output()?;let success = match get_settings().mac_address.as_str() {"random" => {@@ -78,7 +90,9 @@ pub fn set_mac_address(iface: &str) -> Result<(), Error> {.success(),};- Command::new("ifconfig").args([iface, "up"]).output()?;+ Command::new("ip")+ .args(["link", "set", "dev", iface, "up"])+ .output()?;if !success {return Err(Error::new(diff --git a/src/backend/scan.rs b/src/backend/scan.rsindex 0e42f98..b7c5dcc 100644--- a/src/backend/scan.rs+++ b/src/backend/scan.rs@@ -215,9 +215,17 @@ pub fn get_airodump_data() -> HashMap<String, AP> {let mut essid = result.essid.trim_start().to_string();let mut hidden = false;+ let old_ap_data = glob_aps.get(&bssid);+if essid.is_empty() {hidden = true;essid = format!("[Hidden] (length: {})", result.id_length.trim_start());++ if let Some(old_ap_data) = old_ap_data {+ if !old_ap_data.essid.starts_with("[Hidden] (length:") {+ essid = old_ap_data.essid.clone();+ }+ }}let old_data = aps.insert(@@ -232,12 +240,12 @@ pub fn get_airodump_data() -> HashMap<String, AP> {privacy: result.privacy.trim_start().to_string(),hidden,handshake: {- match glob_aps.get(&bssid) {+ match old_ap_data {Some(ap) => ap.handshake,None => false,}},- saved_handshake: match glob_aps.get(&bssid) {+ saved_handshake: match old_ap_data {Some(ap) => ap.saved_handshake.clone(),None => None,},diff --git a/src/frontend/connections/app.rs b/src/frontend/connections/app.rsindex 42bf492..ea8e85f 100755--- a/src/frontend/connections/app.rs+++ b/src/frontend/connections/app.rs@@ -6,6 +6,7 @@ use crate::list_store_get;use crate::types::*;use glib::clone;+use glib::ControlFlow;use gtk4::gdk_pixbuf::Pixbuf;use gtk4::prelude::*;use gtk4::*;@@ -57,26 +58,6 @@ fn connect_about_button(app_data: Rc<AppData>) {}fn connect_update_button(app_data: Rc<AppData>) {- globals::UPDATE_PROC- .lock()- .unwrap()- .replace(backend::spawn_update_checker());-- glib::timeout_add_local(- Duration::from_millis(1000),- clone!(@strong app_data => move || {- let mut updater = globals::UPDATE_PROC.lock().unwrap();-- if let Some(proc) = updater.as_mut() {- if proc.is_finished() && updater.take().unwrap().join().unwrap_or(false) {- app_data.app_gui.update_button.show();- return glib::Continue(false);- }- }- glib::Continue(true)- }),- );-app_data.app_gui.update_button@@ -111,145 +92,183 @@ fn connect_settings_button(app_data: Rc<AppData>) {}));}-fn connect_app_refresh(app_data: Rc<AppData>) {- glib::timeout_add_local(Duration::from_millis(100), move || {- match app_data.app_gui.aps_view.selection().selected() {- Some((_, iter)) => {- let bssid = list_store_get!(app_data.app_gui.aps_model, &iter, 1, String);- let attack_pool = backend::get_attack_pool();-- 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);+fn start_app_refresh(app_data: Rc<AppData>) {+ glib::timeout_add_local(+ Duration::from_millis(100),+ clone!(@strong app_data => move || {+ match app_data.app_gui.aps_view.selection().selected() {+ Some((_, iter)) => {+ let bssid = list_store_get!(app_data.app_gui.aps_model, &iter, 1, String);+ let attack_pool = backend::get_attack_pool();++ 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);+ }}- false => {- 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()[&bssid].handshake {+ true => app_data.app_gui.capture_but.set_sensitive(true),+ false => app_data.app_gui.capture_but.set_sensitive(false),}}-- match backend::get_aps()[&bssid].handshake {- true => app_data.app_gui.capture_but.set_sensitive(true),- false => app_data.app_gui.capture_but.set_sensitive(false),+ None => {+ app_data.app_gui.deauth_but.set_label("Deauth Attack");+ app_data.app_gui.deauth_but.set_icon(globals::DEAUTH_ICON);}- }- 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.export_but.set_sensitive(false);- }- false => {- app_data.app_gui.clear_but.set_sensitive(true);- app_data.app_gui.export_but.set_sensitive(true);- }- }-- let aps = backend::get_airodump_data();+ };- for (bssid, ap) in aps.iter() {- if !backend::get_settings().display_hidden_ap && ap.hidden {- if let Some(iter) =- list_store_find(app_data.app_gui.aps_model.as_ref(), 1, bssid.as_str())- {- app_data.app_gui.aps_model.remove(&iter);+ match backend::get_aps().is_empty() {+ true => {+ app_data.app_gui.clear_but.set_sensitive(false);+ app_data.app_gui.export_but.set_sensitive(false);+ }+ false => {+ app_data.app_gui.clear_but.set_sensitive(true);+ app_data.app_gui.export_but.set_sensitive(true);}- continue;}- let it = match list_store_find(app_data.app_gui.aps_model.as_ref(), 1, bssid.as_str()) {- Some(it) => it,- None => app_data.app_gui.aps_model.append(),- };-- let background_color = match backend::get_attack_pool().contains_key(bssid) {- true => gdk::RGBA::RED,- false => gdk::RGBA::new(0.0, 0.0, 0.0, 0.0),- };+ let aps = backend::get_airodump_data();- let handshake_status = match ap.handshake {- true => "Captured",- false => "",- };-- app_data.app_gui.aps_model.set(- &it,- &[- (0, &ap.essid),- (1, &ap.bssid),- (2, &ap.band),- (3, &ap.channel.parse::<i32>().unwrap_or(-1)),- (4, &ap.speed.parse::<i32>().unwrap_or(-1)),- (5, &ap.power.parse::<i32>().unwrap_or(-1)),- (6, &ap.privacy),- (7, &(ap.clients.len() as i32)),- (8, &ap.first_time_seen),- (9, &ap.last_time_seen),- (10, &handshake_status),- (11, &background_color.to_str()),- ],- );- }-- if let Some((_, iter)) = app_data.app_gui.aps_view.selection().selected() {- let bssid = list_store_get!(app_data.app_gui.aps_model, &iter, 1, String);- let clients = &aps[&bssid].clients;-- for (_, cli) in clients.iter() {- let it =- match list_store_find(app_data.app_gui.cli_model.as_ref(), 0, cli.mac.as_str())+ for (bssid, ap) in aps.iter() {+ if !backend::get_settings().display_hidden_ap && ap.hidden {+ if let Some(iter) =+ list_store_find(app_data.app_gui.aps_model.as_ref(), 1, bssid.as_str()){- Some(it) => it,- None => app_data.app_gui.cli_model.append(),- };+ app_data.app_gui.aps_model.remove(&iter);+ }+ continue;+ }- let background_color = match backend::get_attack_pool().get(&bssid) {- Some((_, attack_target)) => match &attack_target {- AttackedClients::All(_) => gdk::RGBA::RED,- AttackedClients::Selection(selection) => {- let mut color = gdk::RGBA::new(0.0, 0.0, 0.0, 0.0);+ let it = match list_store_find(app_data.app_gui.aps_model.as_ref(), 1, bssid.as_str()) {+ Some(it) => it,+ None => app_data.app_gui.aps_model.append(),+ };- for (sel, _) in selection.iter() {- if sel == cli.mac.as_str() {- color = gdk::RGBA::RED;- }- }- color- }- },- None => gdk::RGBA::new(0.0, 0.0, 0.0, 0.0),+ let background_color = match backend::get_attack_pool().contains_key(bssid) {+ true => gdk::RGBA::RED,+ false => gdk::RGBA::new(0.0, 0.0, 0.0, 0.0),};- app_data.app_gui.cli_model.set(+ let handshake_status = match ap.handshake {+ true => "Captured",+ false => "",+ };++ app_data.app_gui.aps_model.set(&it,&[- (0, &cli.mac),- (1, &cli.packets.parse::<i32>().unwrap_or(-1)),- (2, &cli.power.parse::<i32>().unwrap_or(-1)),- (3, &cli.first_time_seen),- (4, &cli.last_time_seen),- (5, &background_color.to_str()),+ (0, &ap.essid),+ (1, &ap.bssid),+ (2, &ap.band),+ (3, &ap.channel.parse::<i32>().unwrap_or(-1)),+ (4, &ap.speed.parse::<i32>().unwrap_or(-1)),+ (5, &ap.power.parse::<i32>().unwrap_or(-1)),+ (6, &ap.privacy),+ (7, &(ap.clients.len() as i32)),+ (8, &ap.first_time_seen),+ (9, &ap.last_time_seen),+ (10, &handshake_status),+ (11, &background_color.to_str()),],);}- }- glib::Continue(true)- });+ if let Some((_, iter)) = app_data.app_gui.aps_view.selection().selected() {+ let bssid = list_store_get!(app_data.app_gui.aps_model, &iter, 1, String);+ let clients = &aps[&bssid].clients;++ for (_, cli) in clients.iter() {+ let it =+ match list_store_find(app_data.app_gui.cli_model.as_ref(), 0, cli.mac.as_str())+ {+ Some(it) => it,+ None => app_data.app_gui.cli_model.append(),+ };++ let background_color = match backend::get_attack_pool().get(&bssid) {+ Some((_, attack_target)) => match &attack_target {+ AttackedClients::All(_) => gdk::RGBA::RED,+ AttackedClients::Selection(selection) => {+ let mut color = gdk::RGBA::new(0.0, 0.0, 0.0, 0.0);++ for (sel, _) in selection.iter() {+ if sel == cli.mac.as_str() {+ color = gdk::RGBA::RED;+ }+ }+ color+ }+ },+ None => gdk::RGBA::new(0.0, 0.0, 0.0, 0.0),+ };- glib::timeout_add_local(Duration::from_millis(1500), || {- backend::update_handshakes().ok();+ app_data.app_gui.cli_model.set(+ &it,+ &[+ (0, &cli.mac),+ (1, &cli.packets.parse::<i32>().unwrap_or(-1)),+ (2, &cli.power.parse::<i32>().unwrap_or(-1)),+ (3, &cli.first_time_seen),+ (4, &cli.last_time_seen),+ (5, &background_color.to_str()),+ ],+ );+ }+ }- glib::Continue(true)+ ControlFlow::Continue+ }),+ );++ glib::timeout_add_local(+ Duration::from_millis(1000),+ clone!(@strong app_data => move || {+ let mut updater = globals::UPDATE_PROC.lock().unwrap();++ if let Some(proc) = updater.as_mut() {+ if proc.is_finished() {+ if updater.take().unwrap().join().unwrap_or(false) {+ app_data.app_gui.update_button.show();+ }+ return ControlFlow::Break;+ }+ }+ ControlFlow::Continue+ }),+ );+}++fn start_handshake_refresh() {+ std::thread::spawn(|| loop {+ backend::update_handshakes().ok();+ std::thread::sleep(Duration::from_millis(1500));});}+fn start_update_checker() {+ globals::UPDATE_PROC+ .lock()+ .unwrap()+ .replace(std::thread::spawn(|| {+ let update = backend::check_update(globals::VERSION);++ match update {+ Some(update) => {+ *globals::NEW_VERSION.lock().unwrap() = Some(update);+ true+ }+ None => false,+ }+ }));+}+fn connect_deauth_button(app_data: Rc<AppData>) {app_data.app_gui@@ -296,7 +315,7 @@ fn connect_capture_button(app_data: Rc<AppData>) {}if let Some(ref cap) = ap.saved_handshake {- return app_data.decrypt_gui.show(Some(cap.clone()));+ return app_data.decrypt_gui.show(Some((cap.clone(), bssid)));}let was_scanning = backend::is_scan_process();@@ -333,7 +352,7 @@ fn connect_capture_button(app_data: Rc<AppData>) {}}- app_data.decrypt_gui.show(Some(path))+ app_data.decrypt_gui.show(Some((path, bssid)));}if was_scanning {@@ -349,7 +368,9 @@ pub fn connect(app_data: Rc<AppData>) {connect_decrypt_button(app_data.clone());connect_settings_button(app_data.clone());- connect_app_refresh(app_data.clone());+ start_app_refresh(app_data.clone());+ start_handshake_refresh();+ start_update_checker();connect_deauth_button(app_data.clone());connect_capture_button(app_data);diff --git a/src/frontend/connections/deauth.rs b/src/frontend/connections/deauth.rsindex 9c94d4f..6677182 100755--- a/src/frontend/connections/deauth.rs+++ b/src/frontend/connections/deauth.rs@@ -2,6 +2,7 @@ use crate::backend;use crate::frontend::interfaces::*;use crate::frontend::widgets::*;use crate::list_store_get;+use crate::types::AttackSoftware;use glib::clone;use glib::Value;@@ -85,7 +86,12 @@ fn connect_attack_but(app_data: Rc<AppData>) {let bssid = list_store_get!(app_data.app_gui.aps_model, &iter, 1, String);- backend::launch_deauth_attack(backend::get_aps()[&bssid].clone(), params).unwrap_or_else(|e| {+ let attack_software = match app_data.deauth_gui.aireplay_but.is_active() {+ true => AttackSoftware::Aireplay,+ false => AttackSoftware::Mdk4,+ };++ backend::launch_deauth_attack(backend::get_aps()[&bssid].clone(), params, attack_software).unwrap_or_else(|e| {ErrorDialog::spawn(&app_data.app_gui.window,"Error",diff --git a/src/frontend/connections/decrypt.rs b/src/frontend/connections/decrypt.rsindex 745207f..b42a07f 100755--- a/src/frontend/connections/decrypt.rs+++ b/src/frontend/connections/decrypt.rs@@ -1,12 +1,38 @@use crate::backend;use crate::frontend::interfaces::*;use crate::frontend::widgets::ErrorDialog;+use crate::list_store_get;use glib::clone;use gtk4::prelude::*;use gtk4::*;use std::rc::Rc;+fn update_decrypt_button_status(app_data: Rc<AppData>) {+ if app_data.decrypt_gui.handshake_entry.text_length() == 0 {+ return app_data.decrypt_gui.decrypt_but.set_sensitive(false);+ }++ let stack = app_data.decrypt_gui.stack.visible_child_name().unwrap();++ if stack == "dictionary" {+ if app_data.decrypt_gui.wordlist_entry.text_length() == 0 {+ return app_data.decrypt_gui.decrypt_but.set_sensitive(false);+ }+ } else {+ let low = app_data.decrypt_gui.lowercase_but.is_active();+ let up = app_data.decrypt_gui.uppercase_but.is_active();+ let num = app_data.decrypt_gui.numbers_but.is_active();+ let sym = app_data.decrypt_gui.symbols_but.is_active();++ if !low && !up && !num && !sym {+ return app_data.decrypt_gui.decrypt_but.set_sensitive(false);+ }+ }++ app_data.decrypt_gui.decrypt_but.set_sensitive(true);+}+fn connect_handshake_button(app_data: Rc<AppData>) {app_data.decrypt_gui.handshake_but.connect_clicked(clone!(@strong app_data => move |_| {@@ -19,22 +45,48 @@ fn connect_handshake_button(app_data: Rc<AppData>) {);file_chooser_dialog.run_async(clone!(@strong app_data => move |this, response| {+ this.close();+if response == ResponseType::Accept {let gio_file = match this.file() {Some(file) => file,None => return,};- app_data.decrypt_gui.handshake_entry.set_text(gio_file.path().unwrap().to_str().unwrap());- if app_data.decrypt_gui.wordlist_entry.text_length() > 0 && app_data.decrypt_gui.handshake_entry.text_length() > 0 {- app_data.decrypt_gui.decrypt_but.set_sensitive(true);++ let gio_path = gio_file.path().unwrap();+ let file_path = gio_path.to_str().unwrap();+ let handshakes = backend::get_handshakes(file_path).unwrap_or_default();++ if handshakes.is_empty() {+ return ErrorDialog::spawn(&app_data.decrypt_gui.window, "Invalid capture", &format!("\"{}\" doesn't contain any valid handshake", file_path), false);+ }++ app_data.decrypt_gui.target_model.clear();++ for (bssid, essid) in handshakes.iter() {+ app_data.decrypt_gui.target_model.insert_with_values(None, &[(0, &bssid), (1, &essid)]);}++ app_data.decrypt_gui.target_view.set_active(if !handshakes.is_empty() { Some(0) } else { None });++ app_data.decrypt_gui.handshake_entry.set_text(file_path);++ update_decrypt_button_status(app_data);}- this.close();}));}),);}+fn connect_stack_notify(app_data: Rc<AppData>) {+ app_data+ .decrypt_gui+ .stack+ .connect_visible_child_notify(clone!(@strong app_data => move |_| {+ update_decrypt_button_status(app_data.clone());+ }));+}+fn connect_wordlist_button(app_data: Rc<AppData>) {app_data.decrypt_gui.wordlist_but.connect_clicked(clone!(@strong app_data => move |_| {@@ -46,22 +98,52 @@ fn connect_wordlist_button(app_data: Rc<AppData>) {);file_chooser_dialog.run_async(clone!(@strong app_data => move |this, response| {+ this.close();+if response == ResponseType::Accept {let gio_file = match this.file() {Some(file) => file,None => return,};app_data.decrypt_gui.wordlist_entry.set_text(gio_file.path().unwrap().to_str().unwrap());- if app_data.decrypt_gui.wordlist_entry.text_length() > 0 && app_data.decrypt_gui.handshake_entry.text_length() > 0 {- app_data.decrypt_gui.decrypt_but.set_sensitive(true);- }++ update_decrypt_button_status(app_data);}- this.close();}));}),);}+fn connect_bruteforce_buttons(app_data: Rc<AppData>) {+ app_data+ .decrypt_gui+ .lowercase_but+ .connect_toggled(clone!(@strong app_data => move |_| {+ update_decrypt_button_status(app_data.clone());+ }));++ app_data+ .decrypt_gui+ .uppercase_but+ .connect_toggled(clone!(@strong app_data => move |_| {+ update_decrypt_button_status(app_data.clone());+ }));++ app_data+ .decrypt_gui+ .numbers_but+ .connect_toggled(clone!(@strong app_data => move |_| {+ update_decrypt_button_status(app_data.clone());+ }));++ app_data+ .decrypt_gui+ .symbols_but+ .connect_toggled(clone!(@strong app_data => move |_| {+ update_decrypt_button_status(app_data.clone());+ }));+}+fn connect_decrypt_button(app_data: Rc<AppData>) {app_data.decrypt_gui@@ -70,16 +152,38 @@ fn connect_decrypt_button(app_data: Rc<AppData>) {let handshake_entry = app_data.decrypt_gui.handshake_entry.text();let wordlist_entry = app_data.decrypt_gui.wordlist_entry.text();+ let low = app_data.decrypt_gui.lowercase_but.is_active();+ let up = app_data.decrypt_gui.uppercase_but.is_active();+ let num = app_data.decrypt_gui.numbers_but.is_active();+ let sym = app_data.decrypt_gui.symbols_but.is_active();++ let iter = match app_data.decrypt_gui.target_view.active_iter() {+ Some(iter) => iter,+ None => return,+ };+ let bssid = list_store_get!(app_data.decrypt_gui.target_model, &iter, 0, String);+ let essid = list_store_get!(app_data.decrypt_gui.target_model, &iter, 1, String);++ let stack = app_data.decrypt_gui.stack.visible_child_name().unwrap();+app_data.decrypt_gui.window.close();- backend::run_decrypt_process(&handshake_entry, &wordlist_entry).unwrap_or_else(|e| {- ErrorDialog::spawn(&app_data.app_gui.window, "Failed to run decryption", &e.to_string(), false);- });+ if stack == "dictionary" {+ backend::run_decrypt_wordlist_process(&handshake_entry, &bssid, &essid, &wordlist_entry).unwrap_or_else(|e| {+ ErrorDialog::spawn(&app_data.app_gui.window, "Failed to run decryption", &e.to_string(), false);+ });+ } else {+ backend::run_decrypt_bruteforce_process(&handshake_entry, &bssid, &essid, low, up, num, sym).unwrap_or_else(|e| {+ ErrorDialog::spawn(&app_data.app_gui.window, "Failed to run decryption", &e.to_string(), false);+ });+ }}));}pub fn connect(app_data: Rc<AppData>) {connect_handshake_button(app_data.clone());+ connect_stack_notify(app_data.clone());connect_wordlist_button(app_data.clone());+ connect_bruteforce_buttons(app_data.clone());connect_decrypt_button(app_data);}diff --git a/src/frontend/connections/settings.rs b/src/frontend/connections/settings.rsindex d7f0461..0b039f0 100644--- a/src/frontend/connections/settings.rs+++ b/src/frontend/connections/settings.rs@@ -1,5 +1,6 @@use crate::backend;use crate::frontend::interfaces::*;+use crate::types::Settings;use glib::clone;use gtk4::prelude::*;@@ -56,7 +57,7 @@ fn connect_save_but(app_data: Rc<AppData>) {.settings_gui.save_but.connect_clicked(clone!(@strong app_data => move |_| {- let mut mac_address = crate::types::Settings::default().mac_address;+ let mut mac_address = Settings::default().mac_address;if app_data.settings_gui.random_mac.is_active() {mac_address = "random".to_string()@@ -69,7 +70,7 @@ fn connect_save_but(app_data: Rc<AppData>) {let display_hidden_ap = app_data.settings_gui.display_hidden_ap.is_active();let kill_network_manager = app_data.settings_gui.kill_network_manager.is_active();- let settings = crate::types::Settings {+ let settings = Settings {mac_address,display_hidden_ap,kill_network_manager,diff --git a/src/frontend/interfaces/app.rs b/src/frontend/interfaces/app.rsindex 318d487..7a337b9 100755--- a/src/frontend/interfaces/app.rs+++ b/src/frontend/interfaces/app.rs@@ -22,14 +22,14 @@ fn build_update_button() -> Button {fn build_decrypt_button() -> Button {Button::builder().icon_name("utilities-terminal")- .tooltip_text("Open the handshake decryption panel")+ .tooltip_text("Handshake decryption").build()}fn build_settings_button() -> Button {Button::builder().icon_name("preferences-system")- .tooltip_text("Open the settings panel")+ .tooltip_text("Settings").build()}@@ -41,13 +41,13 @@ fn build_window(app: &Application) -> ApplicationWindow {let window = ApplicationWindow::builder().application(app).title("Airgorah")- .default_width(1320)+ .default_width(1300).default_height(620).build();window.connect_close_request(|_| {backend::app_cleanup();- glib::signal::Inhibit(false)+ glib::Propagation::Proceed});window@@ -73,24 +73,25 @@ fn build_aps_model() -> ListStore {fn build_aps_view() -> TreeView {let view = TreeView::builder().vexpand(true).hexpand(true).build();let columns = [- ("ESSID", 68),+ ("ESSID", 154),("BSSID", 130),- ("Band", 62),- ("Channel", 80),- ("Speed", 68),- ("Power", 68),- ("Encryption", 94),- ("Clients", 72),+ ("Band", 64),+ ("Channel", 86),+ ("Speed", 72),+ ("Power", 72),+ ("Encryption", 106),+ ("Clients", 80),("First time seen", 140),("Last time seen", 140),- ("Handshake", 96),+ ("Handshake", 106),];for (pos, (column_name, column_size)) in columns.into_iter().enumerate() {let column = TreeViewColumn::builder().title(column_name)- .resizable(false)+ .resizable(true).fixed_width(column_size)+ .min_width(column_size).sort_indicator(true).sort_column_id(pos as i32).expand(false)@@ -102,7 +103,6 @@ fn build_aps_view() -> TreeView {column.pack_start(&icon_renderer, false);column.set_expand(true);- column.set_min_width(column_size);}let text_renderer = CellRendererText::new();@@ -147,7 +147,7 @@ fn build_cli_view() -> TreeView {for (pos, column_name) in column_names.into_iter().enumerate() {let column = TreeViewColumn::builder().title(column_name)- .resizable(false)+ .resizable(true).min_width(50).sort_indicator(true).sort_column_id(pos as i32)@@ -349,7 +349,6 @@ impl AppGui {main_box.append(&scan_box);window.set_child(Some(&main_box));- window.show();Self {// Header bardiff --git a/src/frontend/interfaces/deauth.rs b/src/frontend/interfaces/deauth.rsindex bd5fac1..42722c2 100755--- a/src/frontend/interfaces/deauth.rs+++ b/src/frontend/interfaces/deauth.rs@@ -5,6 +5,8 @@ use gtk4::*;pub struct DeauthGui {pub window: Window,+ pub aireplay_but: ToggleButton,+ pub mdk4_but: ToggleButton,pub store: ListStore,pub view: TreeView,pub toggle: CellRendererToggle,@@ -20,12 +22,25 @@ impl DeauthGui {.title("Deauth").hide_on_close(true).default_width(300)- .default_height(300)+ .default_height(340).resizable(false).transient_for(parent).modal(true).build();+ let aireplay_but = ToggleButton::with_label("aireplay-ng");+ let mdk4_but = ToggleButton::with_label("mdk4");++ aireplay_but.set_active(true);+ mdk4_but.set_group(Some(&aireplay_but));++ let soft_box = Box::new(Orientation::Horizontal, 10);+ 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));+let all_cli_but = CheckButton::with_label("Deauth all clients");let sel_cli_but = CheckButton::with_label("Deauth selected clients");@@ -66,13 +81,14 @@ impl DeauthGui {deauth_box.append(&sel_cli_but);deauth_box.append(&scroll);- let frame = Frame::new(None);- frame.set_child(Some(&deauth_box));+ let deauth_frame = Frame::new(None);+ deauth_frame.set_child(Some(&deauth_box));- let attack_but = Button::with_label("Attack");+ let attack_but = Button::with_label("Deauth");let main_box = Box::new(Orientation::Vertical, 10);- main_box.append(&frame);+ main_box.append(&soft_box_center);+ main_box.append(&deauth_frame);main_box.append(&attack_but);main_box.set_margin_bottom(10);@@ -84,6 +100,8 @@ impl DeauthGui {Self {window,+ aireplay_but,+ mdk4_but,store,view,toggle,diff --git a/src/frontend/interfaces/decrypt.rs b/src/frontend/interfaces/decrypt.rsindex b716095..c119349 100644--- a/src/frontend/interfaces/decrypt.rs+++ b/src/frontend/interfaces/decrypt.rs@@ -1,12 +1,41 @@+use crate::backend;+use crate::frontend::ErrorDialog;+use gtk4::prelude::*;use gtk4::*;+fn build_ap_model() -> ListStore {+ ListStore::new(&[glib::Type::STRING, glib::Type::STRING])+}++fn build_ap_view(model: &ListStore) -> ComboBox {+ let text_renderer = CellRendererText::new();++ let icon_renderer = CellRendererPixbuf::new();+ icon_renderer.set_property("icon-name", "network-wireless");++ let combo = ComboBox::with_model(model);+ combo.set_hexpand(true);+ combo.pack_start(&icon_renderer, false);+ combo.pack_start(&text_renderer, false);+ combo.add_attribute(&text_renderer, "text", 1);++ combo+}+pub struct DecryptGui {pub window: Window,pub handshake_but: Button,pub handshake_entry: Entry,+ pub target_model: ListStore,+ pub target_view: ComboBox,+ pub stack: Stack,pub wordlist_but: Button,pub wordlist_entry: Entry,+ pub lowercase_but: CheckButton,+ pub uppercase_but: CheckButton,+ pub numbers_but: CheckButton,+ pub symbols_but: CheckButton,pub decrypt_but: Button,}@@ -22,6 +51,61 @@ impl DecryptGui {.modal(true).build();+ //++ let wordlist_entry = Entry::builder()+ .placeholder_text("ex: rockyou.txt")+ .hexpand(true)+ .editable(false)+ .build();++ let wordlist_but = Button::from_icon_name("edit-find-symbolic");++ let wordlist_frame = Frame::new(Some("Wordlist"));++ let wordlist_box = Box::new(Orientation::Horizontal, 4);+ wordlist_box.set_margin_start(4);+ wordlist_box.set_margin_end(4);+ wordlist_box.set_margin_bottom(4);+ wordlist_box.append(&wordlist_entry);+ wordlist_box.append(&wordlist_but);++ wordlist_frame.set_child(Some(&wordlist_box));++ //++ let lowercase_but = CheckButton::with_label("Lowercase [a-z]");+ let uppercase_but = CheckButton::with_label("Uppercase [A-Z]");+ let numbers_but = CheckButton::with_label("Numbers [0-9]");+ let symbols_but = CheckButton::with_label("Symbols [!-#]");++ //++ let bruteforce_frame = Frame::new(Some("Charset"));++ let bruteforce_box = Box::new(Orientation::Horizontal, 4);+ bruteforce_box.set_margin_start(4);+ bruteforce_box.set_margin_end(4);+ bruteforce_box.set_margin_bottom(4);+ bruteforce_box.append(&lowercase_but);+ bruteforce_box.append(&uppercase_but);+ bruteforce_box.append(&numbers_but);+ bruteforce_box.append(&symbols_but);++ bruteforce_frame.set_child(Some(&bruteforce_box));++ //++ let stack = Stack::new();++ stack.add_titled(&wordlist_frame, Some("dictionary"), "Dictionary");+ stack.add_titled(&bruteforce_frame, Some("bruteforce"), "Bruteforce");++ let stack_switcher = StackSwitcher::new();+ stack_switcher.set_stack(Some(&stack));++ //+let handshake_entry = Entry::builder().placeholder_text("ex: handshake.cap").hexpand(true)@@ -41,24 +125,22 @@ impl DecryptGui {handshake_frame.set_child(Some(&handshake_box));- let wordlist_entry = Entry::builder()- .placeholder_text("ex: rockyou.txt")- .hexpand(true)- .editable(false)- .build();+ //- let wordlist_but = Button::from_icon_name("edit-find-symbolic");+ let target_model = build_ap_model();+ let target_view = build_ap_view(&target_model);- let wordlist_frame = Frame::new(Some("Wordlist"));+ let target_frame = Frame::new(Some("Target"));- let wordlist_box = Box::new(Orientation::Horizontal, 4);- wordlist_box.set_margin_start(4);- wordlist_box.set_margin_end(4);- wordlist_box.set_margin_bottom(4);- wordlist_box.append(&wordlist_entry);- wordlist_box.append(&wordlist_but);+ let target_box = Box::new(Orientation::Horizontal, 4);+ target_box.set_margin_start(4);+ target_box.set_margin_end(4);+ target_box.set_margin_bottom(4);+ target_box.append(&target_view);- wordlist_frame.set_child(Some(&wordlist_box));+ target_frame.set_child(Some(&target_box));++ //let decrypt_but = Button::with_label("Start Decryption");decrypt_but.set_sensitive(false);@@ -69,8 +151,10 @@ impl DecryptGui {vbox.set_margin_start(10);vbox.set_margin_bottom(10);+ vbox.append(&stack_switcher);+ vbox.append(&stack);vbox.append(&handshake_frame);- vbox.append(&wordlist_frame);+ vbox.append(&target_frame);vbox.append(&decrypt_but);window.set_child(Some(&vbox));@@ -79,19 +163,58 @@ impl DecryptGui {window,handshake_but,handshake_entry,+ target_model,+ target_view,+ stack,wordlist_but,wordlist_entry,+ lowercase_but,+ uppercase_but,+ numbers_but,+ symbols_but,decrypt_but,}}- pub fn show(&self, capture_file: Option<String>) {+ pub fn show(&self, capture_and_bssid: Option<(String, String)>) {self.handshake_entry.set_text("");+ self.handshake_entry.set_sensitive(true);+ self.handshake_but.set_sensitive(true);+ self.target_view.set_active(None);+ self.target_model.clear();+ self.target_view.set_sensitive(true);self.wordlist_entry.set_text("");+ self.lowercase_but.set_active(false);+ self.uppercase_but.set_active(false);+ self.numbers_but.set_active(false);+ self.symbols_but.set_active(false);self.decrypt_but.set_sensitive(false);- if let Some(path) = capture_file {+ if let Some((path, bssid)) = capture_and_bssid {self.handshake_entry.set_text(&path);++ let handshakes = backend::get_handshakes(&path).unwrap_or_default();++ if handshakes.is_empty() {+ return ErrorDialog::spawn(+ &self.window,+ "Invalid capture",+ &format!("\"{}\" doesn't contain any valid handshake", path),+ false,+ );+ }++ for (hs_bssid, hs_essid) in handshakes.iter() {+ if hs_bssid == &bssid {+ self.target_model+ .insert_with_values(None, &[(0, &hs_bssid), (1, &hs_essid)]);+ }+ }++ self.handshake_entry.set_sensitive(false);+ self.handshake_but.set_sensitive(false);+ self.target_view.set_active(Some(0));+ self.target_view.set_sensitive(false);}self.window.show();diff --git a/src/frontend/mod.rs b/src/frontend/mod.rsindex bff16f3..5ade316 100644--- a/src/frontend/mod.rs+++ b/src/frontend/mod.rs@@ -6,16 +6,22 @@ use crate::backend;use interfaces::*;use widgets::*;+use gtk4::prelude::*;use gtk4::*;+use std::rc::Rc;pub fn build_ui(app: &Application) {let gui_data = Rc::new(AppData::new(app));+ gui_data.app_gui.window.show();+if let Err(e) = backend::app_setup() {return ErrorDialog::spawn(&gui_data.app_gui.window, "Error", &e.to_string(), true);}+ gui_data.interface_gui.window.show();+connections::connect(gui_data);}diff --git a/src/frontend/widgets/dialog.rs b/src/frontend/widgets/dialog.rsindex 0087c56..bf374af 100644--- a/src/frontend/widgets/dialog.rs+++ b/src/frontend/widgets/dialog.rs@@ -57,13 +57,12 @@ pub struct UpdateDialog;impl UpdateDialog {pub fn spawn(parent: &impl IsA<Window>, version: &str, new_version: &str) {- let link = "https://github.com/martin-olivier/airgorah/releases/latest";let title = format!("Update available ({} -> {})", version, new_version);- let body = format!("\nYou can download it from the following page:\n\n{}", link);+ let link = "https://github.com/martin-olivier/airgorah/releases/latest";let dialog = MessageDialog::builder().text(title)- .secondary_text(body)+ .secondary_text(link).decorated(true).message_type(MessageType::Info).modal(true)diff --git a/src/globals.rs b/src/globals.rsindex 7e9b920..8c11dcf 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.martin-olivier.airgorah";-pub static VERSION: &str = "v0.3.0";+pub static VERSION: &str = "v0.4.0";pub static LIVE_SCAN_PATH: &str = "/tmp/airgorah_live_scan";pub static OLD_SCAN_PATH: &str = "/tmp/airgorah_old_scan";diff --git a/src/types.rs b/src/types.rsindex 4dd1736..58d8020 100644--- a/src/types.rs+++ b/src/types.rs@@ -7,6 +7,11 @@ pub enum AttackedClients {Selection(Vec<(String, Child)>),}+pub enum AttackSoftware {+ Aireplay,+ Mdk4,+}+#[derive(Clone, Debug, Serialize, Deserialize)]pub struct AP {pub essid: String,