pax_global_header00006660000000000000000000000064146566354460014535gustar00rootroot0000000000000052 comment=4fae4a2f7a4a6c0be271a49d676e69592c1592a7 SploitScan-0.10.5/000077500000000000000000000000001465663544600136775ustar00rootroot00000000000000SploitScan-0.10.5/.github/000077500000000000000000000000001465663544600152375ustar00rootroot00000000000000SploitScan-0.10.5/.github/workflows/000077500000000000000000000000001465663544600172745ustar00rootroot00000000000000SploitScan-0.10.5/.github/workflows/release.yml000066400000000000000000000012751465663544600214440ustar00rootroot00000000000000name: Release on: push: tags: - 'v*.*.*' jobs: build-and-publish: runs-on: ubuntu-latest steps: - name: Check out the code uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.8' - name: Install build tools run: | python -m pip install --upgrade pip pip install build twine - name: Build the wheel run: python -m build - name: Publish to PyPI env: TWINE_USERNAME: "__token__" TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} run: twine upload dist/* - name: Cleanup build files run: rm -rf dist build *.egg-info SploitScan-0.10.5/.gitignore000066400000000000000000000000301465663544600156600ustar00rootroot00000000000000 sploitscan/config.json SploitScan-0.10.5/CHANGELOG.md000066400000000000000000000110741465663544600155130ustar00rootroot00000000000000# πŸ“† Changelog ## [13. August 2024] - Version 0.10.5 - **General Improvements**: Prevent IndexError by checking for non-empty lists before accessing elements. ## [18. July 2024] - Version 0.10.4 - **CVE ID Export**: Fixed the display of the CVE ID not exporting in HTML. - **Enhanced CVE Retrieval**: Fixed the retrieval of missing CVE information if nested differently. ## [30. June 2024] - Version 0.10.3 - **Main Function Refactoring**: Refactored the main function into smaller, modular functions to improve maintainability and readability. - **Public Exploit Display Enhancements**: Reworked the public exploit display to include the total number of exploits and better error handling. - **Improved Error Handling**: Enhanced error handling for API key configurations and data fetching, especially for VulnCheck. ## [30. June 2024] - Version 0.10.2 - **Custom Configuration Path**: Added support for specifying a custom configuration file path using the `--config` or `-c` command-line argument. - **Platform-Specific Directories**: Added support for platform-specific (*nix, macOS, Windows) configuration directories. - **Debug Mode**: Improved debug output for configuration file loading. ## [26. June 2024] - Version 0.10 - **HackerOne Integration**: Added support for searching through HackerOne and displays if the CVE was used in any Bug Bounty program including its rank and severity distribution. - **General Improvements**: Various bug fixes. ## [24. May 2024] - Version 0.9 - **AI-Powered Risk Assessment**: Integrated OpenAI for detailed risk assessments, potential attack scenarios, mitigation recommendations, and executive summaries (needs OpenAI API key). - **CVE Information Retrieval**: Due to API rate limits and instabilities replaced NIST NVD with [CVE Program](https://github.com/CVEProject/cvelistV5). - **General Improvements**: Various bug fixes and performance improvements. ### [18. May 2024] - Version 0.8 - **HTML Export Functionality**: Introduced the ability to export vulnerability data to HTML reports. - **Packet Storm Integration**: Added support for fetching exploit data from Packet Storm. - **Enhanced Display Functions**: Added CVE_GITHUB_URL as CVE source, and functions to output the most updated CVE source. - **Code Refactoring**: Refactored code to improve maintainability and readability due to the growing code base. ## [11. May 2024] - Version 0.7 - **Nuclei Template Integration**: Added support for discovery of Nuclei templates, enhancing vulnerability data sources. - **Enhanced Display Functions**: Refined visual output across all display functions for consistency and readability. - **General Improvements**: Various bug fixes and performance improvements such as improved error handling. ## [06. May 2024] - Version 0.6.1 - **Import File Capabilities**: Added support for importing vulnerability data directly from Docker Scout scan files. ## [05. May 2024] - Version 0.6 - **Import File Capabilities**: Added support for importing vulnerability data directly from Nessus, Nexpose, and OpenVAS scan files. - **Expanded Command-Line Options**: Introduced new command-line options to specify the import file and its type. - **Robust Configuration Management**: Improved error handling for missing or malformed configuration files. - **General Improvements**: Various bug fixes and performance improvements. ## [02. March 2024] - Version 0.5 - **ExploitDB Integration**: Added support for fetching exploit data from ExploitDB. - **CVSS Enhancements**: Added support for CVSS 2 and CVSS 3.x - **Docker support** - **Code fixes** ## [28. February 2024] - Version 0.4 - **VulnCheck Integration**: Added support for fetching exploit data from VulnCheck, enhancing the exploit information available. - **API Key Configuration**: Introduced the requirement for a VulnCheck API key, specified in config.json. - **Requirements satisfied for Debian Integration** ## [17. February 2024] - Version 0.3 - **Additional Information**: Added further information such as references & vector string - **Removed**: Star count in publicly available exploits ## [15. January 2024] - Version 0.2 - **Multiple CVE Support**: Now capable of handling multiple CVE IDs in a single execution. - **JSON and CSV Export**: Added functionality to export results to JSON and CSV files. - **Enhanced CVE Display**: Improved visual differentiation and information layout for each CVE. - **Patching Priority System**: Introduced a priority rating system for patching, influenced by various factors including the availability of public exploits. ## [13th January 2024] - Version 0.1 - Initial release of SploitScan.SploitScan-0.10.5/Dockerfile000066400000000000000000000002761465663544600156760ustar00rootroot00000000000000FROM python:3.9-slim-buster WORKDIR /app COPY . /app COPY sploitscan/config.json /app/config.json RUN pip install --no-cache-dir -r requirements.txt ENTRYPOINT ["python", "sploitscan.py"] SploitScan-0.10.5/LICENSE000066400000000000000000001044711465663544600147130ustar00rootroot00000000000000GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. 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. Copyright (C) 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 . 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: Copyright (C) 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 . 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 . SploitScan-0.10.5/README.md000066400000000000000000000337761465663544600151760ustar00rootroot00000000000000# SploitScan ![SPLOITSCAN-LOGO](https://github.com/xaitax/SploitScan/assets/5014849/05f6641c-2279-456f-9e5a-329926529169) ## πŸ“œ Description SploitScan is a powerful and user-friendly tool designed to streamline the process of identifying exploits for known vulnerabilities and their respective exploitation probability. Empowering cybersecurity professionals with the capability to swiftly identify and apply known and test exploits. It's particularly valuable for professionals seeking to enhance their security measures or develop robust detection strategies against emerging threats. ## πŸ“– Table of contents - πŸ“œ [Description](#-description) - 🌟 [Features](#-features) - πŸ’£ [Supported Exploit Databases](#-supported-exploit-databases) - πŸ“ [Supported Vulnerability Scanner Import](#-supported-vulnerability-scanner-import) - βš™οΈ [Installation](#️-installation) - πŸš€ [Usage](#-usage) - πŸ€– [AI-Powered Risk Assessment](#-ai-powered-risk-assessment) - πŸ›‘οΈ [Patching Priority System](#️-patching-priority-system) - πŸ«±πŸΌβ€πŸ«²πŸ½ [Contributing](#-contributing) - πŸ“Œ [Author](#-author) - πŸ“š [References](#-references) ## 🌟 Features - **CVE Information Retrieval**: Fetches CVE details from the National Vulnerability Database. - **EPSS Integration**: Includes Exploit Prediction Scoring System (EPSS) data, offering a probability score for the likelihood of CVE exploitation, aiding in prioritization. - **Public Exploits Aggregation**: Gathers publicly available exploits, enhancing the understanding of vulnerabilities. - **CISA KEV**: Shows if the CVE has been listed in the Known Exploited Vulnerabilities (KEV) of CISA. - **AI-Powered Risk Assessment**: Leverages OpenAI to provide detailed risk assessments, potential attack scenarios, mitigation recommendations, and executive summaries. - **HackerOne Reports**: Shows if the CVE was used within HackerOne Bug Bounty programs including their total rank overall and severity distribution. - **Patching Priority System**: Evaluates and assigns a priority rating for patching based on various factors including public exploits availability. - **Multi-CVE Support and Export Options**: Supports multiple CVEs in a single run and allows exporting the results to HTML, JSON and CSV formats. - **Vulnerability Scanner Import**: Import vulnerability scans from popular vulnerability scanners and search directly for known exploits. - **User-Friendly Interface**: Easy to use, providing clear and concise information. - **Comprehensive Security Tool**: Ideal for quick security assessments and staying informed about recent vulnerabilities. ![sploitscan_v0 10 4](https://github.com/user-attachments/assets/4f0ff4fd-9fb4-453f-92a2-f12f41714edd) ## πŸ’£ Supported Exploit Databases - **[GitHub](https://poc-in-github.motikan2010.net/)** - **[ExploitDB](https://www.exploit-db.com/)** - **[VulnCheck](https://vulncheck.com/)** (requires a **free** VulnCheck API key) - **[Packet Storm](https://packetstormsecurity.com/)** - **[Nuclei](https://github.com/projectdiscovery/nuclei-templates)** ## πŸ“ Supported Vulnerability Scanner Import - **[Nessus](https://www.tenable.com/products/nessus) (.nessus)** - **[Nexpose](https://www.rapid7.com/products/nexpose/) (.xml)** - **[OpenVAS](https://www.openvas.org/) (.xml)** - **[Docker](https://docs.docker.com/scout/) (.json)** ## βš™οΈ Installation ### GitHub ```shell git clone https://github.com/xaitax/SploitScan.git cd sploitscan pip install -r requirements.txt ``` ### pip ```shell pip install --user sploitscan ``` ### Kali/Ubuntu/Debian ```shell apt install sploitscan ``` ### Configuration File Create a `config.json` file in one of the following locations with your API keys: - Current directory - `~/.sploitscan/` - `~/.config/sploitscan/` - `/etc/sploitscan/` - `~/Library/Application Support/sploitscan/` (macOS) - `%APPDATA%/sploitscan/` (Windows) You can also specify a custom configuration file path using the `--config` or `-c` command-line argument. ```json { "vulncheck_api_key": "your_vulncheck_api_key", "openai_api_key": "your_openai_api_key" } ``` ## πŸš€ Usage ```shell $ sploitscan.py -h β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β• β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β• β•šβ•β• β•šβ•β• β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β•β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β•β•β• v0.10.3 / Alexander Hagenah / @xaitax / ah@primepage.de usage: sploitscan.py [-h] [-e {json,JSON,csv,CSV,html,HTML}] [-t {nessus,nexpose,openvas,docker}] [-i IMPORT_FILE] [-c CONFIG] [-d] [cve_ids ...] SploitScan: Retrieve and display vulnerability data as well as public exploits for given CVE ID(s). positional arguments: cve_ids Enter one or more CVE IDs to fetch data. Separate multiple CVE IDs with spaces. Format for each ID: CVE-YYYY-NNNNN. This argument is optional if an import file is provided using the -i option. options: -h, --help show this help message and exit -e {json,JSON,csv,CSV,html,HTML}, --export {json,JSON,csv,CSV,html,HTML} Optional: Export the results to a JSON, CSV, or HTML file. Specify the format: 'json', 'csv', or 'html'. -t {nessus,nexpose,openvas,docker}, --type {nessus,nexpose,openvas,docker} Specify the type of the import file: 'nessus', 'nexpose', 'openvas' or 'docker'. -i IMPORT_FILE, --import-file IMPORT_FILE Path to an import file from a vulnerability scanner. If used, CVE IDs can be omitted from the command line arguments. -c CONFIG, --config CONFIG Path to a custom config file. -d, --debug Enable debug output. ``` ### Single CVE Query ```bash sploitscan CVE-2024-1709 ``` ### Multiple CVE Query ```bash sploitscan CVE-2024-1709 CVE-2024-21413 ``` ### Import from Vulnerability Scanner Specify the type: 'nessus', 'nexpose', 'openvas', or 'docker' and provide the file path. ```bash sploitscan --import-file path/to/yourfile.nessus --type nessus ``` ### Export Results Specify the export format: 'json', 'csv', or 'html'. ```bash sploitscan CVE-2024-1709 -e html ``` ### Docker ```shell docker build -t sploitscan . docker run --rm sploitscan CVE-2024-1709 ``` With a volume mounted from the current directory #### Windows (Powershell) ```shell docker run -v ${PWD}:/app --rm sploitscan CVE-2024-1709 -e JSON ``` #### Linux ```shell docker run -v $(pwd):/app --rm sploitscan CVE-2024-1709 -e JSON ``` ## πŸ€– AI-Powered Risk Assessment SploitScan integrates with OpenAI to provide a comprehensive AI-powered risk assessment for each CVE. This feature includes: - Detailed Risk Assessment: Understand the nature of the vulnerability and its business impact. - Potential Attack Scenarios: Get descriptions of potential attack scenarios leveraging the vulnerability. - Mitigation Recommendations: Receive specific, actionable recommendations to mitigate the risk. - Executive Summary: A concise summary accessible to non-technical stakeholders, highlighting the business impact and urgency. ### Example output ```text $ sploitscan.py CVE-2024-21413 [...] β”Œβ”€β”€β”€[ πŸ€– AI-Powered Risk Assessment ] | | 1. Risk Assessment | ------------------- | The vulnerability identified by CVE-2024-21413 is a critical remote code execution flaw in | Microsoft Outlook with a CVSS score of 9.8. The impact on business operations can be severe due to | its high potential to be exploited over a network without any user interactions or elevated | privileges. This unvalidated input vulnerability (CWE-20) could allow an attacker to execute | arbitrary code on the target system, thereby compromising the confidentiality, integrity, and | availability of critical business data and systems. Given its critical rating and the existence of | multiple exploits on public repositories like GitHub, the likelihood of exploitation is very high. | This necessitates immediate attention from the security teams to mitigate the risks associated. | | 2. Potential Attack Scenarios | ------------------------------ | An attacker could exploit this vulnerability by sending a specially crafted email to a victim | using Microsoft Outlook. Once the email is opened or previewed, the malicious payload would | execute, allowing the attacker to gain control over the victim's system. The process involves: 1. | Crafting a malicious email leveraging the specific flaw in email handling within Microsoft | Outlook. 2. Sending the email to the intended victim. 3. Upon opening or previewing the email, the | victim’s system executes the malicious code. The potential outcomes of this attack include theft | of sensitive information, installation of malware or ransomware, and compromising other systems | within the same network due to lateral movement capabilities. | | 3. Mitigation Recommendations | ------------------------------ | Immediate mitigation recommendation includes: 1. Applying the latest security patches provided by | Microsoft. Reference: https://msrc.microsoft.com/update-guide/vulnerability/CVE-2024-21413 2. | Implementing network-level protections such as email filtering and network segmentation to limit | the spread of potential infections. 3. Conducting regular security awareness training for users to | recognize phishing and malicious emails. 4. Monitoring network and system activity for signs of | suspicious behavior and unauthorized execution. 5. Regularly backing up critical data and ensuring | the integrity of backups. | | 4. Executive Summary | --------------------- | CVE-2024-21413, a critical remote code execution vulnerability in Microsoft Outlook, poses a | significant risk to businesses due to its potential to be exploited without user interaction. | Multiple exploit proofs are publicly available, increasing the likelihood of attacks. | Organizations must act swiftly by applying the necessary patches from Microsoft, enhancing their | email security protocols, and educating their staff to identify potential phishing attempts. | Mitigating this vulnerability is essential to protect sensitive information, maintain business | integrity, and ensure system availability, thus preventing potential financial and reputational | damage. Immediate action is crucial to safeguard the organization against this severe threat. | └──────────────────────────────────────── ``` ## πŸ›‘οΈ Patching Priority System The Patching Prioritization System in SploitScan provides a strategic approach to prioritizing security patches based on the severity and exploitability of vulnerabilities. It's influenced by the model from [CVE Prioritizer](https://github.com/TURROKS/CVE_Prioritizer), with enhancements for handling publicly available exploits. Here's how it works: - A+ Priority: Assigned to CVEs listed in CISA's KEV or those with publicly available exploits. This reflects the highest risk and urgency for patching. - A to D Priority: Based on a combination of CVSS scores and EPSS probability percentages. The decision matrix is as follows: - A: CVSS score >= 6.0 and EPSS score >= 0.2. High severity with a significant probability of exploitation. - B: CVSS score >= 6.0 but EPSS score < 0.2. High severity but lower probability of exploitation. - C: CVSS score < 6.0 and EPSS score >= 0.2. Lower severity but higher probability of exploitation. - D: CVSS score < 6.0 and EPSS score < 0.2. Lower severity and lower probability of exploitation. This system assists users in making informed decisions on which vulnerabilities to patch first, considering both their potential impact and the likelihood of exploitation. Thresholds can be changed to your business needs. ## πŸ«±πŸΌβ€πŸ«²πŸ½ Contributing Contributions are welcome. Please feel free to fork, modify, and make pull requests or report issues. Special thanks to: - [Nilsonfsilva](https://github.com/Nilsonfsilva) for support on Debian packaging. - [bcoles](https://github.com/bcoles) for bugfixes. - [Javier Álvarez](https://github.com/jalvarezz13) for bugfixes. - [Romullo](https://github.com/Romullo) for ideas & suggestions. - [davidfortytwo](https://github.com/davidfortytwo) for enhancements (Updated CVE retrieval and PacketStorm addition). - [con-f-use](https://github.com/con-f-use) for support and fixes with setuptools/PyPi. - [Martijn Russchen](https://github.com/martijnrusschen) for his feedback and idea on HackerOne GraphQL. ## πŸ“Œ Author ### Alexander Hagenah - [URL](https://primepage.de) - [Twitter](https://twitter.com/xaitax) - [LinkedIn](https://www.linkedin.com/in/alexhagenah) ## πŸ“š References - [CISA Known Exploited Vulnerabilities Catalog](https://www.cisa.gov/known-exploited-vulnerabilities-catalog) - [CVE Program](https://github.com/CVEProject/cvelistV5) - [ExploitDB](https://www.exploit-db.com/) - [FIRST EPSS](https://www.first.org/epss/api) - [HackerOne](https://hackerone.com/) - [nomi-sec PoC-in-GitHub API](https://poc-in-github.motikan2010.net/) - [OpenAI](https://openai.com/) - [Packet Storm](https://packetstormsecurity.com/) - [ProjectDiscovery Nuclei](https://github.com/projectdiscovery/nuclei-templates) - [VulnCheck](https://vulncheck.com/) SploitScan-0.10.5/docs/000077500000000000000000000000001465663544600146275ustar00rootroot00000000000000SploitScan-0.10.5/docs/sploitscan.1000066400000000000000000000455001465663544600170740ustar00rootroot00000000000000.TH SploitScan 1 "Version 0.10.1" "SploitScan user manual" .SH NAME \fBSploitScan\fP - A tool to fetch and display vulnerability information and public exploits for given CVE IDs. .PP .SH πŸ“œ Description .PP SploitScan is a powerful and user\-friendly tool designed to streamline the process of identifying exploits for known vulnerabilities and their respective exploitation probability. Empowering cybersecurity professionals with the capability to swiftly identify and apply known and test exploits. It's particularly valuable for professionals seeking to enhance their security measures or develop robust detection strategies against emerging threats. .SH πŸ“– Table of contents .RS .IP \(bu 2 πŸ“œ Description \[la]#-description\[ra] .IP \(bu 2 🌟 Features \[la]#-features\[ra] .IP \(bu 2 πŸ’£ Supported Exploit Databases \[la]#-supported-exploit-databases\[ra] .IP \(bu 2 πŸ“ Supported Vulnerability Scanner Import \[la]#-supported-vulnerability-scanner-import\[ra] .IP \(bu 2 βš™οΈ Installation \[la]#️-installation\[ra] .IP \(bu 2 πŸš€ Usage \[la]#-usage\[ra] .IP \(bu 2 πŸ€– AI\-Powered Risk Assessment \[la]#-ai-powered-risk-assessment\[ra] .IP \(bu 2 πŸ›‘οΈ Patching Priority System \[la]#️-patching-priority-system\[ra] .IP \(bu 2 πŸ“† Changelog \[la]#-changelog\[ra] .IP \(bu 2 πŸ«±πŸΌβ€πŸ«²πŸ½ Contributing \[la]#-contributing\[ra] .IP \(bu 2 πŸ“Œ Author \[la]#-author\[ra] .IP \(bu 2 πŸ“š References \[la]#-references\[ra] .RE .SH 🌟 Features .RS .IP \(bu 2 \fBCVE Information Retrieval\fP: Fetches CVE details from the National Vulnerability Database. .IP \(bu 2 \fBEPSS Integration\fP: Includes Exploit Prediction Scoring System (EPSS) data, offering a probability score for the likelihood of CVE exploitation, aiding in prioritization. .IP \(bu 2 \fBPublic Exploits Aggregation\fP: Gathers publicly available exploits, enhancing the understanding of vulnerabilities. .IP \(bu 2 \fBCISA KEV\fP: Shows if the CVE has been listed in the Known Exploited Vulnerabilities (KEV) of CISA. .IP \(bu 2 \fBAI\-Powered Risk Assessment\fP: Leverages OpenAI to provide detailed risk assessments, potential attack scenarios, mitigation recommendations, and executive summaries. .IP \(bu 2 \fBHackerOne Reports\fP: Shows if the CVE was used within HackerOne Bug Bounty programs including their total rank overall and severity distribution. .IP \(bu 2 \fBPatching Priority System\fP: Evaluates and assigns a priority rating for patching based on various factors including public exploits availability. .IP \(bu 2 \fBMulti\-CVE Support and Export Options\fP: Supports multiple CVEs in a single run and allows exporting the results to HTML, JSON and CSV formats. .IP \(bu 2 \fBVulnerability Scanner Import\fP: Import vulnerability scans from popular vulnerability scanners and search directly for known exploits. .IP \(bu 2 \fBUser\-Friendly Interface\fP: Easy to use, providing clear and concise information. .IP \(bu 2 \fBComprehensive Security Tool\fP: Ideal for quick security assessments and staying informed about recent vulnerabilities. .RE .SH πŸ’£ Supported Exploit Databases .RS .IP \(bu 2 \fBGitHub \[la]https://poc-in-github.motikan2010.net/\[ra]\fP .IP \(bu 2 \fBExploitDB \[la]https://www.exploit-db.com/\[ra]\fP .IP \(bu 2 \fBVulnCheck \[la]https://vulncheck.com/\[ra]\fP (requires a \fBfree\fP VulnCheck API key) .IP \(bu 2 \fBPacket Storm \[la]https://packetstormsecurity.com/\[ra]\fP .IP \(bu 2 \fBNuclei \[la]https://github.com/projectdiscovery/nuclei-templates\[ra]\fP .RE .SH πŸ“ Supported Vulnerability Scanner Import .RS .IP \(bu 2 \fBNessus \[la]https://www.tenable.com/products/nessus\[ra] (.nessus)\fP .IP \(bu 2 \fBNexpose \[la]https://www.rapid7.com/products/nexpose/\[ra] (.xml)\fP .IP \(bu 2 \fBOpenVAS \[la]https://www.openvas.org/\[ra] (.xml)\fP .IP \(bu 2 \fBDocker \[la]https://docs.docker.com/scout/\[ra] (.json)\fP .RE .SH βš™οΈ Installation .SS GitHub .PP .RS .nf git clone https://github.com/xaitax/SploitScan.git cd sploitscan pip install \-r requirements.txt .fi .RE .SS pip .PP .RS .nf pip install \-\-user sploitscan .fi .RE .SS Kali/Ubuntu/Debian .PP .RS .nf apt install sploitscan .fi .RE .SS Configuration File .PP Create a \fB\fCconfig.json\fR file in one of the following locations with your API keys: .RS .IP \(bu 2 Current directory .IP \(bu 2 \fB\fC~/.sploitscan/\fR .IP \(bu 2 \fB\fC~/.config/sploitscan/\fR .IP \(bu 2 \fB\fC/etc/sploitscan/\fR .RE .PP .RS .nf { "vulncheck_api_key": "your_vulncheck_api_key", "openai_api_key": "your_openai_api_key" } .fi .RE .SH πŸš€ Usage .PP .RS .nf $ sploitscan.py \-h β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β• β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β• β•šβ•β• β•šβ•β• β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β•β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β•β•β• v0.10.1 / Alexander Hagenah / @xaitax / ah@primepage.de usage: sploitscan.py [\-h] [\-e {json,JSON,csv,CSV,html,HTML}] [\-t {nessus,nexpose,openvas,docker}] [\-i IMPORT_FILE] [\-d] [cve_ids ...] SploitScan: Retrieve and display vulnerability data as well as public exploits for given CVE ID(s). positional arguments: cve_ids Enter one or more CVE IDs to fetch data. Separate multiple CVE IDs with spaces. Format for each ID: CVE\-YYYY\-NNNNN. This argument is optional if an import file is provided using the \-n option. options: \-h, \-\-help show this help message and exit \-e {json,JSON,csv,CSV,html,HTML}, \-\-export {json,JSON,csv,CSV,html,HTML} Optional: Export the results to a JSON, CSV, or HTML file. Specify the format: 'json', 'csv', or 'html'. \-t {nessus,nexpose,openvas,docker}, \-\-type {nessus,nexpose,openvas,docker} Specify the type of the import file: 'nessus', 'nexpose', 'openvas' or 'docker'. \-i IMPORT_FILE, \-\-import\-file IMPORT_FILE Path to an import file from a vulnerability scanner. If used, CVE IDs can be omitted from the command line arguments. \-d, \-\-debug Enable debug output. .fi .RE .SS Single CVE Query .PP .RS .nf sploitscan CVE\-2024\-1709 .fi .RE .SS Multiple CVE Query .PP .RS .nf sploitscan CVE\-2024\-1709 CVE\-2024\-21413 .fi .RE .SS Import from Vulnerability Scanner .PP Specify the type: 'nessus', 'nexpose', 'openvas', or 'docker' and provide the file path. .PP .RS .nf sploitscan \-\-import\-file path/to/yourfile.nessus \-\-type nessus .fi .RE .SS Export Results .PP Specify the export format: 'json', 'csv', or 'html'. .PP .RS .nf sploitscan CVE\-2024\-1709 \-e html .fi .RE .SS Docker .PP .RS .nf docker build \-t sploitscan . docker run \-\-rm sploitscan CVE\-2024\-1709 .fi .RE .PP With a volume mounted from the current directory .SS Windows (Powershell) .PP .RS .nf docker run \-v ${PWD}:/app \-\-rm sploitscan CVE\-2024\-1709 \-e JSON .fi .RE .SS Linux .PP .RS .nf docker run \-v $(pwd):/app \-\-rm sploitscan CVE\-2024\-1709 \-e JSON .fi .RE .SH πŸ€– AI\-Powered Risk Assessment .PP SploitScan integrates with OpenAI to provide a comprehensive AI\-powered risk assessment for each CVE. This feature includes: .RS .IP \(bu 2 Detailed Risk Assessment: Understand the nature of the vulnerability and its business impact. .IP \(bu 2 Potential Attack Scenarios: Get descriptions of potential attack scenarios leveraging the vulnerability. .IP \(bu 2 Mitigation Recommendations: Receive specific, actionable recommendations to mitigate the risk. .IP \(bu 2 Executive Summary: A concise summary accessible to non\-technical stakeholders, highlighting the business impact and urgency. .RE .SS Example output .PP .RS .nf $ sploitscan.py CVE\-2024\-21413 [...] β”Œβ”€β”€β”€[ πŸ€– AI\-Powered Risk Assessment ] | | 1. Risk Assessment | \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- | The vulnerability identified by CVE\-2024\-21413 is a critical remote code execution flaw in | Microsoft Outlook with a CVSS score of 9.8. The impact on business operations can be severe due to | its high potential to be exploited over a network without any user interactions or elevated | privileges. This unvalidated input vulnerability (CWE\-20) could allow an attacker to execute | arbitrary code on the target system, thereby compromising the confidentiality, integrity, and | availability of critical business data and systems. Given its critical rating and the existence of | multiple exploits on public repositories like GitHub, the likelihood of exploitation is very high. | This necessitates immediate attention from the security teams to mitigate the risks associated. | | 2. Potential Attack Scenarios | \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- | An attacker could exploit this vulnerability by sending a specially crafted email to a victim | using Microsoft Outlook. Once the email is opened or previewed, the malicious payload would | execute, allowing the attacker to gain control over the victim's system. The process involves: 1. | Crafting a malicious email leveraging the specific flaw in email handling within Microsoft | Outlook. 2. Sending the email to the intended victim. 3. Upon opening or previewing the email, the | victim’s system executes the malicious code. The potential outcomes of this attack include theft | of sensitive information, installation of malware or ransomware, and compromising other systems | within the same network due to lateral movement capabilities. | | 3. Mitigation Recommendations | \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- | Immediate mitigation recommendation includes: 1. Applying the latest security patches provided by | Microsoft. Reference: https://msrc.microsoft.com/update\-guide/vulnerability/CVE\-2024\-21413 2. | Implementing network\-level protections such as email filtering and network segmentation to limit | the spread of potential infections. 3. Conducting regular security awareness training for users to | recognize phishing and malicious emails. 4. Monitoring network and system activity for signs of | suspicious behavior and unauthorized execution. 5. Regularly backing up critical data and ensuring | the integrity of backups. | | 4. Executive Summary | \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- | CVE\-2024\-21413, a critical remote code execution vulnerability in Microsoft Outlook, poses a | significant risk to businesses due to its potential to be exploited without user interaction. | Multiple exploit proofs are publicly available, increasing the likelihood of attacks. | Organizations must act swiftly by applying the necessary patches from Microsoft, enhancing their | email security protocols, and educating their staff to identify potential phishing attempts. | Mitigating this vulnerability is essential to protect sensitive information, maintain business | integrity, and ensure system availability, thus preventing potential financial and reputational | damage. Immediate action is crucial to safeguard the organization against this severe threat. | └──────────────────────────────────────── .fi .RE .SH πŸ›‘οΈ Patching Priority System .PP The Patching Prioritization System in SploitScan provides a strategic approach to prioritizing security patches based on the severity and exploitability of vulnerabilities. It's influenced by the model from CVE Prioritizer \[la]https://github.com/TURROKS/CVE_Prioritizer\[ra], with enhancements for handling publicly available exploits. Here's how it works: .RS .IP \(bu 2 A+ Priority: Assigned to CVEs listed in CISA's KEV or those with publicly available exploits. This reflects the highest risk and urgency for patching. .IP \(bu 2 A to D Priority: Based on a combination of CVSS scores and EPSS probability percentages. The decision matrix is as follows: .RS .IP \(bu 2 A: CVSS score >= 6.0 and EPSS score >= 0.2. High severity with a significant probability of exploitation. .IP \(bu 2 B: CVSS score >= 6.0 but EPSS score < 0.2. High severity but lower probability of exploitation. .IP \(bu 2 C: CVSS score < 6.0 and EPSS score >= 0.2. Lower severity but higher probability of exploitation. .IP \(bu 2 D: CVSS score < 6.0 and EPSS score < 0.2. Lower severity and lower probability of exploitation. .RE .RE .PP This system assists users in making informed decisions on which vulnerabilities to patch first, considering both their potential impact and the likelihood of exploitation. Thresholds can be changed to your business needs. .SH πŸ“† Changelog .SS [26. June 2024] \- Version 0.10 .RS .IP \(bu 2 \fBHackerOne Integration\fP: Added support for searching through HackerOne and displays if the CVE was used in any Bug Bounty program including its rank and severity distribution. .IP \(bu 2 \fBGeneral Improvements\fP: Various bug fixes. .RE .SS [24. May 2024] \- Version 0.9 .RS .IP \(bu 2 \fBAI\-Powered Risk Assessment\fP: Integrated OpenAI for detailed risk assessments, potential attack scenarios, mitigation recommendations, and executive summaries (needs OpenAI API key). .IP \(bu 2 \fBCVE Information Retrieval\fP: Due to API rate limits and instabilities replaced NIST NVD with CVE Program \[la]https://github.com/CVEProject/cvelistV5\[ra]\&. .IP \(bu 2 \fBGeneral Improvements\fP: Various bug fixes and performance improvements. .RE .SS [18. May 2024] \- Version 0.8 .RS .IP \(bu 2 \fBHTML Export Functionality\fP: Introduced the ability to export vulnerability data to HTML reports. .IP \(bu 2 \fBPacket Storm Integration\fP: Added support for fetching exploit data from Packet Storm. .IP \(bu 2 \fBEnhanced Display Functions\fP: Added CVE\fIGITHUB\fPURL as CVE source, and functions to output the most updated CVE source. .IP \(bu 2 \fBCode Refactoring\fP: Refactored code to improve maintainability and readability due to the growing code base. .RE .SS [11. May 2024] \- Version 0.7 .RS .IP \(bu 2 \fBNuclei Template Integration\fP: Added support for discovery of Nuclei templates, enhancing vulnerability data sources. .IP \(bu 2 \fBEnhanced Display Functions\fP: Refined visual output across all display functions for consistency and readability. .IP \(bu 2 \fBGeneral Improvements\fP: Various bug fixes and performance improvements such as improved error handling. .RE .SS [06. May 2024] \- Version 0.6.1 .RS .IP \(bu 2 \fBImport File Capabilities\fP: Added support for importing vulnerability data directly from Docker Scout scan files. .RE .SS [05. May 2024] \- Version 0.6 .RS .IP \(bu 2 \fBImport File Capabilities\fP: Added support for importing vulnerability data directly from Nessus, Nexpose, and OpenVAS scan files. .IP \(bu 2 \fBExpanded Command\-Line Options\fP: Introduced new command\-line options to specify the import file and its type. .IP \(bu 2 \fBRobust Configuration Management\fP: Improved error handling for missing or malformed configuration files. .IP \(bu 2 \fBGeneral Improvements\fP: Various bug fixes and performance improvements. .RE .SS [02. March 2024] \- Version 0.5 .RS .IP \(bu 2 \fBExploitDB Integration\fP: Added support for fetching exploit data from ExploitDB. .IP \(bu 2 \fBCVSS Enhancements\fP: Added support for CVSS 2 and CVSS 3.x .IP \(bu 2 \fBDocker support\fP .IP \(bu 2 \fBCode fixes\fP .RE .SS [28. February 2024] \- Version 0.4 .RS .IP \(bu 2 \fBVulnCheck Integration\fP: Added support for fetching exploit data from VulnCheck, enhancing the exploit information available. .IP \(bu 2 \fBAPI Key Configuration\fP: Introduced the requirement for a VulnCheck API key, specified in config.json. .IP \(bu 2 \fBRequirements satisfied for Debian Integration\fP .RE .SS [17. February 2024] \- Version 0.3 .RS .IP \(bu 2 \fBAdditional Information\fP: Added further information such as references & vector string .IP \(bu 2 \fBRemoved\fP: Star count in publicly available exploits .RE .SS [15. January 2024] \- Version 0.2 .RS .IP \(bu 2 \fBMultiple CVE Support\fP: Now capable of handling multiple CVE IDs in a single execution. .IP \(bu 2 \fBJSON and CSV Export\fP: Added functionality to export results to JSON and CSV files. .IP \(bu 2 \fBEnhanced CVE Display\fP: Improved visual differentiation and information layout for each CVE. .IP \(bu 2 \fBPatching Priority System\fP: Introduced a priority rating system for patching, influenced by various factors including the availability of public exploits. .RE .SS [13th January 2024] \- Version 0.1 .RS .IP \(bu 2 Initial release of SploitScan. .RE .SH πŸ«±πŸΌβ€πŸ«²πŸ½ Contributing .PP Contributions are welcome. Please feel free to fork, modify, and make pull requests or report issues. .PP Special thanks to: .RS .IP \(bu 2 Nilsonfsilva \[la]https://github.com/Nilsonfsilva\[ra] for support on Debian packaging. .IP \(bu 2 bcoles \[la]https://github.com/bcoles\[ra] for bugfixes. .IP \(bu 2 Javier Álvarez \[la]https://github.com/jalvarezz13\[ra] for bugfixes. .IP \(bu 2 Romullo \[la]https://github.com/Romullo\[ra] for ideas & suggestions. .IP \(bu 2 davidfortytwo \[la]https://github.com/davidfortytwo\[ra] for enhancements (Updated CVE retrieval and PacketStorm addition). .IP \(bu 2 con\-f\-use \[la]https://github.com/con-f-use\[ra] for support and fixes with setuptools/PyPi. .IP \(bu 2 Martijn Russchen \[la]https://github.com/martijnrusschen\[ra] for his feedback and idea on HackerOne GraphQL. .RE .SH πŸ“Œ Author .SS Alexander Hagenah .RS .IP \(bu 2 URL \[la]https://primepage.de\[ra] .IP \(bu 2 Twitter \[la]https://twitter.com/xaitax\[ra] .IP \(bu 2 LinkedIn \[la]https://www.linkedin.com/in/alexhagenah\[ra] .RE .SH πŸ“š References .RS .IP \(bu 2 CISA Known Exploited Vulnerabilities Catalog \[la]https://www.cisa.gov/known-exploited-vulnerabilities-catalog\[ra] .IP \(bu 2 CVE Program \[la]https://github.com/CVEProject/cvelistV5\[ra] .IP \(bu 2 ExploitDB \[la]https://www.exploit-db.com/\[ra] .IP \(bu 2 FIRST EPSS \[la]https://www.first.org/epss/api\[ra] .IP \(bu 2 HackerOne \[la]https://hackerone.com/\[ra] .IP \(bu 2 nomi\-sec PoC\-in\-GitHub API \[la]https://poc-in-github.motikan2010.net/\[ra] .IP \(bu 2 OpenAI \[la]https://openai.com/\[ra] .IP \(bu 2 Packet Storm \[la]https://packetstormsecurity.com/\[ra] .IP \(bu 2 ProjectDiscovery Nuclei \[la]https://github.com/projectdiscovery/nuclei-templates\[ra] .IP \(bu 2 VulnCheck \[la]https://vulncheck.com/\[ra] .RE SploitScan-0.10.5/pyproject.toml000066400000000000000000000017311465663544600166150ustar00rootroot00000000000000[build-system] requires = ["setuptools>=65", "wheel"] build-backend = "setuptools.build_meta" [project] name = "sploitscan" version = "0.10.5" description = "SploitScan is a sophisticated cybersecurity utility designed to provide detailed information on vulnerabilities and associated exploits." authors = [ { name = "Alexander Hagenah", email = "ah@primepage.de" } ] license = { file = "LICENSE" } dynamic = [ "readme" ] dependencies = [ "requests~=2.32.2", "jinja2~=3.1.4", "openai~=1.30.2" ] requires-python = ">=3.8" [project.scripts] sploitscan = "sploitscan.sploitscan:cli" [project.urls] homepage = "https://github.com/xaitax/SploitScan" repository = "https://github.com/xaitax/SploitScan" documentation = "https://github.com/xaitax/SploitScan#readme" changelog = "https://github.com/xaitax/SploitScan" [tool.setuptools] dynamic.readme = { file = [ "README.md" ], content-type = "text/markdown" } package-data.sploitscan = [ "templates/*.html", "config.json" ] SploitScan-0.10.5/requirements.txt000066400000000000000000000000561465663544600171640ustar00rootroot00000000000000requests==2.32.2 jinja2==3.1.4 openai==1.30.2 SploitScan-0.10.5/sploitscan.py000066400000000000000000000001441465663544600164270ustar00rootroot00000000000000#!/usr/bin/env python3 from sploitscan.sploitscan import cli if __name__ == "__main__": cli() SploitScan-0.10.5/sploitscan/000077500000000000000000000000001465663544600160565ustar00rootroot00000000000000SploitScan-0.10.5/sploitscan/__init__.py000066400000000000000000000000001465663544600201550ustar00rootroot00000000000000SploitScan-0.10.5/sploitscan/__main__.py000066400000000000000000000001021465663544600201410ustar00rootroot00000000000000from .sploitscan import cli if __name__ == "__main__": cli() SploitScan-0.10.5/sploitscan/config.json000066400000000000000000000000721465663544600202150ustar00rootroot00000000000000{ "vulncheck_api_key": "", "openai_api_key": "" } SploitScan-0.10.5/sploitscan/sploitscan.py000066400000000000000000001214161465663544600206140ustar00rootroot00000000000000#!/usr/bin/env python3 import requests import argparse import datetime import textwrap import threading import itertools import time import json import sys import os import csv import re import xml.etree.ElementTree as ET from openai import OpenAI from jinja2 import Environment, FileSystemLoader VERSION = "0.10.5" BLUE = "\033[94m" GREEN = "\033[92m" YELLOW = "\033[93m" ENDC = "\033[0m" CVE_GITHUB_URL = "https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves" EPSS_API_URL = "https://api.first.org/data/v1/epss?cve={cve_id}" CISA_URL = "https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json" NUCLEI_URL = ( "https://raw.githubusercontent.com/projectdiscovery/nuclei-templates/main/cves.json" ) GITHUB_API_URL = "https://poc-in-github.motikan2010.net/api/v1/" VULNCHECK_API_URL = "https://api.vulncheck.com/v3/index/vulncheck-kev" EXPLOITDB_URL = "https://gitlab.com/exploit-database/exploitdb/-/raw/main/files_exploits.csv?ref_type=heads" PACKETSTORM_URL = "https://packetstormsecurity.com/search/?q={cve_id}" HACKERONE_URL = "https://hackerone.com/graphql" CVSS_THRESHOLD = 6.0 EPSS_THRESHOLD = 0.2 PRIORITY_COLORS = { "A+": "\033[91m", "A": "\033[31m", "B": "\033[93m", "C": "\033[94m", "D": "\033[92m", } def fetch_data(url, params=None, headers=None): try: response = requests.get(url, params=params, headers=headers) response.raise_for_status() return response except requests.exceptions.RequestException as e: return f"❌ Error fetching data from {url}: {e}" def fetch_json_data(url, params=None, headers=None): response = fetch_data(url, params, headers) if isinstance(response, str): return None, response try: return response.json(), None except json.JSONDecodeError as e: return None, f"❌ Error parsing JSON data from {url}: {e}" def fetch_github_cve_data(cve_id): cve_year = cve_id.split("-")[1] cve_num = int(cve_id.split("-")[2]) url = f"{CVE_GITHUB_URL}/{cve_year}/{cve_num // 1000}xxx/{cve_id}.json" return fetch_json_data(url) def fetch_epss_score(cve_id): return fetch_json_data(EPSS_API_URL.format(cve_id=cve_id)) def fetch_cisa_data(): data, error = fetch_json_data(CISA_URL) if data and "vulnerabilities" in data: for vulnerability in data["vulnerabilities"]: vulnerability["cisa_status"] = "Yes" vulnerability["ransomware_use"] = vulnerability.get( "knownRansomwareCampaignUse", "Unknown" ) return data, error def fetch_nuclei_data(cve_id): response = fetch_data(NUCLEI_URL) if isinstance(response, str): return None, response try: for line in response.iter_lines(): if line: template = json.loads(line.decode("utf-8")) if template["ID"] == cve_id: return template, None except json.JSONDecodeError as e: return None, f"❌ Error parsing JSON data from {NUCLEI_URL}: {e}" return None, None def fetch_vulncheck_data(cve_id): vulncheck_api_key = config.get("vulncheck_api_key") if not vulncheck_api_key: return None, None headers = { "accept": "application/json", "authorization": f"Bearer {vulncheck_api_key}", } response = fetch_data(VULNCHECK_API_URL, params={"cve": cve_id}, headers=headers) if isinstance(response, str): return None, response try: json_data = response.json() return json_data, None except json.JSONDecodeError as e: return None, f"❌ Error parsing JSON data from VulnCheck: {e}" def fetch_exploitdb_data(cve_id): response = fetch_data(EXPLOITDB_URL) if isinstance(response, str): return [], response try: decoded_content = response.content.decode("utf-8") csv_reader = csv.reader(decoded_content.splitlines(), delimiter=",") header = next(csv_reader) codes_index = header.index("codes") return [ {"id": row[0], "date": row[3]} for row in csv_reader if cve_id in row[codes_index].split(";") ], None except csv.Error as e: return [], f"❌ Error parsing CSV data from {EXPLOITDB_URL}: {e}" def fetch_packetstorm_data(cve_id): response = fetch_data(PACKETSTORM_URL.format(cve_id=cve_id)) if isinstance(response, str): return {}, response return ( {"packetstorm_url": PACKETSTORM_URL.format(cve_id=cve_id)} if "No Results Found" not in response.text else {} ), None def fetch_hackerone_cve_details(cve_id): headers = { 'content-type': 'application/json' } payload = { "operationName": "CveDiscoveryDetailedViewCveEntry", "variables": { "cve_id": cve_id }, "query": """ query CveDiscoveryDetailedViewCveEntry($cve_id: String!) { cve_entry(cve_id: $cve_id) { rank reports_submitted_count severity_count_unknown severity_count_none severity_count_low severity_count_medium severity_count_high severity_count_critical __typename } } """ } response = requests.post(HACKERONE_URL, headers=headers, json=payload) if response.status_code == 200: try: data = response.json() if 'data' in data and 'cve_entry' in data['data']: return data, None else: return None, "❌ No HackerOne data found for this CVE." except json.JSONDecodeError as e: return None, f"❌ Error parsing JSON data from HackerOne: {e}" else: return None, f"❌ Error fetching data from HackerOne: {response.status_code}: {response.text}" def display_data(title, data, template, error=None): print(f"β”Œβ”€β”€β”€[ {BLUE}{title}{ENDC} ]") if error: print("|") print(f"β”” {error}\n") return if data: print(f"|") for line in template(data): print(line) print() else: print("|") print(f"β”” ❌ No data found.\n") def display_cve_data(cve_data, error=None): def template(data): if not data or "containers" not in data or "cna" not in data["containers"]: return ["β”” ❌ No vulnerability data found."] cve_item = data["containers"]["cna"] published = data["cveMetadata"].get("datePublished", "") if published: published_date = datetime.datetime.fromisoformat(published.rstrip("Z")) published = published_date.strftime("%Y-%m-%d") description = ( next( ( desc["value"] for desc in cve_item.get("descriptions", []) if desc["lang"] == "en" ), "No description available", ) .replace("\n\n", " ") .replace(" ", " ") ) wrapped_description = textwrap.fill( description, width=100, subsequent_indent=" " * 15 ) metrics = cve_item.get("metrics", []) baseScore, baseSeverity, vectorString = "N/A", "N/A", "N/A" for metric in metrics: cvss_data = metric.get("cvssV3_1") or metric.get("cvssV3") if cvss_data: baseScore = cvss_data.get("baseScore", "N/A") baseSeverity = cvss_data.get("baseSeverity", "N/A") vectorString = cvss_data.get("vectorString", "N/A") if baseScore != "N/A": break if baseScore == "N/A": adp = data["containers"].get("adp", []) for adp_entry in adp: for metric in adp_entry.get("metrics", []): cvss_data = metric.get("cvssV3_1") or metric.get("cvssV3") if cvss_data: baseScore = cvss_data.get("baseScore", "N/A") baseSeverity = cvss_data.get("baseSeverity", "N/A") vectorString = cvss_data.get("vectorString", "N/A") if baseScore != "N/A": break if baseScore != "N/A": break return [ f"β”œ Published: {published}", f"β”œ Base Score: {baseScore} ({baseSeverity})", f"β”œ Vector: {vectorString}", f"β”” Description: {wrapped_description}", ] display_data("πŸ” Vulnerability information", cve_data, template, error) def display_epss_score(epss_data, error=None): def template(data): if not data or "data" not in data or not data["data"]: return ["β”” ❌ No data found."] epss_score = data["data"][0].get("epss", "N/A") return ( [ f"β”” EPSS Score: {float(epss_score) * 100:.2f}% Probability of exploitation." ] if epss_score != "N/A" else [] ) display_data("♾️ Exploit Prediction Score (EPSS)", epss_data, template, error) def display_cisa_status(cve_id, cisa_data, error=None): def template(data): if not data or "vulnerabilities" not in data or not data["vulnerabilities"]: return ["β”” ❌ No data found."] for vulnerability in data["vulnerabilities"]: if vulnerability["cveID"] == cve_id: cisa_status = vulnerability["cisa_status"] ransomware_use = vulnerability["ransomware_use"] return [ f"β”œ Listed: {cisa_status}", f"β”” Ransomware: {ransomware_use}", ] return ["β”” ❌ No data found."] display_data("πŸ›‘οΈ CISA KEV Catalog", cisa_data, template, error) def display_public_exploits(github_data, vulncheck_data, exploitdb_data, packetstorm_data, nuclei_data, vulncheck_error=None): def template(): total_exploits = 0 entries = [] if github_data and github_data.get("pocs"): entries.append("β”œ GitHub") sorted_pocs = sorted(github_data["pocs"], key=lambda x: x.get("created_at", ""), reverse=True) if github_data["pocs"] else [] for poc in sorted_pocs: created_at = poc.get("created_at", "N/A") if created_at != "N/A": created_date = datetime.datetime.fromisoformat(created_at) created_at = created_date.strftime("%Y-%m-%d") entries.append(f"β”‚ β”œ Date: {created_at} - {poc.get('html_url', 'N/A')}") total_exploits += 1 entries[-1] = entries[-1].replace("β”œ", "β””") if vulncheck_data and isinstance(vulncheck_data, dict) and vulncheck_data.get("data"): entries.append("β”‚") entries.append("β”œ VulnCheck") sorted_vulncheck = sorted( (xdb for item in vulncheck_data["data"] for xdb in item.get("vulncheck_xdb", [])), key=lambda x: x.get("date_added", ""), reverse=True ) for xdb in sorted_vulncheck: date_added = xdb.get("date_added", "N/A") if date_added != "N/A": try: date_added = datetime.datetime.fromisoformat(date_added.rstrip("Z")).strftime("%Y-%m-%d") except ValueError: pass github_url = xdb.get("clone_ssh_url", "").replace("git@github.com:", "https://github.com/").replace(".git", "") entries.append(f"β”‚ β”œ Date: {date_added} - {github_url}") total_exploits += 1 entries[-1] = entries[-1].replace("β”œ", "β””") if vulncheck_error: entries.append("β”‚") entries.append(f"β”” ❌ VulnCheck Error: {vulncheck_error}") if exploitdb_data: entries.append("β”‚") entries.append("β”œ Exploit-DB") sorted_exploitdb = sorted(exploitdb_data, key=lambda x: x["date"], reverse=True) for item in sorted_exploitdb: url = f"https://www.exploit-db.com/exploits/{item['id']}" entries.append(f"β”‚ β”œ Date: {item['date']} - {url}") total_exploits += 1 entries[-1] = entries[-1].replace("β”œ", "β””") other_entries = [] if packetstorm_data and packetstorm_data.get("packetstorm_url"): other_entries.append(f"PacketStorm: {packetstorm_data['packetstorm_url']}") if nuclei_data and nuclei_data.get("file_path"): base_url = "https://raw.githubusercontent.com/projectdiscovery/nuclei-templates/main/" file_path = nuclei_data["file_path"] full_url = f"{base_url}{file_path}" other_entries.append(f"Nuclei: {full_url}") if other_entries: entries.append("β”‚") entries.append("β”” Other") for index, entry in enumerate(other_entries[:-1]): entries.append(f" β”œ {entry}") entries.append(f" β”” {other_entries[-1]}") if not entries: return ["β”” ❌ No data found."], total_exploits return entries, total_exploits exploits, total = template() print(f"β”Œβ”€β”€β”€[ {BLUE}πŸ’£ Public Exploits (Total: {total}){ENDC} ]") if exploits: print("|") for line in exploits: print(line) print() else: print("|") print(f"β”” ❌ No data found.\n") def display_hackerone_data(hackerone_data, error=None): def template(data): if not data or "data" not in data or "cve_entry" not in data["data"]: return ["β”” ❌ No data found."] cve_entry = data["data"]["cve_entry"] if not cve_entry: return ["β”” ❌ No data found."] rank = cve_entry.get("rank", "N/A") reports_submitted_count = cve_entry.get("reports_submitted_count", "N/A") severity_unknown = cve_entry.get("severity_count_unknown", 0) severity_none = cve_entry.get("severity_count_none", 0) severity_low = cve_entry.get("severity_count_low", 0) severity_medium = cve_entry.get("severity_count_medium", 0) severity_high = cve_entry.get("severity_count_high", 0) severity_critical = cve_entry.get("severity_count_critical", 0) severity_display = f"Unknown: {severity_unknown} / None: {severity_none} / Low: {severity_low} / Medium: {severity_medium} / High: {severity_high} / Critical: {severity_critical}" return [ f"β”œ Rank: {rank}", f"β”œ Reports: {reports_submitted_count}", f"β”” Severity: {severity_display}", ] display_data("πŸ•΅οΈ HackerOne Hacktivity", hackerone_data, template, error) def display_cve_references(cve_data, error=None): def template(data): if not data or "containers" not in data or "cna" not in data["containers"]: return ["β”” ❌ No data found."] references = data["containers"]["cna"].get("references", []) return ( [f"β”œ {ref['url']}" for ref in references[:-1]] + [f"β”” {references[-1]['url']}"] if references else ["β”” ❌ No further references found."] ) display_data("πŸ“š Further References", cve_data, template, error) def calculate_priority( cve_id, cve_data, epss_data, github_data, cisa_data, vulncheck_data, exploitdb_data ): cvss_score, epss_score = 0, 0 try: metrics = cve_data["containers"]["cna"]["metrics"] for metric in metrics: if "cvssV3_1" in metric: cvss_score = float(metric["cvssV3_1"]["baseScore"]) break except (KeyError, IndexError, TypeError): pass try: epss_score = ( float(epss_data["data"][0]["epss"]) if epss_data and "data" in epss_data else 0 ) except (KeyError, IndexError, TypeError): pass in_cisa_kev = ( any(vuln["cveID"] == cve_id for vuln in cisa_data.get( "vulnerabilities", [])) if cisa_data else False ) has_public_exploits = ( bool(github_data.get("pocs")) if github_data else ( False or bool(vulncheck_data.get("data")) if vulncheck_data else False or bool(exploitdb_data) ) ) if not (cvss_score or epss_score or in_cisa_kev or has_public_exploits): return None if in_cisa_kev or has_public_exploits: return "A+" if cvss_score >= CVSS_THRESHOLD and epss_score >= EPSS_THRESHOLD: return "A" if cvss_score >= CVSS_THRESHOLD: return "B" if epss_score >= EPSS_THRESHOLD: return "C" return "D" def display_priority_rating(cve_id, priority): def template(data): if not data or "priority" not in data or not data["priority"]: return ["β”” ❌ No data found."] priority_color = PRIORITY_COLORS.get(data["priority"], ENDC) return [f"β”” Priority: {priority_color}{data['priority']}{ENDC}"] if priority is None: display_data("⚠️ Patching Priority Rating", None, template) else: display_data("⚠️ Patching Priority Rating", { "priority": priority}, template) def load_config(config_path=None, debug=False): default_config = {"vulncheck_api_key": None, "openai_api_key": None} config_env_var = "SPLOITSCAN_CONFIG_PATH" config_paths = [config_path] if config_path else [] config_paths += [ os.getenv(config_env_var), os.path.join(os.path.dirname(os.path.abspath(__file__)), "config.json"), os.path.expanduser("~/.sploitscan/config.json"), os.path.expanduser("~/.config/sploitscan/config.json"), os.path.expanduser("~/Library/Application Support/sploitscan/config.json"), os.path.join(os.getenv("APPDATA", ""), "sploitscan", "config.json"), "/etc/sploitscan/config.json", ] config_paths = [path for path in config_paths if path] for path in config_paths: if path and os.path.exists(path): try: if debug: print(f"⚠️ Attempting to load config file from: {path}") with open(path, "r", encoding="utf-8") as file: config = json.load(file) if debug: print(f"⚠️ Successfully loaded config file: {path}") return config except json.JSONDecodeError as e: print(f"⚠️ Error decoding JSON from the config file {path}: {e}") except Exception as e: print(f"⚠️ Unexpected error reading config file {path}: {e}") print("⚠️ Config file not found in any checked locations, using default settings.") return default_config def get_risk_assessment(cve_details, cve_data): api_key = config.get("openai_api_key") if not api_key: return "❌ OpenAI API key is not configured correctly." client = OpenAI(api_key=api_key) prompt = f""" You are a security analyst. Analyze the following CVE details and provide a detailed risk assessment, potential attack scenarios, mitigation recommendations, and an executive summary. Ensure the output is formatted for a console display without any markdown, NO MARKDOWN, and the headers are clearly delineated with proper formatting as specified! Output only proper free flowing text and no lists as this won't be properly displayed in the console. CVE Details: {cve_details} Full CVE Data: {json.dumps(cve_data, indent=4)} Format the output exactly as follows: 1. Risk Assessment Provide a detailed risk assessment including the nature of the vulnerability & its business impact. Describe the likelihood and ease of exploitation, and potential impacts on confidentiality, integrity, and availability. 2. Potential Attack Scenarios Describe at least one potential attack scenarios that leverage this vulnerability. Each scenario should include a detailed description of the attack vector, the attack process, and the potential outcomes. 3. Mitigation Recommendations Provide specific, actionable mitigation recommendations. Include immediate actions such as patching. Provide links to relevant resources where applicable. 4. Executive Summary Summarize the vulnerability, its potential impacts, and the importance of taking action. Highlight key points from the risk assessment, attack scenarios, and mitigation recommendations. This summary should be accessible to non-technical stakeholders, emphasizing the business impact and urgency of addressing the vulnerability. """ try: response = client.chat.completions.create( model="gpt-4o", messages=[ {"role": "system", "content": "You are a security analyst."}, {"role": "user", "content": prompt}, ], ) result = response.choices[0].message.content.strip() return result except Exception as e: return f"❌ Error fetching data from OpenAI: {e}" def display_ai_risk_assessment(cve_details, cve_data): def spinner_animation(message): spinner = itertools.cycle(['|', '/', '-', '\\']) while not stop_spinner: sys.stdout.write(f'\r{message} {next(spinner)}') sys.stdout.flush() time.sleep(0.1) sys.stdout.write('\r' + ' ' * (len(message) + 2) + '\r') sys.stdout.flush() def get_risk_assessment_thread(): nonlocal assessment assessment = get_risk_assessment(cve_details, cve_data) global stop_spinner stop_spinner = True global stop_spinner stop_spinner = False assessment = None print("β”Œβ”€β”€β”€[ πŸ€– AI-Powered Risk Assessment ]") print("|") spinner_thread = threading.Thread(target=spinner_animation, args=("| Loading OpenAI risk assessment... ",)) spinner_thread.start() assessment_thread = threading.Thread(target=get_risk_assessment_thread) assessment_thread.start() assessment_thread.join() spinner_thread.join() print("|") if assessment: sections = assessment.split("\n\n") for section in sections: section = section.strip() if section: if section.startswith(("1. ", "2. ", "3. ", "4. ")): header = section.split("\n")[0].strip() print(f"| {header}") print("| " + "-" * (len(header) + 1)) content = "\n".join(section.split("\n")[1:]).strip() wrapped_content = textwrap.fill( content, width=100, initial_indent="| ", subsequent_indent="| " ) print(wrapped_content) else: wrapped_content = textwrap.fill( section, width=100, initial_indent="| ", subsequent_indent="| " ) print(wrapped_content) print("|") print("└────────────────────────────────────────\n") def import_vulnerability_data(file_path, file_type): if not os.path.exists(file_path): print(f"❌ Error: The file '{file_path}' does not exist.") return [] if file_type == "nessus": return import_nessus(file_path) if file_type == "nexpose": return import_nexpose(file_path) if file_type == "openvas": return import_openvas(file_path) if file_type == "docker": return import_docker(file_path) print(f"❌ Unsupported file type: {file_type}") return [] def import_nessus(file_path): def parse_nessus_file(path): tree = ET.parse(path) root = tree.getroot() return [ cve.text.strip().upper() for report_item in root.findall(".//ReportItem") for cve in report_item.findall("cve") if is_valid_cve_id(cve.text.strip().upper()) ] return import_file(file_path, parse_nessus_file) def import_nexpose(file_path): def parse_nexpose_file(path): tree = ET.parse(path) root = tree.getroot() return [ link.get("LinkTitle").upper() for link in root.findall(".//URLLink") if link.get("LinkTitle", "").startswith("CVE-") ] return import_file(file_path, parse_nexpose_file) def import_openvas(file_path): def parse_openvas_file(path): tree = ET.parse(path) root = tree.getroot() return [ ref.attrib.get("id").upper() for ref in root.findall(".//ref[@type='cve']") if is_valid_cve_id(ref.attrib.get("id").upper()) ] return import_file(file_path, parse_openvas_file) def import_docker(file_path): def parse_docker_file(path): with open(path, "r") as file: data = json.load(file) return [ rule.get("id", "").upper() for run in data.get("runs", []) for rule in run.get("tool", {}).get("driver", {}).get("rules", []) if rule.get("id", "").startswith("CVE-") ] return import_file(file_path, parse_docker_file) def import_file(file_path, parse_function): try: cve_ids = parse_function(file_path) unique_cve_ids = list(set(cve_ids)) print( YELLOW + f"πŸ“₯ Successfully imported {len(unique_cve_ids)} CVE(s) from '{file_path}'.\n" ) return unique_cve_ids except ET.ParseError as e: print(f"❌ Error parsing the file '{file_path}': {e}") except json.JSONDecodeError as e: print(f"❌ Error parsing the JSON file '{file_path}': {e}") except Exception as e: print(f"❌ An unexpected error occurred while processing '{file_path}': {e}") return [] def is_valid_cve_id(cve_id): return re.match(r"CVE-\d{4}-\d{4,7}$", cve_id) is not None def generate_filename(cve_ids, extension): timestamp = datetime.datetime.now().strftime("%Y%m%d%H%M%S") cve_part = "_".join(cve_ids[:3]) + \ ("_and_more" if len(cve_ids) > 3 else "") return f"{timestamp}_{cve_part}_export.{extension}" def datetimeformat(value, format="%Y-%m-%d"): return datetime.datetime.fromisoformat(value.rstrip("Z")).strftime(format) def export_to_html(all_results, cve_ids): def template(data): base_path = os.path.dirname(os.path.abspath(__file__)) template_paths = [ os.path.join(base_path, "templates"), os.path.expanduser("~/.sploitscan/templates"), os.path.expanduser("~/.config/sploitscan/templates"), "/etc/sploitscan/templates", ] for path in template_paths: if os.path.exists(os.path.join(path, "report_template.html")): env = Environment(loader=FileSystemLoader(path)) break else: print( "❌ HTML template 'report_template.html' not found in any checked locations.") return ["❌ Error exporting to HTML: template not found"] env.filters["datetimeformat"] = datetimeformat template = env.get_template("report_template.html") filename = generate_filename(cve_ids, "html") output = template.render(cve_data=handle_cvss(data)) with open(filename, "w", encoding="utf-8") as file: file.write(output) return [f"β”” Data exported to file: {filename}"] def handle_cvss(data): for result in data: result["Public Exploits Total"] = sum([ len(result.get("GitHub Data", {}).get("pocs", [])), sum(len(item.get("vulncheck_xdb", [])) for item in result.get("VulnCheck Data", {}).get("data", [])), len(result.get("ExploitDB Data", [])) ]) if "GitHub Data" in result and "pocs" in result["GitHub Data"]: result["GitHub Data"]["pocs"] = sorted(result["GitHub Data"]["pocs"], key=lambda x: x.get("created_at", ""), reverse=True) if "VulnCheck Data" in result and "data" in result["VulnCheck Data"]: for item in result["VulnCheck Data"]["data"]: if "vulncheck_xdb" in item: item["vulncheck_xdb"] = sorted(item["vulncheck_xdb"], key=lambda x: x.get("date_added", ""), reverse=True) if "ExploitDB Data" in result: result["ExploitDB Data"] = sorted(result["ExploitDB Data"], key=lambda x: x.get("date", ""), reverse=True) if "EPSS Data" in result and "data" in result["EPSS Data"] and len(result["EPSS Data"]["data"]) > 0: result["EPSS Data"]["data"][0]["epss"] = try_parse_float(result["EPSS Data"]["data"][0].get("epss")) metrics = result.get("CVE Data", {}).get("containers", {}).get("cna", {}).get("metrics", []) for metric in metrics: cvss_data = metric.get("cvssV3_1", metric.get("cvssV3")) if cvss_data: cvss_data["baseScore"] = try_parse_float(cvss_data.get("baseScore")) cvss_data["baseSeverity"] = str(cvss_data.get("baseSeverity", "N/A")) cvss_data["vectorString"] = str(cvss_data.get("vectorString", "N/A")) else: metric["cvssV3_1"] = { "baseScore": 0.0, "baseSeverity": "N/A", "vectorString": "N/A"} return data def try_parse_float(value): try: return float(value) except (ValueError, TypeError): return 0.0 try: display_data("πŸ“ HTML Export", all_results, template) except Exception as e: print(f"❌ Error exporting to HTML: {e}") def export_to_json(all_results, cve_ids): def template(data): filename = generate_filename(cve_ids, "json") with open(filename, "w") as file: json.dump(data, file, indent=4) return [f"β”” Data exported to file: {filename}"] display_data("πŸ“ JSON Export", all_results, template) def export_to_csv(all_results, cve_ids): def template(data): filename = generate_filename(cve_ids, "csv") keys = list(data[0].keys()) + ["Risk Assessment"] with open(filename, "w", newline="") as file: writer = csv.DictWriter(file, fieldnames=keys) writer.writeheader() for item in data: item["Risk Assessment"] = item.get("Risk Assessment", "N/A") writer.writerow(item) return [f"β”” Data exported to CSV: {filename}"] display_data("πŸ“ CSV Export", all_results, template) def display_banner(): banner = f""" β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β• β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β• β•šβ•β• β•šβ•β• β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β•β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β•β•β• v{VERSION} / Alexander Hagenah / @xaitax / ah@primepage.de """ print(BLUE + banner + ENDC) def print_cve_header(cve_id): header = f" CVE ID: {cve_id} " line = "═" * len(header) print(f"{GREEN}β•”{line}β•—{ENDC}") print(f"{GREEN}β•‘{header}β•‘{ENDC}") print(f"{GREEN}β•š{line}╝{ENDC}\n") def fetch_and_display_cve_data(cve_id): cve_data, cve_error = fetch_github_cve_data(cve_id) display_cve_data(cve_data, cve_error) return cve_data def fetch_and_display_epss_score(cve_id): epss_data, epss_error = fetch_epss_score(cve_id) display_epss_score(epss_data, epss_error) return epss_data def fetch_and_display_cisa_status(cve_id): cisa_data, cisa_error = fetch_cisa_data() display_cisa_status(cve_id, cisa_data, cisa_error) relevant_cisa_data = next( (item for item in cisa_data.get("vulnerabilities", []) if item["cveID"] == cve_id), None, ) return relevant_cisa_data def fetch_and_display_public_exploits(cve_id): github_data, github_error = fetch_json_data(GITHUB_API_URL, params={"cve_id": cve_id}) vulncheck_data, vulncheck_error = fetch_vulncheck_data(cve_id) exploitdb_data, exploitdb_error = fetch_exploitdb_data(cve_id) packetstorm_data, packetstorm_error = fetch_packetstorm_data(cve_id) nuclei_data, nuclei_error = fetch_nuclei_data(cve_id) display_public_exploits(github_data, vulncheck_data, exploitdb_data, packetstorm_data, nuclei_data, vulncheck_error) return { "github_data": github_data, "vulncheck_data": vulncheck_data if isinstance(vulncheck_data, dict) else {}, "exploitdb_data": exploitdb_data, "packetstorm_data": packetstorm_data, "nuclei_data": nuclei_data } def fetch_and_display_hackerone_data(cve_id): hackerone_data, hackerone_error = fetch_hackerone_cve_details(cve_id) display_hackerone_data(hackerone_data, hackerone_error) return hackerone_data def compile_cve_details(cve_id, cve_data, epss_data, relevant_cisa_data, public_exploits): published = cve_data["cveMetadata"].get("datePublished", "N/A") if published != "N/A": published = datetime.datetime.fromisoformat(published.rstrip("Z")).strftime("%Y-%m-%d") description = ( next( (desc["value"] for desc in cve_data["containers"]["cna"].get("descriptions", []) if desc["lang"] == "en"), "No description available", ) .replace("\n\n", " ") .replace(" ", " ") ) metrics = cve_data["containers"]["cna"].get("metrics", []) baseScore, baseSeverity, vectorString = "N/A", "N/A", "N/A" for metric in metrics: if "cvssV3_1" in metric: cvss_data = metric["cvssV3_1"] baseScore = cvss_data.get("baseScore", "N/A") baseSeverity = cvss_data.get("baseSeverity", "N/A") vectorString = cvss_data.get("vectorString", "N/A") break epss_score = epss_data["data"][0].get("epss", "N/A") if epss_data and "data" in epss_data and epss_data["data"] else "N/A" cisa_status = relevant_cisa_data["cisa_status"] if relevant_cisa_data else "N/A" ransomware_use = relevant_cisa_data["ransomware_use"] if relevant_cisa_data else "N/A" github_exploits = "\n".join( [f"{poc['created_at']}: {poc['html_url']}" for poc in public_exploits["github_data"].get("pocs", [])] ) if public_exploits["github_data"] else "N/A" vulncheck_exploits = "\n".join( [f"{xdb['date_added']}: {xdb['clone_ssh_url'].replace('git@github.com:', 'https://github.com/').replace('.git', '')}" for item in public_exploits["vulncheck_data"].get("data", []) for xdb in item.get("vulncheck_xdb", [])] ) if public_exploits["vulncheck_data"] else "N/A" packetstorm_url = public_exploits["packetstorm_data"].get("packetstorm_url", "N/A") nuclei_url = f"https://raw.githubusercontent.com/projectdiscovery/nuclei-templates/main/{public_exploits['nuclei_data']['file_path']}" if public_exploits["nuclei_data"] and "file_path" in public_exploits["nuclei_data"] else "N/A" references_list = cve_data["containers"]["cna"].get("references", []) references = "\n".join([ref["url"] for ref in cve_data["containers"]["cna"].get("references", [])]) if cve_data else "N/A" return f""" Published: {published} Base Score: {baseScore} ({baseSeverity}) Vector: {vectorString} Description: {description} EPSS Score: {epss_score} CISA Status: {cisa_status} Ransomware Use: {ransomware_use} GitHub Exploits: {github_exploits} VulnCheck Exploits: {vulncheck_exploits} PacketStorm URL: {packetstorm_url} Nuclei Template: {nuclei_url} Further References: {references} """ def main(cve_ids, export_format=None, import_file=None, import_type=None, config_path=None, debug=False): global config config = load_config(config_path=config_path, debug=debug) if config_path else load_config(debug=debug) all_results = [] if export_format: export_format = export_format.lower() if import_file and import_type: cve_ids = import_vulnerability_data(import_file, import_type) if not cve_ids: print("❌ No valid CVE IDs found in the provided file.") return if not cve_ids: print("❌ No CVE IDs provided. Please provide CVE IDs or an import file and type.") return for cve_id in cve_ids: cve_id = cve_id.upper() if not is_valid_cve_id(cve_id): print(f"❌ Invalid CVE ID format: {cve_id}. Please use the format CVE-YYYY-NNNNN.") continue print_cve_header(cve_id) cve_data = fetch_and_display_cve_data(cve_id) if not cve_data: continue epss_data = fetch_and_display_epss_score(cve_id) relevant_cisa_data = fetch_and_display_cisa_status(cve_id) public_exploits = fetch_and_display_public_exploits(cve_id) hackerone_data = fetch_and_display_hackerone_data(cve_id) cve_details = compile_cve_details(cve_id, cve_data, epss_data, relevant_cisa_data, public_exploits) risk_assessment = get_risk_assessment(cve_details, cve_data) display_ai_risk_assessment(cve_details, cve_data) priority = calculate_priority( cve_id, cve_data, epss_data, public_exploits["github_data"], relevant_cisa_data, public_exploits["vulncheck_data"], public_exploits["exploitdb_data"] ) display_priority_rating(cve_id, priority) display_cve_references(cve_data) cve_result = { "CVE Data": cve_data, "EPSS Data": epss_data, "CISA Data": relevant_cisa_data, "Nuclei Data": public_exploits["nuclei_data"], "GitHub Data": public_exploits["github_data"], "VulnCheck Data": public_exploits["vulncheck_data"], "ExploitDB Data": public_exploits["exploitdb_data"], "PacketStorm Data": public_exploits["packetstorm_data"], "HackerOne Data": hackerone_data, "Priority": {"Priority": priority}, "Risk Assessment": risk_assessment, } all_results.append(cve_result) if export_format == "json": export_to_json(all_results, cve_ids) elif export_format == "csv": export_to_csv(all_results, cve_ids) elif export_format == "html": export_to_html(all_results, cve_ids) def cli(): display_banner() parser = argparse.ArgumentParser( description="SploitScan: Retrieve and display vulnerability data as well as public exploits for given CVE ID(s)." ) parser.add_argument( "cve_ids", type=str, nargs="*", default=[], help="Enter one or more CVE IDs to fetch data. Separate multiple CVE IDs with spaces. Format for each ID: CVE-YYYY-NNNNN. This argument is optional if an import file is provided using the -i option.", ) parser.add_argument( "-e", "--export", choices=["json", "JSON", "csv", "CSV", "html", "HTML"], help="Optional: Export the results to a JSON, CSV, or HTML file. Specify the format: 'json', 'csv', or 'html'.", ) parser.add_argument( "-t", "--type", choices=["nessus", "nexpose", "openvas", "docker"], help="Specify the type of the import file: 'nessus', 'nexpose', 'openvas' or 'docker'.", ) parser.add_argument( "-i", "--import-file", type=str, help="Path to an import file from a vulnerability scanner. If used, CVE IDs can be omitted from the command line arguments.", ) parser.add_argument( "-c", "--config", type=str, help="Path to a custom config file.", ) parser.add_argument( "-d", "--debug", action="store_true", help="Enable debug output." ) args = parser.parse_args() main(args.cve_ids, args.export, args.import_file, args.type, args.config, args.debug) if __name__ == "__main__": cli() SploitScan-0.10.5/sploitscan/templates/000077500000000000000000000000001465663544600200545ustar00rootroot00000000000000SploitScan-0.10.5/sploitscan/templates/report_template.html000066400000000000000000000414541465663544600241600ustar00rootroot00000000000000 CVE Report

