Kalimariadb 忘记root密码码怎么办

您所在的位置: &
借助John the ripper破解Linux密码
借助John the ripper破解Linux密码
布加迪编译
本文介绍了John the ripper这款密码破解工具。
John the ripper是一款大受欢迎的、基于字典的密码破解工具。它使用内容全是密码的单词表,然后使用单词表中的每一个密码,试图破解某个特定的密码散列。换句话说,它又叫蛮力密码破解,这是一种最基本的密码破解方式。不过它也是最耗费时间、最耗费处理器资源的一种方法。尝试的密码越多,所需的时间就越长。
John有别于Hdra之类的工具。Hydra进行盲目的蛮力攻击,其方法是在FTP服务器或Telnet服务器上的服务后台程序上尝试用户名/密码组合。不过,John首先需要散列。所以,对黑客来说更大的挑战是,先搞到需要破解的散列。如今,使用网上随处可得的免费彩虹表(rainbow table),比较容易破解散列。只要进入到其中一个网站,提交散列;要是散列由一个常见单词组成,那么该网站几乎立马就会显示该单词。彩虹表基本上将常见单词及对应散列存储在一个庞大的数据库中。数据库越大,涵盖的单词就越多。
但是如果你想在自己的系统上本地破解密码,那么John是值得一试的好工具之一。John跻身于Kali Linux的十大安全工具。在Ubuntu上,它可以通过新立得软件包管理器(synaptic package manager)来安装。
我在本文中将向各位介绍如何使用unshadow命令连同John,在Linux系统上破解用户的密码。在Linux上,用户名/密钥方面的详细信息存储在下面这两个文件中。
/etc/passwd/etc/shadow
实际的密码散列则存储在/etc/shadow中;只要对该机器拥有根访问权,就可以访问该文件。所以,试着从你自己的Linux系统来访问该文件。或者先创建一个使用简单密码的新用户。我会在自己的Linux系统上创建一个名为happy的新用户,其密码为chess。
:~# adduser happyAdding user `happy' ...Adding new group `happy' (1001) ...Adding new user `happy' (1000) with group `happy' ...Creating home directory `/home/happy' ...Copying files from `/etc/skel' ...Enter new UNIX password: Retype new UNIX password: passwd: password updated successfullyChanging the user information for happyEnter the new value, or press ENTER for the default&Full Name []: &Room Number []: &Work Phone []: &Home Phone []: &Other []: Is the information correct? [Y/n] y:~#
为了方便演示,最好使用一个简单的密码,那样你没必要等待太长的时间。由于我们的新用户已创建完毕,现在可以破解其密码了。
unshadow命令基本上会结合/etc/passwd的数据和/etc/shadow的数据,创建1个含有用户名和密码详细信息的文件。用法相当简单。
:~# unshadowUsage: unshadow PASSWORD-FILE SHADOW-FILE:~# unshadow /etc/passwd /etc/shadow & ~/file_to_crack
我们将unshadow命令的输出结果重定向至名为file_to_crack的新文件。
借助John来破解
现在这个新文件将由John来破解。就单词表而言,我们将使用Kali Linux上的John随带的密码列表。它位于下面这个路径:
/usr/share/john/password.lst
你也可以使用自己的密码列表。
:~# john --wordlist=/usr/share/john/password.lst ~/file_to_crack Warning: detected hash type &sha512crypt&, but the string is also recognized as &crypt&Use the &--format=crypt& option to force loading these as that type insteadLoaded 2 password hashes with 2 different salts (sha512crypt [64/64])chess&&&&&&&&&&& (happy)guesses: 1& time: 0:00:00:21 DONE (Tue May 14 06:47:58 2013)& c/s: 300& trying: sssUse the &--show& option to display all of the cracked passwords reliably:~#
所以在上面这个命令中,John能够破解散列,为我们破解出用户&happy&的密码&chess&。现在,John能够破解,就因为密码&chess&出现在密码列表中。要是该密码没有出现在密码列表中,那么John就会失败。
使用show选项,列出所有被破解的密码。
:~# john --show ~/file_to_crack happy:chess::,,,:/home/happy:/bin/bash1 password hash cracked, 1 left:~#
剩余的1个密码是用户root的密码。所提供的单词表中没有一个密码破解得了。
不用单词表
要是不使用密码列表就想借助John破解密码,最简单的办法就是这样:
root@kali:~# john ~/file_to_crack
按照说明文档
这会先尝试&简单破解&(single crack)模式,然后使用带规则的单词表,最后是尝试&增强破解&(incremental)模式。
参阅模式方面的说明文档:/john/doc/MODES.shtml。
/john/doc/EXAMPLES.shtml
原文地址:/cracking-linux-password-with-john-the-ripper-tutorial/
【编辑推荐】
【责任编辑: TEL:(010)】
关于&&&&的更多文章
互联网作为一个开放的论坛,已经产生了一些安全方面的问题。互联
随着云计算、物联网、大数据、移动互联网的大发展,你应该知道这些。
讲师: 435人学习过讲师: 362人学习过讲师: 689人学习过
随着互联网的快速发展,社会生活对网络的依赖程度越来
日,OpenSSL发布了安全公告,在OpenSSL1.0.
刚刚过去的这个周末很不太平。3月22日下午6点,白帽子
在软件领域,很少能有像《人月神话》一样具有深远影响力并且畅销不衰的著作。Brooks博士为人们管理复杂项目提供了最具洞察力的见
51CTO旗下网站kali(17)
Debian笔记(18)
CentOS笔记(9)
树莓派(17)
Forgetting&root&password
is an hassle. We try to be vigilant with our security and set a complex&root&password.
We also try not to login using directly into root account (in most production boxes) and use&sudo&instead.
So it’s not very unlikely to loose your root password and depending on how you’ve setup your access, you just might not be able to reset it using&sudo
passwd root/someusername. Following post shows you two different ways to reset root password in Ubuntu, Debian, Kali, CentOS or pretty much any Linux distributions.&
Option 1: Reset root password from Grub
Step 1.1: Boot in to GRUB menu
Boot to the&GRUB&menu.
Then, press&e&(for
edit) before Linux has a chance to boot. (Most standard installation will allow you 5 seconds to choose and Boot option is Grub, so you’ve got plenty of time)
Step 1.2: Edit GRUB menu
Using your keyboard arrow keys, move the cursor down a line or so, and press&e&(for
edit) again, you should now be on the kernel line, and pressEnd&to
go out to the very end of that line. Now hit the space-bar once, if necessary, to add a space, and then add one of the following:
init=/bin/bash
init=/bin/sh
Then press&Enter,
and you’re back at the kernel line, press&b&(for
boot) and the computer will proceed to boot to a root prompt.
Step 1.3: Remount filesystem as Read/Write to save changes
At this point, the root file system is still mounted read-only, so enter the following command:
mount -n -o remount,rw /
Step 1.4: Reset root password / Change password
Then type:
Enter your new password. Retype if asked to confirm. Change your pw with a&passwd&command.
If you’re not sure,&man
passwd&should help.
Step 1.5: Reboot and off you go
Then restart the machine by typing:
Now you should be able to login with your new root password as required.
Option 2: Reset root password using a Live CD/DVD or Live USB
Using a Live Linux CD/DVD or Live USB is another option to reset root password if you’ve uncomfortable using Grub menu.
Following is what you do:
Step 2.1: Boot Computer using any Live Linux CD/DVD or USB
Start up the computer with a Linux live CD (or USB key). You can use any Linux distro such as Debian, Ubuntu or even Kali.
Step 2.2: Mount Filesystem
Using the Disk Utilities available from your device, mount the partition that hosts your&/etc&folder
(probably marked as bootable).
Ideally following command does the trick
mount auto /dev/sdaX /mnt
sudo mount auto /dev/sdaX /mnt
Where&sdaX&or
similar is the partition that contains&/etc&folder.
Step 2.3: Identify correct shadow file in correct /etc folder
In a command line, go to&./etc&under
your mounted partition, probably in&/mnt&and
contains a long hd id-like number. Notice the dot&.before&./etc;
don’t go to&/etc.
You can check that you’re in the right folder with&grep
-i [name of a user of yours (not root!)] shadow&command. If you get anything, you’re in the right folder and you can proceed to Step 4.
Step 2.4: Make a backup of the shadow file
Just to be safe, make a backup copy of your&shadow&file.
./shadow /media/[an inserted and mounted USB key]/shadowcommand.
Step 2.5: Open shadow file using any text editor
Using your favorite text editor (vi, nano or pico), edit your&shadow&file
vi shadow (or)
nano shadow (or)
pico shadow
Step 2.6: Locate the root line
Locate the root line. It’ll look something like&root:[encrypted
pw]:99:::&(You’ll have a some random numbers is there)
Step 2.7: Replace encrypted password line
Replace the [encrypted&pw]
part of the line with a single&!&exclamation
mark without double quotations. That tells Linux to authorize the mentioned user to access the system with no pw, so be cautious&!&Your
line will then look something like&root:!:99:::
Step 2.8: Save changes
Save your changes and exit the command line
Step 2.9: Unmount the partition
Back to your Disk Utilities program, unmount the partition you mounted in step 2 above.
umount /dev/sdaX
sudo umount /dev/sdaX
Where&sdaX&or
similar is the partition that contains&/etc&folder.
Step 2.10: Poweroff and remove boot media
Poweroff your computer and remove all media, may it be USB key, CD, or whatever.
Step 2.11: Restart and boot into rescue mode
Now start/restart your computer and, in the grub menu, choose&rescue
mode. You’ll find yourself in a command line of a root session with no&pw.
Step 2.12: Reset root password / Change password
Change your password with a&passwd&command.
If you’re not sure,&man
passwd&should help. Once done, you can restart again and now you should be able to login as&root&user
from terminal (maybe not from SSH depending on how you’ve configured your SSH server). So there you go, two options to reset root password in Ubuntu, Debian, Kali, CentOS or pretty much any Linux distributions.
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:81318次
积分:1015
积分:1015
排名:千里之外
原创:32篇
转载:18篇
(2)(1)(2)(9)(3)(1)(2)(4)(1)(10)(7)(1)(1)(10)今天看啥 热点:
Kali-Linux之开启ssh服务,kali-linux开启ssh需求:通过putty软件ssh到Kali-Linux系统 问题:默认情况下,Kali系统的ssh服务并没有开启 操作方法: 1、编辑sshd_config文件 root@kali:~# vi /etc/ssh/sshd_config
2、检查如下配置项: PasswordAuthentication yes PermitRootLogin yes 3、启动ssh服务 root@kali:~# /etc/init.d/ssh start[ ok ] Starting OpenBSD Secure Shell server: sshd. 或者: oot@kali:~# service ssh start[ ok ] Starting OpenBSD Secure Shell server: sshd. 4、验证ssh服务状态,使用putty等客户端连接Kali-Linux root@kali:~# /etc/init.d/ssh status[ ok ] sshd is running.root@kali:~# root@kali:~# service ssh status[ ok ] sshd is running.
相关搜索:
相关阅读:
相关频道:
&&&&&&&&&&&&
Linux教程最近更新今天登录kali的时候居然提示鉴定故障,&骏骏聚聚说这是gdm的锅,Debian的gdm不允许root登录桌面。他提供的解决方法如下:1.先用普通用户登录,在shell里登录rootsu root密码2.然后vi /etc/pam.d/gdm在这一行前加一个#auth required pam_succeed_if.so user!=root quiet然而这并没有什么卵用因为我之前一直用的root登录的桌面……骏骏又提出来用ctrl+alt+f1进入控制台登录,但是提示login incorrect,好吧,一定是我密码忘了。百度之便得到了重置root密码的方法:1.在GURB引导菜单里选中有恢复模式(recovery)的那一行,按e进入编辑模式。2.找到类似于kernel /vmlinuz-2.6.15 ro root=/dev/hda2的这行,将ro改成rw3.在刚刚那一行最后再加上init=/bin/bash4.按F10启动,用下面的命令修改root密码。也可以将root换成别的你想重置密码的用户名。passwd root5.重启进入系统就行了。视频学习:/course/90
最新教程周点击榜
微信扫一扫忘记Kali Linux的root登陆密码?告诉你怎么重新设置
&gt科技前沿
电视不播的
真相在这找

我要回帖

更多关于 root密码忘记了怎么办 的文章

 

随机推荐