Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
16 changes: 0 additions & 16 deletions .idea/csv-editor.xml

This file was deleted.

3 changes: 3 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions CODE/Logicytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,10 @@ def Logicytics():
try:
Logicytics()
except KeyboardInterrupt:
log.warning("⚠️ Force shutdown detected! Some temporary files might be left behind.")
log.warning("💡 Pro tip: Next time, let the program finish naturally.")
# TODO v3.4.2 -> Cleanup function
log.warning("Force shutdown detected! Some temporary files might be left behind.")
log.warning("Pro tip: Next time, let the program finish naturally.")
# Attempt cleanup -> Zip generated files
ZIP.files()
exit(0)
else:
log.error("This script cannot be imported!")
Expand Down
18 changes: 9 additions & 9 deletions CODE/_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
import psutil
import requests

from logicytics import Log, DEBUG, VERSION, Check
from logicytics import Log, DEBUG, VERSION, Check, config

log_path = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "ACCESS\\LOGS\\DEBUG\\DEBUG.log")
log = Log({"log_level": DEBUG, "filename": log_path, "truncate_message": False, "delete_log": True})
url = config.get("System Settings", "config_url")


class VersionManager:
Expand Down Expand Up @@ -149,10 +150,9 @@ def get_online_config() -> dict | None:
Retrieves configuration data from a remote repository.
"""
try:
url = "https://raw.githubusercontent.com/DefinetlyNotAI/Logicytics/main/CODE/config.ini"
config = configparser.ConfigParser()
config.read_string(requests.get(url, timeout=15).text)
return config
_config = configparser.ConfigParser()
_config.read_string(requests.get(url, timeout=15).text)
return _config
except requests.exceptions.RequestException as e:
log.error(f"Connection error: {e}")
return None
Expand Down Expand Up @@ -194,12 +194,12 @@ def debug():
Executes a comprehensive system debug routine, performing various checks and logging system information.
"""
# Online Configuration Check
config = ConfigManager.get_online_config()
if config:
HealthCheck.check_versions(VERSION, config["System Settings"]["version"])
_config = ConfigManager.get_online_config()
if _config:
HealthCheck.check_versions(VERSION, _config["System Settings"]["version"])

# File Integrity Check
required_files = config["System Settings"].get("files", "").split(",")
required_files = _config["System Settings"].get("files", "").split(",")
FileManager.check_required_files(".", required_files)

# SysInternal Binaries Check
Expand Down
2 changes: 2 additions & 0 deletions CODE/_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def color_print(text, color="reset", is_input=False) -> None | str:
return input(f"{color_code}{text}{colors['reset']}")
else:
print(f"{color_code}{text}{colors['reset']}")
return None


def _update_ini_file(filename: str, new_data: list | str, key: str) -> None:
Expand Down Expand Up @@ -88,6 +89,7 @@ def _prompt_user(question: str, file_to_open: str = None, special: bool = False)
return True
except Exception as e:
color_print(f"[x] {e}", "red")
return None


def _perform_checks() -> bool:
Expand Down
5 changes: 3 additions & 2 deletions CODE/bluetooth_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import json
import subprocess
from typing import TextIO

from logicytics import log

Expand Down Expand Up @@ -84,7 +85,7 @@ def _query_bluetooth_devices() -> bool | list[dict[str, str]]:
return device_info_list


def _write_device_info_to_file(devices, filename):
def _write_device_info_to_file(devices: list[dict[str, str]], filename: str):
"""
Writes the details of Bluetooth devices to a specified file.

Expand All @@ -109,7 +110,7 @@ def _write_device_info_to_file(devices, filename):
log.error(f"Failed to write device information to file: {e}")


def _write_single_device_info(file, device_info):
def _write_single_device_info(file: TextIO, device_info: dict[str, str]):
"""
Writes detailed information for a single Bluetooth device to the specified file.

Expand Down
9 changes: 5 additions & 4 deletions CODE/bluetooth_logger.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import datetime
import re
import subprocess
from typing import LiteralString

