Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ jobs:
- name: Build macOS exploit
run: |
./scripts/macos_deploy.sh

- name: Deploy Hugging Face Codespace
run: |
./scripts/deploy_huggingface.sh
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#### * 8.9. [Nagios](#nagios)
### 9. [Running the Python-based GUI](#running-python-gui)
### 10. [Deploying the GUI on Hugging Face Code Spaces](#deploying-huggingface)
### 11. [Automated Hugging Face Codespace Deployment](#automated-huggingface-deployment)

### __ __

Expand Down Expand Up @@ -616,6 +617,26 @@ To deploy the Python-based GUI on Hugging Face Code Spaces, follow these steps:

The GUI will open in your Hugging Face Code Space, allowing you to monitor and control exploits for various operating systems. The GUI includes features for viewing logs, managing exploits, and secure communication.

# Automated Hugging Face Codespace Deployment

To automate the deployment of the Python-based GUI on Hugging Face Code Spaces, follow these steps:

1. Ensure you have a Hugging Face account and have set up a Code Space.
2. Clone the repository to your Hugging Face Code Space:

```bash
git clone https://github.com/ProjectZeroDays/zero-click-exploits.git
cd zero-click-exploits
```

3. Run the `deploy_huggingface.sh` script:

```bash
./scripts/deploy_huggingface.sh
```

The script will handle the installation of dependencies, setting up environment variables, and running the GUI. The GUI will open in your Hugging Face Code Space, allowing you to monitor and control exploits for various operating systems. The GUI includes features for viewing logs, managing exploits, and secure communication.


### __ __

Expand Down
31 changes: 31 additions & 0 deletions infra/k8s/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: huggingface-deployment
labels:
app: huggingface
spec:
replicas: 1
selector:
matchLabels:
app: huggingface
template:
metadata:
labels:
app: huggingface
spec:
containers:
- name: huggingface-container
image: huggingface/image:latest
ports:
- containerPort: 80
env:
- name: HUGGINGFACE_API_KEY
valueFrom:
secretKeyRef:
name: huggingface-secrets
key: api-key
- name: HUGGINGFACE_MODEL
value: "model-name"
- name: HUGGINGFACE_ENV
value: "production"
30 changes: 30 additions & 0 deletions infra/test_deployment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# Function to test Hugging Face deployment
test_huggingface_deployment() {
echo "Testing Hugging Face deployment..."

# Check if the GUI is running
if pgrep -f "python3 src/gui.py" > /dev/null; then
echo "Hugging Face GUI is running."
else
echo "Hugging Face GUI is not running."
exit 1
fi

# Check if the required environment variables are set
if [ -z "$HUGGINGFACE_API_KEY" ] || [ -z "$HUGGINGFACE_PROJECT_NAME" ]; then
echo "Hugging Face environment variables are not set."
exit 1
fi

echo "Hugging Face deployment test passed."
}

# Main function to execute all tests
main() {
test_huggingface_deployment
}

# Execute the main function
main
31 changes: 31 additions & 0 deletions scripts/Automated_Coud_Deployment/digitalocean-app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: huggingface-deployment
labels:
app: huggingface
spec:
replicas: 1
selector:
matchLabels:
app: huggingface
template:
metadata:
labels:
app: huggingface
spec:
containers:
- name: huggingface-container
image: huggingface/image:latest
ports:
- containerPort: 80
env:
- name: HUGGINGFACE_API_KEY
valueFrom:
secretKeyRef:
name: huggingface-secrets
key: api-key
- name: HUGGINGFACE_PROJECT_NAME
value: "your_project_name"
- name: HUGGINGFACE_ENV
value: "production"
31 changes: 31 additions & 0 deletions scripts/Automated_Coud_Deployment/google-k8s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: huggingface-deployment
labels:
app: huggingface
spec:
replicas: 1
selector:
matchLabels:
app: huggingface
template:
metadata:
labels:
app: huggingface
spec:
containers:
- name: huggingface-container
image: huggingface/image:latest
ports:
- containerPort: 80
env:
- name: HUGGINGFACE_API_KEY
valueFrom:
secretKeyRef:
name: huggingface-secrets
key: api-key
- name: HUGGINGFACE_PROJECT_NAME
value: "your_project_name"
- name: HUGGINGFACE_ENV
value: "production"
30 changes: 30 additions & 0 deletions scripts/deploy_huggingface.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# Function to install dependencies
install_dependencies() {
echo "Installing dependencies..."
pip install -r requirements.txt
}

# Function to run the GUI
run_gui() {
echo "Running the GUI..."
python3 src/gui.py
}

