Linux-Bulgaria.ORG
навигация

 

начало

пощенски списък

архив на групата

семинари ...

документи

как да ...

 

 

Предишно писмо Следващо писмо Предишно по тема Следващо по тема По Дата По тема (thread)

Re: lug-bg: RAZKODIRANE NA ZIP PAROLI


  • Subject: Re: lug-bg: RAZKODIRANE NA ZIP PAROLI
  • From: kleo@xxxxxxxxxxx (Kliment Ognianov)
  • Date: Fri, 31 Aug 2001 14:21:24 +0300



Yavor Atanasov wrote:

>Oshte po ZIP
>
>http://www.faqs.org/faqs/compression-faq/part1/section-32.html
>
>Po tozi povod imam i az edin vupros. Imam edin perl script za
>extractvane na parolite na potrebitelite na mojta Linux mashina,
>no toj po njakakva prichina ne raboti. Bihte li mi preporuchali njakoe
>prilozhenie za tova che mi e trudno da upravljavam 50 accounta
>bez da moga da vidja tekushtoto sustojanie.
>Tova e moja script ako na njakoj mu se zanimava:
>
>#!/usr/bin/perl
>
>@shadow_entries=`cat /etc/shadow | cut -d: -f1,2`;
>chomp( @shadow_entries );
>
>foreach $shadow (@shadow_entries) {
>    my ($name,$passwd) = split(/\:/, $shadow);
>    $user_passwd{ $name } = $passwd;
>}
>
>while ($user = <STDIN>) {
>    chomp( $user );
>    $passwd = $user_passwd{ $user };
>    if ($passwd) {
>        print "$user:$passwd\n";
>    }
>}
>
grrrrrrrrrr
mnogo nekadurno e taka s shell command da 4ete6 shadow-a :)
Osven tova taka vzimash vsi4ki redove s gluposti i komentari (ako ima 
takiva),a
ne samo <user>:<pass> ot normalnite.
O6te ne6to:
1. sloji mu 'use Data::Dump qw(dump);' v na4aloto i posle mu
drasni v purviq skob 'dump $user;' i posle sushtoto vuv  vtoriq da 
vidish zashto ne raboti :)))))
2. 'my' se izpolzva ako 6te rabotish sus 'strict variables' ... t.e. ako 
si slojil 'use strict;'
....taka samo pre4i i precakva rabotata.
Moje bi ima i ne6to drugo , no ne mi se zanimava sega :)
Predpolagam, izlishno e da escape-vash i dvete to4ki kogato split-vash 
input-a...
Ob6to-vseto e nekadurno napisano...


-- 
.............................................
:  Kliment Ognianov                         :
:  Junior System Administrator & Developer  :
:  ISP Networks Department                  :
:  BulInfo Ltd.                             :
:...........................................:
:  ICQ #16864572, #64866894                 :
:...........................................:
:  http://www.bulinfo.net/                  :
.............................................

===========================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers)
http://www.linux-bulgaria.org/ Hosted by Internet Group Ltd. - Stara Zagora




 

наши приятели

 

линукс за българи
http://linux-bg.org

FSA-BG
http://fsa-bg.org

OpenFest
http://openfest.org

FreeBSD BG
http://bg-freebsd.org

KDE-BG
http://kde.fsa-bg.org/

Gnome-BG
http://gnome.cult.bg/

проект OpenFMI
http://openfmi.net

NetField Forum
http://netField.ludost.net/forum/

 

 

Linux-Bulgaria.ORG

Mailing list messages are © Copyright their authors.