Skip to main content
Bumped by Community user
Bumped by Community user
added 97 characters in body
Source Link

So lets say I have a .sh script and I have to input a password in it , will there be some kind of cache where the bash inputs are stored ? And if yes please tell me whre so I can ersase it . Would the attacker be able to decrypt something which was encrypted with a shell / bash script passed through another program , if he had physical access to the machine ? If yes , how can I prevent that ?

I didnt find anything on the topic .

Thank you !

part of the script as exaple :

echo "please input your password to be hashed "

echo ""

stty -echo

read -p "Password :" x; echo

stty echo

echo ""

echo "please repeat the password "

echo ""

stty -echo

read -p "Password :" x2; echo

stty echo

if [[ $x == $x2 ]]

then

echo ""

echo "Passwords match !"

echo ""

sleep 2

else

echo ""

echo "passwords dont matchexample :( "

echo ""

sleep 2

echo "exiting"

echo ""

sleep 1

exit 1

fi

fi

fi

echo "please input your password to be hashed "
echo ""

stty -echo
read -p "Password :" x; echo
stty echo 

echo ""

echo "please repeat the password "

echo ""
stty -echo
read -p "Password :" x2; echo
stty echo

if [[ $x == $x2 ]] ;then 
    echo ""
    echo "Passwords match !"
    echo ""
    sleep 2
else 
    echo ""
    echo "passwords dont match :( "
    echo ""
    sleep 2
    echo "exiting"
    echo ""
    sleep 1
    exit 1 
fi 

So lets say I have a .sh script and I have to input a password in it , will there be some kind of cache where the bash inputs are stored ? And if yes please tell me whre so I can ersase it . Would the attacker be able to decrypt something which was encrypted with a shell / bash script passed through another program , if he had physical access to the machine ? If yes , how can I prevent that ?

I didnt find anything on the topic .

Thank you !

part of the script as exaple :

echo "please input your password to be hashed "

echo ""

stty -echo

read -p "Password :" x; echo

stty echo

echo ""

echo "please repeat the password "

echo ""

stty -echo

read -p "Password :" x2; echo

stty echo

if [[ $x == $x2 ]]

then

echo ""

echo "Passwords match !"

echo ""

sleep 2

else

echo ""

echo "passwords dont match :( "

echo ""

sleep 2

echo "exiting"

echo ""

sleep 1

exit 1

fi

fi

fi

So lets say I have a .sh script and I have to input a password in it , will there be some kind of cache where the bash inputs are stored ? And if yes please tell me whre so I can ersase it . Would the attacker be able to decrypt something which was encrypted with a shell / bash script passed through another program , if he had physical access to the machine ? If yes , how can I prevent that ?

I didnt find anything on the topic .

Thank you !

part of the script as example :

echo "please input your password to be hashed "
echo ""

stty -echo
read -p "Password :" x; echo
stty echo 

echo ""

echo "please repeat the password "

echo ""
stty -echo
read -p "Password :" x2; echo
stty echo

if [[ $x == $x2 ]] ;then 
    echo ""
    echo "Passwords match !"
    echo ""
    sleep 2
else 
    echo ""
    echo "passwords dont match :( "
    echo ""
    sleep 2
    echo "exiting"
    echo ""
    sleep 1
    exit 1 
fi 
posted a part of the script
Source Link

So lets say I have a .sh script and I have to input a password in it , will there be some kind of cache where the bash inputs are stored ? And if yes please tell me whre so I can ersase it . Would the attacker be able to decrypt something which was encrypted with a shell / bash script passed through another program , if he had physical access to the machine ? If yes , how can I prevent that ?

I didnt find anything on the topic .

Thank you !

part of the script as exaple :

echo "please input your password to be hashed "

echo ""

stty -echo

read -p "Password :" x; echo

stty echo

echo ""

echo "please repeat the password "

echo ""

stty -echo

read -p "Password :" x2; echo

stty echo

if [[ $x == $x2 ]]

then

echo ""

echo "Passwords match !"

echo ""

sleep 2

else

echo ""

echo "passwords dont match :( "

echo ""

sleep 2

echo "exiting"

echo ""

sleep 1

exit 1

fi

fi

fi

So lets say I have a .sh script and I have to input a password in it , will there be some kind of cache where the bash inputs are stored ? And if yes please tell me whre so I can ersase it . Would the attacker be able to decrypt something which was encrypted with a shell / bash script passed through another program , if he had physical access to the machine ? If yes , how can I prevent that ?

I didnt find anything on the topic .

Thank you !

So lets say I have a .sh script and I have to input a password in it , will there be some kind of cache where the bash inputs are stored ? And if yes please tell me whre so I can ersase it . Would the attacker be able to decrypt something which was encrypted with a shell / bash script passed through another program , if he had physical access to the machine ? If yes , how can I prevent that ?

I didnt find anything on the topic .

Thank you !

part of the script as exaple :

echo "please input your password to be hashed "

echo ""

stty -echo

read -p "Password :" x; echo

stty echo

echo ""

echo "please repeat the password "

echo ""

stty -echo

read -p "Password :" x2; echo

stty echo

if [[ $x == $x2 ]]

then

echo ""

echo "Passwords match !"

echo ""

sleep 2

else

echo ""

echo "passwords dont match :( "

echo ""

sleep 2

echo "exiting"

echo ""

sleep 1

exit 1

fi

fi

fi

Source Link

Is it secure to type in sensitive data in bash / shell scripts

So lets say I have a .sh script and I have to input a password in it , will there be some kind of cache where the bash inputs are stored ? And if yes please tell me whre so I can ersase it . Would the attacker be able to decrypt something which was encrypted with a shell / bash script passed through another program , if he had physical access to the machine ? If yes , how can I prevent that ?

I didnt find anything on the topic .

Thank you !