{% for cve in cve_data %}

{{ cve['CVE Data']['cveMetadata']['cveId'] }}

πŸ” Vulnerability Information

{{ cve['CVE Data']['containers']['cna']['descriptions'][0]['value'] if cve['CVE Data'] and cve['CVE Data'].get('containers') else 'N/A' }}

Published {{ cve['CVE Data']['cveMetadata']['datePublished']|datetimeformat if cve['CVE Data'] and cve['CVE Data'].get('cveMetadata') else 'N/A' }}
Base Score {{ cve['CVE Data']['containers']['cna']['metrics'][0]['cvssV3_1']['baseScore'] if cve['CVE Data'] and cve['CVE Data'].get('containers') and cve['CVE Data']['containers']['cna']['metrics'] else 'N/A' }} ({{ cve['CVE Data']['containers']['cna']['metrics'][0]['cvssV3_1']['baseSeverity'] if cve['CVE Data'] and cve['CVE Data'].get('containers') and cve['CVE Data']['containers']['cna']['metrics'] else 'N/A' }})
Vector {{ cve['CVE Data']['containers']['cna']['metrics'][0]['cvssV3_1']['vectorString'] if cve['CVE Data'] and cve['CVE Data'].get('containers') and cve['CVE Data']['containers']['cna']['metrics'] else 'N/A' }}

