Skip to content

Commit 5c199e6

Browse files
Merge branch 'Your-Momma-Beeotch' into fix-archive-gui
2 parents a89c9a8 + 40bebeb commit 5c199e6

File tree

11 files changed

+134
-23
lines changed

11 files changed

+134
-23
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deploy to Huggingface
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: '3.x'
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install -r requirements.txt
25+
26+
- name: Deploy to Huggingface
27+
env:
28+
HUGGINGFACE_API_KEY: ${{ secrets.HUGGINGFACE_API_KEY }}
29+
run: |
30+
bash scripts/deploy_huggingface.sh

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ ENV OPENAI_API_KEY=${OPENAI_API_KEY}
2222
ENV HUGGINGFACE_API_KEY=${HUGGINGFACE_API_KEY}
2323

2424
# Command to start the Gradio app
25-
CMD ["python", "src/frontend/archive_gui.py"]
25+
CMD ["python", "frontend/archive_gui.py"]

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,3 +333,19 @@ We have recently added several new dashboards and functionalities to the Project
333333
24. **Vulnerability Scanner**: Added a new dashboard for the vulnerability scanner, providing comprehensive scanning and reporting of vulnerabilities.
334334
25. **Wireless Exploitation**: Enhanced the wireless exploitation dashboard with new tools and techniques for exploiting wireless vulnerabilities.
335335
26. **Zero Day Exploits**: Added a new dashboard for managing zero-day exploits, including identification and deployment of exploits.
336+
337+
### Huggingface Deployment Automation
338+
339+
To automate the deployment process for Huggingface, follow these steps:
340+
341+
1. **Create a deployment script**: Add a script named `scripts/deploy_huggingface.sh` that includes the necessary commands to deploy your application to Huggingface. Ensure the script includes commands to authenticate with Huggingface, upload your model or dataset, and any other necessary steps.
342+
343+
2. **Define environment variables**: Define the necessary environment variables for Huggingface deployment, such as `HUGGINGFACE_API_KEY`. You can set these environment variables in your deployment script or in your GitHub Actions workflow file.
344+
345+
3. **Integrate with GitHub Actions**: Integrate the Huggingface deployment script with GitHub Actions by creating a workflow file named `.github/workflows/deploy_huggingface.yml`. Define the necessary jobs and steps in the workflow file to run the deployment script. Ensure that the workflow file includes steps to set up the environment, install dependencies, and run the deployment script.
346+
347+
4. **Install dependencies**: Ensure that all dependencies required for the Huggingface deployment script are installed. You can specify the dependencies in a `requirements.txt` file or directly in the deployment script.
348+
349+
5. **Create and manage API keys**: Learn about creating and managing API keys for Huggingface by referring to the Huggingface documentation. Store the API keys securely using GitHub Secrets or other secure methods. Ensure that the API keys are not exposed in your code or version control system.
350+
351+
By following these steps, you can automate the deployment process for Huggingface and ensure a smooth and efficient deployment of your application.

ai/ai_simulations.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ def simulate_attack(self):
1717
return
1818

1919
try:
20-
if not self.scenarios:
21-
raise IndexError("No scenarios available.")
2220
scenario = random.choice(self.scenarios)
2321
print(f"[SIMULATION] Executing simulated attack: {scenario}")
2422

app.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,19 @@
7171

7272

7373
async def random_url(_):
74-
retries = 3
75-
for _ in range(retries):
76-
try:
77-
pet = random.choice(["cat", "dog"])
78-
api_url = f"https://api.the{pet}api.com/v1/images/search"
79-
async with aiohttp.ClientSession() as session:
80-
async with session.get(api_url) as resp:
81-
resp.raise_for_status()
82-
return (await resp.json())[0]["url"]
83-
except aiohttp.ClientError as e:
84-
logging.error(f"API request failed: {e}")
85-
except Exception as e:
86-
logging.error(f"Unexpected error: {e}")
87-
return None
74+
try:
75+
pet = random.choice(["cat", "dog"])
76+
api_url = f"https://api.the{pet}api.com/v1/images/search"
77+
async with aiohttp.ClientSession() as session:
78+
async with session.get(api_url) as resp:
79+
resp.raise_for_status()
80+
return (await resp.json())[0]["url"]
81+
except aiohttp.ClientError as e:
82+
logging.error(f"API request failed: {e}")
83+
return None
84+
except Exception as e:
85+
logging.error(f"Unexpected error: {e}")
86+
return None
8887

8988

9089
@pn.cache
@@ -270,7 +269,7 @@ async def process_inputs(class_names: List[str], image_url: str):
270269
macos_control = MacOSControl()
271270
linux_control = LinuxControl()
272271
android_control = AndroidControl()
273-
ios_control = iOSControl()
272+
ios_control = IOSControl()
274273
advanced_device_control = AdvancedDeviceControl()
275274
code_parser = CodeParser("sample_code")
276275
pipeline_manager = PipelineManager()

