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
11 changes: 10 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
from modules.ios_control import iOSControl
from modules.advanced_device_control import AdvancedDeviceControl

from backend.code_parser import CodeParser
from backend.pipeline_manager import PipelineManager

import pika
from kafka import KafkaProducer, KafkaConsumer

Expand Down Expand Up @@ -271,6 +274,8 @@ async def process_inputs(class_names: List[str], image_url: str):
android_control = AndroidControl()
ios_control = iOSControl()
advanced_device_control = AdvancedDeviceControl()
code_parser = CodeParser("sample_code")
pipeline_manager = PipelineManager()
except Exception as e:
logging.error(f"Error initializing modules: {e}")

Expand Down Expand Up @@ -462,7 +467,9 @@ def add_tool_tips():
"linux_control": "Controls Linux devices.",
"android_control": "Controls Android devices.",
"ios_control": "Controls iOS devices.",
"advanced_device_control": "Provides advanced device control features."
"advanced_device_control": "Provides advanced device control features.",
"code_parser": "Parses and analyzes code.",
"pipeline_manager": "Manages pipelines for various tasks."
}
return tool_tips

Expand Down Expand Up @@ -512,6 +519,8 @@ def add_tool_tips():
android_control.render(),
ios_control.render(),
advanced_device_control.render(),
code_parser.render(),
pipeline_manager.render(),
continue_button,
download_button
)
Expand Down
25 changes: 23 additions & 2 deletions backend/ai_chat.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import openai
import requests
from backend.code_parser import CodeParser
from backend.pipeline_manager import PipelineManager

class MultiAIChat:
def __init__(self, openai_key, huggingface_key, anthropic_key):
self.openai_key = openai_key
self.huggingface_key = huggingface_key
self.anthropic_key = anthropic_key
self.huggingface_key = self.huggingface_key
self.anthropic_key = self.anthropic_key
self.code_parser = CodeParser("")
self.pipeline_manager = PipelineManager()

def openai_chat(self, prompt):
try:
Expand Down Expand Up @@ -36,6 +40,23 @@ def anthropic_chat(self, prompt):
print(f"Error during Anthropic chat: {e}")
return ""

def parse_code(self, code):
try:
self.code_parser = CodeParser(code)
return self.code_parser.analyze_code()
except Exception as e:
print(f"Error during code parsing: {e}")
return {}

def manage_pipeline(self, task):
try:
return self.pipeline_manager.autogpt_task(task)
except Exception as e:
print(f"Error during pipeline management: {e}")
return ""

if __name__ == "__main__":
chat = MultiAIChat("openai_key", "huggingface_key", "anthropic_key")
print(chat.openai_chat("Hello, how can I assist you today?"))
print(chat.parse_code("def example():\n return True"))
print(chat.manage_pipeline("Generate a weekly report."))
7 changes: 7 additions & 0 deletions chatbot/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
from modules.wireless_exploitation import WirelessExploitation
from modules.zero_day_exploits import ZeroDayExploits

from backend.code_parser import CodeParser
from backend.pipeline_manager import PipelineManager

from kafka import KafkaProducer, KafkaConsumer

app = Flask(__name__)
Expand Down Expand Up @@ -130,6 +133,8 @@ def deploy_exploit_endpoint():
vulnerability_scanner = VulnerabilityScanner()
wireless_exploitation = WirelessExploitation()
zero_day_exploits = ZeroDayExploits()
code_parser = CodeParser("sample_code")
pipeline_manager = PipelineManager()
except Exception as e:
print(f"Error initializing modules: {e}")

Expand Down Expand Up @@ -315,6 +320,8 @@ def add_tool_tips():
vulnerability_scanner.render(),
wireless_exploitation.render(),
zero_day_exploits.render(),
code_parser.render(),
pipeline_manager.render(),
continue_button,
download_button
)
Expand Down
11 changes: 11 additions & 0 deletions chatbot/chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
from modules.ios_control import iOSControl
from modules.advanced_device_control import AdvancedDeviceControl

from backend.code_parser import CodeParser
from backend.pipeline_manager import PipelineManager

import pika
from kafka import KafkaProducer, KafkaConsumer

Expand Down Expand Up @@ -222,6 +225,8 @@ def chat():
android_control = AndroidControl()
ios_control = iOSControl()
advanced_device_control = AdvancedDeviceControl()
code_parser = CodeParser("sample_code")
pipeline_manager = PipelineManager()
except Exception as e:
print(f"Error initializing modules: {e}")

Expand Down Expand Up @@ -408,3 +413,9 @@ def send_message_to_queue(message):

# Example usage of sending a message to the queue
send_message_to_queue("Test message")

# Add a continue button for the AI chatbot to continue incomplete responses
continue_button = pn.widgets.Button(name="Continue", button_type="primary")

# Add a download icon button for downloading zip files of projects
download_button = pn.widgets.Button(name="Download .zip", button_type="primary", icon="download")
14 changes: 11 additions & 3 deletions gui/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
from modules.vulnerability_scanner import VulnerabilityScanner
from modules.wireless_exploitation import WirelessExploitation
from modules.zero_day_exploits import ZeroDayExploits
from backend.code_parser import CodeParser
from backend.pipeline_manager import PipelineManager

class Dashboard:
def __init__(self, root):
Expand Down Expand Up @@ -108,7 +110,9 @@ def add_modules(self):
NetworkExploitation(),
VulnerabilityScanner(),
WirelessExploitation(),
ZeroDayExploits()
ZeroDayExploits(),
CodeParser("sample_code"),
PipelineManager()
]

for module in modules:
Expand Down Expand Up @@ -144,7 +148,9 @@ def add_settings_dashboards(self):
{"name": "Network Exploitation", "description": "Configure network exploitation settings."},
{"name": "Vulnerability Scanner", "description": "Configure vulnerability scanner settings."},
{"name": "Wireless Exploitation", "description": "Configure wireless exploitation settings."},
{"name": "Zero Day Exploits", "description": "Configure zero day exploits settings."}
{"name": "Zero Day Exploits", "description": "Configure zero day exploits settings."},
{"name": "Code Parser", "description": "Configure code parser settings."},
{"name": "Pipeline Manager", "description": "Configure pipeline manager settings."}
]

for dashboard in settings_dashboards:
Expand Down Expand Up @@ -179,7 +185,9 @@ def add_settings_dashboards(self):
"Network Exploitation": "Exploits network vulnerabilities.",
"Vulnerability Scanner": "Scans for vulnerabilities.",
"Wireless Exploitation": "Exploits wireless vulnerabilities.",
"Zero Day Exploits": "Manages zero-day exploits."
"Zero Day Exploits": "Manages zero-day exploits.",
"Code Parser": "Parses and analyzes code.",
"Pipeline Manager": "Manages pipelines for various tasks."
}

for name, description in tool_tips.items():
Expand Down
Loading