forked from six/CryptoZSH
48 lines
1.3 KiB
Bash
Executable File
48 lines
1.3 KiB
Bash
Executable File
# Create a temporary file random name and open it with vi
|
|
function tmp {
|
|
curran=$RANDOM$RANDOM
|
|
echo "Temporary file name: /tmp/$curran"
|
|
vi /tmp/$curran
|
|
}
|
|
|
|
|
|
# HTTP and HTTPS response check
|
|
function chkhttpz {
|
|
# http response checks from a given host / port
|
|
echo "HTTP responses"
|
|
wget --spider -S "http://$1:$2/" 2>&1 | grep "HTTP/"
|
|
|
|
echo "\nHTTPS responses"
|
|
wget --spider -S "https://$1:$2/" 2>&1 | grep "HTTP/"
|
|
}
|
|
|
|
# HTTP and HTTPS response check
|
|
function chkgen6 {
|
|
echo "\nHTTPS responses for Gen6 App"
|
|
wget --spider -S "https://gen6.app/" 2>&1 | grep "HTTP/"
|
|
|
|
echo "HTTP responses Gen6 LinkFree"
|
|
wget --spider -S "http://link.g6.network/" 2>&1 | grep "HTTP/"
|
|
|
|
echo "HTTP responses Gen6 LinkFree"
|
|
timeout 2 websocat -1 wss://gen6.app/node -v 2>&1 | timeout 2 grep "Connected"
|
|
}
|
|
|
|
|
|
# Show certificate of website
|
|
function chkcrt {
|
|
# check ssl certificate of a server
|
|
openssl s_client -showcerts -connect $1:$2
|
|
}
|
|
|
|
|
|
# Quickly get random characters
|
|
function rnd {
|
|
# get some random characters
|
|
cat /dev/urandom | tr -dc _A-Z-a-z-0-9.,! | head -c${1:-8};echo;
|
|
cat /dev/urandom | tr -dc _A-Z-a-z-0-9.,! | head -c${1:-16};echo;
|
|
cat /dev/urandom | tr -dc _A-Z-a-z-0-9.,! | head -c${1:-32};echo;
|
|
cat /dev/urandom | tr -dc _A-Z-a-z-0-9.,! | head -c${1:-64};echo;
|
|
}
|
|
|