A WiFi security auditing software
feat: second beta version of the application (#3)
Martin Olivier9401e9bbc5f8
diff --git a/.github/assets/illustration.png b/.github/assets/illustration.pngindex a47429b..7b0bc42 100755Binary files a/.github/assets/illustration.png and b/.github/assets/illustration.png differdiff --git a/.github/dependabot.yml b/.github/dependabot.ymlnew file mode 100644index 0000000..251787c--- /dev/null+++ b/.github/dependabot.yml@@ -0,0 +1,8 @@+version: 2+updates:+ - package-ecosystem: "cargo"+ directory: "/"+ schedule:+ interval: "monthly"+ reviewers:+ - "martin-olivier"\ No newline at end of filediff --git a/.gitignore b/.gitignoreindex 45378bd..0d9563d 100644--- a/.gitignore+++ b/.gitignore@@ -9,4 +9,3 @@# Build Folder/target-Cargo.lock\ No newline at end of filediff --git a/Cargo.lock b/Cargo.locknew file mode 100644index 0000000..5974707--- /dev/null+++ b/Cargo.lock@@ -0,0 +1,1250 @@+# This file is automatically @generated by Cargo.+# It is not intended for manual editing.+version = 3++[[package]]+name = "adler"+version = "1.0.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"++[[package]]+name = "aho-corasick"+version = "0.7.20"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac"+dependencies = [+ "memchr",+]++[[package]]+name = "airgorah"+version = "0.2.0"+dependencies = [+ "csv",+ "ctrlc",+ "glib",+ "gtk4",+ "lazy_static",+ "regex",+ "serde",+ "serde_json",+ "sudo",+ "ureq",+ "which",+]++[[package]]+name = "anyhow"+version = "1.0.69"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800"++[[package]]+name = "autocfg"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"++[[package]]+name = "base64"+version = "0.13.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"++[[package]]+name = "bitflags"+version = "1.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"++[[package]]+name = "bumpalo"+version = "3.12.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535"++[[package]]+name = "cairo-rs"+version = "0.17.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a8af54f5d48af1226928adc1f57edd22f5df1349e7da1fc96ae15cf43db0e871"+dependencies = [+ "bitflags",+ "cairo-sys-rs",+ "glib",+ "libc",+ "once_cell",+ "thiserror",+]++[[package]]+name = "cairo-sys-rs"+version = "0.17.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f55382a01d30e5e53f185eee269124f5e21ab526595b872751278dfbb463594e"+dependencies = [+ "glib-sys",+ "libc",+ "system-deps",+]++[[package]]+name = "cc"+version = "1.0.79"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"++[[package]]+name = "cfg-expr"+version = "0.11.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b0357a6402b295ca3a86bc148e84df46c02e41f41fef186bda662557ef6328aa"+dependencies = [+ "smallvec",+]++[[package]]+name = "cfg-if"+version = "1.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"++[[package]]+name = "crc32fast"+version = "1.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"+dependencies = [+ "cfg-if",+]++[[package]]+name = "csv"+version = "1.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0b015497079b9a9d69c02ad25de6c0a6edef051ea6360a327d0bd05802ef64ad"+dependencies = [+ "csv-core",+ "itoa",+ "ryu",+ "serde",+]++[[package]]+name = "csv-core"+version = "0.1.10"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90"+dependencies = [+ "memchr",+]++[[package]]+name = "ctrlc"+version = "3.2.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bbcf33c2a618cbe41ee43ae6e9f2e48368cd9f9db2896f10167d8d762679f639"+dependencies = [+ "nix",+ "windows-sys",+]++[[package]]+name = "either"+version = "1.8.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91"++[[package]]+name = "field-offset"+version = "0.3.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1e1c54951450cbd39f3dbcf1005ac413b49487dabf18a720ad2383eccfeffb92"+dependencies = [+ "memoffset",+ "rustc_version",+]++[[package]]+name = "flate2"+version = "1.0.25"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841"+dependencies = [+ "crc32fast",+ "miniz_oxide",+]++[[package]]+name = "form_urlencoded"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8"+dependencies = [+ "percent-encoding",+]++[[package]]+name = "futures-channel"+version = "0.3.26"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5"+dependencies = [+ "futures-core",+]++[[package]]+name = "futures-core"+version = "0.3.26"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608"++[[package]]+name = "futures-executor"+version = "0.3.26"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e"+dependencies = [+ "futures-core",+ "futures-task",+ "futures-util",+]++[[package]]+name = "futures-io"+version = "0.3.26"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531"++[[package]]+name = "futures-macro"+version = "0.3.26"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 1.0.108",+]++[[package]]+name = "futures-task"+version = "0.3.26"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366"++[[package]]+name = "futures-util"+version = "0.3.26"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1"+dependencies = [+ "futures-core",+ "futures-macro",+ "futures-task",+ "pin-project-lite",+ "pin-utils",+ "slab",+]++[[package]]+name = "gdk-pixbuf"+version = "0.17.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b023fbe0c6b407bd3d9805d107d9800da3829dc5a676653210f1d5f16d7f59bf"+dependencies = [+ "bitflags",+ "gdk-pixbuf-sys",+ "gio",+ "glib",+ "libc",+ "once_cell",+]++[[package]]+name = "gdk-pixbuf-sys"+version = "0.17.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7b41bd2b44ed49d99277d3925652a163038bd5ed943ec9809338ffb2f4391e3b"+dependencies = [+ "gio-sys",+ "glib-sys",+ "gobject-sys",+ "libc",+ "system-deps",+]++[[package]]+name = "gdk4"+version = "0.6.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e5042053ee765aeef08d9d7e3f0f1e36a4d37f1659b3f93ad3d6997515dbb64a"+dependencies = [+ "bitflags",+ "cairo-rs",+ "gdk-pixbuf",+ "gdk4-sys",+ "gio",+ "glib",+ "libc",+ "pango",+]++[[package]]+name = "gdk4-sys"+version = "0.6.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "14f0fb00507af1e9299681dd09965f720e2b5ea95536d49a5681e8994ef10c7a"+dependencies = [+ "cairo-sys-rs",+ "gdk-pixbuf-sys",+ "gio-sys",+ "glib-sys",+ "gobject-sys",+ "libc",+ "pango-sys",+ "pkg-config",+ "system-deps",+]++[[package]]+name = "gio"+version = "0.17.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "65acfc24267314eee46f49e0a531e08fd6c3025040d1cfb4a7cd8e41c5e06116"+dependencies = [+ "bitflags",+ "futures-channel",+ "futures-core",+ "futures-io",+ "futures-util",+ "gio-sys",+ "glib",+ "libc",+ "once_cell",+ "pin-project-lite",+ "smallvec",+ "thiserror",+]++[[package]]+name = "gio-sys"+version = "0.17.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b5d3076ecb86c8c3a672c9843d6232b3a344fb81d304d0ba1ac64b23343efa46"+dependencies = [+ "glib-sys",+ "gobject-sys",+ "libc",+ "system-deps",+ "winapi",+]++[[package]]+name = "glib"+version = "0.17.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cfb53061756195d76969292c2d2e329e01259276524a9bae6c9b73af62854773"+dependencies = [+ "bitflags",+ "futures-channel",+ "futures-core",+ "futures-executor",+ "futures-task",+ "futures-util",+ "gio-sys",+ "glib-macros",+ "glib-sys",+ "gobject-sys",+ "libc",+ "memchr",+ "once_cell",+ "smallvec",+ "thiserror",+]++[[package]]+name = "glib-macros"+version = "0.17.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "32e73a9790e243f6d55d8e302426419f6084a1de7a84cd07f7268300408a19de"+dependencies = [+ "anyhow",+ "heck",+ "proc-macro-crate",+ "proc-macro-error",+ "proc-macro2",+ "quote",+ "syn 1.0.108",+]++[[package]]+name = "glib-sys"+version = "0.17.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "72a0985cf568e18cf63b443c9a14f4bdaa947fed7437476000dba84926a20b25"+dependencies = [+ "libc",+ "system-deps",+]++[[package]]+name = "gobject-sys"+version = "0.17.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9a0155d388840c77d61b033b66ef4f9bc7f4133d83df83572d6b4fb234a3be7d"+dependencies = [+ "glib-sys",+ "libc",+ "system-deps",+]++[[package]]+name = "graphene-rs"+version = "0.17.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "21cf11565bb0e4dfc2f99d4775b6c329f0d40a2cff9c0066214d31a0e1b46256"+dependencies = [+ "glib",+ "graphene-sys",+ "libc",+]++[[package]]+name = "graphene-sys"+version = "0.17.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cf80a4849a8d9565410a8fec6fc3678e9c617f4ac7be182ca55ab75016e07af9"+dependencies = [+ "glib-sys",+ "libc",+ "pkg-config",+ "system-deps",+]++[[package]]+name = "gsk4"+version = "0.6.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2fa9cd285a72a95124b65c069a9cb1b8fb8e310be71783404c39fccf3bf7774c"+dependencies = [+ "bitflags",+ "cairo-rs",+ "gdk4",+ "glib",+ "graphene-rs",+ "gsk4-sys",+ "libc",+ "pango",+]++[[package]]+name = "gsk4-sys"+version = "0.6.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5a445ae1e50cbf181a1d5c61b920a7e7e8657b96e0ecdbbf8911a86fad462a32"+dependencies = [+ "cairo-sys-rs",+ "gdk4-sys",+ "glib-sys",+ "gobject-sys",+ "graphene-sys",+ "libc",+ "pango-sys",+ "system-deps",+]++[[package]]+name = "gtk4"+version = "0.6.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1e30e124b5a605f6f5513db13958bfcd51d746607b20bc7bb718b33e303274ed"+dependencies = [+ "bitflags",+ "cairo-rs",+ "field-offset",+ "futures-channel",+ "gdk-pixbuf",+ "gdk4",+ "gio",+ "glib",+ "graphene-rs",+ "gsk4",+ "gtk4-macros",+ "gtk4-sys",+ "libc",+ "once_cell",+ "pango",+]++[[package]]+name = "gtk4-macros"+version = "0.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "db4676c4f90d8b010e88cb4558f61f47d76d6f6b8e6f6b89e62640f443907f61"+dependencies = [+ "anyhow",+ "proc-macro-crate",+ "proc-macro-error",+ "proc-macro2",+ "quote",+ "syn 1.0.108",+]++[[package]]+name = "gtk4-sys"+version = "0.6.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "65463dc801460e498d5e7ffa6e9ae2cfbed7d05fabd1ca5a8d024adbc89eeda6"+dependencies = [+ "cairo-sys-rs",+ "gdk-pixbuf-sys",+ "gdk4-sys",+ "gio-sys",+ "glib-sys",+ "gobject-sys",+ "graphene-sys",+ "gsk4-sys",+ "libc",+ "pango-sys",+ "system-deps",+]++[[package]]+name = "hashbrown"+version = "0.12.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"++[[package]]+name = "heck"+version = "0.4.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"++[[package]]+name = "idna"+version = "0.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6"+dependencies = [+ "unicode-bidi",+ "unicode-normalization",+]++[[package]]+name = "indexmap"+version = "1.9.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399"+dependencies = [+ "autocfg",+ "hashbrown",+]++[[package]]+name = "itoa"+version = "1.0.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440"++[[package]]+name = "js-sys"+version = "0.3.61"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730"+dependencies = [+ "wasm-bindgen",+]++[[package]]+name = "lazy_static"+version = "1.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"++[[package]]+name = "libc"+version = "0.2.139"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"++[[package]]+name = "log"+version = "0.4.17"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"+dependencies = [+ "cfg-if",+]++[[package]]+name = "memchr"+version = "2.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"++[[package]]+name = "memoffset"+version = "0.6.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"+dependencies = [+ "autocfg",+]++[[package]]+name = "miniz_oxide"+version = "0.6.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa"+dependencies = [+ "adler",+]++[[package]]+name = "nix"+version = "0.26.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a"+dependencies = [+ "bitflags",+ "cfg-if",+ "libc",+ "static_assertions",+]++[[package]]+name = "nom8"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8"+dependencies = [+ "memchr",+]++[[package]]+name = "once_cell"+version = "1.17.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"++[[package]]+name = "pango"+version = "0.17.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "243c048be90312220fb3bd578176eed8290568274a93c95040289d39349384bc"+dependencies = [+ "bitflags",+ "gio",+ "glib",+ "libc",+ "once_cell",+ "pango-sys",+]++[[package]]+name = "pango-sys"+version = "0.17.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4293d0f0b5525eb5c24734d30b0ed02cd02aa734f216883f376b54de49625de8"+dependencies = [+ "glib-sys",+ "gobject-sys",+ "libc",+ "system-deps",+]++[[package]]+name = "percent-encoding"+version = "2.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"++[[package]]+name = "pest"+version = "2.5.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "028accff104c4e513bad663bbcd2ad7cfd5304144404c31ed0a77ac103d00660"+dependencies = [+ "thiserror",+ "ucd-trie",+]++[[package]]+name = "pin-project-lite"+version = "0.2.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116"++[[package]]+name = "pin-utils"+version = "0.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"++[[package]]+name = "pkg-config"+version = "0.3.26"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160"++[[package]]+name = "proc-macro-crate"+version = "1.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "66618389e4ec1c7afe67d51a9bf34ff9236480f8d51e7489b7d5ab0303c13f34"+dependencies = [+ "once_cell",+ "toml_edit",+]++[[package]]+name = "proc-macro-error"+version = "1.0.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"+dependencies = [+ "proc-macro-error-attr",+ "proc-macro2",+ "quote",+ "syn 1.0.108",+ "version_check",+]++[[package]]+name = "proc-macro-error-attr"+version = "1.0.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"+dependencies = [+ "proc-macro2",+ "quote",+ "version_check",+]++[[package]]+name = "proc-macro2"+version = "1.0.53"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ba466839c78239c09faf015484e5cc04860f88242cff4d03eb038f04b4699b73"+dependencies = [+ "unicode-ident",+]++[[package]]+name = "quote"+version = "1.0.26"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc"+dependencies = [+ "proc-macro2",+]++[[package]]+name = "regex"+version = "1.7.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cce168fea28d3e05f158bda4576cf0c844d5045bc2cc3620fa0292ed5bb5814c"+dependencies = [+ "aho-corasick",+ "memchr",+ "regex-syntax",+]++[[package]]+name = "regex-syntax"+version = "0.6.29"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"++[[package]]+name = "ring"+version = "0.16.20"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc"+dependencies = [+ "cc",+ "libc",+ "once_cell",+ "spin",+ "untrusted",+ "web-sys",+ "winapi",+]++[[package]]+name = "rustc_version"+version = "0.3.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee"+dependencies = [+ "semver",+]++[[package]]+name = "rustls"+version = "0.20.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f"+dependencies = [+ "log",+ "ring",+ "sct",+ "webpki",+]++[[package]]+name = "ryu"+version = "1.0.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde"++[[package]]+name = "sct"+version = "0.7.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4"+dependencies = [+ "ring",+ "untrusted",+]++[[package]]+name = "semver"+version = "0.11.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6"+dependencies = [+ "semver-parser",+]++[[package]]+name = "semver-parser"+version = "0.10.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7"+dependencies = [+ "pest",+]++[[package]]+name = "serde"+version = "1.0.158"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "771d4d9c4163ee138805e12c710dd365e4f44be8be0503cb1bb9eb989425d9c9"+dependencies = [+ "serde_derive",+]++[[package]]+name = "serde_derive"+version = "1.0.158"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e801c1712f48475582b7696ac71e0ca34ebb30e09338425384269d9717c62cad"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.8",+]++[[package]]+name = "serde_json"+version = "1.0.94"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea"+dependencies = [+ "itoa",+ "ryu",+ "serde",+]++[[package]]+name = "slab"+version = "0.4.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d"+dependencies = [+ "autocfg",+]++[[package]]+name = "smallvec"+version = "1.10.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"++[[package]]+name = "spin"+version = "0.5.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"++[[package]]+name = "static_assertions"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"++[[package]]+name = "sudo"+version = "0.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "88bd84d4c082e18e37fef52c0088e4407dabcef19d23a607fb4b5ee03b7d5b83"+dependencies = [+ "libc",+ "log",+]++[[package]]+name = "syn"+version = "1.0.108"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d56e159d99e6c2b93995d171050271edb50ecc5288fbc7cc17de8fdce4e58c14"+dependencies = [+ "proc-macro2",+ "quote",+ "unicode-ident",+]++[[package]]+name = "syn"+version = "2.0.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bcc02725fd69ab9f26eab07fad303e2497fad6fb9eba4f96c4d1687bdf704ad9"+dependencies = [+ "proc-macro2",+ "quote",+ "unicode-ident",+]++[[package]]+name = "system-deps"+version = "6.0.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2955b1fe31e1fa2fbd1976b71cc69a606d7d4da16f6de3333d0c92d51419aeff"+dependencies = [+ "cfg-expr",+ "heck",+ "pkg-config",+ "toml",+ "version-compare",+]++[[package]]+name = "thiserror"+version = "1.0.38"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0"+dependencies = [+ "thiserror-impl",+]++[[package]]+name = "thiserror-impl"+version = "1.0.38"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 1.0.108",+]++[[package]]+name = "tinyvec"+version = "1.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50"+dependencies = [+ "tinyvec_macros",+]++[[package]]+name = "tinyvec_macros"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"++[[package]]+name = "toml"+version = "0.5.11"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234"+dependencies = [+ "serde",+]++[[package]]+name = "toml_datetime"+version = "0.5.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4553f467ac8e3d374bc9a177a26801e5d0f9b211aa1673fb137a403afd1c9cf5"++[[package]]+name = "toml_edit"+version = "0.18.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "56c59d8dd7d0dcbc6428bf7aa2f0e823e26e43b3c9aca15bbc9475d23e5fa12b"+dependencies = [+ "indexmap",+ "nom8",+ "toml_datetime",+]++[[package]]+name = "ucd-trie"+version = "0.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81"++[[package]]+name = "unicode-bidi"+version = "0.3.10"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58"++[[package]]+name = "unicode-ident"+version = "1.0.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc"++[[package]]+name = "unicode-normalization"+version = "0.1.22"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921"+dependencies = [+ "tinyvec",+]++[[package]]+name = "untrusted"+version = "0.7.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"++[[package]]+name = "ureq"+version = "2.6.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "338b31dd1314f68f3aabf3ed57ab922df95ffcd902476ca7ba3c4ce7b908c46d"+dependencies = [+ "base64",+ "flate2",+ "log",+ "once_cell",+ "rustls",+ "serde",+ "serde_json",+ "url",+ "webpki",+ "webpki-roots",+]++[[package]]+name = "url"+version = "2.3.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643"+dependencies = [+ "form_urlencoded",+ "idna",+ "percent-encoding",+]++[[package]]+name = "version-compare"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29"++[[package]]+name = "version_check"+version = "0.9.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"++[[package]]+name = "wasm-bindgen"+version = "0.2.84"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b"+dependencies = [+ "cfg-if",+ "wasm-bindgen-macro",+]++[[package]]+name = "wasm-bindgen-backend"+version = "0.2.84"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9"+dependencies = [+ "bumpalo",+ "log",+ "once_cell",+ "proc-macro2",+ "quote",+ "syn 1.0.108",+ "wasm-bindgen-shared",+]++[[package]]+name = "wasm-bindgen-macro"+version = "0.2.84"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5"+dependencies = [+ "quote",+ "wasm-bindgen-macro-support",+]++[[package]]+name = "wasm-bindgen-macro-support"+version = "0.2.84"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 1.0.108",+ "wasm-bindgen-backend",+ "wasm-bindgen-shared",+]++[[package]]+name = "wasm-bindgen-shared"+version = "0.2.84"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d"++[[package]]+name = "web-sys"+version = "0.3.61"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97"+dependencies = [+ "js-sys",+ "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"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87"+dependencies = [+ "webpki",+]++[[package]]+name = "which"+version = "4.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269"+dependencies = [+ "either",+ "libc",+ "once_cell",+]++[[package]]+name = "winapi"+version = "0.3.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"+dependencies = [+ "winapi-i686-pc-windows-gnu",+ "winapi-x86_64-pc-windows-gnu",+]++[[package]]+name = "winapi-i686-pc-windows-gnu"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"++[[package]]+name = "winapi-x86_64-pc-windows-gnu"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"++[[package]]+name = "windows-sys"+version = "0.45.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"+dependencies = [+ "windows-targets",+]++[[package]]+name = "windows-targets"+version = "0.42.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7"+dependencies = [+ "windows_aarch64_gnullvm",+ "windows_aarch64_msvc",+ "windows_i686_gnu",+ "windows_i686_msvc",+ "windows_x86_64_gnu",+ "windows_x86_64_gnullvm",+ "windows_x86_64_msvc",+]++[[package]]+name = "windows_aarch64_gnullvm"+version = "0.42.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608"++[[package]]+name = "windows_aarch64_msvc"+version = "0.42.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7"++[[package]]+name = "windows_i686_gnu"+version = "0.42.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640"++[[package]]+name = "windows_i686_msvc"+version = "0.42.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605"++[[package]]+name = "windows_x86_64_gnu"+version = "0.42.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45"++[[package]]+name = "windows_x86_64_gnullvm"+version = "0.42.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463"++[[package]]+name = "windows_x86_64_msvc"+version = "0.42.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"diff --git a/Cargo.toml b/Cargo.tomlold mode 100644new mode 100755index d36f4f8..893967b--- a/Cargo.toml+++ b/Cargo.toml@@ -1,6 +1,6 @@[package]name = "airgorah"-version = "0.1.0"+version = "0.2.0"edition = "2021"license = "MIT"authors = ["Martin Olivier <[email protected]>"]@@ -10,36 +10,33 @@ documentation = "https://github.com/martin-olivier/airgorah"description = "A WiFi auditing software that can perform deauth attacks and passwords cracking"keywords = ["networking", "pentest", "aircrack-ng", "gui", "linux"]readme = "README.md"-exclude = ["/.github"]+exclude = ["/.github", "/package", "/docs"][dependencies]-serde = { version = "1.0.104", features = ["derive"] }-serde_json = "1.0.86"-csv = "1.1.6"-glib = "0.15.12"+gtk4 = { version = "0.6.4", features = ["v4_6"] }+glib = "0.17.5"+serde = { version = "1.0.158", features = ["derive"] }+serde_json = "1.0.94"+csv = "1.2.1"sudo = "0.6.0"-ctrlc = "3.2.3"-regex = "1.6.0"+ctrlc = "3.2.5"+regex = "1.7.2"lazy_static = "1.4.0"-which = "4.3.0"--[dependencies.gtk4]-version = "0.4.8"-default-features = false-features = ["v4_6"]+ureq = { version = "2.6.2", features = ["json"] }+which = "4.4.0"[package.metadata.deb]copyright = "2022, 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 = "pkexec, libgtk-4-1, dbus-x11, wireless-tools, aircrack-ng (>= 1.6)"+depends = "gnome-terminal, pkexec, libgtk-4-1 (>= 4.6.0), dbus-x11, wireless-tools, aircrack-ng (>= 1.6), wireshark-common"priority = "optional"section = "utility"assets = [- ["target/release/airgorah", "/usr/bin/", "755"],+ ["target/release/airgorah", "/usr/bin/airgorah", "755"],["README.md", "/usr/share/doc/airgorah/README", "644"],["icons/app_icon.png", "/usr/share/app-install/icons/airgorah.png", "644"],["package/.desktop", "/usr/share/applications/com.martin-olivier.airgorah.desktop", "644"],["package/.policy", "/usr/share/polkit-1/actions/org.freedesktop.policykit.airgorah.policy", "755"],-]\ No newline at end of file+]diff --git a/README.md b/README.mdindex 22811b0..dcbe2ca 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.1.0">- <img src="https://img.shields.io/badge/Version-0.1.0_(beta)-blue.svg" alt="version"/>+ <a href="https://github.com/martin-olivier/airgorah/releases/tag/v0.2.0">+ <img src="https://img.shields.io/badge/Version-0.2.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"/>@@ -27,8 +27,6 @@It is written in Rust and uses [GTK4 bindings](https://github.com/gtk-rs/gtk4-rs) for the graphical part. The software is based on [aircrack-ng](https://github.com/aircrack-ng/aircrack-ng) tools suite.-> This project is still in beta version, for the moment only deauth attacks are implemented. The list of future implementations is available [here](#future).-`⭐ Don't forget to put a star if you like the project!`## Legal@@ -43,10 +41,12 @@ You will also need a wireless network card that supports `monitor mode` and `pac## Installation-You 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 package and install it with the following command:+You 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:-```sh-sudo apt install <path_to_deb_package>+```+wget https://github.com/martin-olivier/airgorah/releases/download/v0.2.0/airgorah_0.2.0_amd64.deb+sudo apt update+sudo apt install ./airgorah_0.2.0_amd64.deb```Otherwise, if you'd like to compile from source, you can follow this [guide](docs/build_from_source.md).@@ -61,11 +61,9 @@ Pull requests are welcome. For major changes, please open an issue first to disc## Future-- [ ] WPA handshake capture-- [ ] WPA handshake decryption (dictionary / bruteforce)-- [ ] WPS attack feature-- [ ] WEP attack feature-- [ ] Provide releases for other linux distributions (Arch, Fedora, ...)-- [ ] Provide releases for other architectures (amd, arm, ...)+- [ ] Implement the setting page+- [ ] Provide usage documentation- [ ] Improve the code quality and the documentation- [ ] Improve the UI+- [ ] 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.mdindex 607a7c5..97d4418 100644--- a/docs/build_from_source.md+++ b/docs/build_from_source.md@@ -15,13 +15,13 @@ 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 wireless-tools+sudo apt install dbus-x11 libgtk-4-dev libglib2.0-dev aircrack-ng wireless-tools gnome-terminal wireshark-common```### Fedora```sh-sudo dnf install dbus-x11 gtk4-devel glib2-devel aircrack-ng wireless-tools-1+sudo dnf install dbus-x11 gtk4-devel glib2-devel aircrack-ng wireless-tools-1 gnome-terminal wireshark-cli```## 3. Install Airgorahdiff --git a/package/.desktop b/package/.desktopindex da4be26..d399046 100644--- a/package/.desktop+++ b/package/.desktop@@ -1,6 +1,6 @@[Desktop Entry]Encoding=UTF-8-Version=0.1.0+Version=0.2.0Type=ApplicationTerminal=falseExec=pkexec airgorahdiff --git a/src/backend/app.rs b/src/backend/app.rsold mode 100644new mode 100755index 977d826..af6ea34--- a/src/backend/app.rs+++ b/src/backend/app.rs@@ -2,6 +2,8 @@ use crate::error::Error;use crate::globals::*;use crate::types::*;+use std::thread::JoinHandle;+pub fn app_setup() -> Result<(), Error> {app_cleanup();@@ -24,16 +26,16 @@ pub fn app_setup() -> Result<(), Error> {"airmon-ng","airodump-ng","aireplay-ng",+ "aircrack-ng",+ "gnome-terminal",+ "mergecap",])}pub fn app_cleanup() {- if let Some(child) = SCAN_PROC.lock().unwrap().as_mut() {- child.kill().unwrap();- child.wait().unwrap();- }+ super::stop_scan_process();- for attacked_ap in ATTACK_POOL.lock().unwrap().iter_mut() {+ for attacked_ap in super::get_attack_pool().iter_mut() {match &mut attacked_ap.1 .1 {AttackedClients::All(child) => {child.kill().unwrap();@@ -53,7 +55,9 @@ pub fn app_cleanup() {super::restore_network_manager().ok();}- std::fs::remove_file(SCAN_PATH.to_string() + "-01.csv").ok();+ std::fs::remove_file(LIVE_SCAN_PATH.to_string() + "-01.csv").ok();+ std::fs::remove_file(LIVE_SCAN_PATH.to_string() + "-01.cap").ok();+ std::fs::remove_file(OLD_SCAN_PATH.to_string() + "-01.cap").ok();}pub fn check_dependencies(deps: &[&str]) -> Result<(), Error> {@@ -67,3 +71,16 @@ pub fn check_dependencies(deps: &[&str]) -> Result<(), Error> {}Ok(())}++pub fn spawn_update_checker() -> JoinHandle<bool> {+ std::thread::spawn(|| {+ 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>() {+ return json["tag_name"] != VERSION;+ }+ }+ false+ })+}diff --git a/src/backend/capture.rs b/src/backend/capture.rsnew file mode 100755index 0000000..11d7a2a--- /dev/null+++ b/src/backend/capture.rs@@ -0,0 +1,32 @@+use crate::globals::*;++pub fn update_handshakes() {+ let live_scan_output = std::process::Command::new("aircrack-ng")+ .args([&(LIVE_SCAN_PATH.to_string() + "-01.cap")])+ .output()+ .unwrap();++ let old_scan_output = std::process::Command::new("aircrack-ng")+ .args([&(OLD_SCAN_PATH.to_string() + "-01.cap")])+ .output()+ .unwrap();++ let mut stdout = String::from_utf8_lossy(&live_scan_output.stdout).to_string();+ stdout.push_str(&String::from_utf8_lossy(&old_scan_output.stdout));++ let lines = stdout.lines();+ let mut aps = super::get_aps();++ for data in lines {+ for (bssid, ap) in aps.iter_mut() {+ if data.contains(bssid) && data.contains("WPA (") && !data.contains("WPA (0 handshake)")+ {+ ap.handshake = true;+ }+ }+ }+}++pub fn save_capture(path: &str) {+ std::fs::copy(OLD_SCAN_PATH.to_string() + "-01.cap", path).ok();+}diff --git a/src/backend/deauth.rs b/src/backend/deauth.rsold mode 100644new mode 100755index cfd82d4..3ec628c--- a/src/backend/deauth.rs+++ b/src/backend/deauth.rs@@ -1,7 +1,6 @@use crate::error::Error;use crate::globals::*;use crate::types::*;-use std::collections::HashMap;use std::process::Command;use std::sync::MutexGuard;@@ -11,20 +10,6 @@ pub fn launch_deauth_attack(ap: AP, specific_clients: Option<Vec<String>>) -> ReNone => return Err(Error::new("No interface set")),};- // Set channel focus-- let mut channel_select = Command::new("airodump-ng")- .args(["-c", &ap.channel, "--bssid", &ap.bssid, &iface])- .stdout(std::process::Stdio::null())- .spawn()?;-- std::thread::sleep(std::time::Duration::from_millis(100));-- channel_select.kill()?;- channel_select.wait()?;-- // Start deauth process-let mut attack_pool = super::get_attack_pool();let attack_targets = match specific_clients {@@ -74,6 +59,6 @@ pub fn stop_deauth_attack(ap_bssid: &str) {attack_pool.remove(ap_bssid);}-pub fn get_attack_pool() -> MutexGuard<'static, HashMap<String, (AP, AttackedClients)>> {+pub fn get_attack_pool() -> MutexGuard<'static, AttackPool> {ATTACK_POOL.lock().unwrap()}diff --git a/src/backend/decrypt.rs b/src/backend/decrypt.rsnew file mode 100755index 0000000..59e5ba2--- /dev/null+++ b/src/backend/decrypt.rs@@ -0,0 +1,15 @@+use std::process::{Command, Stdio};++pub fn run_decrypt_process(handshake: &str, wordlist: &str) {+ let cmd = format!(+ "gnome-terminal --hide-menubar --title \"Handshake Decryption\" -- sh -c \"aircrack-ng '{}' -w '{}' ; exec sh\"",+ handshake,+ wordlist+ );++ Command::new("sh")+ .stdin(Stdio::piped())+ .args(["-c", &cmd])+ .output()+ .ok();+}diff --git a/src/backend/mod.rs b/src/backend/mod.rsold mode 100644new mode 100755index 94077f3..60a25ab--- a/src/backend/mod.rs+++ b/src/backend/mod.rs@@ -1,9 +1,13 @@pub mod app;+pub mod capture;pub mod deauth;+pub mod decrypt;pub mod interface;pub mod scan;pub use app::*;+pub use capture::*;pub use deauth::*;+pub use decrypt::*;pub use interface::*;pub use scan::*;diff --git a/src/backend/scan.rs b/src/backend/scan.rsindex 2280270..1ffe894 100644--- a/src/backend/scan.rs+++ b/src/backend/scan.rs@@ -86,20 +86,15 @@ pub fn set_scan_process(args: &[&str]) -> Result<(), Error> {None => return Err(Error::new("No interface set")),};- if let Some(child) = SCAN_PROC.lock().unwrap().as_mut() {- child.kill().unwrap();- child.wait().unwrap();- }-- std::fs::remove_file(SCAN_PATH.to_string() + "-01.csv").ok();+ stop_scan_process();let mut proc_args = vec![iface.as_str(),"-a","--output-format",- "csv",+ "csv,cap","-w",- SCAN_PATH,+ LIVE_SCAN_PATH,"--write-interval","1",];@@ -117,13 +112,53 @@ pub fn set_scan_process(args: &[&str]) -> Result<(), Error> {pub fn stop_scan_process() {if let Some(child) = SCAN_PROC.lock().unwrap().as_mut() {- child.kill().unwrap();- child.wait().unwrap();+ std::process::Command::new("kill")+ .arg(child.id().to_string())+ .status()+ .unwrap();+ child.wait().ok();}SCAN_PROC.lock().unwrap().take();- std::fs::remove_file(SCAN_PATH.to_string() + "-01.csv").ok();+ let old_path_exists = std::path::Path::new(&(OLD_SCAN_PATH.to_string() + "-01.cap")).exists();+ let live_path_exists = std::path::Path::new(&(LIVE_SCAN_PATH.to_string() + "-01.cap")).exists();++ std::fs::remove_file(LIVE_SCAN_PATH.to_string() + "-01.csv").ok();++ if !live_path_exists {+ return;+ }++ if !old_path_exists {+ std::fs::rename(+ LIVE_SCAN_PATH.to_string() + "-01.cap",+ OLD_SCAN_PATH.to_string() + "-01.cap",+ )+ .ok();+ return;+ }++ std::process::Command::new("mergecap")+ .args([+ "-a",+ "-F",+ "pcap",+ "-w",+ &(MERGE_SCAN_PATH.to_string() + "-01.cap"),+ &(OLD_SCAN_PATH.to_string() + "-01.cap"),+ &(LIVE_SCAN_PATH.to_string() + "-01.cap"),+ ])+ .status()+ .unwrap();++ std::fs::remove_file(LIVE_SCAN_PATH.to_string() + "-01.cap").ok();+ std::fs::remove_file(OLD_SCAN_PATH.to_string() + "-01.cap").ok();+ std::fs::rename(+ MERGE_SCAN_PATH.to_string() + "-01.cap",+ OLD_SCAN_PATH.to_string() + "-01.cap",+ )+ .ok();}pub fn get_airodump_data() -> HashMap<String, AP> {@@ -139,7 +174,7 @@ pub fn get_airodump_data() -> HashMap<String, AP> {aps.insert(ap.0.clone(), ap.1.clone());}- let full_path = SCAN_PATH.to_string() + "-01.csv";+ let full_path = LIVE_SCAN_PATH.to_string() + "-01.csv";let csv_file = match std::fs::read_to_string(full_path) {Ok(file) => file,Err(_) => return aps,@@ -173,7 +208,7 @@ pub fn get_airodump_data() -> HashMap<String, AP> {let mut essid = result.essid.trim_start().to_string();if essid.is_empty() {- essid = format!("[Hidden ESSID] (length: {})", result.id_length.trim_start());+ essid = format!("[Hidden] (length: {})", result.id_length.trim_start());}let old_data = aps.insert(@@ -186,6 +221,16 @@ pub fn get_airodump_data() -> HashMap<String, AP> {speed: result.speed.trim_start().to_string(),power: result.power.trim_start().to_string(),privacy: result.privacy.trim_start().to_string(),+ handshake: {+ match glob_aps.get(&bssid) {+ Some(ap) => ap.handshake,+ None => false,+ }+ },+ saved_handshake: match glob_aps.get(&bssid) {+ Some(ap) => ap.saved_handshake.clone(),+ None => None,+ },first_time_seen: result.first_time_seen.trim_start().to_string(),last_time_seen: result.last_time_seen.trim_start().to_string(),clients: HashMap::new(),diff --git a/src/frontend/connections/app.rs b/src/frontend/connections/app.rsnew file mode 100755index 0000000..7d74f31--- /dev/null+++ b/src/frontend/connections/app.rs@@ -0,0 +1,334 @@+use crate::backend;+use crate::frontend::interfaces::*;+use crate::frontend::*;+use crate::globals;+use crate::list_store_get;+use crate::types::*;++use glib::clone;+use gtk4::gdk_pixbuf::Pixbuf;+use gtk4::prelude::*;+use gtk4::*;+use std::rc::Rc;+use std::time::Duration;++fn list_store_find(storage: &ListStore, pos: i32, to_match: &str) -> Option<TreeIter> {+ let mut iter = storage.iter_first();++ while let Some(it) = iter {+ let value = list_store_get!(storage, &it, pos, String);++ if value == to_match {+ return Some(it);+ }++ iter = match storage.iter_next(&it) {+ true => Some(it),+ false => None,+ }+ }++ None+}++fn connect_about_button(app_data: Rc<AppData>) {+ app_data+ .app_gui+ .about_button+ .connect_clicked(clone!(@strong app_data => move |_| {+ let ico = Pixbuf::from_read(std::io::BufReader::new(globals::APP_ICON)).unwrap();+ let des = "A WiFi auditing software that can perform deauth attacks and passwords cracking";++ AboutDialog::builder()+ .program_name("Airgorah")+ .version(globals::VERSION)+ .authors(vec!["Martin OLIVIER ([email protected])".to_string()])+ .copyright("Copyright (c) Martin OLIVIER")+ .license_type(License::MitX11)+ .logo(&Picture::for_pixbuf(&ico).paintable().unwrap())+ .comments(des)+ .website_label("https://github.com/martin-olivier/airgorah")+ .transient_for(&app_data.app_gui.window)+ .modal(true)+ .build()+ .show();+ }));+}++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+ .connect_clicked(clone!(@strong app_data => move |_| {+ InfoDialog::spawn(&app_data.app_gui.window, "Update available", "An update is available, you can download it on the following page:\n\nhttps://github.com/martin-olivier/airgorah/releases/latest");+ }));+}++fn connect_decrypt_button(app_data: Rc<AppData>) {+ app_data+ .app_gui+ .decrypt_button+ .connect_clicked(clone!(@strong app_data => move |_| {+ app_data.decrypt_gui.show(None);+ }));+}++fn connect_settings_button(app_data: Rc<AppData>) {+ app_data+ .app_gui+ .settings_button+ .connect_clicked(clone!(@strong app_data => move |_| {+ InfoDialog::spawn(&app_data.app_gui.window, "Coming Soon", "The settings page will be available in a future release");+ }));+}++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);+ }+ 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),+ }+ }+ 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() {+ 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),+ };++ 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,+ &match ap.handshake {+ true => "Captured",+ false => "",+ },+ ),+ (9, &ap.first_time_seen),+ (10, &ap.last_time_seen),+ (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())+ {+ 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),+ };++ 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()),+ ],+ );+ }+ }++ backend::update_handshakes();++ glib::Continue(true)+ });+}++fn connect_deauth_button(app_data: Rc<AppData>) {+ app_data+ .app_gui+ .deauth_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 bssid = list_store_get!(app_data.app_gui.aps_model, &iter, 1, String);+ let channel = list_store_get!(app_data.app_gui.aps_model, &iter, 3, i32);+ let under_attack = backend::get_attack_pool().contains_key(&bssid);++ match under_attack {+ true => backend::stop_deauth_attack(&bssid),+ false => {+ app_data.app_gui.channel_filter_entry.set_text(&channel.to_string());+ app_data.deauth_gui.show(backend::get_aps()[&bssid].clone());+ }+ }+ }));+}++fn connect_capture_button(app_data: Rc<AppData>) {+ app_data+ .app_gui+ .capture_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 bssid = list_store_get!(app_data.app_gui.aps_model, &iter, 1, String);++ let ap = match backend::get_aps().get(&bssid) {+ Some(ap) => ap.clone(),+ None => return,+ };++ if !ap.handshake {+ return;+ }++ if let Some(ref cap) = ap.saved_handshake {+ return app_data.decrypt_gui.show(Some(cap.clone()));+ }++ let was_scanning = backend::is_scan_process();++ if was_scanning {+ app_data.app_gui.scan_but.emit_clicked();+ }++ let file_chooser_dialog = FileChooserDialog::new(+ Some("Save Capture"),+ Some(&app_data.app_gui.window),+ FileChooserAction::Save,+ &[("Save", ResponseType::Accept)],+ );++ file_chooser_dialog.set_current_name("capture.cap");+ file_chooser_dialog.run_async(clone!(@strong app_data => move |this, response| {+ if response == ResponseType::Accept {+ let gio_file = match this.file() {+ Some(file) => file,+ None => return,+ };+ let path = gio_file.path().unwrap().to_str().unwrap().to_string();++ backend::save_capture(&path);++ for (_, ap) in backend::get_aps().iter_mut() {+ if ap.handshake {+ ap.saved_handshake = Some(path.to_owned());+ }+ }++ app_data.decrypt_gui.show(Some(path))+ }++ this.close();++ if was_scanning {+ app_data.app_gui.scan_but.emit_clicked();+ }+ }));+ //+ }));+}++pub fn connect(app_data: Rc<AppData>) {+ connect_about_button(app_data.clone());+ connect_update_button(app_data.clone());+ connect_decrypt_button(app_data.clone());+ connect_settings_button(app_data.clone());++ connect_app_refresh(app_data.clone());++ connect_deauth_button(app_data.clone());+ connect_capture_button(app_data);+}diff --git a/src/frontend/connections/deauth.rs b/src/frontend/connections/deauth.rsold mode 100644new mode 100755index bca86b6..5759617--- a/src/frontend/connections/deauth.rs+++ b/src/frontend/connections/deauth.rs@@ -1,34 +1,106 @@use crate::backend;use crate::frontend::interfaces::*;+use crate::frontend::widgets::*;use crate::list_store_get;+use glib::clone;+use glib::Value;use gtk4::prelude::*;use gtk4::*;use std::rc::Rc;-pub fn connect_deauth_button(app_data: Rc<AppData>) {+fn get_selected_clis(storage: &ListStore) -> Vec<String> {+ let mut iter = storage.iter_first();+ let mut selected_clis = vec![];++ while let Some(it) = iter {+ let check_val = list_store_get!(storage, &it, 0, bool);+ let mac_val = list_store_get!(storage, &it, 1, String);++ if check_val {+ selected_clis.push(mac_val);+ }++ iter = match storage.iter_next(&it) {+ true => Some(it),+ false => None,+ }+ }++ selected_clis+}++fn connect_all_cli_button(app_data: Rc<AppData>) {app_data- .deauth_but- .connect_clicked(clone!(@strong app_data => move |_| {- let (_model, iter) = match app_data.aps_view.selection().selected() {- Some((selection, iter)) => (selection, iter),- None => return,- };+ .deauth_gui+ .all_cli_but+ .connect_toggled(clone!(@strong app_data => move |_| {+ app_data.deauth_gui.view.set_sensitive(false);+ app_data.deauth_gui.view.selection().unselect_all();+ app_data.deauth_gui.attack_but.set_sensitive(true);+ }));+}- let bssid = list_store_get!(app_data.aps_model, &iter, 1, String);- let under_attack = backend::get_attack_pool().contains_key(&bssid);-- match under_attack {- true => backend::stop_deauth_attack(&bssid),- false => {- if backend::is_scan_process() {- app_data.scan_but.emit_clicked();- }- DeauthWindow::spawn(- &app_data.main_window,- backend::get_aps()[&bssid].clone(),- );- }+fn connect_sel_cli_button(app_data: Rc<AppData>) {+ app_data+ .deauth_gui+ .sel_cli_but+ .connect_toggled(clone!(@strong app_data => move |_| {+ app_data.deauth_gui.view.set_sensitive(true);++ if get_selected_clis(&app_data.deauth_gui.store).is_empty() {+ app_data.deauth_gui.attack_but.set_sensitive(false);}}));}++fn connect_toggle(app_data: Rc<AppData>) {+ app_data+ .deauth_gui+ .toggle+ .connect_toggled(clone!(@strong app_data => move |_, path| {+ let iter = app_data.deauth_gui.store.iter(&path).unwrap();+ let old_val = list_store_get!(app_data.deauth_gui.store, &iter, 0, bool);++ app_data.deauth_gui.store.set_value(&iter, 0, &Value::from(&(!old_val)));++ match get_selected_clis(&app_data.deauth_gui.store).is_empty() {+ true => app_data.deauth_gui.attack_but.set_sensitive(false),+ false => app_data.deauth_gui.attack_but.set_sensitive(true),+ };+ }));+}++fn connect_attack_but(app_data: Rc<AppData>) {+ app_data.deauth_gui.attack_but.connect_clicked(clone!(@strong app_data => move |_| {+ let params = match app_data.deauth_gui.sel_cli_but.is_active() {+ true => Some(get_selected_clis(&app_data.deauth_gui.store)),+ false => None,+ };++ let iter = match app_data.app_gui.aps_view.selection().selected() {+ Some((_, iter)) => iter,+ None => return,+ };++ 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| {+ ErrorDialog::spawn(+ &app_data.app_gui.window,+ "Error",+ &format!("Could not start deauth process: {}", e),+ false,+ );+ });++ app_data.deauth_gui.window.hide();+ }));+}++pub fn connect(app_data: Rc<AppData>) {+ connect_all_cli_button(app_data.clone());+ connect_sel_cli_button(app_data.clone());+ connect_toggle(app_data.clone());+ connect_attack_but(app_data);+}diff --git a/src/frontend/connections/decrypt.rs b/src/frontend/connections/decrypt.rsnew file mode 100755index 0000000..6bdf520--- /dev/null+++ b/src/frontend/connections/decrypt.rs@@ -0,0 +1,75 @@+use crate::backend;+use crate::frontend::interfaces::*;++use glib::clone;+use gtk4::prelude::*;+use gtk4::*;+use std::rc::Rc;++fn connect_handshake_button(app_data: Rc<AppData>) {+ app_data.decrypt_gui.handshake_but.connect_clicked(+ clone!(@strong app_data => move |_| {++ let file_chooser_dialog = FileChooserDialog::new(+ Some("Select Capture"),+ Some(&app_data.decrypt_gui.window),+ FileChooserAction::Open,+ &[("Open", ResponseType::Accept)],+ );++ file_chooser_dialog.run_async(clone!(@strong app_data => move |this, response| {+ 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);+ }+ }+ this.close();+ }));+ }),+ );+}++fn connect_wordlist_button(app_data: Rc<AppData>) {+ app_data.decrypt_gui.wordlist_but.connect_clicked(+ clone!(@strong app_data => move |_| {+ let file_chooser_dialog = FileChooserDialog::new(+ Some("Select Wordlist"),+ Some(&app_data.decrypt_gui.window),+ FileChooserAction::Open,+ &[("Open", ResponseType::Accept)],+ );++ file_chooser_dialog.run_async(clone!(@strong app_data => move |this, response| {+ 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);+ }+ }+ this.close();+ }));+ }),+ );+}++fn connect_decrypt_button(app_data: Rc<AppData>) {+ app_data.decrypt_gui.decrypt_but.connect_clicked(clone!(@strong app_data => move |_| {+ backend::run_decrypt_process(app_data.decrypt_gui.handshake_entry.text().as_str(), app_data.decrypt_gui.wordlist_entry.text().as_str());+ app_data.decrypt_gui.window.close();+ }));+}++pub fn connect(app_data: Rc<AppData>) {+ connect_handshake_button(app_data.clone());+ connect_wordlist_button(app_data.clone());+ connect_decrypt_button(app_data);+}diff --git a/src/frontend/connections/handshake.rs b/src/frontend/connections/handshake.rsdeleted file mode 100644index 6cf0de4..0000000--- a/src/frontend/connections/handshake.rs+++ /dev/null@@ -1,15 +0,0 @@-use crate::frontend::interfaces::*;-use glib::clone;-use std::rc::Rc;--pub fn connect_capture_button(app_data: Rc<AppData>) {- app_data- .capture_but- .connect_clicked(clone!(@strong app_data => move |_| {- InfoDialog::spawn(- &app_data.main_window,- "Comming Soon",- "This feature will be available in a future version",- );- }));-}diff --git a/src/frontend/connections/interface.rs b/src/frontend/connections/interface.rsindex a912831..7160617 100644--- a/src/frontend/connections/interface.rs+++ b/src/frontend/connections/interface.rs@@ -1,21 +1,24 @@use crate::backend;use crate::frontend::interfaces::*;+use crate::frontend::*;use crate::list_store_get;+use glib::clone;use gtk4::prelude::*;use std::rc::Rc;-pub fn connect_interface_refresh(app_data: Rc<AppData>) {+fn connect_interface_refresh(app_data: Rc<AppData>) {app_data+ .interface_gui.refresh_but.connect_clicked(clone!(@strong app_data => move |_| {- app_data.interface_model.clear();+ app_data.interface_gui.interface_model.clear();let ifaces = match backend::get_interfaces() {Ok(ifaces) => ifaces,Err(e) => {return ErrorDialog::spawn(- &app_data.interface_window,+ &app_data.interface_gui.window,"Failed to get interfaces",&e.to_string(),false,@@ -24,39 +27,47 @@ pub fn connect_interface_refresh(app_data: Rc<AppData>) {};for iface in ifaces.iter() {- app_data.interface_model.insert_with_values(None, &[(0, &iface)]);+ app_data.interface_gui.interface_model.insert_with_values(None, &[(0, &iface)]);}- app_data.interface_view.set_active(if !ifaces.is_empty() { Some(0) } else { None });+ app_data.interface_gui.interface_view.set_active(if !ifaces.is_empty() { Some(0) } else { None });}));- app_data.refresh_but.emit_clicked();+ app_data.interface_gui.refresh_but.emit_clicked();}-pub fn connect_interface_select(app_data: Rc<AppData>) {+fn connect_interface_select(app_data: Rc<AppData>) {app_data+ .interface_gui.select_but.connect_clicked(clone!(@strong app_data => move |_| {- let iter = match app_data.interface_view.active_iter() {+ let iter = match app_data.interface_gui.interface_view.active_iter() {Some(iter) => iter,None => return,};- let iface = list_store_get!(app_data.interface_model, &iter, 0, String);+ let iface = list_store_get!(app_data.interface_gui.interface_model, &iter, 0, String);match crate::backend::enable_monitor_mode(&iface) {Ok(res) => {- backend::set_iface(res);- app_data.interface_window.hide();- app_data.scan_but.emit_clicked();+ backend::set_iface(res.clone());++ app_data.app_gui.iface_label.set_text(&res);+ app_data.interface_gui.window.hide();+ app_data.app_gui.scan_but.emit_clicked();}Err(e) => {ErrorDialog::spawn(- &app_data.interface_window,+ &app_data.interface_gui.window,"Monitor mode failed",&format!("Could not enable monitor mode on \"{}\":\n{}", iface, e),false,);- app_data.refresh_but.emit_clicked();+ app_data.interface_gui.refresh_but.emit_clicked();}};}));}++pub fn connect(app_data: Rc<AppData>) {+ connect_interface_refresh(app_data.clone());+ connect_interface_select(app_data);+}diff --git a/src/frontend/connections/mod.rs b/src/frontend/connections/mod.rsindex 5cbe261..34073c3 100644--- a/src/frontend/connections/mod.rs+++ b/src/frontend/connections/mod.rs@@ -1,11 +1,16 @@-pub mod deauth;-pub mod handshake;-pub mod interface;-pub mod refresh;-pub mod scan;+mod app;+mod deauth;+mod decrypt;+mod interface;+mod scan;-pub use deauth::*;-pub use handshake::*;-pub use interface::*;-pub use refresh::*;-pub use scan::*;+use crate::frontend::interfaces::AppData;+use std::rc::Rc;++pub fn connect(app_data: Rc<AppData>) {+ app::connect(app_data.clone());+ scan::connect(app_data.clone());+ interface::connect(app_data.clone());+ deauth::connect(app_data.clone());+ decrypt::connect(app_data);+}diff --git a/src/frontend/connections/refresh.rs b/src/frontend/connections/refresh.rsdeleted file mode 100644index 0dd6c08..0000000--- a/src/frontend/connections/refresh.rs+++ /dev/null@@ -1,132 +0,0 @@-use crate::backend;-use crate::frontend::interfaces::*;-use crate::globals;-use crate::list_store_get;-use crate::types::*;-use gtk4::prelude::*;-use gtk4::*;-use std::rc::Rc;-use std::time::Duration;--pub fn list_store_find(storage: &ListStore, pos: i32, to_match: &str) -> Option<TreeIter> {- let mut iter = storage.iter_first();-- while let Some(it) = iter {- let value = list_store_get!(storage, &it, pos, String);-- if value == to_match {- return Some(it);- }-- iter = match storage.iter_next(&it) {- true => Some(it),- false => None,- }- }-- None-}--pub fn connect_app_refresh(app_data: Rc<AppData>) {- glib::timeout_add_local(Duration::from_millis(100), move || {- match app_data.aps_view.selection().selected() {- Some((_, iter)) => {- let bssid = list_store_get!(app_data.aps_model, &iter, 1, String);- let attack_pool = backend::get_attack_pool();-- match attack_pool.contains_key(&bssid) {- true => {- app_data.deauth_but.set_label("Stop Attack");- app_data.deauth_but.set_icon(globals::STOP_ICON);- }- false => {- app_data.deauth_but.set_label("Deauth Attack");- app_data.deauth_but.set_icon(globals::DEAUTH_ICON);- }- }- }- None => {- app_data.deauth_but.set_label("Deauth Attack");- app_data.deauth_but.set_icon(globals::DEAUTH_ICON);- }- };-- match backend::get_aps().is_empty() {- true => app_data.clear_but.set_sensitive(false),- false => app_data.clear_but.set_sensitive(true),- }-- let aps = backend::get_airodump_data();-- for (bssid, ap) in aps.iter() {- let it = match list_store_find(app_data.aps_model.as_ref(), 1, bssid.as_str()) {- Some(it) => it,- None => app_data.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),- };-- app_data.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, &background_color.to_str()),- ],- );- }-- if let Some((_, iter)) = app_data.aps_view.selection().selected() {- let bssid = list_store_get!(app_data.aps_model, &iter, 1, String);- let clients = &aps[&bssid].clients;-- for (_, cli) in clients.iter() {- let it = match list_store_find(app_data.cli_model.as_ref(), 0, cli.mac.as_str()) {- Some(it) => it,- None => app_data.cli_model.append(),- };-- let background_color = match backend::get_attack_pool().get(&bssid) {- Some(attack_target) => match &attack_target.1 {- 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.0 == cli.mac.as_str() {- color = gdk::RGBA::RED;- }- }- color- }- },- None => gdk::RGBA::new(0.0, 0.0, 0.0, 0.0),- };-- app_data.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)- });-}diff --git a/src/frontend/connections/scan.rs b/src/frontend/connections/scan.rsindex dbf86ac..33cfcdb 100644--- a/src/frontend/connections/scan.rs+++ b/src/frontend/connections/scan.rs@@ -1,11 +1,10 @@use crate::backend;use crate::frontend::interfaces::*;-use crate::types::*;+use crate::frontend::*;+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) {@@ -13,12 +12,12 @@ fn run_scan(app_data: &AppData) {let iface = match backend::get_iface() {Some(iface) => iface,- None => return app_data.interface_window.show(),+ None => return app_data.interface_gui.window.show(),};- if !app_data.ghz_2_4_but.is_active() && !app_data.ghz_5_but.is_active() {+ if !app_data.app_gui.ghz_2_4_but.is_active() && !app_data.app_gui.ghz_5_but.is_active() {return ErrorDialog::spawn(- &app_data.main_window,+ &app_data.app_gui.window,"Error","You need to select at least one frequency band",false,@@ -27,25 +26,26 @@ fn run_scan(app_data: &AppData) {let mut bands = "".to_string();- if app_data.ghz_5_but.is_active() {+ if app_data.app_gui.ghz_5_but.is_active() {if !backend::is_5ghz_supported(&iface).unwrap() {ErrorDialog::spawn(- &app_data.main_window,+ &app_data.app_gui.window,"Error","Your network card doesn't support 5GHz",false,);- return app_data.ghz_5_but.set_active(false);+ return app_data.app_gui.ghz_5_but.set_active(false);}bands.push('a');}- if app_data.ghz_2_4_but.is_active() {+ if app_data.app_gui.ghz_2_4_but.is_active() {bands.push_str("bg");}args.push("--band");args.push(&bands);let channel_filter = app_data+ .app_gui.channel_filter_entry.text().as_str()@@ -59,7 +59,7 @@ fn run_scan(app_data: &AppData) {}false => {return ErrorDialog::spawn(- &app_data.main_window,+ &app_data.app_gui.window,"Error","You need to put a valid channel filter",false,@@ -70,7 +70,7 @@ fn run_scan(app_data: &AppData) {backend::set_scan_process(&args).unwrap_or_else(|e| {ErrorDialog::spawn(- &app_data.main_window,+ &app_data.app_gui.window,"Error",&format!("Could not start scan process: {}", e),false,@@ -78,12 +78,13 @@ fn run_scan(app_data: &AppData) {});app_data+ .app_gui.scan_but.set_icon_name("media-playback-pause-symbolic");}-pub fn connect_scan_button(app_data: Rc<AppData>) {- app_data.scan_but.connect_clicked(+fn connect_scan_button(app_data: Rc<AppData>) {+ app_data.app_gui.scan_but.connect_clicked(clone!(@strong app_data => move |this| match backend::is_scan_process() {true => {backend::stop_scan_process();@@ -96,71 +97,83 @@ pub fn connect_scan_button(app_data: Rc<AppData>) {);}-pub fn connect_clear_button(app_data: Rc<AppData>) {+fn connect_clear_button(app_data: Rc<AppData>) {app_data+ .app_gui.clear_but.connect_clicked(clone!(@strong app_data => move |this| {backend::stop_scan_process();backend::get_aps().clear();- app_data.aps_model.clear();- app_data.cli_model.clear();+ app_data.app_gui.aps_model.clear();+ app_data.app_gui.cli_model.clear();this.set_sensitive(false);app_data+ .app_gui.scan_but.set_icon_name("media-playback-start-symbolic");}));}-pub fn connect_save_button(app_data: Rc<AppData>) {+fn connect_save_button(app_data: Rc<AppData>) {app_data+ .app_gui.export_but.connect_clicked(clone!(@strong app_data => move |_| {- let aps = backend::get_aps();-- if aps.is_empty() {- return ErrorDialog::spawn(- &app_data.main_window,- "Error",- "There is no data to export",- false,- );+ if backend::get_aps().is_empty() {+ return;}- let aps = aps.values().cloned().collect::<Vec<AP>>();- let json_data = serde_json::to_string::<Vec<AP>>(&aps).unwrap();+ let was_scanning = backend::is_scan_process();++ if was_scanning {+ app_data.app_gui.scan_but.emit_clicked();+ }- let file_chooser_dialog = Rc::new(FileChooserDialog::new(+ let file_chooser_dialog = FileChooserDialog::new(Some("Save Capture"),- Some(&app_data.main_window),+ Some(&app_data.app_gui.window),FileChooserAction::Save,&[("Save", ResponseType::Accept)],- ));+ );- file_chooser_dialog.set_current_name("capture.json");- file_chooser_dialog.run_async(move |this, response| {+ file_chooser_dialog.set_current_name("capture.cap");+ file_chooser_dialog.run_async(clone!(@strong app_data => 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();+ let path = gio_file.path().unwrap().to_str().unwrap().to_string();++ backend::save_capture(&path);++ for (_, ap) in backend::get_aps().iter_mut() {+ if ap.handshake {+ ap.saved_handshake = Some(path.to_owned());+ }+ }}+this.close();- });++ if was_scanning {+ app_data.app_gui.scan_but.emit_clicked();+ }+ }));}));}-pub fn connect_ghz_2_4_button(app_data: Rc<AppData>) {+fn connect_ghz_2_4_button(app_data: Rc<AppData>) {app_data+ .app_gui.ghz_2_4_but.connect_toggled(clone!(@strong app_data => move |this| {if backend::is_scan_process() {- if !this.is_active() && !app_data.ghz_5_but.is_active() {+ if !this.is_active() && !app_data.app_gui.ghz_5_but.is_active() {ErrorDialog::spawn(- &app_data.main_window,+ &app_data.app_gui.window,"Error","You need to select at least one frequency band",false,@@ -174,6 +187,7 @@ pub fn connect_ghz_2_4_button(app_data: Rc<AppData>) {pub fn connect_ghz_5_button(app_data: Rc<AppData>) {app_data+ .app_gui.ghz_5_but.connect_toggled(clone!(@strong app_data => move |this| {let iface = match backend::get_iface() {@@ -183,7 +197,7 @@ pub fn connect_ghz_5_button(app_data: Rc<AppData>) {if !backend::is_5ghz_supported(&iface).unwrap() && this.is_active() {ErrorDialog::spawn(- &app_data.main_window,+ &app_data.app_gui.window,"Error","Your network card doesn't support 5GHz",false,@@ -192,9 +206,9 @@ pub fn connect_ghz_5_button(app_data: Rc<AppData>) {}if backend::is_scan_process() {- if !this.is_active() && !app_data.ghz_2_4_but.is_active() {+ if !this.is_active() && !app_data.app_gui.ghz_2_4_but.is_active() {ErrorDialog::spawn(- &app_data.main_window,+ &app_data.app_gui.window,"Error","You need to select at least one frequency band",false,@@ -206,10 +220,9 @@ pub fn connect_ghz_5_button(app_data: Rc<AppData>) {}));}-pub fn connect_channel_entry(app_data: Rc<AppData>) {- app_data- .channel_filter_entry- .connect_text_notify(clone!(@strong app_data => move |this| {+fn connect_channel_entry(app_data: Rc<AppData>) {+ app_data.app_gui.channel_filter_entry.connect_text_notify(+ clone!(@strong app_data => move |this| {let channel_filter = this.text().as_str()@@ -222,23 +235,36 @@ pub fn connect_channel_entry(app_data: Rc<AppData>) {if backend::is_scan_process() {run_scan(&app_data);}- }));+ }),+ );}-pub fn connect_cursor_changed(app_data: Rc<AppData>) {+fn connect_cursor_changed(app_data: Rc<AppData>) {app_data+ .app_gui.aps_view.connect_cursor_changed(clone!(@strong app_data => move |this| {match this.selection().selected().is_some() {true => {- app_data.deauth_but.set_sensitive(true);- app_data.capture_but.set_sensitive(true);+ app_data.app_gui.deauth_but.set_sensitive(true);}false => {- app_data.deauth_but.set_sensitive(false);- app_data.capture_but.set_sensitive(false);+ app_data.app_gui.deauth_but.set_sensitive(false);+ app_data.app_gui.capture_but.set_sensitive(false);}};- app_data.cli_model.clear();+ app_data.app_gui.cli_model.clear();}));}++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_ghz_2_4_button(app_data.clone());+ connect_ghz_5_button(app_data.clone());++ connect_channel_entry(app_data.clone());+ connect_cursor_changed(app_data);+}diff --git a/src/frontend/interfaces/app.rs b/src/frontend/interfaces/app.rsold mode 100644new mode 100755index 6c4289e..0072f7a--- a/src/frontend/interfaces/app.rs+++ b/src/frontend/interfaces/app.rs@@ -1,48 +1,47 @@use crate::backend;use crate::frontend::widgets::*;use crate::globals;-use gtk4::gdk_pixbuf::Pixbuf;use gtk4::prelude::*;use gtk4::*;fn build_about_button() -> Button {- let about_button = Button::builder().icon_name("dialog-information").build();-- about_button.connect_clicked(|_| {- let ico = Pixbuf::from_read(std::io::BufReader::new(globals::APP_ICON)).unwrap();- let des = "A WiFi auditing software that can perform deauth attacks and passwords cracking";-- AboutDialog::builder()- .program_name("Airgorah")- .version(globals::VERSION)- .authors(vec!["Martin OLIVIER ([email protected])".to_string()])- .copyright("Copyright (c) Martin OLIVIER")- .license_type(License::MitX11)- .logo(&Picture::for_pixbuf(&ico).paintable().unwrap())- .comments(des)- .website_label("https://github.com/martin-olivier/airgorah")- .modal(true)- .build()- .show();- });+ Button::builder()+ .icon_name("dialog-information")+ .tooltip_text("About")+ .build()+}- about_button+fn build_update_button() -> Button {+ Button::builder()+ .icon_name("emblem-downloads")+ .tooltip_text("Update available")+ .build()}-pub fn build_header_bar() -> HeaderBar {- let header_bar = HeaderBar::builder().show_title_buttons(true).build();+fn build_decrypt_button() -> Button {+ Button::builder()+ .icon_name("utilities-terminal")+ .tooltip_text("Open the handshake decryption pannel")+ .build()+}- header_bar.pack_start(&build_about_button());+fn build_settings_button() -> Button {+ Button::builder()+ .icon_name("preferences-system")+ .tooltip_text("Open the settings pannel")+ .build()+}- header_bar+pub fn build_header_bar() -> HeaderBar {+ HeaderBar::builder().show_title_buttons(true).build()}-fn build_main_window(app: &Application) -> ApplicationWindow {+fn build_window(app: &Application) -> ApplicationWindow {let window = ApplicationWindow::builder().application(app).title("Airgorah").default_width(1280)- .default_height(540)+ .default_height(620).build();window.connect_close_request(|_| {@@ -53,50 +52,20 @@ fn build_main_window(app: &Application) -> ApplicationWindow {window}-fn build_interface_window(app: &Application) -> Window {- Window::builder()- .title("Select a wireless interface")- .hide_on_close(true)- .default_width(280)- .default_height(70)- .resizable(false)- .modal(true)- .transient_for(&app.active_window().unwrap())- .build()-}--fn build_interface_model() -> ListStore {- ListStore::new(&[glib::Type::STRING])-}--fn build_interface_view(model: &ListStore) -> ComboBox {- let text_renderer = CellRendererText::new();-- let icon_renderer = CellRendererPixbuf::new();- icon_renderer.set_property("icon-name", "network-wired");-- 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", 0);-- combo-}-fn build_aps_model() -> ListStore {ListStore::new(&[- glib::Type::STRING,- glib::Type::STRING,- glib::Type::STRING,- glib::Type::I32,- glib::Type::I32,- glib::Type::I32,- glib::Type::STRING,- glib::Type::I32,- glib::Type::STRING,- glib::Type::STRING,- glib::Type::STRING, // color+ glib::Type::STRING, // ESSID+ glib::Type::STRING, // BSSID+ glib::Type::STRING, // Band+ glib::Type::I32, // Channel+ glib::Type::I32, // Speed+ glib::Type::I32, // Power+ glib::Type::STRING, // Encryption+ glib::Type::I32, // Clients+ glib::Type::STRING, // Handshake+ glib::Type::STRING, // First time seen+ glib::Type::STRING, // First time seen+ glib::Type::STRING, // <color>])}@@ -111,6 +80,7 @@ fn build_aps_view() -> TreeView {"Power","Encryption","Clients",+ "Handshake","First time seen","Last time seen",];@@ -132,9 +102,9 @@ fn build_aps_view() -> TreeView {}let text_renderer = CellRendererText::new();- column.pack_start(&text_renderer, true);+ column.pack_start(&text_renderer, false);column.add_attribute(&text_renderer, "text", pos as i32);- column.add_attribute(&text_renderer, "background", 10);+ column.add_attribute(&text_renderer, "background", 11);view.append_column(&column);}@@ -151,12 +121,12 @@ fn build_aps_scroll() -> ScrolledWindow {fn build_cli_model() -> ListStore {ListStore::new(&[- glib::Type::STRING,- glib::Type::I32,- glib::Type::I32,- glib::Type::STRING,- glib::Type::STRING,- glib::Type::STRING,+ glib::Type::STRING, // Station MAC+ glib::Type::I32, // Packets+ glib::Type::I32, // Power+ glib::Type::STRING, // First time seen+ glib::Type::STRING, // Last time seen+ glib::Type::STRING, // <color>])}@@ -203,13 +173,20 @@ fn build_cli_scroll() -> ScrolledWindow {aps_scroll}-pub struct AppData {+pub struct AppGui {+ // Header bar+ pub about_button: Button,+ pub update_button: Button,+ pub decrypt_button: Button,+ pub settings_button: Button,+// Main window- pub main_window: ApplicationWindow,+ pub window: ApplicationWindow,pub aps_model: ListStore,pub aps_view: TreeView,pub cli_model: ListStore,pub cli_view: TreeView,+ pub iface_label: Label,pub ghz_2_4_but: CheckButton,pub ghz_5_but: CheckButton,pub channel_filter_entry: Entry,@@ -218,23 +195,28 @@ pub struct AppData {pub export_but: Button,pub deauth_but: IconTextButton,pub capture_but: IconTextButton,-- // Interface window- pub interface_window: Window,- pub select_but: Button,- pub refresh_but: Button,- pub interface_model: ListStore,- pub interface_view: ComboBox,}-impl AppData {+impl AppGui {pub fn new(app: &Application) -> Self {- // --- MAIN WINDOW ---+ let window = build_window(app);+ let header_bar = build_header_bar();++ window.set_titlebar(Some(&header_bar));++ 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(&update_button);+ header_bar.pack_end(&settings_button);+ header_bar.pack_end(&decrypt_button);- let main_window = build_main_window(app);- main_window.set_titlebar(Some(&build_header_bar()));+ update_button.hide();- // Left Views (APs and Clients)+ // Left View (Access Points and Clients)let aps_model = build_aps_model();let aps_view = build_aps_view();@@ -265,7 +247,7 @@ impl AppData {let export_but = Button::builder().icon_name("media-floppy-symbolic")- .tooltip_text("Export the scan results to a JSON file")+ .tooltip_text("Save the capture").build();let top_but_box = CenterBox::new();@@ -276,19 +258,35 @@ impl AppData {top_but_box.set_center_widget(Some(&clear_but));top_but_box.set_end_widget(Some(&export_but));- // Scan filters+ // Interface Display- let scan_box = Box::new(Orientation::Vertical, 10);+ 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));++ // Scan filterslet 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();- ghz_2_4_but.set_margin_start(6);- ghz_5_but.set_margin_end(6);-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"));@@ -309,14 +307,20 @@ impl AppData {separator.set_opacity(0.0);let deauth_but = IconTextButton::new(globals::DEAUTH_ICON, "Deauth Attack");- deauth_but.set_tooltip_text(Some("Perform (or stop) a deauth attack on the selected AP"));+ 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, "Handshake Capture");- capture_but.set_tooltip_text(Some("Capture a WPA handshake from the selected AP"));+ let capture_but = IconTextButton::new(globals::CAPTURE_ICON, "Decrypt Handshake");+ 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);@@ -331,57 +335,31 @@ impl AppData {// Set main window childs- let main_box = Box::new(Orientation::Horizontal, 10);-let panned = Paned::new(Orientation::Vertical);panned.set_wide_handle(true);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);- main_window.set_child(Some(&main_box));- main_window.show();-- // --- INTERFACE WINDOW ----- let interface_window = build_interface_window(app);-- let interface_model = build_interface_model();-- let interface_view = build_interface_view(&interface_model);-- let refresh_but = Button::builder()- .icon_name("object-rotate-right-symbolic")- .build();-- let select_but = Button::with_label("Select");-- let hbox = Box::new(Orientation::Horizontal, 10);- let vbox = Box::new(Orientation::Vertical, 10);-- hbox.append(&interface_view);- hbox.append(&refresh_but);-- hbox.set_margin_top(10);- hbox.set_margin_start(10);- hbox.set_margin_end(10);-- vbox.append(&hbox);- vbox.append(&select_but);-- vbox.set_margin_top(0);-- interface_window.set_child(Some(&vbox));+ window.set_child(Some(&main_box));+ window.show();Self {- // MAIN WINDOW- main_window,+ // Header bar+ about_button,+ update_button,+ decrypt_button,+ settings_button,+ // Main window+ window,aps_model,aps_view,cli_model,cli_view,+ iface_label,ghz_2_4_but,ghz_5_but,channel_filter_entry,@@ -390,12 +368,6 @@ impl AppData {export_but,deauth_but,capture_but,- // INTERFACE WINDOW- interface_window,- select_but,- refresh_but,- interface_model,- interface_view,}}}diff --git a/src/frontend/interfaces/deauth.rs b/src/frontend/interfaces/deauth.rsold mode 100644new mode 100755index 80aca82..b39a142--- a/src/frontend/interfaces/deauth.rs+++ b/src/frontend/interfaces/deauth.rs@@ -1,28 +1,29 @@-use glib::Value;+use crate::types::*;use gtk4::prelude::*;use gtk4::*;-use std::rc::Rc;--use super::dialog::*;-use crate::backend;-use crate::list_store_get;-use crate::types::*;-pub struct DeauthWindow;--impl DeauthWindow {- pub fn spawn(parent: &impl IsA<Window>, ap: AP) {- let window = Rc::new(- Window::builder()- .title(&format!("Deauth \"{}\"", ap.essid))- .default_width(300)- .default_height(140)- .resizable(false)- .modal(true)- .build(),- );+pub struct DeauthGui {+ pub window: Window,+ pub store: ListStore,+ pub view: TreeView,+ pub toggle: CellRendererToggle,+ pub scroll: ScrolledWindow,+ pub all_cli_but: CheckButton,+ pub sel_cli_but: CheckButton,+ pub attack_but: Button,+}- window.set_transient_for(Some(parent));+impl DeauthGui {+ pub fn new(parent: &impl IsA<Window>) -> Self {+ let window = Window::builder()+ .title("Deauth")+ .hide_on_close(true)+ .default_width(300)+ .default_height(300)+ .resizable(false)+ .transient_for(parent)+ .modal(true)+ .build();let all_cli_but = CheckButton::with_label("Deauth all clients");let sel_cli_but = CheckButton::with_label("Deauth selected clients");@@ -40,22 +41,19 @@ impl DeauthWindow {but_box.append(&all_cli_but);but_box.append(&sel_cli_but);- let store = Rc::new(ListStore::new(&[glib::Type::BOOL, glib::Type::STRING]));+ let store = ListStore::new(&[glib::Type::BOOL, glib::Type::STRING]);let frame = Frame::new(None);frame.set_child(Some(&but_box));- let view = Rc::new(TreeView::new());- view.set_model(Some(store.as_ref()));-- for (_, cli) in ap.clients.iter() {- store.set(&store.append(), &[(0, &false), (1, &cli.mac)]);- }-let column = TreeViewColumn::new();column.set_title("Clients");- view.append_column(&column);++ let view = TreeView::new();+ view.set_sensitive(false);view.set_vexpand(true);+ view.set_model(Some(&store));+ view.append_column(&column);let toggle = CellRendererToggle::new();column.pack_start(&toggle, false);@@ -65,17 +63,16 @@ impl DeauthWindow {column.pack_start(&text_ren, true);column.add_attribute(&text_ren, "text", 1);- let scroll = Rc::new(ScrolledWindow::new());+ let scroll = ScrolledWindow::new();scroll.set_policy(PolicyType::Never, PolicyType::Automatic);- scroll.set_child(Some(view.as_ref()));- scroll.hide();+ scroll.set_child(Some(&view));- let attack_but = Rc::new(Button::with_label("Attack"));+ let attack_but = Button::with_label("Attack");let main_box = Box::new(Orientation::Vertical, 10);main_box.append(&frame);- main_box.append(&*scroll);- main_box.append(&*attack_but);+ main_box.append(&scroll);+ main_box.append(&attack_but);main_box.set_margin_bottom(10);main_box.set_margin_end(10);@@ -83,84 +80,34 @@ impl DeauthWindow {main_box.set_margin_top(10);window.set_child(Some(&main_box));- window.show();-- // Callbacks-- let window_ref = window.clone();- let scroll_ref = scroll.clone();- let attack_but_ref = attack_but.clone();-- all_cli_but.connect_toggled(move |_| {- scroll_ref.hide();- window_ref.set_height_request(140);- attack_but_ref.set_sensitive(true);- });-- let window_ref = window.clone();- let store_ref = store.clone();- let attack_but_ref = attack_but.clone();-- sel_cli_but.connect_toggled(move |_| {- scroll.show();- window_ref.set_height_request(300);- if get_selected_clis(&store_ref).is_empty() {- attack_but_ref.set_sensitive(false);- }- });-- let store_ref = store.clone();- let attack_but_ref = attack_but.clone();-- toggle.connect_toggled(move |_, path| {- let iter = store_ref.iter(&path).unwrap();- let old_val = list_store_get!(store_ref, &iter, 0, bool);-- store_ref.set_value(&iter, 0, &Value::from(&(!old_val)));-- match get_selected_clis(&store_ref).is_empty() {- true => attack_but_ref.set_sensitive(false),- false => attack_but_ref.set_sensitive(true),- };- });-- attack_but.connect_clicked(move |_| {- let params = match sel_cli_but.is_active() {- true => Some(get_selected_clis(store.as_ref())),- false => None,- };-- backend::launch_deauth_attack(ap.clone(), params).unwrap_or_else(|e| {- return ErrorDialog::spawn(- window.as_ref(),- "Error",- &format!("Could not start deauth process: {}", e),- false,- );- });-- window.close();- });++ Self {+ window,+ store,+ view,+ toggle,+ scroll,+ all_cli_but,+ sel_cli_but,+ attack_but,+ }}-}-fn get_selected_clis(storage: &ListStore) -> Vec<String> {- let mut iter = storage.iter_first();- let mut selected_clis = vec![];+ pub fn show(&self, ap: AP) {+ self.window+ .set_title(Some(&format!("Deauth \"{}\"", ap.essid)));- while let Some(it) = iter {- let check_val = list_store_get!(storage, &it, 0, bool);- let mac_val = list_store_get!(storage, &it, 1, String);+ self.sel_cli_but.set_active(false);+ self.all_cli_but.set_active(true);+ self.view.set_sensitive(false);+ self.attack_but.set_sensitive(true);- if check_val {- selected_clis.push(mac_val);+ self.store.clear();+ for (_, cli) in ap.clients.iter() {+ self.store+ .set(&self.store.append(), &[(0, &false), (1, &cli.mac)]);}- iter = match storage.iter_next(&it) {- true => Some(it),- false => None,- }+ self.window.show();}-- selected_clis}diff --git a/src/frontend/interfaces/decrypt.rs b/src/frontend/interfaces/decrypt.rsnew file mode 100644index 0000000..b716095--- /dev/null+++ b/src/frontend/interfaces/decrypt.rs@@ -0,0 +1,99 @@+use gtk4::prelude::*;+use gtk4::*;++pub struct DecryptGui {+ pub window: Window,+ pub handshake_but: Button,+ pub handshake_entry: Entry,+ pub wordlist_but: Button,+ pub wordlist_entry: Entry,+ pub decrypt_but: Button,+}++impl DecryptGui {+ pub fn new(parent: &impl IsA<Window>) -> Self {+ let window = Window::builder()+ .title("Decrypt Handshake")+ .hide_on_close(true)+ .default_width(500)+ .default_height(200)+ .resizable(false)+ .transient_for(parent)+ .modal(true)+ .build();++ let handshake_entry = Entry::builder()+ .placeholder_text("ex: handshake.cap")+ .hexpand(true)+ .editable(false)+ .build();++ let handshake_but = Button::from_icon_name("edit-find-symbolic");++ let handshake_frame = Frame::new(Some("Capture"));++ let handshake_box = Box::new(Orientation::Horizontal, 4);+ handshake_box.set_margin_start(4);+ handshake_box.set_margin_end(4);+ handshake_box.set_margin_bottom(4);+ handshake_box.append(&handshake_entry);+ handshake_box.append(&handshake_but);++ 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 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 decrypt_but = Button::with_label("Start Decryption");+ decrypt_but.set_sensitive(false);++ let vbox = Box::new(Orientation::Vertical, 10);+ vbox.set_margin_top(10);+ vbox.set_margin_end(10);+ vbox.set_margin_start(10);+ vbox.set_margin_bottom(10);++ vbox.append(&handshake_frame);+ vbox.append(&wordlist_frame);+ vbox.append(&decrypt_but);++ window.set_child(Some(&vbox));++ Self {+ window,+ handshake_but,+ handshake_entry,+ wordlist_but,+ wordlist_entry,+ decrypt_but,+ }+ }++ pub fn show(&self, capture_file: Option<String>) {+ self.handshake_entry.set_text("");+ self.wordlist_entry.set_text("");+ self.decrypt_but.set_sensitive(false);++ if let Some(path) = capture_file {+ self.handshake_entry.set_text(&path);+ }++ self.window.show();+ }+}diff --git a/src/frontend/interfaces/interface.rs b/src/frontend/interfaces/interface.rsnew file mode 100755index 0000000..4c930fd--- /dev/null+++ b/src/frontend/interfaces/interface.rs@@ -0,0 +1,74 @@+use gtk4::prelude::*;+use gtk4::*;++fn build_interface_model() -> ListStore {+ ListStore::new(&[glib::Type::STRING])+}++fn build_interface_view(model: &ListStore) -> ComboBox {+ let text_renderer = CellRendererText::new();++ let icon_renderer = CellRendererPixbuf::new();+ icon_renderer.set_property("icon-name", "network-wired");++ 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", 0);++ combo+}++pub struct InterfaceGui {+ pub window: Window,+ pub select_but: Button,+ pub refresh_but: Button,+ pub interface_model: ListStore,+ pub interface_view: ComboBox,+}++impl InterfaceGui {+ pub fn new(parent: &impl IsA<Window>) -> Self {+ let window = Window::builder()+ .title("Select a wireless interface")+ .hide_on_close(true)+ .default_width(280)+ .default_height(70)+ .resizable(false)+ .modal(true)+ .transient_for(parent)+ .build();++ let interface_model = build_interface_model();+ let interface_view = build_interface_view(&interface_model);++ let refresh_but = Button::builder().icon_name("view-refresh-symbolic").build();++ let select_but = Button::with_label("Select");++ let hbox = Box::new(Orientation::Horizontal, 10);+ let vbox = Box::new(Orientation::Vertical, 10);++ hbox.append(&interface_view);+ hbox.append(&refresh_but);++ vbox.set_margin_top(10);+ vbox.set_margin_start(10);+ vbox.set_margin_end(10);+ vbox.set_margin_bottom(10);++ vbox.append(&hbox);+ vbox.append(&select_but);++ window.set_child(Some(&vbox));++ Self {+ window,+ select_but,+ refresh_but,+ interface_model,+ interface_view,+ }+ }+}diff --git a/src/frontend/interfaces/mod.rs b/src/frontend/interfaces/mod.rsindex 240bd8c..d0fd494 100644--- a/src/frontend/interfaces/mod.rs+++ b/src/frontend/interfaces/mod.rs@@ -1,7 +1,32 @@pub mod app;pub mod deauth;-pub mod dialog;+pub mod decrypt;+pub mod interface;-pub use app::AppData;-pub use deauth::DeauthWindow;-pub use dialog::{ErrorDialog, InfoDialog};+pub use app::AppGui;+pub use deauth::DeauthGui;+pub use decrypt::DecryptGui;+pub use interface::InterfaceGui;++pub struct AppData {+ pub app_gui: AppGui,+ pub interface_gui: InterfaceGui,+ pub deauth_gui: DeauthGui,+ pub decrypt_gui: DecryptGui,+}++impl AppData {+ pub fn new(app: >k4::Application) -> Self {+ let app_gui = AppGui::new(app);+ let interface_gui = InterfaceGui::new(&app_gui.window);+ let deauth_gui = DeauthGui::new(&app_gui.window);+ let decrypt_gui = DecryptGui::new(&app_gui.window);++ Self {+ app_gui,+ interface_gui,+ deauth_gui,+ decrypt_gui,+ }+ }+}diff --git a/src/frontend/mod.rs b/src/frontend/mod.rsindex 0bfb9a2..bff16f3 100644--- a/src/frontend/mod.rs+++ b/src/frontend/mod.rs@@ -3,10 +3,9 @@ mod interfaces;mod widgets;use crate::backend;-use connections::*;use interfaces::*;+use widgets::*;-use gtk4::prelude::*;use gtk4::*;use std::rc::Rc;@@ -14,25 +13,10 @@ pub fn build_ui(app: &Application) {let gui_data = Rc::new(AppData::new(app));if let Err(e) = backend::app_setup() {- return ErrorDialog::spawn(&app.active_window().unwrap(), "Error", &e.to_string(), true);+ return ErrorDialog::spawn(&gui_data.app_gui.window, "Error", &e.to_string(), true);}- connect_app_refresh(gui_data.clone());- connect_cursor_changed(gui_data.clone());-- connect_interface_refresh(gui_data.clone());- connect_interface_select(gui_data.clone());-- connect_scan_button(gui_data.clone());- connect_clear_button(gui_data.clone());- connect_save_button(gui_data.clone());-- connect_ghz_2_4_button(gui_data.clone());- connect_ghz_5_button(gui_data.clone());- connect_channel_entry(gui_data.clone());-- connect_deauth_button(gui_data.clone());- connect_capture_button(gui_data);+ connections::connect(gui_data);}#[macro_export]diff --git a/src/frontend/interfaces/dialog.rs b/src/frontend/widgets/dialog.rssimilarity index 100%rename from src/frontend/interfaces/dialog.rsrename to src/frontend/widgets/dialog.rsdiff --git a/src/frontend/widgets/icon_button.rs b/src/frontend/widgets/icon_button.rsindex 95dd543..3b20215 100644--- a/src/frontend/widgets/icon_button.rs+++ b/src/frontend/widgets/icon_button.rs@@ -12,9 +12,7 @@ pub struct IconButton {impl IconButton {pub fn new(icon: &'static [u8]) -> Self {let pixbuf = Pixbuf::from_read(std::io::BufReader::new(icon)).unwrap();-let image = Image::from_pixbuf(Some(&pixbuf));-let handle = Button::builder().child(&image).build();Self { handle, image }diff --git a/src/frontend/widgets/icon_text_button.rs b/src/frontend/widgets/icon_text_button.rsindex db30d3d..8a4c64b 100644--- a/src/frontend/widgets/icon_text_button.rs+++ b/src/frontend/widgets/icon_text_button.rs@@ -16,9 +16,7 @@ impl IconTextButton {but_box.set_halign(Align::Center);let pixbuf = Pixbuf::from_read(std::io::BufReader::new(icon)).unwrap();-let image = Image::from_pixbuf(Some(&pixbuf));-let label = Label::with_mnemonic(text);but_box.append(&image);diff --git a/src/frontend/widgets/mod.rs b/src/frontend/widgets/mod.rsindex 809793e..f4797b3 100644--- a/src/frontend/widgets/mod.rs+++ b/src/frontend/widgets/mod.rs@@ -1,5 +1,7 @@+mod dialog;mod icon_button;mod icon_text_button;+pub use dialog::*;pub use icon_button::IconButton;pub use icon_text_button::IconTextButton;diff --git a/src/globals.rs b/src/globals.rsindex eea0600..b0aacb6 100644--- a/src/globals.rs+++ b/src/globals.rs@@ -3,20 +3,26 @@ use lazy_static::lazy_static;use std::collections::HashMap;use std::process::Child;use std::sync::Mutex;+use std::thread::JoinHandle;pub static APP_ID: &str = "com.martin-olivier.airgorah";-pub static VERSION: &str = "v0.1.0";-pub static SCAN_PATH: &str = "/tmp/airgorah_scan";+pub static VERSION: &str = "v0.2.0";++pub static LIVE_SCAN_PATH: &str = "/tmp/airgorah_live_scan";+pub static OLD_SCAN_PATH: &str = "/tmp/airgorah_old_scan";+pub static MERGE_SCAN_PATH: &str = "/tmp/airgorah_merge_scan";pub static APP_ICON: &[u8] = include_bytes!("../icons/app_icon.png");pub static DEAUTH_ICON: &[u8] = include_bytes!("../icons/deauth.png");pub static STOP_ICON: &[u8] = include_bytes!("../icons/stop.png");pub static CAPTURE_ICON: &[u8] = include_bytes!("../icons/capture.png");+pub type AttackPool = HashMap<String, (AP, AttackedClients)>;+lazy_static! {pub static ref IFACE: Mutex<Option<String>> = Mutex::new(None);+ pub static ref UPDATE_PROC: Mutex<Option<JoinHandle<bool>>> = Mutex::new(None);pub static ref SCAN_PROC: Mutex<Option<Child>> = Mutex::new(None);pub static ref APS: Mutex<HashMap<String, AP>> = Mutex::new(HashMap::new());- pub static ref ATTACK_POOL: Mutex<HashMap<String, (AP, AttackedClients)>> =- Mutex::new(HashMap::new());+ pub static ref ATTACK_POOL: Mutex<AttackPool> = Mutex::new(HashMap::new());}diff --git a/src/types.rs b/src/types.rsindex dd0016d..15e84cc 100644--- a/src/types.rs+++ b/src/types.rs@@ -16,6 +16,8 @@ pub struct AP {pub speed: String,pub power: String,pub privacy: String,+ pub handshake: bool,+ pub saved_handshake: Option<String>,pub first_time_seen: String,pub last_time_seen: String,pub clients: HashMap<String, Client>,