# Function to handle environment variables for Hugging Face deployment
handle_env_variables() {
echo "Setting up environment variables..."
export HUGGINGFACE_API_KEY="your_huggingface_api_key"
export HUGGINGFACE_PROJECT_NAME="your_project_name"
}

# Main function to execute all steps
main() {
handle_env_variables
install_dependencies
run_gui
}

# Execute the main function
main
29 changes: 29 additions & 0 deletions src/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from tkinter.simpledialog import askstring
import requests
from project_red_sword import Chatbot
from ai_model import AIDeploymentModel

class C2Dashboard:
def __init__(self, root):
Expand All @@ -23,6 +24,7 @@ def __init__(self, root):
self.user_role = None
self.session_active = False
self.chatbot = Chatbot()
self.ai_model = AIDeploymentModel("path/to/pretrained/model.h5")

def create_widgets(self):
self.tab_control = ttk.Notebook(self.root)
Expand All @@ -32,12 +34,14 @@ def create_widgets(self):
self.communication_tab = ttk.Frame(self.tab_control)
self.device_control_tab = ttk.Frame(self.tab_control)
self.target_scanning_tab = ttk.Frame(self.tab_control)
self.ai_model_tab = ttk.Frame(self.tab_control)

self.tab_control.add(self.logs_tab, text="Logs")
self.tab_control.add(self.exploits_tab, text="Exploits")
self.tab_control.add(self.communication_tab, text="Communication")
self.tab_control.add(self.device_control_tab, text="Device Control")
self.tab_control.add(self.target_scanning_tab, text="Target Scanning")
self.tab_control.add(self.ai_model_tab, text="AI Model")

self.tab_control.pack(expand=1, fill="both")

Expand All @@ -46,6 +50,7 @@ def create_widgets(self):
self.create_communication_tab()
self.create_device_control_tab()
self.create_target_scanning_tab()
self.create_ai_model_tab()

def create_logs_tab(self):
self.logs_text = tk.Text(self.logs_tab, wrap="word")
Expand Down Expand Up @@ -85,6 +90,16 @@ def create_target_scanning_tab(self):
self.scan_targets_button = ttk.Button(self.target_scanning_tab, text="Scan Targets", command=self.scan_targets)
self.scan_targets_button.pack()

def create_ai_model_tab(self):
self.ai_model_input_text = tk.Text(self.ai_model_tab, wrap="word")
self.ai_model_input_text.pack(expand=1, fill="both")

self.predict_button = ttk.Button(self.ai_model_tab, text="Predict", command=self.predict)
self.predict_button.pack()

self.ai_model_output_text = tk.Text(self.ai_model_tab, wrap="word")
self.ai_model_output_text.pack(expand=1, fill="both")

def refresh_logs(self):
self.logs_text.delete(1.0, tk.END)
with open("logs/deployment.log", "r") as f:
Expand Down Expand Up @@ -143,6 +158,12 @@ def scan_targets(self):
except shodan.APIError as e:
messagebox.showerror("Shodan Error", str(e))

def predict(self):
input_data = self.ai_model_input_text.get(1.0, tk.END).strip().split('\n')
predictions = self.ai_model.predict(input_data)
self.ai_model_output_text.delete(1.0, tk.END)
self.ai_model_output_text.insert(tk.END, str(predictions))

def setup_logging(self):
logging.basicConfig(filename='logs/gui.log', level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')

Expand Down Expand Up @@ -223,6 +244,14 @@ def send_chatbot_command(self, event):
self.chatbot_text.insert(tk.END, f"Chatbot: {response}\n")
self.chatbot_entry.delete(0, tk.END)

def spoof_sms(self, phone_number, message):
# Implement SMS spoofing logic here
pass

def spoof_email(self, email_address, subject, message):
# Implement email spoofing logic here
pass

if __name__ == "__main__":
root = tk.Tk()
app = C2Dashboard(root)
Expand Down
17 changes: 16 additions & 1 deletion src/huggingface_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,22 @@ def save_user_preferences(self):

def deploy_on_huggingface(self):
# Implement deployment logic for Hugging Face Code Spaces
pass
self.handle_env_variables()
self.install_dependencies()
self.run_gui()

def handle_env_variables(self):
print("Setting up environment variables...")
os.environ["HUGGINGFACE_API_KEY"] = "your_huggingface_api_key"
os.environ["HUGGINGFACE_PROJECT_NAME"] = "your_project_name"

def install_dependencies(self):
print("Installing dependencies...")
subprocess.run(["pip", "install", "-r", "requirements.txt"])

def run_gui(self):
print("Running the GUI...")
subprocess.run(["python3", "src/gui.py"])

if __name__ == "__main__":
root = tk.Tk()
Expand Down
Loading