403Webshell
Server IP : 172.67.149.12  /  Your IP : 162.159.114.31
Web Server : Apache
System : Linux vm3310.eosdns.net 4.18.0-553.132.1.el8_10.x86_64 #1 SMP Thu Jun 11 14:27:43 UTC 2026 x86_64
User : carnalmedia ( 1000)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /mojo/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /mojo/genpass
#!/bin/bash
#
# Script: genpass
#
# Usage: genpass [#length] [-s]
#
# Description: A tool for generating passwords
#
# Author: Gary Locke
#
# Changelog:
# * 07/30/2013: Gary Locke
# - Initial write
# * 03/25/2014: Adam Gomulka
# - Added '-s' flag to generate single password. Moved definition of $spec to outside if statements
# * 09/04/2015: Keith Muska
# - Moved $spec back inside of if statements where it should be

function usage() {
    printf "\nUsage: Provide password length as an optional argument.\n"
    printf "\t$0 [#]\n"
    printf %s "Use '-s' flag to generate only a single password. Length may still be supplied as an optional argument."
}

function genpass() {
    truncate="tr -dc a-zA-Z0-9${spec}"
    pass1=`cat /dev/urandom| $truncate | fold -w 8 |head -1`
    pass2=`cat /dev/urandom| $truncate | fold -w 12 |head -1`
    pass3=`cat /dev/urandom| $truncate | fold -w 16 |head -1`
    pass4=`cat /dev/urandom| $truncate | fold -w 20 |head -1`
}

function genpass_length() {
    truncate="tr -dc a-zA-Z0-9${spec}"
    pass1=`cat /dev/urandom| $truncate | fold -w $len |head -1`
    pass2=`cat /dev/urandom| $truncate | fold -w $len |head -1`
    pass3=`cat /dev/urandom| $truncate | fold -w $len |head -1`
    pass4=`cat /dev/urandom| $truncate | fold -w $len |head -1`
}

function echopass() {
echo "$pass1 $pass2 $pass3 $pass4" |\
    sed 's/[0O]/o/g' |\
    sed 's/[1l]/L/g' |\
    sed 's/I/i/g'
}


if [[ -z $1 ]];then
    #clear
    printf "\n5 alphanumeric passwords:\n\n"
    for i in {1..5}; do genpass; echopass; done
    printf "\n5 passwords using these special characters: !@#\%%^&\n\n"
    spec="!@#%^&"
    for i in {1..5}; do genpass; echopass; done
elif [[ $1 =~ ^[0-9]+$ ]];then
    len=$1
    #clear
    printf "\n5 alphanumeric passwords (length = ${len}):\n\n"
    for i in {1..5}; do genpass_length; echopass; done
    printf "\n5 passwords (length = ${len}) using these special characters: !@#\%%^&\n\n"
    spec="!@#%^&"
    for i in {1..5}; do genpass_length; echopass; done
elif [[ $1 == "-s" ]]; then
	truncate="tr -dc a-zA-Z0-9${spec}"
	if [[ $2 =~ ^[0-9]+$ ]];then
		len=$2
		pass=`cat /dev/urandom| $truncate | fold -w $len |head -1 | sed 's/[0O]/o/g' | sed 's/[1l]/L/g' | sed 's/I/i/g'`
		printf %s $pass
		exit
	else
		pass=`cat /dev/urandom| $truncate | fold -w 12 |head -1 | sed 's/[0O]/o/g' | sed 's/[1l]/L/g' | sed 's/I/i/g'`
		printf %s $pass
		exit
	fi
else
    usage
fi

echo;exit

Youez - 2016 - github.com/yon3zu
LinuXploit