当前位置: 首页 > Linux相关, 算法相关 > 正文

使用john破解Linux密码

john是Linux上的一个密码查看工具,他可以查看/etc/shadow或者是/etc/passwd里面的密文的内容,可以对简单的MD5进行”破解“
下面是源码安装john的教程:
首先使用切换到tmp目录,并且新建一个目录:

cd tmp
mkdir john

切换到新建的目录:

cd john

RedHat/CentOSy用户使用下面的命令将shadow和passwd的内容输出到文件中:

/usr/bin/unshadow /etc/passwd /etc/shadow > /tmp/crack.password.db

然后使用wget下载john的源码包,具体的版本随意:

wget ftp://ftp.openwall.com/pub/projects/john/1.7.8/john-1.7.8.tar.gz

解压下载下来的压缩包:

tar -zxvf john-1.7.8.tar.gz

切换到解压出来的目录中:

cd john-1.7.8

切换到src目录:

cd src

输入下面的命令:

make clean generic

上面的命令只是一个通用的命令,如果你想更加准确的命令的话,输入make命令,程序会提示:

To build John the Ripper, type:
        make clean SYSTEM
where SYSTEM can be one of the following:
linux-x86-64             Linux, x86-64 with SSE2 (best tested)
linux-x86-64-avx         Linux, x86-64 with AVX (experimental)
linux-x86-64-xop         Linux, x86-64 with AVX and XOP (experimental)
linux-x86-sse2           Linux, x86 32-bit with SSE2 (best tested if 32-bit)
linux-x86-mmx            Linux, x86 32-bit with MMX (for old computers)
linux-x86-any            Linux, x86 32-bit (for truly ancient computers)
linux-x86-avx            Linux, x86 32-bit with AVX (experimental)
linux-x86-xop            Linux, x86 32-bit with AVX and XOP (experimental)
linux-alpha              Linux, Alpha
linux-sparc              Linux, SPARC 32-bit
linux-ppc32-altivec      Linux, PowerPC w/AltiVec (best)
linux-ppc32              Linux, PowerPC 32-bit
linux-ppc64              Linux, PowerPC 64-bit
linux-ia64               Linux, IA-64
freebsd-x86-64           FreeBSD, x86-64 with SSE2 (best)
freebsd-x86-sse2         FreeBSD, x86 with SSE2 (best if 32-bit)
freebsd-x86-mmx          FreeBSD, x86 with MMX
freebsd-x86-any          FreeBSD, x86
freebsd-alpha            FreeBSD, Alpha
openbsd-x86-64           OpenBSD, x86-64 with SSE2 (best)
openbsd-x86-sse2         OpenBSD, x86 with SSE2 (best if 32-bit)
openbsd-x86-mmx          OpenBSD, x86 with MMX
openbsd-x86-any          OpenBSD, x86
openbsd-alpha            OpenBSD, Alpha
openbsd-sparc64          OpenBSD, SPARC 64-bit (best)
openbsd-sparc            OpenBSD, SPARC 32-bit
openbsd-ppc32            OpenBSD, PowerPC 32-bit
openbsd-ppc64            OpenBSD, PowerPC 64-bit
openbsd-pa-risc          OpenBSD, PA-RISC
openbsd-vax              OpenBSD, VAX
netbsd-sparc64           NetBSD, SPARC 64-bit
netbsd-vax               NetBSD, VAX
solaris-sparc64-cc       Solaris, SPARC V9 64-bit, cc (best)
solaris-sparc64-gcc      Solaris, SPARC V9 64-bit, gcc
solaris-sparcv9-cc       Solaris, SPARC V9 32-bit, cc
solaris-sparcv8-cc       Solaris, SPARC V8 32-bit, cc
solaris-sparc-gcc        Solaris, SPARC 32-bit, gcc
solaris-x86-64-cc        Solaris, x86-64 with SSE2, cc (best)
solaris-x86-64-gcc       Solaris, x86-64 with SSE2, gcc
solaris-x86-sse2-cc      Solaris 9 4/04+, x86 with SSE2, cc
solaris-x86-sse2-gcc     Solaris 9 4/04+, x86 with SSE2, gcc
solaris-x86-mmx-cc       Solaris, x86 with MMX, cc
solaris-x86-mmx-gcc      Solaris, x86 with MMX, gcc
solaris-x86-any-cc       Solaris, x86, cc
solaris-x86-any-gcc      Solaris, x86, gcc
sco-x86-any-gcc          SCO, x86, gcc
sco-x86-any-cc           SCO, x86, cc
tru64-alpha              Tru64 (Digital UNIX, OSF/1), Alpha
aix-ppc32                AIX, PowerPC 32-bit
macosx-x86-64            Mac OS X 10.5+, Xcode 3.0+, x86-64 with SSE2 (best)
macosx-x86-sse2          Mac OS X, x86 with SSE2
macosx-ppc32-altivec     Mac OS X, PowerPC w/AltiVec (best)
macosx-ppc32             Mac OS X, PowerPC 32-bit
macosx-ppc64             Mac OS X 10.4+, PowerPC 64-bit
macosx-universal         Mac OS X, Universal Binary (x86 + x86-64 + PPC)
hpux-pa-risc-gcc         HP-UX, PA-RISC, gcc
hpux-pa-risc-cc          HP-UX, PA-RISC, ANSI cc
irix-mips64-r10k         IRIX, MIPS 64-bit (R10K) (best)
irix-mips64              IRIX, MIPS 64-bit
irix-mips32              IRIX, MIPS 32-bit
dos-djgpp-x86-mmx        DOS, DJGPP, x86 with MMX
dos-djgpp-x86-any        DOS, DJGPP, x86
win32-cygwin-x86-sse2    Win32, Cygwin, x86 with SSE2 (best)
win32-cygwin-x86-mmx     Win32, Cygwin, x86 with MMX
win32-cygwin-x86-any     Win32, Cygwin, x86
beos-x86-sse2            BeOS, x86 with SSE2 (best)
beos-x86-mmx             BeOS, x86 with MMX
beos-x86-any             BeOS, x86
generic                  Any other Unix-like system with gcc

输入指定的系统版本和CPU版本,如果不确定,请输入make clean generic
大约几分钟后,编译完成了后,切换到run目录:

cd ..
cd run

输入下面的命令开始破解:

./john -show /tmp/crack.password.db

其中的-show是显示结果的参数,具体的参数可以输入./john 来查看

如果还有不懂的,可以查考下面的两篇文章:
Linux Password Cracking: Explain unshadow and john commands ( john the ripper tool )

Teaching John The Ripper how to Crack MD5 Hashes



本文固定链接: http://kuaile.in/archives/827 | 蒲公英的博客

该日志由 蒲公英 于2012年04月10日发表在 Linux相关, 算法相关 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: 使用john破解Linux密码 | 蒲公英的博客
关键字:
【上一篇】
【下一篇】

使用john破解Linux密码:等您坐沙发呢!

发表评论


You must enable javascript to see captcha here!

快捷键:Ctrl+Enter