5 Commits
7 changed files with 798 additions and 80 deletions

No files matched your search

+1
View File
@@ -39,6 +39,7 @@ script=/tmp/install_script.sh && curl -s https://git.thecoven.info/PrincessPi/ge
* `large_file_search_for_hash`
* `randomtoken`
* `alfa_install_kali.sh`
* `torsilly.sh`
#### monitoring
* `mon-watch`
+380
View File
@@ -0,0 +1,380 @@
<!-- Base file structure and logic utilized from Random-Words.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Princess Pi's Magic Random Words Generator</title>
<style>
:root {
--bg-color: #fce4ec;
--card-bg: #f3e5f5;
--text-color: #4a148c;
--text-muted: #7b1fa2;
--accent-color: #90caf9;
--accent-hover: #64b5f6;
--border-color: #ce93d8;
--success-color: #ec407a;
}
body {
font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", "Marker Felt", cursive, sans-serif;
background-color: var(--bg-color);
color: var(--text-color);
margin: 0;
padding: 20px;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
box-sizing: border-box;
overflow: hidden;
}
/* ASCII Art Background */
#ascii-bg {
position: fixed;
top: 0;
left: 0;
margin: 0;
z-index: -1;
font-family: monospace;
white-space: pre;
font-size: 10px;
line-height: 10px;
pointer-events: none;
}
/* Replaced .container with #content and set 70% opacity */
#content {
background-color: var(--card-bg);
border: 2px solid var(--border-color);
border-radius: 16px;
padding: 30px;
width: 100%;
max-width: 800px;
box-shadow: 0 10px 25px -5px rgba(74, 20, 140, 0.15);
opacity: 0.65; /* Makes #content and all children visually 70% opaque */
}
h1 {
margin-top: 0;
font-size: 1.6rem;
text-align: center;
/* Flex layout to keep characters inline if they wrap */
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 1px;
}
h1 span {
transition: color 0.1s ease;
}
.privacy-badge {
background-color: rgba(236, 64, 122, 0.1);
color: var(--success-color);
border: 1px dashed var(--success-color);
padding: 8px 12px;
border-radius: 8px;
font-size: 0.85rem;
text-align: center;
margin-bottom: 20px;
font-weight: bold;
}
.form-group {
margin-bottom: 20px;
}
label {
display: block;
margin-bottom: 8px;
font-size: 0.95rem;
color: var(--text-muted);
font-weight: bold;
}
input[type="number"],
input[type="text"] {
width: 100%;
padding: 10px 12px;
background-color: #ffffff;
border: 2px solid var(--border-color);
color: var(--text-color);
border-radius: 8px;
font-size: 1rem;
box-sizing: border-box;
font-family: inherit;
}
input:focus {
outline: none;
border-color: var(--accent-hover);
}
.controls-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 15px;
}
button {
width: 100%;
background-color: var(--accent-color);
color: #1a237e;
border: 2px solid #64b5f6;
padding: 12px;
font-size: 1.1rem;
font-weight: bold;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s ease;
margin-top: 10px;
font-family: inherit;
}
button:hover {
background-color: var(--accent-hover);
transform: scale(1.02);
}
.output-container {
margin-top: 25px;
position: relative;
}
textarea {
width: 100%;
height: 120px;
background-color: #ffffff;
border: 2px solid var(--border-color);
color: var(--text-color);
border-radius: 8px;
padding: 12px;
font-family: monospace;
font-size: 1.1rem;
resize: vertical;
box-sizing: border-box;
}
textarea:focus {
outline: none;
border-color: var(--accent-hover);
}
.copy-btn {
background-color: #e1bee7;
border-color: #ce93d8;
color: var(--text-color);
margin-top: 10px;
padding: 10px;
font-size: 0.95rem;
}
.copy-btn:hover {
background-color: #ce93d8;
}
</style>
</head>
<body>
<!-- Preformatted text ASCII Art Background -->
<pre id="ascii-bg">
.. .....
....------..
..:--------.. .......
..----------.. ....---..
...---------=------::....:----:..
..-----=+**************=-----:...
.----+****************=-----...
.--=****************=-----=**+:::--:....
.-=#*********##**++=---====++**+-----:.
..:==********#=.+@%-==++===++===++*=----...
.:=::******%%+-::=++====+==++====+**=--...
.:+..+*****--@===-:-%--====-=+====+*#=:..
.-=.-****#=.#+===--=+===----======+*+..
.:=:+****#@#+=====-**-----*+====++**:.
.. .=****=--======-..%-----%+==++***+-..
..=++***+-.----======..*-----#+==+***#%#+..
.. .:-..---=====--------=-+==+**-@*. ............::::::....
..=:..--===+-:-------*%+==*+#%**=. .....:-------------------------:.
..............-:..--===+-..:-------+==+==.:... ...:----------------------------::.
......:----------::=:...--==+--:.:-------+==+=:.... ....--------------------------:.....
..:::----------------=-::.:--===---:.:------=--:.... ...:---------------------------...
..:------------------=--:..:--=+=--------::.:+-..... ...------------------------------..
...:-----------------:....----==-------:...=%*.......:::--------------------------------:..
...--------------:+......---------------:+%%#.----------------------------:.......-----:..
.:----===-------:-.. .:--------------*%%%%=--------------========------:.......-------:...
..-:.:------------....-.=---------=#%%%%##%------------=-----------------------------------..
.:--:....:--------:##*=:.-------=#%%%%%%#%+-----------=-------------------------------------:
..:-----------------::*%%#-------=###%%%%##=--------------------------------------:............
..:-------------------:.-#%%##+==+%%%%%%#%+------------------------...:::--------------::::::..
...:----------------------..-#%#%%%%%%%%*+#%=-------------------------=-:....:----------------:...
--------------------------:.-#%%%%%%%%+#@%%%--------------------------=++=-::---------------:...
---------------------------...+%%%%%]%%%%#---------------------------------------------:....
............------.....----:....-#%%%%%%%*=------------------------------::+=---------.......
..:-... ....-----.. ....-=-------------------------------------.=*+=.......
..---:....:-----:.......:--------------------------:-------------==+=-......
.:-------------..........:---------------------------..:-------------==..........
..-------------:... ...--------:...----------------....:-----------==-...........
..:----==------:..-.... ..--------:...:---------------.....:----------=+-.....
..------==+=++==-..+--:. .:--------.....-----------=*%=.. ..----------=+=......
....------------........:... ..:--------.....-------+#%%#@%.. ...----------=+=......
....---------===:............... .:----=+*#=. ..--+#**+%@@@#%+. ..:-:..=----=*=:.....
:............:=::+=:--:=.=-.::=... ..*@*-+%@@@:.....-@@#%@*#@@@#%:.. ..-:..---:-#**+-.........
.. ...::::....::-.:.::-.. ..*%:..*@@@*.. ..-%#%@@+%@@@@=.. ...::.=#=..-%*++=:... ...
...... .......... ..**...*#=*%:. .-*#@%+#%@@@@+... ..*%@%+...+%+=*+=-...
..*#:.-#+..+-. ..-*#**%%*%@@%=.. ..-%@@*:..+@%=:+**+=:..
..*@#*%%=..==. .-*%@#%@##@@@#-. ...#@@%*-=%@@#:..-=++=-
.:#@*-:++..==. .=#%@%*@@*%*=+*:....:.+@*::+%@@@%=......-*
.-%+...=%##%-. .+@*@%*%@##*-:*+..:-==*@=..:#@+:=*:.......
.:*#:..:*@@@%:. .-%@*%@#*%*#=..-%-....:+#=-.:#%-.:+-.......
.+@#=.-*@@@@*.. ....-%@@@@@@=..+%*.. .-%--=+#%-.:*-. ....
.-=++++++++=... .:***+++==::::... .-%#=-*#%#**#-.
</pre>
<div id="content">
<h1 id="titleText">Princess Pi's Magic Random Words Generator</h1>
<div class="privacy-badge">
✨ 100% Offline • Zero Storage • Zero Logging • Web Crypto API ✨
</div>
<div class="controls-row">
<div class="form-group">
<label for="wordCount">Number of Words</label>
<input type="number" id="wordCount" value="12" min="1" max="256">
</div>
<div class="form-group">
<label for="delimiter">Custom Delimiter</label>
<input type="text" id="delimiter" value=" ">
</div>
</div>
<button onclick="generateSecureWords()">Generate Magic Words</button>
<div class="output-container">
<label for="output">Generated Output</label>
<textarea id="output" readonly placeholder="Click generate to create magic words..."></textarea>
<button class="copy-btn" onclick="copyToClipboard()">Copy to Clipboard</button>
</div>
</div>
<script>
// Changed variable name from BIP39_WORDS to wordsListArray per your request
// SecLists language-english.txt + SecLists us-citites.txt
// sed 's/.*/"&"/' input.txt | paste -sd, - | sed 's/,/, /g' > output.txt
const wordsListArray = [
"Abbeville", "Abbotsford", "Abbott", "Abbottsburg", "Abbottstown", "Abbyville", "Abell", "Abercrombie", "Aberdeen", "Aberfoil", "Abernant", "Abernathy", "Abeytas", "Abie", "Abilene", "Abingdon", "Abington", "Abiquiu", "Abita Springs", "Abo", "Aboite", "Abraham", "Abram", "Abrams", "Absarokee", "Absecon", "Academy", "Accokeek", "Accomac", "Accord", "Ace", "Aceitunas", "Acequia", "Achille", "Achilles", "Ackerly", "Ackerman", "Ackley", "Ackworth", "Acme", "Acomita Lake", "Acra", "Acree", "Acton", "Acworth", "Acy", "Ada", "Adair", "Adair Village", "Adairsville", "Adairville", "Adams", "Adams Center", "Adams City", "Adamstown", "Adamsville", "Adario", "Addicks", "Addie", "Addieville", "Addington", "Addis", "Addison", "Addy", "Addyston", "Adel", "Adelaide", "Adelanto", "Adelino", "Adell", "Adelphi", "Adelphia", "Aden", "Adena", "Adgateville", "Adin", "Adjuntas", "Admire", "Adna", "Adona", "Adrian", "Advance", "Adwolf", "Ady", "Aetna", "Affton", "Afton", "Agar", "Agate", "Agate Beach", "Agawam", "Agency", "Agnes", "Agness", "Agnew", "Agnos", "Agoura", "Agra", "Agricola", "Agua Dulce", "Agua Fria", "Aguada", "Aguadilla", "Aguanga", "Aguas Buenas", "Aguas Claras", "Agudo", "Aguila", "Aguilar", "Aguilares", "Aguilita", "Ahloso", "Ahmeek", "Ahoskie", "Ahtanum", "Ahuimanu", "Ahwahnee", "Aibonito", "Aid", "Aiea", "Aiken", "Ailey", "Ainsworth", "Airmont", "Airport Drive", "Airway Heights", "Aitkin", "Ajo", "Akaska", "Akeley", "Akers", "Akhiok", "Akiachak", "Akiak", "Akin", "Akra", "Akron", "Akutan", "Alabam", "Alabaster", "Aladdin", "Alakanuk", "Alamance", "Alameda", "Alamo", "Alamo Alto", "Alamo Heights", "Alamo Oaks", "Alamogordo", "Alamosa", "Alamota", "Alanreed", "Alapaha", "Alba", "Albany", "Albee", "Albemarle", "Alberene", "Alberhill", "Albers", "Albert", "Albert City", "Albert Lea", "Alberta", "Alberton", "Albertson", "Albertville", "Albin", "Albion", "Alborn", "Albright", "Albuquerque", "Alburg", "Alburnett", "Alburtis", "Alcalde", "Alcan", "Alcester", "Alco", "Alcoa", "Alcoa Center", "Alcolu", "Alcoma", "Alda", "Aldan", "Alden", "Alden Bridge", "Alder", "Alderpoint", "Alderson", "Alderwood Manor", "Aldine", "Aldrich", "Aledo", "Aleknagik", "Alex", "Alexander", "Alexander City", "Alexandria", "Alexandria Bay", "Alexis", "Alfalfa", "Alfordsville", "Alfred", "Alger", "Algerita", "Algoa", "Algodones", "Algoma", "Algona", "Algonac", "Algonquin", "Algood", "Alhambra", "Ali Chukson", "Alice", "Aliceville", "Alicia", "Aline", "Aliquippa", "Alire", "Aliso Viejo", "Alix", "Alkabo", "Allakaket", "Allamuchy", "Allandale", "Allardt", "Alleene", "Allegan", "Allegany", "Alleghany", "Allegre", "Alleman", "Allen", "Allen City", "Allen Park", "Allendale", "Allenfarm", "Allenhurst", "Allenport", "Allenspark", "Allensville", "Allenton", "Allentown", "Allenville", "Allenwood", "Allerton", "Alley", "Allgood", "Alliance", "Alligator", "Allison", "Allison Gap", "Allison Park", "Allons", "Allouez", "Alloway", "Allport", "Allyn", "Alma", "Alma Center", "Almedia", "Almelund", "Almena", "Almeria", "Almira", "Almo", "Almon", "Almond", "Almont", "Almonte", "Almota", "Almy", "Almyra", "Alnwick", "Aloe", "Aloha", "Alondra Park", "Alpaugh", "Alpena", "Alpha", "Alpharetta", "Alpine", "Alquina", "Alsea", "Alsen", "Alsey", "Alsip", "Alston", "Alstown", "Alsuma", "Alta", "Alta Loma", "Alta Sierra", "Alta Vista", "Altadena", "Altair", "Altamahaw", "Altamont", "Altamonte Springs", "Altavista", "Altenburg", "Altha", "Altheimer", "Altmar", "Alto", "Alto Pass", "Alton", "Altona", "Altoona", "Altura", "Alturas", "Altus", "Alum Bridge", "Alva", "Alvarado", "Alvaton", "Alvin", "Alvo", "Alvord", "Alvordton", "Alvwood", "Alzada", "Amado", "Amador City", "Amagansett", "Amagon", "Amalga", "Amanda", "Amanda Park", "Amargosa Valley", "Amarillo", "Amasa", "Amawalk", "Amazonia", "Amber", "Amberg", "Amberley", "Ambler", "Amboy", "Ambridge", "Ambridge Heights", "Ambrose", "Amchitka", "Amelia", "Amelia City", "Amelia Court House", "Amenia", "American Beach", "American Canyon", "American Falls", "American Fork", "Americus", "Amery", "Ames", "Amesbury", "Amesville", "Amherst", "Amherst Junction", "Amherstdale", "Amidon", "Amiret", "Amistad", "Amite", "Amity", "Amity Gardens", "Amityville", "Ammon", "Amo", "Amonate", "Amoret", "Amorita", "Amory", "Amsden", "Amsterdam", "Amy", "Anacoco", "Anaconda", "Anacortes", "Anaheim", "Anahola", "Anahuac", "Anaktuvuk Pass", "Anamoose", "Anamosa", "Anandale", "Anasco", "Anatone", "Anawalt", "Ancho", "Anchor", "Anchor Point", "Anchorage", "Anchorville", "Ancient Oaks", "Andale", "Andalusia", "Anderson", "Anderson Mill", "Andersonville", "Andes", "Anding", "Andover", "Andrade", "Andrew", "Andrews", "Andrix", "Anegam", "Aneta", "Angel City", "Angel Fire", "Angela", "Angeles", "Angelica", "Angels City", "Angelus", "Angier", "Angiola", "Angle", "Angle Inlet", "Angleton", "Angola", "Angola on the Lake", "Angora", "Anguilla", "Angus", "Angwin", "Aniak", "Animas", "Anita", "Aniwa", "Ankeny", "Ankenytown", "Anmoore", "Ann Arbor", "AnLine truncated
];
/**
* Utility function to generate a random pastel color
*/
function getRandomPastel() {
const hue = Math.floor(Math.random() * 360);
return `hsl(${hue}, 100%, 75%)`;
}
/**
* Utility function for random timeouts
*/
function getRandomTimeout(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
// Initialization logic for UI animations
window.addEventListener('DOMContentLoaded', () => {
// --- H1 Character Color Animation ---
const h1 = document.getElementById('titleText');
const textChars = h1.innerText.split('');
h1.innerText = ''; // Clear raw text
textChars.forEach(char => {
const span = document.createElement('span');
// Handle spaces explicitly
span.innerHTML = char === ' ' ? '&nbsp;' : char;
h1.appendChild(span);
const animateChar = () => {
span.style.color = getRandomPastel();
setTimeout(animateChar, getRandomTimeout(50, 500));
};
// Kick off the animation loop for this character
animateChar();
});
// --- ASCII Art Background Animation ---
const asciiBg = document.getElementById('ascii-bg');
const animateAsciiBg = () => {
asciiBg.style.color = getRandomPastel();
setTimeout(animateAsciiBg, getRandomTimeout(200, 750));
};
// Kick off the ASCII background loop
animateAsciiBg();
});
/**
* Generates a string of cryptographically secure random words.
*/
function generateSecureWords() {
const countInput = document.getElementById('wordCount').value;
const delimiter = document.getElementById('delimiter').value;
const outputArea = document.getElementById('output');
let numberOfWords = parseInt(countInput, 10);
if (isNaN(numberOfWords) || numberOfWords < 1) {
numberOfWords = 12;
document.getElementById('wordCount').value = 12;
}
const generatedWords = [];
// Array length evaluated dynamically allowing arbitrary additions/removals
const wordListLength = wordsListArray.length;
for (let i = 0; i < numberOfWords; i++) {
const randomBuffer = new Uint32Array(1);
window.crypto.getRandomValues(randomBuffer);
const randomIndex = randomBuffer[0] % wordListLength;
generatedWords.push(wordsListArray[randomIndex]);
}
outputArea.value = generatedWords.join(delimiter);
}
/**
* Copies the currently generated text in the textarea to the system clipboard.
*/
function copyToClipboard() {
const outputArea = document.getElementById('output');
if (!outputArea.value) {
return;
}
outputArea.select();
outputArea.setSelectionRange(0, 99999);
navigator.clipboard.writeText(outputArea.value)
.then(() => {
const copyBtn = document.querySelector('.copy-btn');
const originalText = copyBtn.innerText;
copyBtn.innerText = "Copied! ✨";
setTimeout(() => {
copyBtn.innerText = originalText;
}, 2000);
})
.catch(err => {
console.warn('Clipboard API failed, attempting execCommand...', err);
document.execCommand('copy');
});
}
</script>
</body>
</html>
+277
View File
@@ -0,0 +1,277 @@
[CmdletBinding(DefaultParameterSetName='Generate')]
param(
# File(s) or wildcard pattern to compute checksum for
[Parameter(Position = 0, ParameterSetName = 'Generate', ValueFromPipeline = $true)]
[Parameter(Position = 0, ParameterSetName = 'Match', ValueFromPipeline = $true)]
[string[]]$FilePath,
# Output file to save generated checksums (-o mode)
[Parameter(Mandatory = $false, ParameterSetName = 'Generate')]
[Alias('o')]
[string]$OutFile,
# File containing checksums to verify (-c mode)
[Parameter(Mandatory = $false, ParameterSetName = 'Verify')]
[Alias('c')]
[string]$Check,
# Direct checksum hash string to match against (-m mode)
[Parameter(Mandatory = $true, ParameterSetName = 'Match')]
[Alias('m')]
[string]$Match,
# Hashing algorithm to use (Defaults to SHA256)
[Parameter(Mandatory = $false)]
[Alias('a')]
[ValidateSet('SHA1', 'SHA256', 'SHA384', 'SHA512', 'MD5')]
[string]$Algorithm,
# Help flag (-h, -Help)
[Parameter(Mandatory = $false)]
[Alias('h')]
[switch]$Help
)
begin {
function Show-Help {
@'
NAME
checksum - Compute and verify message digests / file checksums
SYNOPSIS
.\checksum.ps1 [-FilePath] <string[]> [-OutFile <string>] [-Algorithm <string>]
.\checksum.ps1 [-FilePath] <string[]> -Match <string> [-Algorithm <string>]
.\checksum.ps1 -Check <string> [-Algorithm <string>]
.\checksum.ps1 -Help
DESCRIPTION
Computes or verifies checksums using various cryptographic algorithms.
Outputs hash values in standard Linux utility format (<hash> <filename>).
PARAMETERS
-FilePath <string[]>
Specifies the path to one or more files to hash. Accepts wildcards (*).
-o, -OutFile <string>
Specifies an output file to save the checksum results to, while still
displaying the output on screen.
-c, -Check <string>
Read checksums from the specified file and verify them against files on disk.
-m, -Match <string>
Compare the computed hash of the target file(s) against a specific hash string.
-a, -Algorithm <string>
Specifies the cryptographic hash algorithm to use.
Supported values: SHA1, SHA256 (default), SHA384, SHA512, MD5.
If omitted in -c or -m mode, the algorithm is auto-detected by hash length.
-h, -Help
Display this help message.
EXAMPLES
1. Compute SHA256 checksum for a single file:
.\checksum.ps1 myfile.iso
2. Compute checksums for all files and write to a file while showing output:
.\checksum.ps1 * -o checksums.sha256
3. Verify a file against a explicit hash string:
.\checksum.ps1 myfile.iso -m "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
4. Verify checksums from a verification file (auto-detects algorithm):
.\checksum.ps1 -c checksums.sha256
'@
}
# Helper function to auto-detect hash algorithm based on string character length
function Get-AlgorithmFromHashLength {
param([string]$HashString)
switch ($HashString.Trim().Length) {
32 { return 'MD5' }
40 { return 'SHA1' }
64 { return 'SHA256' }
96 { return 'SHA384' }
128 { return 'SHA512' }
default {
Write-Error "checksum: Could not auto-detect algorithm for hash length $($HashString.Length). Please specify -Algorithm."
return $null
}
}
}
}
process {
# Match help arguments passed either as switch (-h, -Help) or positional string ('help', 'h', '--help', etc.)
$isHelpRequested = $Help.IsPresent -or (
$FilePath -and $FilePath.Count -eq 1 -and (
$FilePath[0] -match '^(?i)[-/]{0,2}(h|help)$'
)
)
if ($isHelpRequested) {
Show-Help
return
}
# Normalize explicit algorithm input if provided
if (-not [string]::IsNullOrWhiteSpace($Algorithm)) {
$Algorithm = $Algorithm.ToUpper()
}
# --- DIRECT MATCH MODE (-m / -Match) ---
if ($PSCmdlet.ParameterSetName -eq 'Match') {
if (-not $FilePath -or $FilePath.Count -eq 0) {
Write-Error "checksum: Missing file path parameter for matching. Use -Help for usage."
return
}
# Auto-detect algorithm from provided -Match hash string if not explicitly given
if ([string]::IsNullOrWhiteSpace($Algorithm)) {
$Algorithm = Get-AlgorithmFromHashLength -HashString $Match
if (-not $Algorithm) { return }
Write-Verbose "Auto-detected algorithm: $Algorithm"
}
$expectedHash = $Match.Trim().ToLower()
foreach ($pathEntry in $FilePath) {
$resolvedItems = Get-Item -Path $pathEntry -ErrorAction SilentlyContinue
if (-not $resolvedItems) {
Write-Error "checksum: $pathEntry`: No such file or directory"
continue
}
foreach ($item in $resolvedItems) {
if ($item.PSIsContainer) {
Write-Error "checksum: $($item.Name)`: Is a directory"
} else {
$actualHash = (Get-FileHash -Path $item.FullName -Algorithm $Algorithm).Hash.ToLower()
$targetFile = Resolve-Path -Path $item.FullName -Relative
if ($targetFile.StartsWith(".\")) { $targetFile = $targetFile.Substring(2) }
if ($actualHash -eq $expectedHash) {
Write-Host "${targetFile}: " -NoNewline
Write-Host "OK" -ForegroundColor Green
} else {
Write-Host "${targetFile}: " -NoNewline
Write-Host "FAILED" -ForegroundColor Red
}
}
}
}
}
# --- VERIFICATION MODE (-c / -Check) ---
elseif ($PSCmdlet.ParameterSetName -eq 'Verify') {
if (-not (Test-Path -Path $Check -PathType Leaf)) {
Write-Error "checksum: $Check`: No such file or directory"
return
}
$lines = Get-Content -Path $Check
# Auto-detect algorithm based on hash length if not explicitly provided
if ([string]::IsNullOrWhiteSpace($Algorithm)) {
foreach ($line in $lines) {
if ([string]::IsNullOrWhiteSpace($line) -or $line.StartsWith("#")) { continue }
if ($line -match '^([a-fA-F0-9]+)\s+') {
$Algorithm = Get-AlgorithmFromHashLength -HashString $Matches[1]
if (-not $Algorithm) { return }
Write-Verbose "Auto-detected algorithm: $Algorithm"
break
}
}
# Fallback if file contained no parsable hashes
if ([string]::IsNullOrWhiteSpace($Algorithm)) {
$Algorithm = 'SHA256'
}
}
foreach ($line in $lines) {
# Skip empty lines or comments
if ([string]::IsNullOrWhiteSpace($line) -or $line.StartsWith("#")) { continue }
# Match standard checksum output format: "<hash> [* ]<filename>"
if ($line -match '^([a-fA-F0-9]+)\s+[* ]?(.*)$') {
$expectedHash = $Matches[1].ToLower()
# Strip leading whitespace and any leftover leading asterisk
$targetFile = $Matches[2].Trim().TrimStart('*')
if (Test-Path -Path $targetFile -PathType Leaf) {
$actualHash = (Get-FileHash -Path $targetFile -Algorithm $Algorithm).Hash.ToLower()
if ($actualHash -eq $expectedHash) {
Write-Host "${targetFile}: " -NoNewline
Write-Host "OK" -ForegroundColor Green
} else {
Write-Host "${targetFile}: " -NoNewline
Write-Host "FAILED" -ForegroundColor Red
}
} else {
Write-Host "${targetFile}: " -NoNewline
Write-Host "FAILED open or read" -ForegroundColor Red
}
} else {
Write-Warning "checksum: improperly formatted line: $line"
}
}
}
# --- GENERATION MODE ---
else {
# Default to SHA256 if no algorithm was specified in generation mode
if ([string]::IsNullOrWhiteSpace($Algorithm)) {
$Algorithm = 'SHA256'
}
if (-not $FilePath -or $FilePath.Count -eq 0) {
Write-Error "checksum: Missing file path parameter. Use -Help for usage."
return
}
# Clear/initialize output file if specified before writing hashes
if (-not [string]::IsNullOrWhiteSpace($OutFile)) {
$null = New-Item -Path $OutFile -ItemType File -Force
}
foreach ($pathEntry in $FilePath) {
# Resolve wildcards and single file inputs
$resolvedItems = Get-Item -Path $pathEntry -ErrorAction SilentlyContinue
if (-not $resolvedItems) {
Write-Error "checksum: $pathEntry`: No such file or directory"
continue
}
foreach ($item in $resolvedItems) {
# Handle directories like Linux sha256sum does
if ($item.PSIsContainer) {
Write-Error "checksum: $($item.Name)`: Is a directory"
} else {
$hash = (Get-FileHash -Path $item.FullName -Algorithm $Algorithm).Hash.ToLower()
# Format standard relative path (stripping leading '.\')
$relativePath = Resolve-Path -Path $item.FullName -Relative
if ($relativePath.StartsWith(".\")) {
$relativePath = $relativePath.Substring(2)
}
$outputLine = "$hash $relativePath"
# If -OutFile is provided, write line to file
if (-not [string]::IsNullOrWhiteSpace($OutFile)) {
Add-Content -Path $OutFile -Value $outputLine
}
# Output to stdout
Write-Output $outputLine
}
}
}
}
}
end {}
-32
View File
@@ -1,32 +0,0 @@
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
@@ -0,0 +1,58 @@
#!/bin/bash
domain=kasm.h.acker.is
local_port=8443
swap_size_gib=6
sudo apt update
sudo apt dist-upgrade -y
sudo fallocate -l ${swap_size_gib}g /mnt/${swap_size_gib}GiB.swap
sudo chmod 600 /mnt/${swap_size_gib}GiB.swap
sudo mkswap /mnt/${swap_size_gib}GiB.swap
sudo swapon /mnt/${swap_size_gib}GiB.swap
echo "/mnt/${swap_size_gib}GiB.swap swap swap defaults 0 0" | sudo tee -a /etc/fstab
cd /tmp
curl -O https://kasm-static-content.s3.amazonaws.com/kasm_release_1.19.0-latest.tar.gz
tar -xf kasm_release*.tar.gz
sudo bash kasm_release/install.sh -L $local_port
sudo apt update
sudo apt install nginx certbot python3-certbot-nginx -y
sudo certbot certonly --nginx -d $domain
sudo cat << 'EOF' > /etc/nginx/sites-available/$domain
server {
listen 443 ssl;
server_name $domain;
ssl_certificate /etc/letsencrypt/live/$domain/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/$domain/privkey.pem;
location / {
# WebSocket Support
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Host and X headers
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Should match the listening port of this proxy
proxy_set_header X-Forwarded-Port 443;
# Connectivity Options
proxy_http_version 1.1;
proxy_read_timeout 1800s;
proxy_send_timeout 1800s;
proxy_connect_timeout 1800s;
proxy_buffering off;
# Allow large requests to support file uploads to sessions
client_max_body_size 10M;
# Proxy to Kasm Workspaces running locally on $local_port using ssl
proxy_pass https://127.0.0.1:$local_port;
}
}
EOF
sudo ln -s /etc/nginx/sites-available/$domain /etc/nginx/sites-enabled/$domain
sudo nginx -t
sudo systemctl restart nginx
sudo docker restart kasm_api
sudo shutdown -r +7
+42 -48
View File
@@ -12,7 +12,6 @@ tmpDir='/tmp/generalssss'
tmp_customscripts_dir="$tmpDir/customscripts"
finalDir='/usr/share/customscripts'
packages="7zip apache2 argon2 avahi-daemon btop build-essential byobu cargo cifs-utils clamav cmake cowsay cracklib-runtime detox docker.io exiftool fdupes ffuf gcc-arm-none-eabi grc gzip iotop iptraf-ng jq kpartx libnss-mdns libnewlib-arm-none-eabi librust-git2+openssl-probe-dev libstdc++-arm-none-eabi-newlib locales lynx net-tools nginx openssl php polygen polygen-data procps python3 python3-scapy resolvconf restic ripgrep samba screen seclists snapd thefuck unzip wget xrdp xxd xz-utils zip kali-linux-default"
# packages="grc kpartx openssl cracklib-runtime argon2 jq polygen polygen-data apache2 seclists cmake locales python3 build-essential gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib librust-git2+openssl-probe-dev cargo nginx build-essential cowsay iotop iptraf-ng btop screen byobu thefuck wget lynx zip unzip 7zip xz-utils gzip net-tools clamav php restic cifs-utils detox fdupes ripgrep avahi-daemon libnss-mdns xxd xrdp libimage-exiftool-perl kali-tools-hardware kali-tools-crypto-stego kali-tools-fuzzing kali-tools-bluetooth kali-tools-rfid kali-tools-sdr kali-tools-voip kali-tools-802-11 kali-tools-forensics samba procps snapd"
echo -e "\nSTARTING!\n\tUsing Shell $SHELL\n"
@@ -73,49 +72,48 @@ if [ ! -z "$1" ]; then
# echo -e "\nhaveibeenpwned-downloader installed, skipping install\n"
# fi
# homebrew
# if [ ! $(which brew) ]; then
# ## install homebrew
# echo -e "\nlinuxbrew not found, installing\n"
# bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
# test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
# ### add to rcfile
# if ! grep -q 'linuxbrew' $rcfile; then
# # echo "adding linuxbrew to $rcfile"
# # echo "# linuxbrew (homebrew/brew)" >> $rcfile
# # echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> $rcfile
# else
# echo "linuxbrew already in $rcfile skipping"
# fi
#
# # source $rcfile
# else
# echo -e "\nlinuxbrew installed, skipping install\n"
# # source $rcfile
# fi
# ### install ponysay
# if [ ! $(which ponysay) ]; then
# echo -e "\nponysay not fonud, installiing\n"
# brew install ponysay
# if ! grep 'ponysay fix' $rcfile; then
# # echo "adding ponysay fix to $rcfile"
# # echo -e "# ponysay fix\nexport PYTHONWARNINGS=ignore::SyntaxWarning" >> $rcfile
# # source $rcfile
# else
# # echo "ponysay fix already in $rcfile skipping"
# # source $rcfile
# fi
# else
# echo -e "\nponysay already installed, skipping\n"
# fi
if [ ! $(which brew) ]; then
## install homebrew
echo -e "\nlinuxbrew not found, installing\n"
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
### add to rcfile
if ! grep -q 'linuxbrew' $rcfile; then
echo "adding linuxbrew to $rcfile"
echo "# linuxbrew (homebrew/brew)" >> $rcfile
echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> $rcfile
else
echo "linuxbrew already in $rcfile skipping"
fi
else
echo -e "\nlinuxbrew installed, skipping install\n"
fi
### install ponysay
if [ ! $(which ponysay) ]; then
echo -e "\nponysay not fonud, installiing\n"
brew install ponysay
if ! grep 'ponysay fix' $rcfile; then
echo "adding ponysay fix to $rcfile"
echo -e "# ponysay fix\nexport PYTHONWARNINGS=ignore::SyntaxWarning" >> $rcfile
source $rcfile
else
echo "ponysay fix already in $rcfile skipping"
source $rcfile
fi
else
echo -e "\nponysay already installed, skipping\n"
fi
# cargo
## oniux
echo -e "\nINSTALLIN TOR ONIUX\n"
if [ -f /usr/local/bin/oniux ]; then
echo -e "\nexisting oniux found, skipping\n"
else
echo -e "\nexisting oniux not found, installing\n"
cargo install --git https://gitlab.torproject.org/tpo/core/oniux --tag v0.6.1 oniux
cd /tmp && cargo install --git https://gitlab.torproject.org/tpo/core/oniux && cd - && echo -e '## Oniux/Cargo Shit\nPATH=$PATH:$HOME/.cargo/bin' >> ~/.bashrc && source ~/.bashrc && oniux curl https://canhazip.com
fi
else
@@ -160,7 +158,7 @@ git clone $gitRepo $tmpDir --single-branch --depth 1
# donut
echo -e "\nCompiling donut\n"
gcc -o "$tmp_customscripts_dir/donut" "$tmp_customscripts_dir/donut.c" -lm # 2>/dev/null
gcc -o "$tmp_customscripts_dir/donut" "$tmp_customscripts_dir/donut.c" -lm 2>/dev/null
# put the customscripts dir into place
echo -e "\nPlacing in $finalDir\n"
@@ -181,10 +179,10 @@ pathgrep=$?
if [ $pathgrep -eq 0 ]; then
echo -e "\n$finalDir Already in \$PATH Skipping Append\n"
fi
# else
else
# echo -e "\nAdding $finalDir to $username's \$PATH by Appending to $rcfile\n"
# echo -e "\n\n# automatically added by customscripts installer\nexport PATH=\"\$PATH:$finalDir\"" >> "$rcfile"
# fi
fi
# install pishrink if not there
if [ ! -f /usr/local/bin/pishrink ]; then
@@ -204,15 +202,11 @@ if [ ! -d $userhome/.local/share/blesh ]; then
cd /tmp
git clone --recursive --depth 1 --shallow-submodules --single-branch -b master https://github.com/akinomyoga/ble.sh.git
make -C ble.sh install PREFIX=~/.local
# echo '# ble.sh' >> $rcfile
# echo "source -- ~/.local/share/blesh/ble.sh" >> $rcfile
# source $rcfile
# exec "$SHELL"
echo '# ble.sh' >> $rcfile
echo "source -- ~/.local/share/blesh/ble.sh" >> $rcfile
else
echo -e "\nble.sh already installed, skippping\n"
fi
# else
# echo -e "\nble.sh already installed, skippping\n"
# source $rcfile
# fi
$SHELL -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)"' >> "$rcfile"
+40
View File
@@ -0,0 +1,40 @@
#!/bin/bash
# Usage:
## Install Tor
### sudo apt update; sudo apt install tor -y
## Edit /etc/tor/torrc
### sudo nano /etc/tor/torrc
#### Uncomment or add
##### ControlPort 9051
#### Ucomment and change to (default value is 1, change to 0)
##### CookieAuthentication 0
## Enable, Start, and Restart Tor
### sudo systemctl enable tor; sudo systemctl start tor; sleep 20; sudo systemctl restart tor
# Configuration
TARGET_URL="https://canhazip.com"
TOR_PROXY="socks5h://127.0.0.1:9050"
TOR_CONTROL_PORT=9051
DELAY=2 # Delay in seconds between requests
# Ensure you respect HIBP's API rate limits and terms of service
while true; do
echo "[+] Requesting new Tor identity..."
# Send NEWNYM signal to Tor Control Port to switch IP
echo -e 'AUTHENTICATE ""\r\nsignal NEWNYM\r\nQUIT' | nc 127.0.0.1 9051 > /dev/null
# Give Tor a brief moment to establish the new circuit
sleep "$DELAY"
echo "[+] Verifying current IP..."
CURRENT_IP=$(curl -s --proxy "$TOR_PROXY" https://canhazip.com)
echo "[+] Current Tor IP: $CURRENT_IP"
echo "[+] Sending request to Have I Been Pwned..."
# 'socks5h://' ensures DNS resolution happens through Tor, preventing leaks
curl -s --proxy "$TOR_PROXY" -H "hibp-api-key: YOUR_API_KEY" "$TARGET_URL"
echo -e "\n[+] Waiting for next iteration...\n"
sleep "$DELAY"
done