WCM - Das österreichische Computer Magazin Forenübersicht
 

Zurück   WCM Forum > Rat & Tat > Programmierung

Programmierung Rat & Tat für Programmierer

Microsoft KARRIERECAMPUS

Antwort
 
Themen-Optionen Ansicht
Alt 29.01.2002, 17:07   #1
SNo0py
Inventar
 
Registriert seit: 08.02.2000
Beiträge: 1.696


Böse [perl] .htpasswd-Einträge erstellen

Hallo allerseits!

Ich such schon verzweifelt im Netz, finde aber nirgens was! Wie kann ich ein Kennwort so verschlüsseln, dass es im Apache funktioniert??? (d.h. wenn ich es in die .htpasswd-Datei eintrage)???

Gelöst sollte das ganze natürlich mit Perl werden

mfg
____________________________________
Sex is like hacking. You get in, you get out, and you hope you didnt leave something behind that can be traced back to you.
SNo0py ist offline   Mit Zitat antworten
Alt 29.01.2002, 17:17   #2
MZ
IAMTHEAMDIN
 
Registriert seit: 12.10.2000
Beiträge: 1.992


Standard

http://www.users.f2s.com/faq/htaccess.php3

hth
____________________________________
cu

mz

MZ ist offline   Mit Zitat antworten
Alt 29.01.2002, 17:25   #3
SNo0py
Inventar
 
Registriert seit: 08.02.2000
Beiträge: 1.696


Standard

Zitat:
Original geschrieben von MZ
http://www.users.f2s.com/faq/htaccess.php3

hth
Die Seite kenn ich, aber da steht nirgens ein Code zum Abschreiben

Wie .htaccess funktioniert, ist mir klar!! Ich will nur meine eigenen Kennwörter verschlüsseln!!!
____________________________________
Sex is like hacking. You get in, you get out, and you hope you didnt leave something behind that can be traced back to you.
SNo0py ist offline   Mit Zitat antworten
Alt 29.01.2002, 18:42   #4
_m3
Inventar
 
Registriert seit: 24.09.2001
Beiträge: 7.335


Standard

Nicht verzagen, m3 Fragen:
Code:
#!/usr/bin/perl
if (scalar(@ARGV) < 2) {
print <<EOF;
usage: make-password <htpasswd file> <user> <password>
EOF
exit;
}

$salt="XX";
$file=$ARGV[0];
$key=$ARGV[1];
$value=$ARGV[2];

if ($file && $key && $value) {
$hash = crypt($value, "$salt");
open(DB, ">>$file") || die "Error: $!\n";
print DB "$key:$hash\n";
close(DB);
print "User $key added with password $value, 
encrypted to $hash\n";
exit;
}
____________________________________
Weiterhin zu finden auf http://martin.leyrer.priv.at , http://twitter.com/leyrer , http://www.debattierclub.net/ , http://www.tratschen.at/ und via Instant Messaging auf Jabber: m3 <ät> cargal.org .
_m3 ist offline   Mit Zitat antworten
Alt 29.01.2002, 18:49   #5
SNo0py
Inventar
 
Registriert seit: 08.02.2000
Beiträge: 1.696


Standard

Und warum ist $salt gleich "XX"?? Ist das bei jedem Apache so?? Das glaub ich nämlich nicht... weil im Netz gibt es viele Tools, und jedes liefert einen anderen Hash (=codiertes Passwort) zurück.

Deswegen würd ich gerne wissen, was $salt ist? Der "Rest" des Programmes war mir klar

Trotzdem mal ein Danke!
____________________________________
Sex is like hacking. You get in, you get out, and you hope you didnt leave something behind that can be traced back to you.
SNo0py ist offline   Mit Zitat antworten
Alt 30.01.2002, 07:18   #6
Sloter
Inventar
 
Registriert seit: 05.01.2000
Beiträge: 3.812


Lächeln

Mit SSH verbinden:
htpasswd /pfad/zur/userdatei Username /Return

Oder auf der Apacheseite www.apache.org

Sloter
Sloter ist offline   Mit Zitat antworten
Alt 30.01.2002, 07:51   #7
SNo0py
Inventar
 
Registriert seit: 08.02.2000
Beiträge: 1.696


Standard

Hi Sloter!

Ich hab kein SSH (erstes Problem) und ich will gerne ein Perl-Script schreiben, welches mir das "automatisch" erledigt (ohne auf htpasswd zuzugreifen).

@apache.org: dort steht leider auch nicht, wie das Script funkt

Trotzdem danke!
____________________________________
Sex is like hacking. You get in, you get out, and you hope you didnt leave something behind that can be traced back to you.
SNo0py ist offline   Mit Zitat antworten
Alt 30.01.2002, 07:58   #8
_m3
Inventar
 
Registriert seit: 24.09.2001
Beiträge: 7.335


Standard

Google rulez:
http://hotwired.lycos.com/webmonkey/...tw=programming
Zitat:
A "salt" is a little bit of data used to skew an otherwise standard DES encryption algorithm. The salt of a DES-encrypted string is available to you as the first two characters of the final output. This is important to remember — keep on reading to find out why.

If you have used .htaccess-based authentication in the past, you know that usernames and passwords are kept in a file, usually called .htpasswd. The passwords are stored in a format something like this:
joe:WvzodahMR9USk
jane:g3RYjX5evEvdM
julie:YzASzTGEo2VMA

Now, "WvzodahMR9USk" is not Joe User's password. His password is actually "abba001," but after encryption, it looks like "WvzodahMR9USk." Which is the salt ("Wv") tacked on to the DES-encrypted version of "abba001" ("zodahMR9Usk"). Similarly, "g3" is the salt used to encrypt Jane User's password, and "Yz" is the salt used to encrypt Julie User's password. By knowing the salt, you can perform password-matching as outlined below.
____________________________________
Weiterhin zu finden auf http://martin.leyrer.priv.at , http://twitter.com/leyrer , http://www.debattierclub.net/ , http://www.tratschen.at/ und via Instant Messaging auf Jabber: m3 <ät> cargal.org .
_m3 ist offline   Mit Zitat antworten
Alt 30.01.2002, 08:35   #9
SNo0py
Inventar
 
Registriert seit: 08.02.2000
Beiträge: 1.696


Standard



Wow! So is des also!

Werd ich gleich ausprobieren!!

Danke einstweilen!

mfg
Mike
____________________________________
Sex is like hacking. You get in, you get out, and you hope you didnt leave something behind that can be traced back to you.
SNo0py ist offline   Mit Zitat antworten
Antwort


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.

Gehe zu


Alle Zeitangaben in WEZ +2. Es ist jetzt 06:48 Uhr.


Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Forum SEO by Zoints
© 2009 FSL Verlag