♾️ Exploit Prediction Score (EPSS)

{% if cve['EPSS Data'] and cve['EPSS Data'].get('data') %} {% else %} {% endif %}
Score{{ "%.2f" % (cve['EPSS Data']['data'][0]['epss'] * 100) }}% Probability of exploitationN/A

πŸ›‘οΈ CISA KEV Catalog

Listed {{ cve['CISA Data']['cisa_status'] if cve['CISA Data'] else 'N/A' }}
Ransomware {{ cve['CISA Data']['ransomware_use'] if cve['CISA Data'] else 'N/A' }}

πŸ’£ Public Exploits (Total: {{ cve['Public Exploits Total'] }})

{% if cve['GitHub Data']['pocs'] %}

GitHub

{% for poc in cve['GitHub Data']['pocs'] %} {% endfor %}
{{ poc['created_at']|datetimeformat }} {{ poc['html_url'] }}
{% endif %} {% if cve['VulnCheck Data']['data'] %}

VulnCheck

{% for item in cve['VulnCheck Data']['data'] %} {% for xdb in item['vulncheck_xdb'] %} {% endfor %} {% endfor %}
{{ xdb['date_added']|datetimeformat }} {{ xdb['clone_ssh_url'].replace('git@github.com:', 'https://github.com/').replace('.git', '') }}
{% endif %} {% if cve['ExploitDB Data'] %}