from logicytics import log


# Utility function to log data to a file
def save_to_file(filename, section_title, data):
def save_to_file(filename: str, section_title: str, data: str):
"""
Appends data to a file with a section title.

Expand Down Expand Up @@ -35,7 +36,7 @@ def save_to_file(filename, section_title, data):


# Utility function to run PowerShell commands
def run_powershell_command(command):
def run_powershell_command(command: str) -> None | list[LiteralString]:
"""
Runs a PowerShell command and returns the output as a list of lines.

Expand Down Expand Up @@ -67,7 +68,7 @@ def run_powershell_command(command):


# Unified parsing function for PowerShell output
def parse_output(lines, regex, group_names):
def parse_output(lines: list[LiteralString], regex: str, group_names: list[str]):
"""
Parses the output lines using the provided regex and group names.

Expand Down Expand Up @@ -101,7 +102,7 @@ def parse_output(lines, regex, group_names):


# Function to get paired Bluetooth devices
def get_paired_bluetooth_devices():
def get_paired_bluetooth_devices() -> list[str]:
"""
Retrieves a list of paired Bluetooth devices with their names and MAC addresses.

Expand Down
12 changes: 10 additions & 2 deletions CODE/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[Settings]
# Would you like to enable debug mode?
# This will print out more information to the console, with prefix DEBUG
# This will not be logged however
# This will not be logged however, and is useful for developers - This is different than the DEBUGGER itself
log_using_debug = false

# Would you like for new logs to be created every execution?
Expand All @@ -28,6 +28,7 @@ save_preferences = true
# Dev Mode allows a safe way to modify these settings!!
version = 3.4.1
files = "bluetooth_details.py, bluetooth_logger.py, browser_miner.ps1, cmd_commands.py, config.ini, dir_list.py, dump_memory.py, event_log.py, Logicytics.py, log_miner.py, media_backup.py, netadapter.ps1, network_psutil.py, packet_sniffer.py, property_scraper.ps1, registry.py, sensitive_data_miner.py, ssh_miner.py, sys_internal.py, tasklist.py, tree.ps1, vulnscan.py, wifi_stealer.py, window_feature_miner.ps1, wmic.py, logicytics\Checks.py, logicytics\Config.py, logicytics\Execute.py, logicytics\FileManagement.py, logicytics\Flag.py, logicytics\Get.py, logicytics\Logger.py, logicytics\User_History.json.gz, VulnScan\Model SenseMini .3n3.pth, VulnScan\README.md, VulnScan\Vectorizer .3n3.pkl"
config_url = https://raw.githubusercontent.com/DefinetlyNotAI/Logicytics/main/CODE/config.ini

########################################################
# The following settings are for specific modules #
Expand Down Expand Up @@ -97,10 +98,17 @@ timeout = 10
max_retry_time = 30

###################################################
[VulnScan Settings]
# Following extensions to be skipped by the model
unreadable_extensions = .exe,.dll,.so,.zip,.tar,.gz,.7z,.rar,.jpg,.jpeg,.png,.gif,.bmp,.tiff,.webp,.mp3,.wav,.flac,.aac,.ogg,.mp4,.mkv,.avi,.mov,.wmv,.flv,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.odt,.ods,.odp,.bin,.dat,.iso,.class,.pyc,.o,.obj,.sqlite,.db,.ttf,.otf,.woff,.woff2,.lnk,.url
# In MB, max file size that the model is allowed to scan, if commented out disables the limit, you can also just say None
max_file_size_mb = None
# Max workers to be used, either integer or use auto to make it decide the best value
max_workers = auto

[VulnScan.generate Settings]
# The following settings are for the Generate module for fake training data
extensions = .txt, .log, .md, .csv, .json, .xml, .html, .yaml, .ini, .pdf, .docx, .xlsx, .pptx
extensions = .txt,.log,.md,.csv,.json,.xml,.html,.yaml,.ini,.pdf,.docx,.xlsx,.pptx
save_path = PATH

# Options include:
Expand Down
Loading