backend/ai_chat.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ def openai_chat(self, prompt):
2121
openai.api_key = self.openai_key
2222
response = openai.Completion.create(engine="text-davinci-003", prompt=prompt, max_tokens=100)
2323
return response.choices[0].text.strip()
24+
except openai.error.AuthenticationError as e:
25+
logging.error(f"Authentication error during OpenAI chat: {e}")
26+
return "Authentication error"
2427
except Exception as e:
2528
logging.error(f"Error during OpenAI chat: {e}")
2629
return ""

chatbot/app.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,22 @@ def receive_message_from_kafka(consumer):
396396
except Exception as e:
397397
logging.error(f"Error receiving message from Kafka: {e}")
398398

399+
# Integrate email spoofing techniques
400+
def email_spoofing(target_email, spoofed_email, subject, message):
401+
try:
402+
return advanced_social_engineering.email_spoofing_attack(target_email, spoofed_email, subject, message)
403+
except Exception as e:
404+
logging.error(f"Error during email spoofing: {e}")
405+
return "Email spoofing failed."
406+
407+
# Integrate SMS spoofing techniques
408+
def sms_spoofing(target_number, spoofed_number, message):
409+
try:
410+
return advanced_social_engineering.sms_spoofing_attack(target_number, spoofed_number, message)
411+
except Exception as e:
412+
logging.error(f"Error during SMS spoofing: {e}")
413+
return "SMS spoofing failed."
414+
399415
if __name__ == "__main__":
400416
channel = setup_message_queue()
401417
if channel:

infra/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Base image
32
FROM python:3.9-slim
43

@@ -9,10 +8,11 @@ WORKDIR /app
98
COPY . .
109

1110
# Install dependencies
11+
RUN apt-get update && apt-get install -y libgl1-mesa-glx
1212
RUN pip install -r requirements.txt
1313

1414
# Expose application port
1515
EXPOSE 5000
1616

1717
# Run the application
18-
CMD ["python", "src/frontend/gui_chat_interface.py"]
18+
CMD ["python", "frontend/archive_gui.py"]

infra/test_deployment.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
#!/bin/bash
32

43
echo "Starting Deployment Testing..."
@@ -35,4 +34,13 @@ fi
3534
echo "Checking Kubernetes Pods..."
3635
kubectl get pods
3736

37+
# Test Huggingface Deployment
38+
echo "Testing Huggingface Deployment..."
39+
bash scripts/deploy_huggingface.sh
40+
if [ $? -eq 0 ]; then
41+
echo "Huggingface Deployment Tested Successfully."
42+
else
43+
echo "Huggingface Deployment Test Failed!" && exit 1
44+
fi
45+
3846
echo "Deployment Testing Completed."

modules/advanced_social_engineering.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
class AdvancedSocialEngineering:
44
def __init__(self):
5-
self.attack_types = ["phishing", "spear_phishing", "whaling"]
5+
self.attack_types = ["phishing", "spear_phishing", "whaling", "email_spoofing", "sms_spoofing"]
66

77
def execute_attack(self, attack_type, target):
88
if attack_type not in self.attack_types:
@@ -15,6 +15,10 @@ def execute_attack(self, attack_type, target):
1515
return self.spear_phishing_attack(target)
1616
elif attack_type == "whaling":
1717
return self.whaling_attack(target)
18+
elif attack_type == "email_spoofing":
19+
return self.email_spoofing_attack(target)
20+
elif attack_type == "sms_spoofing":
21+
return self.sms_spoofing_attack(target)
1822

1923
def phishing_attack(self, target):
2024
logging.info(f"Executing phishing attack on target: {target}")
@@ -31,5 +35,15 @@ def whaling_attack(self, target):
3135
# Placeholder for whaling attack logic
3236
return f"Whaling attack executed on {target}"
3337

38+
def email_spoofing_attack(self, target_email, spoofed_email, subject, message):
39+
logging.info(f"Executing email spoofing attack on target: {target_email}")
40+
# Placeholder for email spoofing attack logic
41+
return f"Email spoofing attack executed on {target_email} with spoofed email {spoofed_email}, subject {subject}, and message {message}"
42+
43+
def sms_spoofing_attack(self, target_number, spoofed_number, message):
44+
logging.info(f"Executing SMS spoofing attack on target: {target_number}")
45+
# Placeholder for SMS spoofing attack logic
46+
return f"SMS spoofing attack executed on {target_number} with spoofed number {spoofed_number} and message {message}"
47+
3448
def render(self):
35-
return "Advanced Social Engineering Module: Ready to execute phishing, spear phishing, and whaling attacks."
49+
return "Advanced Social Engineering Module: Ready to execute phishing, spear phishing, whaling, email spoofing, and SMS spoofing attacks."

0 commit comments

Comments
 (0)