Exploit-DB

{% for item in cve['ExploitDB Data'] %} {% endfor %}
{{ item['date']|datetimeformat }} https://www.exploit-db.com/exploits/{{ item['id'] }}
{% endif %}

Other

{% if cve['PacketStorm Data']['packetstorm_url'] %} {% endif %} {% if cve['Nuclei Data']['file_path'] %} {% endif %}
PacketStorm {{ cve['PacketStorm Data']['packetstorm_url'] }}
Nuclei {{ cve['Nuclei Data']['file_path'] }}

πŸ•΅οΈ HackerOne Hacktivity

Rank {{ cve['HackerOne Data']['data']['cve_entry']['rank'] if cve['HackerOne Data'] and cve['HackerOne Data'].get('data') and cve['HackerOne Data']['data'].get('cve_entry') else 'N/A' }}
Reports Submitted {{ cve['HackerOne Data']['data']['cve_entry']['reports_submitted_count'] if cve['HackerOne Data'] and cve['HackerOne Data'].get('data') and cve['HackerOne Data']['data'].get('cve_entry') else 'N/A' }}
Severity πŸ” Unknown: {{ cve['HackerOne Data']['data']['cve_entry']['severity_count_unknown'] if cve['HackerOne Data'] and cve['HackerOne Data'].get('data') and cve['HackerOne Data']['data'].get('cve_entry') else 0 }}, 🚫 None: {{ cve['HackerOne Data']['data']['cve_entry']['severity_count_none'] if cve['HackerOne Data'] and cve['HackerOne Data'].get('data') and cve['HackerOne Data']['data'].get('cve_entry') else 0 }}, ⚠️ Low: {{ cve['HackerOne Data']['data']['cve_entry']['severity_count_low'] if cve['HackerOne Data'] and cve['HackerOne Data'].get('data') and cve['HackerOne Data']['data'].get('cve_entry') else 0 }}, πŸ”§ Medium: {{ cve['HackerOne Data']['data']['cve_entry']['severity_count_medium'] if cve['HackerOne Data'] and cve['HackerOne Data'].get('data') and cve['HackerOne Data']['data'].get('cve_entry') else 0 }}, πŸ”₯ High: {{ cve['HackerOne Data']['data']['cve_entry']['severity_count_high'] if cve['HackerOne Data'] and cve['HackerOne Data'].get('data') and cve['HackerOne Data']['data'].get('cve_entry') else 0 }}, πŸ’€ Critical: {{ cve['HackerOne Data']['data']['cve_entry']['severity_count_critical'] if cve['HackerOne Data'] and cve['HackerOne Data'].get('data') and cve['HackerOne Data']['data'].get('cve_entry') else 0 }}

πŸ€– AI-Powered Risk Assessment

{{ cve['Risk Assessment'] }}

⚠️ Patching Priority Rating

Priority {{ cve['Priority']['Priority'] if cve['Priority'] and cve['Priority']['Priority'] else 'N/A' }}

πŸ“š Further References

{% for ref in cve['CVE Data']['containers']['cna']['references'] %} {% else %} {% endfor %}
N/A
{% endfor %}