不少人都知道使用linux能夠利用sudo來執行一些root權限執行的事情,可是sudo和root仍是有很大的區別的。linux
一、獲取root的權限,也並非沒有前提的,至少具有/etc/password和/etc/shadow的其中一個文件的修改權限,這個並不是root自己才能執行,通常拿到了帳號密碼的普通帳號均可以作到,對於非root的帳號的sudo權限限制,並非作的那麼好。二、具有密碼hash生成機,這個很簡單,能夠用c語言編寫一個,編譯後,隨處可用。和密碼爆破機的原理如出一轍。ubuntu
#include <stdio.h> #include <crypt.h> #include <unistd.h> #include <string.h> #include <stdlib.h> int main(int argc, char *argv[]){ //const char *userPassword = "1234"; //const char *saltString = "$6$UaS4js6$"; printf("%s\n",crypt((const char*)argv[1], (const char*)argv[2])); //printf("%s\n", hashString); } + 使用方法:
./crack 1234 $6$UaS4js6$tcp
+ 效果: ![](https://img2018.cnblogs.com/blog/1070321/201809/1070321-20180921113107423-542887066.png) ## 覆蓋密碼: *** ### 一、配置ubuntu的root密碼爲toor1234
bobac@ubuntu:~$ sudo passwd root
[sudo] password for bobac:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
```code