Jump to content
escalation666

script care genereaza parole pe baza de date personale

Recommended Posts

Posted

Neavand un script care sa-mi genereze parole dupa anumite date personale, am apelat la putin bash pentru a face acest script.

Stiu ca arata cam primitiv, asa si este, dar isi face treaba si asta conteaza :P

Puteti pune de exemplu numele site-ului, numele adminului, adresa de email, adresa etc (si asta pentru ca am intalnit cazuri in care parolele erau ceva de genul user:siteul si pass:meu pentru site-ul www.siteulmeu.com, unii admini foloseau drept parola adresa de email etc...)


#!/usr/bin/bash
clear
echo "----------Simple password generator----------"
echo "----------------------by 35c666--------------"
echo "Introdu prima data personala"
read var1
echo "Introdu a doua personala"
read var2
echo "Introdu a treia data personala"
read var3
echo "Introdu a patra data personala"
read var4
echo "Introdu a cincea data personala"
read var5

echo ""
echo $var1 > date.txt
echo $var2 >> date.txt
echo $var3 >> date.txt
echo $var4 >> date.txt
echo $var5 >> date.txt

echo $var1$var1 >> date.txt
echo $var1$var2 >> date.txt
echo $var1$var3 >> date.txt
echo $var1$var4 >> date.txt
echo $var1$var5 >> date.txt

echo $var2$var1 >> date.txt
echo $var2$var2 >> date.txt
echo $var2$var3 >> date.txt
echo $var2$var4 >> date.txt
echo $var2$var5 >> date.txt

echo $var3$var1 >> date.txt
echo $var3$var2 >> date.txt
echo $var3$var3 >> date.txt
echo $var3$var4 >> date.txt
echo $var3$var5 >> date.txt

echo $var4$var1 >> date.txt
echo $var4$var2 >> date.txt
echo $var4$var3 >> date.txt
echo $var4$var4 >> date.txt
echo $var4$var5 >> date.txt

echo $var5$var1 >> date.txt
echo $var5$var2 >> date.txt
echo $var5$var3 >> date.txt
echo $var5$var4 >> date.txt
echo $var5$var5 >> date.txt

echo $var1$var1$var1 >> date.txt
echo $var1$var2$var1 >> date.txt
echo $var1$var1$var2 >> date.txt
echo $var1$var2$var2 >> date.txt
echo $var1$var3$var1 >> date.txt
echo $var1$var1$var3 >> date.txt
echo $var1$var2$var3 >> date.txt
echo $var1$var3$var2 >> date.txt

echo $var2$var2$var2 >> date.txt
echo $var2$var1$var2 >> date.txt
echo $var2$var2$var1 >> date.txt
echo $var2$var1$var1 >> date.txt
echo $var2$var3$var2 >> date.txt
echo $var2$var2$var3 >> date.txt
echo $var2$var1$var3 >> date.txt
echo $var2$var3$var1 >> date.txt

echo $var3$var3$var3 >> date.txt
echo $var3$var1$var3 >> date.txt
echo $var3$var2$var1 >> date.txt
echo $var3$var1$var1 >> date.txt
echo $var3$var2$var3 >> date.txt
echo $var3$var3$var2 >> date.txt
echo $var3$var1$var2 >> date.txt
echo $var3$var3$var1 >> date.txt

echo "generez si parole cu caractere alfanumerice pana la 100?[da/pt nu tasteaza orice altceva]"
read rasp
rasp=$rasp
if [ "$rasp" == "da" ]; then
for i in `seq 1 100`;
do
echo $var1$i >> date.txt
echo $var2$i >> date.txt
echo $var1$var1$i >> date.txt
echo $var1$i$var2 >> date.txt
echo $var2$var2$i >> date.txt
echo $var2$i$var1 >> date.txt

done
fi

echo "Parole generate:"
wc -l date.txt | awk '{print $1}'


de ex


----------Simple password generator----------
----------------------by 35c666---------------------
introdu prima data personala
jiji
introdu a doua personala
siteul
introdu a treia data personala
meu
introdu a patra data personala
[email]eu@test.com[/email]
introdu a cincea data personala
spanac

generez si parole cu caractere alfanumerice pana la 100?[da/pt nu tasteaza orice altceva]
da
Parole generate:
654

produce ceva de genu:


jiji
siteul
meu
[email]eu@test.com[/email]
spanac
jijijiji
jijisiteul
jijimeu
[email]jijieu@test.com[/email]
jijispanac
siteuljiji
siteulsiteul
siteulmeu
[email]siteuleu@test.com[/email]
siteulspanac
meujiji
meusiteul
meumeu
[email]meueu@test.com[/email]
meuspanac
[email]eu@test.comj[/email]iji
[email]eu@test.coms[/email]iteul
[email]eu@test.comm[/email]eu
[email]eu@test.comeu@test.com[/email]
[email]eu@test.coms[/email]panac
spanacjiji
spanacsiteul
spanacmeu
[email]spanaceu@test.com[/email]
spanacspanac
jijijijijiji
jijisiteuljiji
jijijijisiteul
jijisiteulsiteul
jijimeujiji
jijijijimeu
jijisiteulmeu
jijimeusiteul
siteulsiteulsiteul
siteuljijisiteul
siteulsiteuljiji
siteuljijijiji
siteulmeusiteul
siteulsiteulmeu

etc etc

Posted

ca sa-ti simplifici scriptu poti sa faci si chestii de genul

$$var si reprezinta $(de valoarea variabilei)

nu prea mi-a iesit explicatia.

exemplu:

$val1 = "1";

$val2 = "2";

$var = "val1";

$$var reprezinta 1;

stiu ca la php merge ... la bash nu stiu :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...