⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 examples

📁 unix密码破解软件John the Ripper
💻
字号:
 John the Ripper's Usage Examples==================================These examples are to give you some tips on what John's features can beused for. Some of them may not be obvious, I'm sorry if others are, butanyway, I just got tired of answering questions. Command Line--------------1. First, you need to get a copy of your password file. If you got shadowpasswords, then (as root):	unshadow /etc/passwd /etc/shadow > passwd.1or similar should do (replace the filenames as needed, and make sure thatyour combined password file isn't readable by others). Otherwise, just:	cp /etc/passwd passwd.1If you're going to crack AFS or NT passwords, then use 'unafs' or JeremyAllison's PWDump (ftp://samba.anu.edu.au/pub/samba/pwdump/), respectively.2. Assume you just got a password file, 'passwd.1', and want to crack it.The simplest way is to use the default order of cracking modes:	john passwd.1This will try "single crack" mode first, then use a wordlist with rules,and finally go for incremental mode. Read doc/MODES for more informationon these modes.It is highly recommended that you obtain a larger wordlist, and edit the'Wordfile =' line in ~/john.ini before running John.3. Now, you got some passwords cracked, they are saved in ~/john.pot. Youwant to retrieve them:	john -show passwd.1If the account list gets large and doesn't fit on the screen, you can, ofcourse, use output redirection. (There's intentionally no example here, afew people have asked for one, but they shouldn't be using John anyway.)Now, you may notice that many accounts have a disabled shell, you can makeJohn ignore these (assume that shell is called '/etc/expired'):	john -show -shells:-/etc/expired passwd.1or, shorter, but will also match '/any/path/expired':	john -show -shells:-expired passwd.1or, if you also want to ignore some other shell, say '/etc/newuser':	john -show -shells:-expired,newuser passwd.1(Note: the above syntax has changed since version 1.4 so that it's morelogical and shorter to type.)To check if any root (uid 0) accounts got cracked:	john -show -users:0 passwd.1or, to check for cracked root (uid 0) accounts in all the files:	john -show -users:0 passwd.*To display the root (login 'root') account only:	john -show -users:root passwd.1And finally, to check for privileged groups:	john -show -groups:0,1 passwd.14. You might prefer to manage the cracking modes manually instead. It iswise to start with "single crack" mode:	john -single passwd.1or, since options can be abbreviated (however, I'll be using full namesfor most options in these examples):	john -si passwd.1If you have more files to crack, better to load them at the same time:	john -single passwd.1 passwd.2or even:	john -single passwd.*5. To catch more complicated (but still weak) passwords, you can use morepowerful cracking modes. First, try a wordlist:	john -w:words.lst passwd.1or, you might prefer to use the GNU-style long options syntax, say, to usefile name completion in bash:	john --wordfile=words.lst passwd.1or, shorter to type:	john -w=words.lst passwd.1or, with rules enabled (slower, but more powerful; this is what you shoulduse if you're trying to locate almost all the weak passwords):	john -w:words.lst -rules passwd.1or, if you got a lot of spare disk space to trade for performance:	john -w:words.lst -rules -stdout:8 | unique huge.lst	john -w:huge.lst passwd.1This is going to take some time, so you will probably want to continuecracking in the background. You can simply disconnect, or close yourxterm: John will ignore the SIGHUP and continue running. Alternatively,you might prefer to start it like this, and then logout:	nice -n 20 john -w:words.lst -rules passwd.1 &Finally, to make John have even less impact on other processes, you mightwant to set the 'Idle =' option in ~/john.ini.To only crack accounts with a good shell (in general, the shell, user andgroup filters described above work for all the cracking modes also):	john -w:words.lst -rules -shells:sh,csh,tcsh,bash passwd.1Like with all the other cracking modes, faster to crack all the files youneed cracked simultaneously:	john -w:words.lst -rules passwd.*You can crack some passwords only. This will try cracking all root (uid 0)accounts in all the password files:	john -w:words.lst -rules -users:0 passwd.*Alternatively, you may wish not to waste the time cracking your very ownpasswords, if you're sure they're uncrackable:	john -w:words.lst -rules -users:-root,solar passwd.*Sometimes it is useful to split your password files into two parts whichyou crack separately, like:	john -w:words.lst -rules -salts:2 passwd.*	john -w:words.lst -rules -salts:-2 passwd.*This will make John try salts with two or more passwords faster, and thentry the rest. Total cracking time will be about the same, but you will getsome passwords cracked earlier, and may not need the rest. Also, you mightwant to try all the accounts with a small wordlist, and only those thatyou can try faster (with '-salts:2') with a larger one. Often it is betterto use a larger value than 2 for '-salts' (sometimes even as high as 1000will do, indicating a problem with your password changing program though),adjust it for your particular case.Note that the default wordlist rules include ':' (which means "try wordsas they are in the list") as the first line. If you already ran through awordlist without using rules, and then decided to try the same wordlistwith rules also, you'd better comment this line out.6. The most powerful cracking mode in John is called "incremental" (not aproper name, but kept for historical reasons). You can simply run:	john -i passwd.1This will use the default incremental mode parameters, which are definedin ~/john.ini's [Incremental:All] section. In the configuration filesupplied with John these parameters are to use the full 95 character set,and to try all possible password lengths, from 0 to 8. (By zero passwordlength I mean a hashed empty string, this sometimes happens.) Don't expectthis to terminate in a reasonable time (unless all the passwords were weakand got cracked), read doc/MODES for an explanation.In some cases it is faster to use some other pre-defined incremental modeparameters and only crack simpler passwords, from a limited charset. Thefollowing command will try 26 different characters only, passwords from'a' to 'zzzzzzzz':	john -i:alpha passwd.1Again, you can crack root accounts only and use some other John's featureswith the incremental mode. This command will try cracking all root (uid 0)accounts in all the password files, and only those of them that producematching salts, so you get at least twice the performance -- if you have alot of password files (like 100+ of them, named '*.pwd'), otherwise therewill probably be no roots with matching salts:	john -i -users:0 -salts:2 *.pwd7. If you got a password file and already have a lot of passwords crackedor sniffed, and the passwords are unusual, then you might want to generatea new charset file, based on characters from that password file only:	john -makechars:custom.chr passwd.1Then use that new file for the incremental mode.If you got many password files from your country, your university, etc,it might be useful to use all of them for the charset file that you thenuse to crack more passwords in these files, or some other files from thesame place:	john -makechars:custom.chr passwd.1 passwd.2	[ Add your custom incremental mode to ~/john.ini now. See below. ]	john -i:custom passwd.3You can use some pre-defined or custom word filters when generating thecharset file, to make it only try some simpler words:	john -makechars:my_alpha.chr -external:filter_alpha passwd.1If your ~/john.pot file got large enough (or if you don't have any charsetfiles at all), you might want to use it for new main charset files:	john -makechars:all.chr	john -makechars:alpha.chr -external:filter_alpha	john -makechars:digits.chr -external:filter_digits	john -makechars:lanman.chr -external:filter_lanmanIn the example above, John will overwrite the charset files with new onesthat are based on your entire ~/john.pot (John uses the entire file if youdon't specify any password files). Note that the word filters used hereare pre-defined in ~/john.ini supplied with John, for your convenience.8. Finally, you might want to mail all the users who got weak passwords,to tell them to change the passwords. It's not always a good idea though(unfortunately, lots of people seem to ignore such mail, it can be usedas a hint for crackers, etc), but anyway, I'll assume you know what you'redoing. Edit the 'mailer' script supplied with John: the message it sends,and possibly the mail command (especially if the password file is from adifferent box than you got John running on). Then run:	mailer passwd.1 Configuration File--------------------1. Assume you notice that in some password file a lot of users have theirpasswords set to login names with '?!' appended. Then you just make a new"single crack" mode rule (see doc/RULES for information on the syntax),and place it somewhere near the beginning:	[List.Rules:Single]	$?$!Hint: if you want to temporarily comment out all the default rules, youcan simply rename the section to something John doesn't use, and definea new one with the section's old name, but be sure to leave the 'list.'part of the name, so that you don't get a parse error.All the same applies to the wordlist rules also.2. If you generate a custom charset file (described above) you will alsoneed to define a ~/john.ini section with the incremental mode parameters.In the simplest case it will be like this (where 'Custom' can be replacedwith any name you like):	[Incremental:Custom]	File = custom.chrThis will make John use characters that were in passwords used to generatethe charset file only. To make John try some more characters, add:	Extra = !@#$%These extra characters will then be added, but still considered the leastprobable. If you want to make sure that, with your extra characters, Johnwill try all the 95 characters, you can add:	CharCount = 95This will make John print a warning if it only has less than 95 charactersin its charset.You can also use CharCount to limit the number of different charactersthat John tries, even if the charset file has more:	CharCount = 25If you didn't use any filters when generating the charset file, settingCharCount that low will most likely disable some rare characters, and makeJohn try complicated long passwords earlier. However, the default lengthswitching is usually smart enough so that you shouldn't need such a trick.To make John try passwords of some lengths only, use the following lines:	MinLen = 6	MaxLen = 8Setting 'MinLen' high, as in the example above, is reasonable if shorterpasswords weren't allowed to set on the machine you got the password filefrom (however, note that root can usually set any password for any user).On the contrary, you might want to set 'MaxLen' low if you think there'sa lot of short passwords.3. Another example: a lot of users at some site use short duplicated wordsas their passwords, such as "fredfred". As the number of such potentialpasswords is fairly low, it makes sense to code a new external crackingmode that tries them all, up to some length.You can find the actual implementation of such a cracking mode with lotsof comments in the default ~/john.ini supplied with John. See doc/EXTERNALfor information on the language used.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -