| 1 | # | ||
| 2 | # $Id$ | ||
| 3 | # | ||
| 4 | # password::rockyou Brik | ||
| 5 | # | ||
| 6 | package Metabrik::Password::Rockyou; | ||
| 7 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 1 | ▶ | use base qw(Metabrik::Client::Www); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | sub brik_properties { | ||
| 13 | return { | ||
| 14 | revision => '$Revision$', | ||
| 15 | tags => [ qw(unstable) ], | ||
| 16 | author => 'GomoR <GomoR[at]metabrik.org>', | ||
| 17 | license => 'http://opensource.org/licenses/BSD-3-Clause', | ||
| 18 | attributes => { | ||
| 19 | datadir => [ qw(datadir) ], | ||
| 20 | }, | ||
| 21 | attributes_default => { | ||
| 22 | }, | ||
| 23 | commands => { | ||
| 24 | update => [ ], | ||
| 25 | }, | ||
| 26 | require_modules => { | ||
| 27 | 'Metabrik::File::Compress' => [ ], | ||
| 28 | }, | ||
| 29 | }; | ||
| 30 | } | ||
| 31 | |||
| 32 | # | ||
| 33 | # More password lists are available at: | ||
| 34 | # http://downloads.skullsecurity.org/passwords/ | ||
| 35 | # | ||
| 36 | sub update { | ||
| 37 | my $self = shift; | ||
| 38 | |||
| 39 | my @urls = qw( | ||
| 40 | https://downloads.skullsecurity.org/passwords/rockyou.txt.bz2 | ||
| 41 | https://downloads.skullsecurity.org/passwords/rockyou-withcount.txt.bz2 | ||
| 42 | ); | ||
| 43 | |||
| 44 | my $datadir = $self->datadir; | ||
| 45 | |||
| 46 | my $fc = Metabrik::File::Compress->new_from_brik_init($self) or return; | ||
| 47 | $fc->datadir($datadir); | ||
| 48 | |||
| 49 | my @updated = (); | ||
| 50 | for my $u (@urls) { | ||
| 51 | $self->log->info("update: trying to update [$u]..."); | ||
| 52 | my $files = $self->mirror($u) or next; | ||
| 53 | for my $file (@$files) { | ||
| 54 | (my $outfile = $file) =~ s/\.bz2$//; | ||
| 55 | $self->log->verbose("update: uncompressing to [$outfile]"); | ||
| 56 | $fc->uncompress($file, $outfile) or next; | ||
| 57 | push @updated, $outfile; | ||
| 58 | } | ||
| 59 | } | ||
| 60 | |||
| 61 | return \@updated; | ||
| 62 | } | ||
| 63 | |||
| 64 | 1; | ||
| 65 | |||
| 66 | __END__ | ||