[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[FWP] passwd file fwacking



It's been a long, long time since I've needed to do a crack run on a
password file, all my tools are rusty. So naturally the first thing
I needed to do was to fwap a passwd and a shadow back into an
old-fashioned passwd file for feeding to crack.

Maybe it's my imagination, but I _swear_ it didn't used to be this
easy (worked the first time:-):

	my %passwd = map { $_->[0] => $_ } map { [ split /:/ ] }
		IO::File->new("<$passwd")->getlines;
	my %shadow = map { $_->[0] => $_ } map { [ split /:/ ] }
		 IO::File->new("<$shadow")->getlines;
	$passwd{$_}->[1] = $shadow{$_}->[1] for keys %passwd;
	print join(':', @{$_}) for values %passwd;

(with the usual paragraph of "use" lines, and a Getopt::Long to get
$passwd and $shadow initialized).

-Bennett

PGP signature