1. #!/usr/bin/perl 2.
3. # crack.pl
4.
5. use English;
6. use FileHandle;
7.
8. #Set ALL USER s pictures
9. #$FORMAT_NAME = "AUSER";
10. #$FORMAT_TOP_NAME = "AUSER_TOP";
11. $~ = "AUSER";
12. $^ = "AUSER_TOP";
13.
14. # Step 1:
15. # Get all account list,and genarate a report.
16. # In the mean time get system users names and
17. # passwords,get ready for cracking.
18.
19. my $allcount = 0;
20. my $syscount = 0;
21. my $lockcount = 0;
22. my $unknown = 0;
23. my @encrypt = ();
24. my @users = ();
25. while (($account,$passwd,$uid,$gid,$quota,$coment,$gcos,$home,$shell) = getpwent())
26. {
27. write;
28. $allcount ++;
29. if ($passwd =~ /\$/){
30. $users[$syscount] = $account;
31. $encrypt[$syscount] = $passwd;
32. $syscount++;
33. }elsif($passwd =~ /\*/ || $passwd =~ /\!/ || $passwd =~ /x/){
34. $lockcount++;
35. }
36. }
37. $unknown = $allcount - $syscount - $lockcount;
38.
39. # Print table Header.
40. format AUSER_TOP =
41. =========================================================================================
42. Name Password UID GID Home Shell
43. =========================================================================================
44. .
45. # Print table Body.
46. format AUSER =
47. @ |