├── .gitignore ├── .travis.yml ├── CODE_OF_CONDUCT.md ├── DEPENDENCIES.md ├── ISSUE_TEMPLATE.md ├── LICENSE ├── README.md ├── _config.yml ├── bin ├── arpcontroller.py ├── installer.py ├── interface.py ├── quickinstall.sh ├── scutum ├── scutum-gui ├── scutum.py ├── ufw.py └── utilities.py ├── res ├── scutum-gui.desktop ├── scutum-gui.png └── scutum.service └── scutum-gui-qt ├── main.cpp ├── mainwindow.cpp ├── mainwindow.h ├── mainwindow.ui ├── scutum-gui.pro ├── scutum-gui.pro.user ├── scutum-gui.pro.user.044bdd7 └── scutum-gui.pro.user.84c1451 /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | .idea/ 3 | .directory -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: enabled 2 | dist: xenial 3 | language: python 4 | python: 5 | - "3.6" 6 | 7 | install: "pip install avalon_framework" 8 | 9 | script: 10 | - python3 bin/scutum.py --version 11 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at k4yt3x@k4yt3x.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /DEPENDENCIES.md: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | Date Created: Sep 30, 2017 3 | Last Modified: Nov 10, 2017 4 | Updated for Version **2.6.1** 5 | 6 | 7 | ### Through Package Manager 8 | * arptables 9 | * ufw ( only if UFW Firewall function is enabled ) 10 | 11 | ### Through pip 12 | * avalon_framework 13 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Expected Behavior 2 | 3 | 4 | ## Actual Behavior 5 | 6 | 7 | ## Steps to Reproduce the Problem 8 | 9 | 1. 10 | 1. 11 | 1. 12 | 13 | ## Specifications 14 | 15 | - Version: 16 | - Platform: 17 | - Subsystem: 18 | -------------------------------------------------------------------------------- /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 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 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 | {project} Copyright (C) {year} {fullname} 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 | [![Join the chat at https://gitter.im/K4YT3X-DEV/SCUTUM](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/K4YT3X-DEV/SCUTUM?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 2 | [![status](https://travis-ci.org/K4YT3X/scutum.svg)](https://travis-ci.org/K4YT3X/scutum) 3 | 4 | # SCUTUM Firewall 5 | 6 | ## Introduction 7 | 8 | **In short, SCUTUM configures your personal computer automatically against malicious TCP/UDP traffic and ARP spoofing attacks.** This software uses UFW to setup conventional firewall for you, determines and locks the gateway MAC address so you won't get ARP-spoofed. 9 | 10 | This software is designed to be compact and effective. Currently it can support only one interface at a time. Traffic will only be allowed on one interface. We are looking into possibilities of supporting multiple interfaces at once. 11 | 12 | ## 2.10.2 (May 5, 2019) 13 | 14 | 1. Fixed nftables ARP issues. ARP packets are now correctly blocked in the arp table instead of inet. 15 | 1. Replaced format strings with f-strings. 16 | 17 | ## 2.10.0 (November 2, 2018) 18 | 19 | 1. Fixed the problem when SCUTUM is first enabled, gateway MAC address is not 20 | cached and locked. 21 | 22 | ## 2.10.0 (October 31, 2018) 23 | 24 | 1. Changed configuration file to JSON 25 | - Please delete the old INI config and reinstall `scutum`. 26 | 1. Added support for `netfilter`. 27 | 1. Grouped sections of code into methods for easier code maintenance. 28 | 1. Optimized code. 29 | 30 | ## Quick Install 31 | 32 | ### Prerequisites 33 | 34 | * Designed for Linux OS 35 | * `curl` or `wget` is required for quick install 36 | * `git` should be installed 37 | 38 | **Example for a typical Ubuntu environment (18.04)** 39 | ``` 40 | $ sudo apt install git python3-pip curl 41 | $ sudo pip3 install avalon_framework 42 | ``` 43 | 44 | **Full SCUTUM Dependency list can be found in [DEPENDENCIES.md](https://github.com/K4YT3X/scutum/blob/master/README.md)** 45 | 46 | **via curl** 47 | 48 | ``` 49 | $ sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/K4YT3X/scutum/master/bin/quickinstall.sh)" 50 | ``` 51 | 52 | **via wget** 53 | 54 | ``` 55 | $ sudo sh -c "$(wget https://raw.githubusercontent.com/K4YT3X/scutum/master/bin/quickinstall.sh -O -)" 56 | ``` 57 | 58 | ![scutum_gui](https://user-images.githubusercontent.com/21986859/29802954-bb3475f2-8c46-11e7-8c21-efae476ac5a6.png) 59 | ![effects](https://user-images.githubusercontent.com/21986859/44294941-86b5da80-a26d-11e8-9ed1-f67171a3f4d2.png) 60 | 61 | ## What is SCUTUM? 62 | 63 | **Long story short, ARP firewall. It automatically adds gateways to the whitelist on connect and blocks everthing else to avoid potential threat.** 64 | 65 | SCUTUM is an ARP firewall that **prevents your computer from being ARP-spoofed** by other computers on LAN. SCUTUM controls "arptables" in your computer so it accepts ARP packets only from the gateway. This way, when people with malicious intentions cannot spoof your arp table. SCUTUM also prevents other people from detecting your device on LAN if SCUTUM is used with properly configured TCP/UDP firewall. 66 | 67 | SCUTUM is also capable of handling tcp/udp/icmp traffic with iptables. You can choose to enable this feature during installation. However, a more professional firewall controller like UFW is recommended. They can handle traffic with more precision. 68 | 69 | ## Usage & Installation 70 | 71 | You should run a installation before running it for the first time for setting up configuration files. 72 | I am not sure if portable version is necessary. If you think this should be changed, raise an issue and I will change it. 73 | 74 | #### Installation 75 | 76 | Quick install above is recommended 77 | 78 | ``` 79 | git clone https://github.com/K4YT3X/scutum.git 80 | cd scutum/bin 81 | sudo python3 scutum.py --install 82 | ``` 83 | 84 | #### GUI Usage (Currently not working) 85 | 86 | ``` 87 | ENABLE: Enable SCUTUM (Start spontaneously) 88 | DISABLE: Disable SCUTUM (Never start spontaneously) 89 | DISABLE (Temporarily): Disable SCUTUM until the next time connected to a network 90 | ``` 91 | 92 | #### Usage 93 | 94 | SCUTUM starts **automatically** by itself after installation. 95 | 96 | Full up-to-date usage can be found by executing: 97 | ``` 98 | $ scutum --help 99 | ``` 100 | ``` 101 | $ sudo service scutum start # Start scutum service 102 | $ sudo service scutum stop # Stop scutum service 103 | $ sudo systemctl enable scutum # Start SCUTUM with system 104 | $ sudo systemctl disable scutum # Don't start SCUTUM with system 105 | $ sudo scutum # Start SCUTUM Normally 106 | $ sudo scutum --start # Start SCUTUM Manually for once even it it's disabled 107 | $ sudo scutum --enable # Enable SCUTUM (Start automatically on connect) 108 | $ sudo scutum --disable # Disable SCUTUM (Don't start automatically on connect) 109 | $ sudo scutum --reset # Reset SCUTUM (Allow ALL ARP packages temporarily) 110 | $ sudo scutum --purgelog # Purge SCUTUM logs 111 | $ sudo scutum --install # Run scutum installation wizard and install SCUTUM into system 112 | $ sudo scutum --uninstall # Remove SCUTUM from system completely 113 | $ sudo scutum --upgrade # Upgrade SCUTUM and AVALON Framework 114 | ``` 115 | 116 | ## SCUTUM Workflow 117 | 118 | #### postconnect 119 | 120 | 1. Connect to Wi-Fi 121 | 2. Accept all ARP packets 122 | 3. Cache gateway MAC address by establishing a socket connection with a timeout of 0 123 | 4. Add Gateway MAC to exception 124 | 5. DROP all ARP packets 125 | 126 | [Finished] 127 | 128 | #### postdisconnect 129 | 130 | 1. Accept all ARP packets 131 | 132 | [Finished] 133 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-slate -------------------------------------------------------------------------------- /bin/arpcontroller.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Name: SCUTUM ARP Controller 5 | Author: K4YT3X 6 | Date Created: October 31, 2018 7 | Last Modified: May 5, 2019 8 | 9 | Description: This class controls all ARP 10 | related operations. 11 | """ 12 | from avalon_framework import Avalon 13 | from utilities import Utilities 14 | 15 | 16 | class ArpController(): 17 | """ ARP Controller for SCUTUM 18 | 19 | This class controls all the operations that are 20 | related to ARP, such as blocking and allowing. 21 | """ 22 | 23 | def __init__(self, driver='nftables'): 24 | 25 | self.driver = driver 26 | 27 | if self.driver != 'nftables' and self.driver != 'arptables': 28 | Avalon.warning('Unrecognized ARP controller driver {}'.format(self.driver)) 29 | Avalon.warning('Falling back to nftables') 30 | self.driver = 'nftables' 31 | 32 | def append_allowed_mac(self, mac_address, interface=False): 33 | """ Allow the traffic from this MAC address 34 | 35 | This will drop all traffic that is not from this address. 36 | """ 37 | if self.driver == 'arptables': 38 | # Allow only this MAC address globally 39 | Utilities.execute(['arptables', '-P', 'INPUT', 'DROP']) 40 | Utilities.execute(['arptables', '-A', 'INPUT', '--source-mac', mac_address, '-j', 'ACCEPT']) 41 | elif interface: 42 | # If an interface is provided, limit rule to interface 43 | Utilities.execute(['nft', 'add', 'rule', 'arp', 'filter', 'INPUT', 'iif', interface, 'ether', 'saddr', '!=', mac_address, 'drop']) 44 | else: 45 | # If no interface specified, allow only this MAC globally 46 | Utilities.execute(['nft', 'add', 'rule', 'arp', 'filter', 'INPUT', 'ether', 'saddr', '!=', mac_address, 'drop']) 47 | 48 | def flush_all(self): 49 | """ Accept all incoming connections 50 | 51 | Accept all incoming connections by flushing the 52 | inet input chain. This will allow any address to 53 | talk to our host. 54 | """ 55 | if self.driver == 'arptables': 56 | Utilities.execute(['arptables', '-P', 'INPUT', 'ACCEPT']) 57 | Utilities.execute(['arptables', '--flush']) 58 | else: 59 | Utilities.execute(['nft', 'flush', 'chain', 'arp', 'filter', 'INPUT']) 60 | -------------------------------------------------------------------------------- /bin/installer.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Name: SCUTUM Installer Class 5 | Author: K4YT3X 6 | Date Created: September 26, 2017 7 | Last Modified: April 22, 2019 8 | 9 | Description: Handles the installation, removal, configuring and 10 | upgrading for SCUTUM 11 | """ 12 | from avalon_framework import Avalon 13 | from ufw import Ufw 14 | from utilities import Utilities 15 | import json 16 | import os 17 | import shutil 18 | 19 | 20 | class Installer(): 21 | """ SCUTUM Installer 22 | 23 | This is the installer for SCUTUM. It handles 24 | all the installations, file installation and 25 | removal. 26 | """ 27 | 28 | def __init__(self, CONFPATH='/etc/scutum.conf', INSTALL_DIR='/usr/share/scutum'): 29 | 30 | # Initialize constants 31 | self.SCUTUM_BIN_FILE = '/usr/bin/scutum' 32 | self.CONFPATH = CONFPATH 33 | self.INSTALL_DIR = INSTALL_DIR 34 | self.INSTALLER_DIR = os.path.dirname(os.path.realpath(__file__)).replace('/bin', '') 35 | self.DESKTOP_FILE = '/usr/share/applications/scutum-gui.desktop' 36 | 37 | def install_wicd_scripts(self): 38 | """ Write scutum scripts for WICD 39 | """ 40 | print(Avalon.FG.G + '[+] INFO: Installing for WICD' + Avalon.FM.RST + '.....', end='') 41 | if not os.path.isdir('/etc/wicd/'): 42 | print(Avalon.FG.R + Avalon.FM.BD + 'ERROR' + Avalon.FM.RST) 43 | Avalon.warning('WICD folder not found! WICD does not appear to be installed!') 44 | if Avalon.ask('Continue anyway? (Create Directories)', False): 45 | Utilities.execute(['mkdir', '-p', '/etc/wicd/scripts/postconnect/']) 46 | Utilities.execute(['mkdir', '-p', '/etc/wicd/scripts/postdisconnect/']) 47 | else: 48 | Avalon.warning('Aborting installation for WICD') 49 | return False 50 | with open('/etc/wicd/scripts/postconnect/scutum_connect', 'w') as postconnect: 51 | postconnect.write('#!/bin/bash\n') 52 | postconnect.write('scutum') 53 | postconnect.close() 54 | with open('/etc/wicd/scripts/postdisconnect/scutum_disconnect', 'w') as postdisconnect: 55 | postdisconnect.write('#!/bin/bash\n') 56 | postdisconnect.write('scutum --reset') 57 | postdisconnect.close() 58 | Utilities.execute(['chown', 'root:', '/etc/wicd/scripts/postconnect/scutum_connect']) 59 | Utilities.execute(['chmod', '755', '/etc/wicd/scripts/postconnect/scutum_connect']) 60 | Utilities.execute(['chown', 'root:', '/etc/wicd/scripts/postdisconnect/scutum_disconnect']) 61 | Utilities.execute(['chmod', '755', '/etc/wicd/scripts/postdisconnect/scutum_disconnect']) 62 | print(Avalon.FG.G + Avalon.FM.BD + 'SUCCEED' + Avalon.FM.RST) 63 | return True 64 | 65 | def install_nm_scripts(self, interfaces): 66 | """ Write scutum scripts for Network Manager 67 | """ 68 | print(Avalon.FG.G + '[+] INFO: Installing for NetworkManager' + Avalon.FM.RST + '.....', end='') 69 | if not os.path.isdir('/etc/NetworkManager/dispatcher.d/'): 70 | print(Avalon.FG.R + Avalon.FM.BD + 'ERROR' + Avalon.FM.RST) 71 | Avalon.warning('NetworkManager folders not found! NetworkManager does not appear to be installed!') 72 | if Avalon.ask('Continue anyway? (Create Directories)', False): 73 | Utilities.execute(['mkdir', '-p', '/etc/NetworkManager/dispatcher.d/']) 74 | else: 75 | Avalon.warning('Aborting installation for NetworkManager') 76 | return False 77 | with open('/etc/NetworkManager/dispatcher.d/scutum', 'w') as nmScript: 78 | nmScript.write('#!/usr/bin/env python3\n') 79 | nmScript.write('\n') 80 | nmScript.write('import sys\n') 81 | nmScript.write('import os\n') 82 | nmScript.write('\n') 83 | nmScript.write('try:\n') 84 | nmScript.write(' interface = sys.argv[1]\n') 85 | nmScript.write(' status = sys.argv[2]\n') 86 | nmScript.write('except IndexError:\n') 87 | nmScript.write(' exit(0)\n') 88 | nmScript.write('\n') 89 | nmScript.write('if status == \"down\":\n') 90 | nmScript.write(' os.system(\"scutum --reset\")\n') 91 | nmScript.write(' exit(0)\n') 92 | nmScript.write('\n') 93 | nmScript.write('if status == \"up\":\n') 94 | nmScript.write(' os.system(\"scutum\")\n') 95 | nmScript.write(' exit(0)\n') 96 | nmScript.close() 97 | 98 | Utilities.execute(['chown', 'root:', '/etc/NetworkManager/dispatcher.d/scutum']) 99 | Utilities.execute(['chmod', '755', '/etc/NetworkManager/dispatcher.d/scutum']) 100 | print(Avalon.FG.G + Avalon.FM.BD + 'SUCCEED' + Avalon.FM.RST) 101 | return True 102 | 103 | def remove_wicd_scripts(self): 104 | """ Remove WICD SCUTUM scripts 105 | """ 106 | try: 107 | os.remove('/etc/wicd/scripts/postconnect/scutum_connect') 108 | os.remove('/etc/wicd/scripts/postdisconnect/scutum_disconnect') 109 | except FileNotFoundError: 110 | pass 111 | 112 | def remove_nm_scripts(self): 113 | """ Remove Network Manager SCUTUM scripts 114 | """ 115 | try: 116 | os.remove('/etc/NetworkManager/dispatcher.d/scutum') 117 | except FileNotFoundError: 118 | pass 119 | 120 | def _install_scutum_files(self): 121 | """ Install all SCUTUM files into system 122 | """ 123 | print(Avalon.FM.BD + 'Choose Installation Directory (Enter for default)' + Avalon.FM.RST) 124 | installation_dir = Avalon.gets('Choose Installation Path (\"/usr/share/scutum\"):') 125 | if installation_dir.strip(' ') != '' and installation_dir[-1] == '/': 126 | self.INSTALL_DIR = installation_dir[0:-1] # strip last '/' if exists. breaks program path format 127 | Avalon.info(f'Changed installation directory to: {Avalon.FM.BD}{self.INSTALL_DIR}{Avalon.FM.RST}') 128 | elif installation_dir.strip(' ') != '': 129 | self.INSTALL_DIR = installation_dir 130 | Avalon.info(f'Changed installation directory to: {Avalon.FM.BD}{self.INSTALL_DIR}{Avalon.FM.RST}') 131 | else: 132 | Avalon.info(f'Using default installation directory: {Avalon.FM.BD}{self.INSTALL_DIR}{Avalon.FM.RST}') 133 | 134 | # If files are not already in place 135 | if self.INSTALLER_DIR != self.INSTALL_DIR: 136 | if os.path.isdir(self.INSTALL_DIR): 137 | shutil.rmtree(self.INSTALL_DIR) # delete existing old scutum files 138 | shutil.copytree(self.INSTALLER_DIR, self.INSTALL_DIR) 139 | 140 | # Remove executable in PATH if exists 141 | if os.path.islink(self.SCUTUM_BIN_FILE) or os.path.isfile(self.SCUTUM_BIN_FILE): 142 | os.remove(self.SCUTUM_BIN_FILE) # Remove old file or symbolic links 143 | 144 | # Link scutum main executable to PATH 145 | # This will allow user to use the "scutum" command 146 | Utilities.execute(['ln', '-s', f'{self.INSTALL_DIR}/bin/scutum.py', self.SCUTUM_BIN_FILE]) 147 | 148 | def _install_service(self): 149 | """ Install SCUTUM service 150 | """ 151 | if os.path.isdir('/etc/init.d/'): 152 | """ 153 | This is for debian-based systems. On debian, only an executable 154 | script/file is needed. This file is usually in /etc/inid.d/ and 155 | registered with update-rc.d. The service (unit) files will be 156 | created automagically. 157 | """ 158 | shutil.copyfile(self.INSTALL_DIR + '/bin/scutum', '/etc/init.d/scutum') 159 | Utilities.execute(['chmod', '755', '/etc/init.d/scutum']) 160 | Utilities.execute(['update-rc.d', 'scutum', 'defaults']) 161 | # runlevels are now defined in the executable files in newer versions 162 | # of systemd. Keeping this line for older systems 163 | Utilities.execute(['update-rc.d', 'scutum', 'start', '10', '2', '3', '4', '5', '.', 'stop', '90', '0', '1', '6', '.']) 164 | elif os.path.isdir('/usr/lib/systemd'): 165 | """ 166 | This is for the old-fashion systemds. In old (maybe I'm wrong) 167 | systemds, unit files are created manually. They are stored in 168 | /usr/lib/systemd/system/ folder. systemctl command will look 169 | for service files in that folder. 170 | """ 171 | shutil.copyfile(self.INSTALL_DIR + '/res/scutum.service', '/usr/lib/systemd/system/scutum.service') 172 | if os.path.islink('/etc/systemd/system/multi-user.target.wants/scutum.service'): 173 | # Let's just remove it in case of program structure update. 174 | os.remove('/etc/systemd/system/multi-user.target.wants/scutum.service') 175 | Utilities.execute(['ln', '-s', '/usr/lib/systemd/system/scutum.service', '/etc/systemd/system/multi-user.target.wants/scutum.service']) 176 | 177 | # Enable service 178 | Utilities.execute(['systemctl', 'enable', 'scutum']) 179 | Utilities.execute(['systemctl', 'start', 'scutum']) 180 | 181 | def _get_arp_controller_driver(self): 182 | """ Choose ARP controller driver 183 | """ 184 | print(Avalon.FM.BD + '\nConfigure ARP Controller Driver' + Avalon.FM.RST) 185 | 186 | # Inform the user which driver is active on current system 187 | if shutil.which('nft'): 188 | Avalon.info('nftables is available') 189 | 190 | if shutil.which('arptables'): 191 | Avalon.info('arptables is available') 192 | 193 | while True: 194 | driver = Avalon.gets('Please choose an ARP controller driver (nftables/arptables): ') 195 | if driver == 'nftables' or driver == 'arptables': 196 | self.config['ArpController']['driver'] = driver 197 | break 198 | else: 199 | Avalon.error('Invalid ARP controller driver chosen') 200 | 201 | def _install_arp_controller_driver(self): 202 | """ Install the CLI tool if not installed 203 | """ 204 | if self.config['ArpController']['driver'] == 'nftables': 205 | binary = 'nft' 206 | elif self.config['ArpController']['driver'] == 'arptables': 207 | binary = 'arptables' 208 | 209 | if shutil.which(binary) is None: 210 | Avalon.warning('ARP controller driver is not installed') 211 | if Avalon.ask(f'Install {self.config["ArpController"]["driver"]}?', True): 212 | Utilities.install_packages([self.config['ArpController']['driver']]) 213 | else: 214 | Avalon.error('ARP controller driver not installed') 215 | Avalon.error('SCUTUM relies on the driver to run') 216 | Avalon.error('Aborting installation') 217 | exit(1) 218 | 219 | def _get_controlled_interfaces(self): 220 | """ Get interfaces to be controlled by SCUTUM 221 | """ 222 | 223 | # Get controlled interfaces 224 | ifaces_selected = [] 225 | ifaces = [] 226 | 227 | # List all available interfaces 228 | with open('/proc/net/dev', 'r') as dev: 229 | for line in dev: 230 | try: 231 | if line.split(':')[1]: 232 | ifaces.append(line.split(':')[0]) 233 | except IndexError: 234 | pass 235 | 236 | # Enroll controlled interfaces 237 | while True: 238 | print(Avalon.FM.BD + '\nWhich interface do you want scutum to control?' + Avalon.FM.RST) 239 | if not len(ifaces) == 0: 240 | index = 0 241 | for iface in ifaces: 242 | if iface.replace(' ', '') not in ifaces_selected: 243 | print(f'{str(index)}. {iface.replace(" ", "")}') 244 | index += 1 245 | print('x. Manually Enter') 246 | print(Avalon.FM.BD + 'Press [ENTER] when complete' + Avalon.FM.RST) 247 | selection = Avalon.gets('Please select (index number): ') 248 | 249 | try: 250 | if selection == 'x': 251 | manif = Avalon.gets('Interface: ') 252 | if manif not in ifaces_selected: 253 | ifaces_selected.append(manif) 254 | elif selection == '': 255 | if len(ifaces_selected) != 0: 256 | break 257 | else: 258 | Avalon.error('You have not selected any interfaces yet') 259 | elif int(selection) >= len(ifaces): 260 | Avalon.error('Selected interface doesn\'t exist!') 261 | else: 262 | ifaces_selected.append(ifaces[int(selection)].replace(' ', '')) 263 | 264 | except ValueError: 265 | Avalon.error('Invalid Input!') 266 | Avalon.error('Please enter the index number!') 267 | 268 | # Put controlled interfaces into configuraion 269 | self.config['Interfaces']['interfaces'] = ifaces_selected 270 | 271 | def _get_controlled_nm(self): 272 | """ Ask which network controller to hook to 273 | """ 274 | while True: 275 | print(Avalon.FM.BD + '\nWhich network controller do you want to install for?' + Avalon.FM.RST) 276 | print('1. WICD') 277 | print('2. Network-Manager') 278 | print('3. Both') 279 | 280 | selection = Avalon.gets('Please select: (index number): ') 281 | 282 | if selection == '1': 283 | if self.install_wicd_scripts() is not True: 284 | Avalon.error('SCUTUM Script for WICD has failed to install!') 285 | Avalon.error('Aborting Installation...') 286 | exit(1) 287 | self.config['NetworkControllers']['controllers'] = 'wicd' 288 | break 289 | elif selection == '2': 290 | if self.install_nm_scripts(self.config['Interfaces']['interfaces']) is not True: 291 | Avalon.error('SCUTUM Script for NetworkManager has failed to install!') 292 | Avalon.error('Aborting Installation...') 293 | exit(1) 294 | self.config['NetworkControllers']['controllers'] = 'NetworkManager' 295 | break 296 | elif selection == '3': 297 | ifaces = ['wicd', 'NetworkManager'] 298 | if self.install_wicd_scripts() is not True: 299 | Avalon.warning('Deselected WICD from installation') 300 | ifaces.remove('wicd') 301 | if self.install_nm_scripts(self.config['Interfaces']['interfaces']) is not True: 302 | Avalon.warning('Deselected NetworkManager from installation') 303 | ifaces.remove('NetworkManager') 304 | if len(ifaces) == 0: 305 | Avalon.error('All SCUTUM Scripts have failed to install!') 306 | Avalon.error('Aborting Installation...') 307 | exit(1) 308 | self.config['NetworkControllers']['controllers'] = ifaces 309 | break 310 | else: 311 | Avalon.error('Invalid Input!') 312 | 313 | def _setup_ufw(self): 314 | """ Enable UFW to controll the firewall 315 | """ 316 | print(Avalon.FM.BD + '\nEnable UFW firewall?' + Avalon.FM.RST) 317 | print('Do you want SCUTUM to help configuring and enabling UFW firewall?') 318 | print('This may help preventing a lot of scanning and attacks') 319 | if Avalon.ask('Enable?', True): 320 | 321 | # If ufw is not installed 322 | if shutil.which('ufw') is None: 323 | if Avalon.ask('UFW is not installed. Install?', True): 324 | Utilities.install_packages(['ufw']) 325 | else: 326 | Avalon.warning('UFW package not available, disabling UFW') 327 | self.config['Ufw']['handled'] = False 328 | return 329 | 330 | ufwctrl = Ufw() 331 | print('SCUTUM can configure UFW Firewall for you') 332 | print('However this will reset your current UFW configurations') 333 | print('It is recommended to do so the first time you install SCUTUM') 334 | if Avalon.ask('Let SCUTUM configure UFW for you?', True): 335 | ufwctrl.initialize(True) 336 | else: 337 | Avalon.info('Okay. Then we will simply enable it for you') 338 | ufwctrl.enable() 339 | 340 | print('If you let SCUTUM handle UFW, then UFW will be activated and deactivated with SCUTUM') 341 | if Avalon.ask('Let SCUTUM handle UFW?', True): 342 | self.config['Ufw']['handled'] = True 343 | else: 344 | self.config['Ufw']['handled'] = False 345 | else: 346 | self.config['Ufw']['handled'] = False 347 | Avalon.info('You can turn it on whenever you change your mind') 348 | 349 | def _install_scutum_gui(self): 350 | """ Install SCUTUM GUI 351 | """ 352 | print(Avalon.FM.BD + '\nInstall SCUTUM GUI?' + Avalon.FM.RST) 353 | print('SCUTUM GUI is convenient for GUI Interfaces') 354 | print('ex. KDE, GNOME, XFCE, etc.') 355 | print('However, there\'s not point to install GUI on servers') 356 | if Avalon.ask('Install SCUTUM GUI?', True): 357 | if os.path.islink(self.DESKTOP_FILE) or os.path.isfile(self.DESKTOP_FILE): 358 | os.remove(self.DESKTOP_FILE) 359 | Utilities.execute(['ln', '-s', f'{self.INSTALL_DIR}/res/scutum-gui.desktop', self.DESKTOP_FILE]) 360 | 361 | def install(self): 362 | """ Install SCUTUM 363 | 364 | This method will install all SCUTUM files and components 365 | """ 366 | 367 | Avalon.info('Starting installation procedure') 368 | 369 | # Initialize configuration containers 370 | self.config = {} 371 | self.config['Interfaces'] = {} 372 | self.config['NetworkControllers'] = {} 373 | self.config['Ufw'] = {} 374 | self.config['ArpController'] = {} 375 | 376 | self._install_scutum_files() 377 | self._install_service() 378 | self._get_arp_controller_driver() 379 | self._install_arp_controller_driver() 380 | self._get_controlled_interfaces() 381 | self._get_controlled_nm() 382 | self._setup_ufw() 383 | self._install_scutum_gui() 384 | 385 | # Export the configuration into configuration file 386 | with open(self.CONFPATH, 'w') as configfile: 387 | json.dump(self.config, configfile, indent=2) 388 | configfile.close() 389 | 390 | print('\n' + Avalon.FM.BD, end='') 391 | Avalon.info('SCUTUM installation completed') 392 | Avalon.info('SCUTUM service is now enabled on system startup') 393 | Avalon.info('You can now control it with systemd') 394 | Avalon.info('You can also control it manually via the \"scutum\" command') 395 | 396 | def uninstall(self): 397 | """ Remove SCUTUM completely 398 | 399 | This method will remove all SCUTUM files from 400 | the system. It is yet to be tested completely. 401 | """ 402 | self.remove_wicd_scripts() 403 | self.remove_nm_scripts() 404 | Utilities.execute(['ufw', '--force', 'reset']) # Reset ufw configurations 405 | Utilities.execute(['rm', '-f', '/etc/ufw/*.*.*']) # Delete automatic backups 406 | 407 | # A list of files, directories and links to remove 408 | rmlist = ['/usr/bin/scutum', 409 | self.INSTALL_DIR, 410 | self.CONFPATH, 411 | '/var/log/scutum.log', 412 | '/usr/lib/systemd/system/scutum.service', '/etc/init.d/scutum', 413 | '/etc/systemd/system/multi-user.target.wants/scutum.service' 414 | ] 415 | 416 | # Remove all files in rmlist 417 | for path in rmlist: 418 | if os.path.isfile(path) or os.path.islink(path): 419 | os.remove(path) 420 | elif os.path.isdir(path): 421 | shutil.rmtree(path) 422 | 423 | Avalon.info('SCUTUM removed successfully!') 424 | exit(0) 425 | -------------------------------------------------------------------------------- /bin/interface.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Name: SCUTUM Interface Class 5 | Author: K4YT3X 6 | Date Created: Sep 26, 2017 7 | Last Modified: April 22, 2019 8 | 9 | Description: This class controls all system configuring activities 10 | ex. set arptables, set iptables, etc. 11 | """ 12 | import re 13 | import socket 14 | import struct 15 | import subprocess 16 | import time 17 | 18 | 19 | class Interface: 20 | """ 21 | The Interface class handles the arp firewall 22 | This is the core part of this program (maybe, in some ways) 23 | """ 24 | 25 | def __init__(self, adapter): 26 | """ 27 | Arguments: 28 | adapter {string} -- name of adapter to handle 29 | log {object} -- object of logger (default: {False}) 30 | 31 | Raises: 32 | FileNotFoundError -- raised when arptables not installed 33 | """ 34 | self.gateway_mac = False 35 | self.interface = adapter 36 | 37 | def get_gateway(self): 38 | """Get Linux Default Gateway""" 39 | with open('/proc/net/route') as fh: 40 | for line in fh: 41 | if self.interface in line: 42 | fields = line.strip().split() 43 | if fields[1] != '00000000' or not int(fields[3], 16) & 2: 44 | continue 45 | return socket.inet_ntoa(struct.pack(". 26 | 27 | Description: SCUTUM is a firewall designed for personal computers that 28 | integrates with WICD and NetworkManager. 29 | For tutorial please look at the GitHub Page: https://github.com/K4YT3X/scutum. 30 | """ 31 | from arpcontroller import ArpController 32 | from avalon_framework import Avalon 33 | from installer import Installer 34 | from interface import Interface 35 | from ufw import Ufw 36 | import argparse 37 | import json 38 | import os 39 | import subprocess 40 | import sys 41 | import syslog 42 | import traceback 43 | 44 | # master version number 45 | VERSION = '2.10.2' 46 | 47 | 48 | def process_arguments(): 49 | """ This function parses all arguments 50 | 51 | There are three groups of arguments. 52 | 53 | The first group is controls group which directly controls the 54 | firewall. 55 | 56 | The second group, Installation group, controls the installation, 57 | uninstallation and upgrading of scutum 58 | 59 | The last groups, Extra, contains only a version function 60 | for now. 61 | """ 62 | parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) 63 | 64 | # general firewall controls 65 | control_group = parser.add_argument_group('Controls') 66 | control_group.add_argument('-i', '--interface', help='run SCUTUM on specified interface', action='store') 67 | control_group.add_argument('-s', '--start', help='enable SCUTUM once before shutdown', action='store_true') 68 | control_group.add_argument('-r', '--reset', help='disable SCUTUM temporarily before the next connection', action='store_true') 69 | control_group.add_argument('-e', '--enable', help='enable SCUTUM', action='store_true') 70 | control_group.add_argument('-d', '--disable', help='Disable SCUTUM', action='store_true') 71 | control_group.add_argument('-c', '--config', help='specify config file location', action='store', default='/etc/scutum.json') 72 | control_group.add_argument('--status', help='show SCUTUM current status', action='store_true') 73 | control_group.add_argument('--enableufw', help='enable SCUTUM generic firewall', action='store_true') 74 | control_group.add_argument('--disableufw', help='disable SCUTUM generic firewall', action='store_true') 75 | 76 | # installation controls 77 | install_group = parser.add_argument_group('Installation') 78 | install_group.add_argument('--install', help='Install SCUTUM', action='store_true') 79 | install_group.add_argument('--uninstall', help='Uninstall SCUTUM', action='store_true') 80 | 81 | # extra arguments 82 | etc = parser.add_argument_group('Extra') 83 | etc.add_argument('-v', '--version', help='Show SCUTUM version and exit', action='store_true') 84 | return parser.parse_args() 85 | 86 | 87 | def print_icon(): 88 | """ print SCUTUM icon 89 | 90 | icon generated using messletters.com 91 | """ 92 | print(f'{Avalon.FM.BD} ___ __ _ _ ____ _ _ __ __{Avalon.FM.RST}') 93 | print(f'{Avalon.FM.BD} / __) / _)( )( )(_ _)( )( )( \/ ){Avalon.FM.RST}') 94 | print(f'{Avalon.FM.BD} \__ \( (_ )()( )( )()( ) ({Avalon.FM.RST}') 95 | print(f'{Avalon.FM.BD} (___/ \__) \__/ (__) \__/ (_/\/\_){Avalon.FM.RST}') 96 | print('\n ARP Firewall') 97 | spaces = ((32 - len(f'Version {VERSION}')) // 2) * ' ' 98 | print(f'{Avalon.FM.BD}\n{spaces} Version {VERSION}\n{Avalon.FM.RST}') 99 | 100 | 101 | def update_arp(): 102 | """ Update gateway MAC address 103 | 104 | This function creates an instance for each handled 105 | interface and locks it's corresponded gateway mac 106 | address into nftables or arptables. 107 | """ 108 | 109 | # reset arptables, removing all rules and 110 | # accept all incoming packages 111 | ac.flush_all() 112 | 113 | if args.interface: 114 | interface = Interface(args.interface) 115 | interface.update_gateway_addrs() 116 | Avalon.info(f'ADAPTER={interface.interface}', log=True) 117 | Avalon.info(f'GATEWAY_MAC={interface.gateway_mac}', log=True) 118 | Avalon.info(f'SELF_IP={interface.get_ip()}', log=True) 119 | if interface.gateway_mac: 120 | ac.block(interface.gateway_mac) 121 | else: 122 | # Create one instance for each interface 123 | for interface in interfaces: 124 | interface = Interface(interface) 125 | interface_objects.append(interface) 126 | 127 | # make each interface update gateway mac address 128 | for interface in interface_objects: 129 | interface.update_gateway_addrs() 130 | if interface.gateway_mac or interface.get_ip(): 131 | Avalon.info(f'ADAPTER={interface.interface}', log=True) 132 | Avalon.info(f'GATEWAY_MAC={interface.gateway_mac}', log=True) 133 | Avalon.info(f'SELF_IP={interface.get_ip()}', log=True) 134 | 135 | for interface in interface_objects: 136 | if interface.gateway_mac: 137 | ac.append_allowed_mac(interface.gateway_mac) 138 | 139 | 140 | def read_config(): 141 | """ Parses configuration 142 | This function parses the configuration file and 143 | load the configurations into the program 144 | 145 | TODO: Do something about KeyError 146 | """ 147 | if not os.path.isfile(args.config): # Configuration not found 148 | Avalon.error('SCUTUM configuration file not found! Please re-install SCUTUM!') 149 | Avalon.warning('Please run \"scutum --install\" before using it for the first time') 150 | raise FileNotFoundError(args.config) 151 | 152 | # Initialize python confparser and read config 153 | with open(args.config, 'r') as raw_config: 154 | config = json.load(raw_config) 155 | 156 | # Get controlled interfaces 157 | interfaces = [] 158 | for interface in config['Interfaces']['interfaces']: 159 | if os.path.isdir(f'/sys/class/net/{interface}'): 160 | # Check if interface is connected 161 | interfaces.append(interface) 162 | 163 | # Get controlled network controllers 164 | network_controllers = config['NetworkControllers']['controllers'] 165 | 166 | # Check if we should handle ufw 167 | ufw_handled = config['Ufw']['handled'] 168 | 169 | # Get ARP Controller driver 170 | arp_driver = config['ArpController']['driver'] 171 | 172 | return interfaces, network_controllers, ufw_handled, arp_driver 173 | 174 | 175 | args = process_arguments() 176 | 177 | if not (args.enable or args.disable): 178 | print_icon() 179 | 180 | # unprivileged section 181 | 182 | # if '--version' 183 | if args.version: # prints program legal / dev / version info 184 | print(f'SCUTUM Version: {VERSION}') 185 | print('Author: K4YT3X') 186 | print('License: GNU GPL v3') 187 | print('Github Page: https://github.com/k4yt3x/scutum') 188 | print('Contact: k4yt3x@k4yt3x.com\n') 189 | exit(0) 190 | 191 | # if '--status' 192 | elif args.status: 193 | # asks systemd-sysv-install if scutum is enabled 194 | # by systemctl. May not apply to non-Debian distros 195 | if subprocess.run(['/lib/systemd/systemd-sysv-install', 'is-enabled', 'scutum']).returncode: 196 | Avalon.info(f'{Avalon.FM.RST}SCUTUM is {Avalon.FG.R}NOT ENABLED{Avalon.FM.RST}\n') 197 | else: 198 | Avalon.info(f'{Avalon.FM.RST}SCUTUM is {Avalon.FG.G}ENABLED{Avalon.FM.RST}\n') 199 | exit(0) 200 | 201 | # if user not root (UID != 0) 202 | elif os.getuid() != 0: 203 | # multiple components require root access 204 | Avalon.error('SCUTUM must be run as root') 205 | Avalon.error('Exiting') 206 | exit(1) 207 | 208 | 209 | # privileged section 210 | 211 | # set an exit code 212 | exit_code = 0 213 | 214 | try: 215 | # initialize installer 216 | installer = Installer(args.config) 217 | 218 | if not (args.install or args.uninstall): 219 | # Some objects don't need to be initialized during 220 | # installation or uninstallation 221 | interfaces, network_controllers, ufw_handled, arp_driver = read_config() 222 | 223 | # Initialize objects 224 | ac = ArpController() 225 | if ufw_handled: 226 | ufwctrl = Ufw() 227 | 228 | # If '--install' 229 | if args.install: 230 | # Install scutum into system 231 | installer.install() 232 | 233 | # If '--uninstall' 234 | elif args.uninstall: 235 | # Removes scutum completely from the system 236 | # Note that the configuration file will be removed too 237 | if Avalon.ask('Removal confirmation: ', False): 238 | installer.uninstall() 239 | else: 240 | Avalon.warning('Removal canceled') 241 | 242 | # If '--reset' 243 | elif args.reset: 244 | # resets the arptable, ufw and accept all incoming connections 245 | # This will expose the computer entirely on the network 246 | ac.flush_all() 247 | if ufw_handled is True: 248 | ufwctrl.disable() 249 | Avalon.info('RESETED') 250 | 251 | # If '--enable' 252 | elif args.enable: 253 | # Enable scutum will write scrips for wicd and network-manager 254 | # scutum will be started automatically 255 | if 'wicd' in network_controllers: 256 | installer.install_wicd_scripts() 257 | if 'NetworkManager' in network_controllers: 258 | installer.install_nm_scripts(network_controllers) 259 | 260 | # Lock gateway MAC on current networks 261 | interface_objects = [] 262 | update_arp() 263 | 264 | if ufw_handled: 265 | ufwctrl.enable() 266 | Avalon.info('ENABLED') 267 | 268 | # If '--disable' 269 | elif args.disable: 270 | # This will disable scutum entirely and ufw too if it 271 | # is handled by scutum. scutum will not be started automatically 272 | # Firewalls will be reseted and expose the computer completely 273 | installer.remove_nm_scripts() 274 | installer.remove_wicd_scripts() 275 | ac.flush_all() 276 | if ufw_handled: 277 | ufwctrl.disable() 278 | Avalon.info('DISABLED') 279 | 280 | # If '--enableufw' 281 | elif args.enableufw: 282 | ufwctrl.enable() 283 | 284 | # If '--disableufw' 285 | elif args.disableufw: 286 | ufwctrl.disable() 287 | 288 | # If no arguments given 289 | # updates firewall status by default 290 | else: 291 | interface_objects = [] # a list to store internet controller objects 292 | update_arp() 293 | 294 | if ufw_handled: 295 | ufwctrl.enable() 296 | Avalon.info('OK') 297 | 298 | except KeyboardInterrupt: 299 | Avalon.warning('KeyboardInterrupt caught') 300 | Avalon.warning('Exiting') 301 | exit_code = 1 302 | error_string = traceback.format_exc() 303 | print(error_string, file=sys.stderr) 304 | syslog.syslog(syslog.LOG_ERR, error_string) 305 | 306 | except KeyError: 307 | Avalon.error('The configuration file is broken') 308 | Avalon.error('Try reinstalling SCUTUM to repair the configuration file') 309 | exit_code = 1 310 | error_string = traceback.format_exc() 311 | print(error_string, file=sys.stderr) 312 | syslog.syslog(syslog.LOG_ERR, error_string) 313 | 314 | except Exception: 315 | Avalon.error('SCUTUM has encountered an error') 316 | exit_code = 1 317 | error_string = traceback.format_exc() 318 | print(error_string, file=sys.stderr) 319 | syslog.syslog(syslog.LOG_ERR, error_string) 320 | 321 | finally: 322 | exit(exit_code) 323 | -------------------------------------------------------------------------------- /bin/ufw.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Name: SCUTUM ufw Class 5 | Author: K4YT3X 6 | Date Created: Sep 15, 2017 7 | Last Modified: April 22, 2019 8 | 9 | Description: This class controls TCP/UDP/ICMP traffic 10 | using ufw. 11 | """ 12 | from avalon_framework import Avalon 13 | from utilities import Utilities 14 | import shutil 15 | 16 | 17 | class Ufw: 18 | """ 19 | UFW controller class 20 | 21 | This class handles UFW Firewall 22 | UFW has to be installed when an object of this class is created, 23 | otherwise the program will raise an exception 24 | """ 25 | 26 | def __init__(self): 27 | """ 28 | Keyword Arguments: 29 | log {object} -- object of logger (default: {False}) 30 | 31 | Raises: 32 | FileNotFoundError -- raised when UFW not installed 33 | """ 34 | 35 | if shutil.which('ufw') is None: # Detect if ufw installed 36 | print(Avalon.FM.BD + Avalon.FG.R + '\nWe have detected that you don\'t have UFW installed!' + Avalon.FM.RST) 37 | print('UFW Firewall function requires UFW to run') 38 | if not Utilities.install_package('ufw'): 39 | Avalon.error('ufw is required for this function. Exiting...') 40 | raise FileNotFoundError('File: \"/usr/sbin/ufw\" not found') 41 | 42 | def initialize(self, purge=True): 43 | """ 44 | Checks and adjusts the default rules of ufw which control outgoing data 45 | and incoming data. 46 | We drop all incoming data by default 47 | 48 | This will only be ran when scutum is being installed 49 | """ 50 | if purge: 51 | Utilities.execute(['ufw', '--force', 'reset']) # Reset ufw configurations 52 | Utilities.execute(['rm', '-f', '/etc/ufw/*.*.*']) # Delete automatic backups 53 | 54 | coutparsed = Utilities.execute(['ufw', 'status', 'verbose']) 55 | for line in coutparsed: 56 | if 'Default:' in line: 57 | if not (line.split(' ')[1] + line.split(' ')[2] == 'deny(incoming),'): 58 | print(line.split(' ')[1] + line.split(' ')[2]) 59 | Avalon.info('[UFW]: Adjusting default rule for incoming packages to drop\n') 60 | Utilities.execute(['ufw', 'default', 'deny', 'incoming']) 61 | if not (line.split(' ')[3] + line.split(' ')[4] == 'allow(outgoing),'): 62 | line.split(' ')[3] + line.split(' ')[4] 63 | Avalon.info('[UFW]: Adjusting default rule for outgoing packages to allow\n') 64 | Utilities.execute(['ufw', 'default', 'allow', 'outgoing']) 65 | if 'inactive' in line: 66 | Avalon.info('[UFW]: Enabling ufw\n') 67 | Utilities.execute(['ufw', 'enable']) 68 | 69 | def enable(self): 70 | Utilities.execute(['ufw', '--force', 'enable']) 71 | 72 | def disable(self): 73 | Utilities.execute(['ufw', '--force', 'disable']) 74 | 75 | def allow(self, port): 76 | """ 77 | Accept all traffic from one address 78 | 79 | Arguments: 80 | port {int} -- Port number 81 | """ 82 | Avalon.info(f'[UFW]: Allowing port {str(port)}\n\n') 83 | Utilities.execute(['ufw', 'allow', f'{str(port)}/tcp']) 84 | 85 | def expire(self, port): 86 | """ 87 | Disallows all traffic from one address 88 | 89 | Arguments: 90 | port {int} -- Port number 91 | """ 92 | Avalon.info(f'[UFW]: Expiring port {str(port)}\n\n') 93 | Utilities.execute(['ufw', '--force', 'delete', 'allow', f'{str(port)}/tcp']) 94 | -------------------------------------------------------------------------------- /bin/utilities.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Name: K4YT3X Generic Utilities 5 | Author: K4YT3X 6 | Date Created: October 19, 2018 7 | Last Modified: April 22, 2019 8 | 9 | Description: This class contains some useful utilities. 10 | """ 11 | from avalon_framework import Avalon 12 | import os 13 | import shutil 14 | import subprocess 15 | import sys 16 | 17 | 18 | class Utilities: 19 | """ Useful utilities 20 | 21 | This class contains a number of utility tools. 22 | """ 23 | 24 | def execute(command, std_in='', std_out=subprocess.PIPE, std_err=subprocess.PIPE): 25 | """ Execute a system command and return the output 26 | """ 27 | if type(std_in) is str: 28 | process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=std_out, stderr=std_err) 29 | return process.communicate(input=std_in)[0].decode().split('\n') 30 | else: 31 | process = subprocess.Popen(command, stdin=sys.stdin, stdout=std_out, stderr=std_err) 32 | return process.communicate()[0].decode().split('\n') 33 | 34 | def install_packages(packages): 35 | """ Install a package using system package manager 36 | 37 | This method is currently using os.system instead of 38 | subprocess.run or subprocess.Popen because subprocess 39 | doesn't seem to handle some of the TUIs well. 40 | """ 41 | Avalon.warning('If the installation is unsuccessful, you should consider updating the package manager cache', log=False) 42 | 43 | # Convert packages list into a string 44 | if len(packages) > 1: 45 | packages_string = ' '.join(packages) 46 | else: 47 | packages_string = packages[0] 48 | 49 | if shutil.which('apt-get'): 50 | return os.system(f'apt-get install {packages_string} -y') 51 | elif shutil.which('yum'): 52 | return os.system(f'yum install {packages_string} -y') 53 | elif shutil.which('pacman'): 54 | return os.system(f'pacman -S {packages_string} --noconfirm') 55 | else: 56 | Avalon.error('Sorry, we can\'t find a package manager that we currently support. Aborting..') 57 | Avalon.error('Currently Supported: apt, yum, pacman') 58 | return False 59 | -------------------------------------------------------------------------------- /res/scutum-gui.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=SCUTUM GUI 3 | Encoding=UTF-8 4 | Exec=sh -c "/usr/share/scutum/bin/scutum-gui" 5 | Icon=/usr/share/scutum/res/scutum-gui.png 6 | Terminal=false 7 | Type=Application 8 | -------------------------------------------------------------------------------- /res/scutum-gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k4yt3x/scutum/8f9776cd26ed2d7193dc531406f5ceaf11c0a7a9/res/scutum-gui.png -------------------------------------------------------------------------------- /res/scutum.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Scutum service file 3 | ConditionPathExists=/usr/share/scutum 4 | Wants=network.target 5 | 6 | [Service] 7 | Type=simple 8 | ExecStart=/usr/bin/env scutum --enable 9 | ExecStop=/usr/bin/env scutum --disable 10 | ExecReload=/usr/bin/env scutum --reset && scutum --enable 11 | TimeoutSec=0 12 | StandardOutput=tty 13 | RemainAfterExit=yes 14 | SysVStartPriority=99 15 | 16 | [Install] 17 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /scutum-gui-qt/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | MainWindow w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /scutum-gui-qt/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | /************************** 2 | * Name: SCUTUM GUI 3 | * Author K4YT3X 4 | * Date Created: I can't remember 5 | * Last Modified: Oct 1, 2017 6 | * 7 | * For SCUTUM 2.6.0 beta 5 8 | **************************/ 9 | #include "mainwindow.h" 10 | #include "ui_mainwindow.h" 11 | #include 12 | #include 13 | 14 | MainWindow::MainWindow(QWidget *parent):QMainWindow(parent), ui(new Ui::MainWindow){ 15 | ui->setupUi(this); 16 | int scutumStatus = getScutumStatus(); 17 | if (scutumStatus == 0) { 18 | QPalette platte; 19 | platte.setColor(QPalette::WindowText,Qt::green); 20 | ui->statusLabel->setText("ENABLED"); 21 | ui->statusLabel->setPalette(platte); 22 | } else { 23 | QPalette platte; 24 | platte.setColor(QPalette::WindowText,Qt::red); 25 | ui->statusLabel->setText("DISABLED"); 26 | ui->statusLabel->setPalette(platte); 27 | } 28 | 29 | } 30 | 31 | MainWindow::~MainWindow(){ 32 | delete ui; 33 | } 34 | 35 | int MainWindow::getScutumStatus(){ 36 | return system("/lib/systemd/systemd-sysv-install is-enabled scutum"); 37 | } 38 | 39 | void MainWindow::on_enableButton_clicked() 40 | { 41 | QPalette platte; 42 | platte.setColor(QPalette::WindowText,Qt::green); 43 | ui->statusLabel->setText("ENABLED"); 44 | ui->statusLabel->setPalette(platte); 45 | system("gksu \"systemctl enable scutum\""); 46 | system("gksu \"service scutum start\""); 47 | } 48 | 49 | void MainWindow::on_disableButton_clicked() 50 | { 51 | QPalette platte; 52 | platte.setColor(QPalette::WindowText,Qt::red); 53 | ui->statusLabel->setText("DISABLED"); 54 | ui->statusLabel->setPalette(platte); 55 | system("gksu \"systemctl disable scutum\""); 56 | system("gksu \"service scutum stop\""); 57 | } 58 | 59 | void MainWindow::on_disabletempButton_clicked() 60 | { 61 | QPalette platte; 62 | platte.setColor(QPalette::WindowText,Qt::red); 63 | ui->statusLabel->setText("TEMP-DIS"); 64 | ui->statusLabel->setPalette(platte); 65 | system("gksu \"scutum --reset\""); 66 | } 67 | -------------------------------------------------------------------------------- /scutum-gui-qt/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class MainWindow; 8 | } 9 | 10 | class MainWindow : public QMainWindow 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit MainWindow(QWidget *parent = 0); 16 | ~MainWindow(); 17 | 18 | private slots: 19 | void on_enableButton_clicked(); 20 | 21 | void on_disableButton_clicked(); 22 | 23 | void on_disabletempButton_clicked(); 24 | 25 | private: 26 | Ui::MainWindow *ui; 27 | int getScutumStatus(); 28 | }; 29 | 30 | #endif // MAINWINDOW_H 31 | -------------------------------------------------------------------------------- /scutum-gui-qt/mainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 600 10 | 282 11 | 12 | 13 | 14 | SCUTUM GUI 15 | 16 | 17 | 18 | ../../Python/SCUTUM/scutum-gui.png../../Python/SCUTUM/scutum-gui.png 19 | 20 | 21 | 22 | 23 | 24 | 30 25 | 30 26 | 181 27 | 41 28 | 29 | 30 | 31 | ENABLE 32 | 33 | 34 | 35 | 36 | 37 | 30 38 | 100 39 | 181 40 | 41 41 | 42 | 43 | 44 | DISABLE 45 | 46 | 47 | 48 | 49 | 50 | 30 51 | 170 52 | 181 53 | 41 54 | 55 | 56 | 57 | DISABLE (temporarily) 58 | 59 | 60 | 61 | 62 | 63 | 220 64 | 30 65 | 371 66 | 51 67 | 68 | 69 | 70 | 71 | 14 72 | 73 | 74 | 75 | SCUTUM Firewall GUI Controller 76 | 77 | 78 | Qt::PlainText 79 | 80 | 81 | Qt::AlignCenter 82 | 83 | 84 | 85 | 86 | 87 | 250 88 | 100 89 | 71 90 | 81 91 | 92 | 93 | 94 | 95 | 0 96 | 0 97 | 98 | 99 | 100 | 101 | 15 102 | 103 | 104 | 105 | Status: 106 | 107 | 108 | 109 | 110 | 111 | 330 112 | 90 113 | 251 114 | 100 115 | 116 | 117 | 118 | 119 | 32 120 | 121 | 122 | 123 | ENABLED 124 | 125 | 126 | Qt::AlignCenter 127 | 128 | 129 | 130 | 131 | 132 | 133 | 0 134 | 0 135 | 600 136 | 23 137 | 138 | 139 | 140 | 141 | &Main C2 142 | 143 | 144 | 145 | 146 | He&lp 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | TopToolBarArea 155 | 156 | 157 | false 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /scutum-gui-qt/scutum-gui.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-08-28T15:27:03 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = scutum-gui 12 | TEMPLATE = app 13 | 14 | # The following define makes your compiler emit warnings if you use 15 | # any feature of Qt which as been marked as deprecated (the exact warnings 16 | # depend on your compiler). Please consult the documentation of the 17 | # deprecated API in order to know how to port your code away from it. 18 | DEFINES += QT_DEPRECATED_WARNINGS 19 | 20 | # You can also make your code fail to compile if you use deprecated APIs. 21 | # In order to do so, uncomment the following line. 22 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 23 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 24 | 25 | 26 | SOURCES += \ 27 | main.cpp \ 28 | mainwindow.cpp 29 | 30 | HEADERS += \ 31 | mainwindow.h 32 | 33 | FORMS += \ 34 | mainwindow.ui 35 | -------------------------------------------------------------------------------- /scutum-gui-qt/scutum-gui.pro.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {c0375aea-f867-4c0f-a8af-b8268681d3b8} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | UTF-8 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | true 45 | 0 46 | 8 47 | true 48 | 1 49 | true 50 | true 51 | true 52 | false 53 | 54 | 55 | 56 | ProjectExplorer.Project.PluginSettings 57 | 58 | 59 | 60 | ProjectExplorer.Project.Target.0 61 | 62 | Desktop 63 | Desktop 64 | {0dcd6760-efce-4134-8b7f-3cdcc3121f38} 65 | 0 66 | 0 67 | 0 68 | 69 | /home/k4yt3x/Projects/Python/SCUTUM/build-scutum-gui-Desktop-Debug 70 | 71 | 72 | true 73 | qmake 74 | 75 | QtProjectManager.QMakeBuildStep 76 | false 77 | 78 | false 79 | false 80 | false 81 | 82 | 83 | true 84 | Make 85 | 86 | Qt4ProjectManager.MakeStep 87 | 88 | -w 89 | -r 90 | 91 | false 92 | 93 | 94 | 95 | 2 96 | Build 97 | 98 | ProjectExplorer.BuildSteps.Build 99 | 100 | 101 | 102 | true 103 | Make 104 | 105 | Qt4ProjectManager.MakeStep 106 | 107 | -w 108 | -r 109 | 110 | true 111 | clean 112 | 113 | 114 | 1 115 | Clean 116 | 117 | ProjectExplorer.BuildSteps.Clean 118 | 119 | 2 120 | false 121 | 122 | Debug 123 | 124 | Qt4ProjectManager.Qt4BuildConfiguration 125 | 2 126 | true 127 | 128 | 129 | /home/k4yt3x/Projects/Python/SCUTUM/build-scutum-gui-Desktop-Release 130 | 131 | 132 | true 133 | qmake 134 | 135 | QtProjectManager.QMakeBuildStep 136 | false 137 | 138 | false 139 | false 140 | false 141 | 142 | 143 | true 144 | Make 145 | 146 | Qt4ProjectManager.MakeStep 147 | 148 | -w 149 | -r 150 | 151 | false 152 | 153 | 154 | 155 | 2 156 | Build 157 | 158 | ProjectExplorer.BuildSteps.Build 159 | 160 | 161 | 162 | true 163 | Make 164 | 165 | Qt4ProjectManager.MakeStep 166 | 167 | -w 168 | -r 169 | 170 | true 171 | clean 172 | 173 | 174 | 1 175 | Clean 176 | 177 | ProjectExplorer.BuildSteps.Clean 178 | 179 | 2 180 | false 181 | 182 | Release 183 | 184 | Qt4ProjectManager.Qt4BuildConfiguration 185 | 0 186 | true 187 | 188 | 2 189 | 190 | 191 | 0 192 | Deploy 193 | 194 | ProjectExplorer.BuildSteps.Deploy 195 | 196 | 1 197 | Deploy locally 198 | 199 | ProjectExplorer.DefaultDeployConfiguration 200 | 201 | 1 202 | 203 | 204 | false 205 | false 206 | 1000 207 | 208 | true 209 | 210 | false 211 | false 212 | false 213 | false 214 | true 215 | 0.01 216 | 10 217 | true 218 | 1 219 | 25 220 | 221 | 1 222 | true 223 | false 224 | true 225 | valgrind 226 | 227 | 0 228 | 1 229 | 2 230 | 3 231 | 4 232 | 5 233 | 6 234 | 7 235 | 8 236 | 9 237 | 10 238 | 11 239 | 12 240 | 13 241 | 14 242 | 243 | 2 244 | 245 | scutum-gui 246 | 247 | Qt4ProjectManager.Qt4RunConfiguration:/home/k4yt3x/Projects/Python/SCUTUM/scutum-gui-qt/scutum-gui.pro 248 | true 249 | 250 | scutum-gui.pro 251 | false 252 | 253 | /home/k4yt3x/Projects/Python/SCUTUM/build-scutum-gui-Desktop-Debug 254 | 3768 255 | false 256 | true 257 | false 258 | false 259 | true 260 | 261 | 1 262 | 263 | 264 | 265 | ProjectExplorer.Project.TargetCount 266 | 1 267 | 268 | 269 | ProjectExplorer.Project.Updater.FileVersion 270 | 18 271 | 272 | 273 | Version 274 | 18 275 | 276 | 277 | -------------------------------------------------------------------------------- /scutum-gui-qt/scutum-gui.pro.user.044bdd7: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {044bdd77-695d-4437-a7a3-d6c1a29e7d6c} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | UTF-8 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | true 45 | 0 46 | 8 47 | true 48 | 1 49 | true 50 | true 51 | true 52 | false 53 | 54 | 55 | 56 | ProjectExplorer.Project.PluginSettings 57 | 58 | 59 | 60 | ProjectExplorer.Project.Target.0 61 | 62 | Desktop 63 | Desktop 64 | {ac82ae88-5005-4052-9067-e0c3d0d35f7b} 65 | 0 66 | 0 67 | 0 68 | 69 | /home/k4yt3x/Projects/QT/build-scutum-gui-Desktop-Debug 70 | 71 | 72 | true 73 | qmake 74 | 75 | QtProjectManager.QMakeBuildStep 76 | false 77 | 78 | false 79 | false 80 | false 81 | 82 | 83 | true 84 | Make 85 | 86 | Qt4ProjectManager.MakeStep 87 | 88 | -w 89 | -r 90 | 91 | false 92 | 93 | 94 | 95 | 2 96 | Build 97 | 98 | ProjectExplorer.BuildSteps.Build 99 | 100 | 101 | 102 | true 103 | Make 104 | 105 | Qt4ProjectManager.MakeStep 106 | 107 | -w 108 | -r 109 | 110 | true 111 | clean 112 | 113 | 114 | 1 115 | Clean 116 | 117 | ProjectExplorer.BuildSteps.Clean 118 | 119 | 2 120 | false 121 | 122 | Debug 123 | 124 | Qt4ProjectManager.Qt4BuildConfiguration 125 | 2 126 | true 127 | 128 | 129 | /home/k4yt3x/Projects/QT/build-scutum-gui-Desktop-Release 130 | 131 | 132 | true 133 | qmake 134 | 135 | QtProjectManager.QMakeBuildStep 136 | false 137 | 138 | false 139 | false 140 | false 141 | 142 | 143 | true 144 | Make 145 | 146 | Qt4ProjectManager.MakeStep 147 | 148 | -w 149 | -r 150 | 151 | false 152 | 153 | 154 | 155 | 2 156 | Build 157 | 158 | ProjectExplorer.BuildSteps.Build 159 | 160 | 161 | 162 | true 163 | Make 164 | 165 | Qt4ProjectManager.MakeStep 166 | 167 | -w 168 | -r 169 | 170 | true 171 | clean 172 | 173 | 174 | 1 175 | Clean 176 | 177 | ProjectExplorer.BuildSteps.Clean 178 | 179 | 2 180 | false 181 | 182 | Release 183 | 184 | Qt4ProjectManager.Qt4BuildConfiguration 185 | 0 186 | true 187 | 188 | 2 189 | 190 | 191 | 0 192 | Deploy 193 | 194 | ProjectExplorer.BuildSteps.Deploy 195 | 196 | 1 197 | Deploy locally 198 | 199 | ProjectExplorer.DefaultDeployConfiguration 200 | 201 | 1 202 | 203 | 204 | false 205 | false 206 | 1000 207 | 208 | true 209 | 210 | false 211 | false 212 | false 213 | false 214 | true 215 | 0.01 216 | 10 217 | true 218 | 1 219 | 25 220 | 221 | 1 222 | true 223 | false 224 | true 225 | valgrind 226 | 227 | 0 228 | 1 229 | 2 230 | 3 231 | 4 232 | 5 233 | 6 234 | 7 235 | 8 236 | 9 237 | 10 238 | 11 239 | 12 240 | 13 241 | 14 242 | 243 | 2 244 | 245 | scutum-gui 246 | scutum-gui2 247 | Qt4ProjectManager.Qt4RunConfiguration:/home/k4yt3x/Projects/Python/SCUTUM/scutum-gui-qt/scutum-gui.pro 248 | true 249 | 250 | scutum-gui.pro 251 | false 252 | 253 | /home/k4yt3x/Projects/QT/build-scutum-gui-Desktop-Debug 254 | 3768 255 | false 256 | true 257 | false 258 | false 259 | true 260 | 261 | 1 262 | 263 | 264 | 265 | ProjectExplorer.Project.TargetCount 266 | 1 267 | 268 | 269 | ProjectExplorer.Project.Updater.FileVersion 270 | 18 271 | 272 | 273 | Version 274 | 18 275 | 276 | 277 | -------------------------------------------------------------------------------- /scutum-gui-qt/scutum-gui.pro.user.84c1451: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {84c1451d-d001-4c1d-9244-809e61323135} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | UTF-8 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | true 45 | 0 46 | 8 47 | true 48 | 1 49 | true 50 | true 51 | true 52 | false 53 | 54 | 55 | 56 | ProjectExplorer.Project.PluginSettings 57 | 58 | 59 | 60 | ProjectExplorer.Project.Target.0 61 | 62 | Desktop 63 | Desktop 64 | {d0ad5df8-69ae-4e0a-bbf4-2afeb7ef2adb} 65 | 0 66 | 0 67 | 0 68 | 69 | /home/k4yt3x/Projects/Python/SCUTUM/build-scutum-gui-Desktop-Debug 70 | 71 | 72 | true 73 | qmake 74 | 75 | QtProjectManager.QMakeBuildStep 76 | false 77 | 78 | false 79 | false 80 | false 81 | 82 | 83 | true 84 | Make 85 | 86 | Qt4ProjectManager.MakeStep 87 | 88 | -w 89 | -r 90 | 91 | false 92 | 93 | 94 | 95 | 2 96 | Build 97 | 98 | ProjectExplorer.BuildSteps.Build 99 | 100 | 101 | 102 | true 103 | Make 104 | 105 | Qt4ProjectManager.MakeStep 106 | 107 | -w 108 | -r 109 | 110 | true 111 | clean 112 | 113 | 114 | 1 115 | Clean 116 | 117 | ProjectExplorer.BuildSteps.Clean 118 | 119 | 2 120 | false 121 | 122 | Debug 123 | 124 | Qt4ProjectManager.Qt4BuildConfiguration 125 | 2 126 | true 127 | 128 | 129 | /home/k4yt3x/Projects/Python/SCUTUM/build-scutum-gui-Desktop-Release 130 | 131 | 132 | true 133 | qmake 134 | 135 | QtProjectManager.QMakeBuildStep 136 | false 137 | 138 | false 139 | false 140 | false 141 | 142 | 143 | true 144 | Make 145 | 146 | Qt4ProjectManager.MakeStep 147 | 148 | -w 149 | -r 150 | 151 | false 152 | 153 | 154 | 155 | 2 156 | Build 157 | 158 | ProjectExplorer.BuildSteps.Build 159 | 160 | 161 | 162 | true 163 | Make 164 | 165 | Qt4ProjectManager.MakeStep 166 | 167 | -w 168 | -r 169 | 170 | true 171 | clean 172 | 173 | 174 | 1 175 | Clean 176 | 177 | ProjectExplorer.BuildSteps.Clean 178 | 179 | 2 180 | false 181 | 182 | Release 183 | 184 | Qt4ProjectManager.Qt4BuildConfiguration 185 | 0 186 | true 187 | 188 | 2 189 | 190 | 191 | 0 192 | Deploy 193 | 194 | ProjectExplorer.BuildSteps.Deploy 195 | 196 | 1 197 | Deploy locally 198 | 199 | ProjectExplorer.DefaultDeployConfiguration 200 | 201 | 1 202 | 203 | 204 | false 205 | false 206 | 1000 207 | 208 | true 209 | 210 | false 211 | false 212 | false 213 | false 214 | true 215 | 0.01 216 | 10 217 | true 218 | 1 219 | 25 220 | 221 | 1 222 | true 223 | false 224 | true 225 | valgrind 226 | 227 | 0 228 | 1 229 | 2 230 | 3 231 | 4 232 | 5 233 | 6 234 | 7 235 | 8 236 | 9 237 | 10 238 | 11 239 | 12 240 | 13 241 | 14 242 | 243 | 2 244 | 245 | scutum-gui 246 | 247 | Qt4ProjectManager.Qt4RunConfiguration:/home/k4yt3x/Projects/Python/SCUTUM/scutum-gui-qt/scutum-gui.pro 248 | true 249 | 250 | scutum-gui.pro 251 | false 252 | 253 | /home/k4yt3x/Projects/Python/SCUTUM/build-scutum-gui-Desktop-Debug 254 | 3768 255 | false 256 | true 257 | false 258 | false 259 | true 260 | 261 | 1 262 | 263 | 264 | 265 | ProjectExplorer.Project.TargetCount 266 | 1 267 | 268 | 269 | ProjectExplorer.Project.Updater.FileVersion 270 | 18 271 | 272 | 273 | Version 274 | 18 275 | 276 | 277 | --------------------------------------------------------------------------------