checksum.ps1 added, removed the old hashing scripts for windows
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
b960c475a456cd4ca4df9228e6935d26aba2d3de a_very_normal_test_file.txt
|
||||
49af6ace2910bb5f533149065a7c2ee669c09ea9 alert.ps1
|
||||
8a0c16f254bb9571708350aab7beb99e0dca3e8b checksum.ps1
|
||||
8a0c16f254bb9571708350aab7beb99e0dca3e8b checksums.ps1
|
||||
8393fe88bab4ce86cf9a1f13949b8db371326bf2 ffmpreg_gif_loopy.ps1
|
||||
f9fd13e485e1254a30279de16c243354e58e411c FIND_THE_FUCKING_PI.ps1
|
||||
64c0df71f41403614e9d20ea33c710915f90d590 get_wsl_usb.ps1
|
||||
9e36220ef01b549c8504877d668c8833cd71fa4a gitshit.ps1
|
||||
a06a596f11d87a8a9a2d87bf7538e9f5c2786d93 gitsync.ps1
|
||||
4eea8bba2f6f2f12dc85aa6d7ac53f2d1fbbd1b0 IM_SO_TIRED_BOSS.ps1
|
||||
4f3b3e0add2d3cb3b93c7c39bfbf547695a18a2c md5sum.ps1
|
||||
79fa68ebfb087c2d2bc2b1a805cc1604ecbd5e7e monitor-copy.txt
|
||||
6ed64c41888586e4d1c06137a8813fc906d5e5db pi-ascii-powershell.ps1
|
||||
56c8acf528e19e2cbf9cdbc5648577f35ec74587 redundant-backup.ps1
|
||||
747560d92967b308de0a467d129f15b0c1136724 scan_subnets_for_port.ps1
|
||||
a47661cc0dd39493bf6e531fb3448c68c0a93439 sha1sum.ps1
|
||||
575c1bc33ce2491cf7069b1bc6984d268a84dcc4 sha256sum.ps1
|
||||
4ad867d4b1b070f49255efc61e80f2098d843b6f sha384sum.ps1
|
||||
0bf441799d73d07c1223979c5c53640a09b25638 sha512sum.ps1
|
||||
19ee7ac9242165951ad6056280e014c5811b2b31 ssh-wait-loop.ps1
|
||||
09bdf386e755f5ca339d2e9edddc7a10bbf88511 subnets.txt
|
||||
50d093581df1e4031662fd91491c3494dfcc0fd9 sync_media.ps1
|
||||
086ad24aa6b5d8d97e98392da06faa805e95ee2f syncstatus.ps1
|
||||
e38f48eea08e3c2f4c28b736d64152a19676cb5d tag.txt
|
||||
d644db4aaf1e31a7c9b2f5cb41f11d74ae136605 tea-cli.exe
|
||||
dafe05b34aaf8a9c0ff80ad27cab0dc5780cf2e2 testtime.ps1
|
||||
75219e011a3aeb01e92546485c5de9d480ccbfd5 wait-on-host.ps1
|
||||
a02db4524ff453394e8246e950a197cbc691f4bd waypoint.ps1
|
||||
0a6f65c3aeeacf8a381faab9834a992b5d297a52 webhook.ps1
|
||||
23171433219f70e576f400bbc88a77ceba7c9822 webhook.txt
|
||||
6b4ce2df2b7e2d63b6415adc7e7ba45e0ff5c9fa windows-repair.ps1
|
||||
23a95097cbcbbc536f1e8ef3eb8737fb1b3bbf7b winhash.ps1
|
||||
@@ -1,6 +0,0 @@
|
||||
param (
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$infile
|
||||
)
|
||||
|
||||
Invoke-Expression "$PSScriptRoot\winhash.ps1 $infile MD5"
|
||||
@@ -1,6 +0,0 @@
|
||||
param (
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$infile
|
||||
)
|
||||
|
||||
Invoke-Expression "$PSScriptRoot\winhash.ps1 $infile SHA1"
|
||||
@@ -1,11 +0,0 @@
|
||||
# param (
|
||||
# [Parameter(Mandatory=$true)]
|
||||
# [string]$infile
|
||||
# )
|
||||
|
||||
if(!$args[0]) {
|
||||
Write-Host "Usage: sha256sum <file path>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Invoke-Expression "$PSScriptRoot\winhash.ps1 $infile SHA256"
|
||||
@@ -1,6 +0,0 @@
|
||||
param (
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$infile
|
||||
)
|
||||
|
||||
Invoke-Expression "$PSScriptRoot\winhash.ps1 $infile SHA384"
|
||||
@@ -1,6 +0,0 @@
|
||||
param (
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$infile
|
||||
)
|
||||
|
||||
Invoke-Expression "$PSScriptRoot\winhash.ps1 $infile SHA512"
|
||||
@@ -1,143 +0,0 @@
|
||||
# Usage:
|
||||
# Open PowerShell as Administrator
|
||||
# win+x
|
||||
# alt+a
|
||||
# alt+y
|
||||
# Run:
|
||||
# In admin powershell Terminal:
|
||||
# iwr -UseBasicParsing -Uri "https://git.thecoven.info/PrincessPi/general-scripts-and-system-ssssssetup/raw/branch/main/Windows-Scripts/windows-repair.ps1?nocache=$(Get-Random)" -OutFile "$env:TEMP\windows-repair-temp.ps1"; powershell -ExecutionPolicy Bypass -File "$env:TEMP\windows-repair-temp.ps1"
|
||||
# or maybe
|
||||
# iwr https://git.thecoven.info/PrincessPi/general-scripts-and-system-ssssssetup/raw/branch/main/Windows-Scripts/windows-repair.ps1 | iex
|
||||
|
||||
# check if hasadmin rights, if notm run script in new terminal, clopsing old
|
||||
## if not, carry on
|
||||
if (-not ([Security.Principal.WindowsIdentity]::GetCurrent().Groups -contains 'S-1-5-32-544')) {
|
||||
# launch tghis script int new window after promopting for admin
|
||||
Start-Process -FilePath 'powershell' -Verb RunAs -ArgumentList "-ExecutionPolicy Bypass -File $PSCommandPath"
|
||||
|
||||
# CLOSE previous terminal
|
||||
exit 0
|
||||
} else {
|
||||
clear # clear window
|
||||
|
||||
Write-Host -ForegroundColor Magenta @'
|
||||
.. .....
|
||||
....------..
|
||||
..:--------.. .......
|
||||
..----------.. ....---..
|
||||
...---------=------::....:----:..
|
||||
..-----=+**************=-----:...
|
||||
.----+****************=-----...
|
||||
.--=****************=-----=**+:::--:....
|
||||
.-=#*********##**++=---====++**+-----:.
|
||||
..:==********#=.+@%-==++===++===++*=----...
|
||||
.:=::******%%+-::=++====+==++====+**=--...
|
||||
.:+..+*****--@===-:-%--====-=+====+*#=:..
|
||||
.-=.-****#=.#+===--=+===----======+*+..
|
||||
.:=:+****#@#+=====-**-----*+====++**:.
|
||||
.. .=****=--======-..%-----%+==++***+-..
|
||||
..=++***+-.----======..*-----#+==+***#%#+..
|
||||
.. .:-..---=====--------=-+==+**-@*. ............::::::....
|
||||
..=:..--===+-:-------*%+==*+#%**=. .....:-------------------------:.
|
||||
..............-:..--===+-..:-------+==+==.:... ...:----------------------------::.
|
||||
......:----------::=:...--==+--:.:-------+==+=:.... ....--------------------------:.....
|
||||
..:::----------------=-::.:--===---:.:------=--:.... ...:---------------------------...
|
||||
..:------------------=--:..:--=+=--------::.:+-..... ...------------------------------..
|
||||
...:-----------------:....----==-------:...=%*.......:::--------------------------------:..
|
||||
...--------------:+......---------------:+%%#.----------------------------:.......-----:..
|
||||
.:----===-------:-.. .:--------------*%%%%=--------------========------:.......-------:...
|
||||
..-:.:------------....-.=---------=#%%%%##%------------=-----------------------------------..
|
||||
.:--:....:--------:##*=:.-------=#%%%%%%#%+-----------=-------------------------------------:
|
||||
..:-----------------::*%%#-------=###%%%%##=--------------------------------------:............
|
||||
..:-------------------:.-#%%##+==+%%%%%%#%+------------------------...:::--------------::::::..
|
||||
...:----------------------..-#%#%%%%%%%%*+#%=-------------------------=-:....:----------------:...
|
||||
--------------------------:.-#%%%%%%%%+#@%%%--------------------------=++=-::---------------:...
|
||||
---------------------------...+%%%%%%%#%%%%#---------------------------------------------:....
|
||||
............------.....----:....-#%%%%%%%*=------------------------------::+=---------.......
|
||||
..:-... ....-----.. ....-=-------------------------------------.=*+=.......
|
||||
..---:....:-----:.......:--------------------------:-------------==+=-......
|
||||
.:-------------..........:---------------------------..:-------------==..........
|
||||
..-------------:... ...--------:...----------------....:-----------==-...........
|
||||
..:----==------:..-.... ..--------:...:---------------.....:----------=+-.....
|
||||
..------==+=++==-..+--:. .:--------.....-----------=*%=.. ..----------=+=......
|
||||
....------------........:... ..:--------.....-------+#%%#@%.. ...----------=+=......
|
||||
....---------===:............... .:----=+*#=. ..--+#**+%@@@#%+. ..:-:..=----=*=:.....
|
||||
:............:=::+=:--:=.=-.::=... ..*@*-+%@@@:.....-@@#%@*#@@@#%:.. ..-:..---:-#**+-.........
|
||||
.. ...::::....::-.:.::-.. ..*%:..*@@@*.. ..-%#%@@+%@@@@=.. ...::.=#=..-%*++=:... ...
|
||||
...... .......... ..**...*#=*%:. .-*#@%+#%@@@@+... ..*%@%+...+%+=*+=-...
|
||||
..*#:.-#+..+-. ..-*#**%%*%@@%=.. ..-%@@*:..+@%=:+**+=:..
|
||||
..*@#*%%=..==. .-*%@#%@##@@@#-. ...#@@%*-=%@@#:..-=++=-
|
||||
.:#@*-:++..==. .=#%@%*@@*%*=+*:....:.+@*::+%@@@%=......-*
|
||||
.-%+...=%##%-. .+@*@%*%@##*-:*+..:-==*@=..:#@+:=*:.......
|
||||
.:*#:..:*@@@%:. .-%@*%@#*%*#=..-%-....:+#=-.:#%-.:+-.......
|
||||
.+@#=.-*@@@@*.. ....-%@@@@@@=..+%*.. .-%--=+#%-.:*-. ....
|
||||
.-=++++++++=... .:***+++==::::... .-%#=-*#%#**#-.
|
||||
..............
|
||||
'@
|
||||
|
||||
Write-Host "`nFIXING WINDOWS FULL PRINCESS PI STYLE (THIS WILL TAKE MANY HOURS AND REBOOT MORE THAN ONCE, SLOWLY)`n" -ForegroundColor Magenta
|
||||
|
||||
Write-Host "ABORTING ANY SCHEDULED SHUTDOWN 1/17"
|
||||
shutdown.exe /a > $null 2> $null # cmd abort scheduled shutdowns
|
||||
|
||||
Write-Host "GENERATING AND DISPLAYING COMPREHENSIVE STABILITY REPORT 2/17"
|
||||
Start-Process "perfmon.exe" -ArgumentList "/report" -Wait
|
||||
|
||||
Write-Host "GENERATING AND DISPLAYING STABILITY HISTORY REPORT 3/17"
|
||||
Start-Process "perfmon.exe" -ArgumentList "/rel" -Wait
|
||||
|
||||
Write-Host "CLEARING DNS 4/17"
|
||||
ipconfig.exe /flushsdns > $null
|
||||
|
||||
Write-Host "CLEARING ARP CACHE 5/17"
|
||||
Remove-NetNeighbor -Confirm:$false > $null 2> $null
|
||||
|
||||
Write-Host "CLEARING ALL SAMBA CREDENTIALS 6/17"
|
||||
net.exe use * /delete /y > $null 2> $null # nuke all samba creds
|
||||
|
||||
Write-Host "RELEASING AND RENEWING DHCP 7/17"
|
||||
# release and renew dhcp
|
||||
ipconfig.exe /release > $null
|
||||
ipconfig.exe /renew > $null
|
||||
|
||||
Write-Host "GETTING CONTROL OF WINDOWS UPDATE"
|
||||
Install-Module -Name PSWindowsUpdate -Force > $null 2> $null
|
||||
|
||||
|
||||
Import-Module PSWindowsUpdate
|
||||
|
||||
Write-Host "UPDATING MALWARE SIGNATURES 8/17"
|
||||
Update-MpSignature # update windows defender malware siggs
|
||||
|
||||
Write-Host "RUNNING WINDOWS MALICIOUS SOFTWARE REMOVAL TOOL (MRT, MAY TAKE A LONG TIME, WONT SHOW STATUS) 9/17"
|
||||
Start-Process -FilePath "MRT.exe" -ArgumentList "/F:Y /Q" -Wait # do full microsoft malicious software removal scan in background automatically removing anything found, wait to proceed
|
||||
|
||||
Write-Host "UPDATING MALWARE SIGNATURES (AGAIN) 10/17"
|
||||
Update-MpSignature # update windows defender malware siggs
|
||||
|
||||
Write-Host "RUNNING FULL WINDOWS DEFENDER SCAN 11/17"
|
||||
Start-MpScan -ScanType FullScan # full windows defender scan
|
||||
|
||||
Write-Host "RUNNING DISM ONLINE IMAGE CLEANUP 12/17"
|
||||
DISM.exe /Online /Cleanup-Image /RestoreHealth # online check for bad files
|
||||
|
||||
Write-Host "RUNNING SYSTEM FILE CHECKER (SFC) 13/17"
|
||||
SFC.exe /scannow # older check for bad files
|
||||
|
||||
Write-Host "SCHEDULING ESSENTIAL FILE CHECK ON NEXT BOOT 14/17"
|
||||
SFC.exe /scanonce # check essential files on next boot
|
||||
|
||||
Write-Host "SCHEDULING OFFLINE CHECK DISK AND REPAIR OF C: (CHKDSK) 15/17"
|
||||
echo y | chkdsk.exe /f /r C: # cmd checks C drive after reboot to waste time and fix errors (noninteractive via y ffuckery)
|
||||
|
||||
Write-Host "SCHEDULINMG OFFLINE MEMTEST 16/17"
|
||||
mdsched.exe /s # schedule offline memtest (noninteractive)
|
||||
|
||||
Write-Host "SCHEDULING WINDOWS DEFENDER OFFLINE SCAN MAY REBOOT UNEXPECTEDLY 17/17"
|
||||
Start-MpWDOScan # powershell starts Windows Defender Offline Scan after reboot
|
||||
|
||||
Write-Host "`nREBOOTING IN 5 MINUTES MAX PROVBABLY SOONER`n"
|
||||
shutdown.exe /r /t (60*5) # shutdown in 5 minutes as failsafe
|
||||
|
||||
Write-Host "`nDONEsiez :3~`n"
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
# Usage:
|
||||
## .\winhash.ps1 <FILE> <ALGO>
|
||||
## Algos Supported:
|
||||
### MD5
|
||||
### SHA1
|
||||
### SHA256
|
||||
### SHA384
|
||||
### SHA512
|
||||
## Example:
|
||||
### .\winhash.ps1 sillyfilly.bin SHA256
|
||||
## Outputs to terminal and to a text file
|
||||
### Text file name format <input filepath>.<unix epoch microseconds>.<hashing algorithm>.txt
|
||||
|
||||
param (
|
||||
[Parameter(Mandatory=$true)] # prompt for input if not specified via cli
|
||||
[string]$infile,
|
||||
|
||||
[Parameter(Mandatory=$true)] # this 1 2 :pope:
|
||||
[string]$algo
|
||||
)
|
||||
|
||||
function Get-UnixMicroseconds {
|
||||
$unixEpoch = [DateTimeOffset]'1970-01-01T00:00:00Z' # unix epoch constant
|
||||
$currentTime = [DateTimeOffset]::UtcNow # current utc time
|
||||
$timeDifferenceTicks = $currentTime.Ticks - $unixEpoch.Ticks # subtract current time from unix epoch constant in ticks
|
||||
$microseconds = [Int64]($timeDifferenceTicks / 10) # use 64bit int, divide ticks by 10 to give microseconds
|
||||
|
||||
# I am literally using Unix microseconds because they are more fun than Unix seconds :pinkie:
|
||||
return $microseconds
|
||||
}
|
||||
|
||||
# jesus fuckin analbeads the selection of hash algos in powershell is weird and limited
|
||||
# probably because Bill Gates and Satya Nadella get together with the other C-suite executives
|
||||
# and hypergoon to leagelese in clickwrap agreements that absolves them of liability and
|
||||
# lets them sell our private data and other assorted dickpics or sumtin idk man lmao
|
||||
$hash = $(Get-FileHash -Path $infile -Algorithm $algo | Format-List) # do da fookin hashin right dafucc here
|
||||
echo $hash # show user
|
||||
echo $hash > "$infile.$(Get-UnixMicroseconds).$algo.txt" # make the txt file
|
||||
Reference in New Issue
Block a user