<?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>waimv.com &#187; scanf</title>
	<atom:link href="http://www.waimv.com/tag/scanf/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.waimv.com</link>
	<description></description>
	<lastBuildDate>Fri, 09 Nov 2018 10:41:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>扫描端口的shell脚本</title>
		<link>http://www.waimv.com/linux/232/</link>
		<comments>http://www.waimv.com/linux/232/#comments</comments>
		<pubDate>Wed, 29 Aug 2012 03:32:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[scanf]]></category>
		<category><![CDATA[端口扫描]]></category>

		<guid isPermaLink="false">http://www.szpian.com/?p=232</guid>
		<description><![CDATA[#!/bin/bash alarm() { perl -e &#8216; eval { $SIG{ALRM} = sub { die }; alarm shift; system(@ARGV); }; if ($@) { exit 1 } &#8216; &#8220;$@&#8221;; } if [[ -z $1 &#124;&#124; -z $2 ]]; then echo &#8220;Usage: $0 &#60;host&#62; &#60;port, ports, or port-range&#62;&#8221; return fi host=$1 ports=() case $2 in *-*) IFS=- read start [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste">#!/bin/bash</div>
<div id="_mcePaste">alarm() {</div>
<div id="_mcePaste">perl -e &#8216;</div>
<div id="_mcePaste">eval {</div>
<div id="_mcePaste">$SIG{ALRM} = sub { die };</div>
<div id="_mcePaste">alarm shift;</div>
<div id="_mcePaste">system(@ARGV);</div>
<div id="_mcePaste">};</div>
<div id="_mcePaste">if ($@) { exit 1 }</div>
<div id="_mcePaste">&#8216; &#8220;$@&#8221;;</div>
<div id="_mcePaste">}</div>
<div id="_mcePaste">if [[ -z $1 || -z $2 ]]; then</div>
<div id="_mcePaste">echo &#8220;Usage: $0 &lt;host&gt; &lt;port, ports, or port-range&gt;&#8221;</div>
<div id="_mcePaste">return</div>
<div id="_mcePaste">fi</div>
<div id="_mcePaste">host=$1</div>
<div id="_mcePaste">ports=()</div>
<div id="_mcePaste">case $2 in</div>
<div id="_mcePaste">*-*)</div>
<div id="_mcePaste">IFS=- read start end &lt;&lt;&lt; &#8220;$2&#8243;</div>
<div id="_mcePaste">for ((port=start; port &lt;= end; port++)); do</div>
<div id="_mcePaste">ports+=($port)</div>
<div id="_mcePaste">done</div>
<div id="_mcePaste">;;</div>
<div id="_mcePaste">*,*)</div>
<div id="_mcePaste">IFS=, read -ra ports &lt;&lt;&lt; &#8220;$2&#8243;</div>
<div id="_mcePaste">;;</div>
<div id="_mcePaste">*)</div>
<div id="_mcePaste">ports+=($2)</div>
<div id="_mcePaste">;;</div>
<div id="_mcePaste">esac</div>
<div id="_mcePaste">echo $host;</div>
<div id="_mcePaste">for port in &#8220;${ports[@]}&#8221;; do</div>
<div id="_mcePaste">alarm 1 &#8220;echo &gt;/dev/tcp/$host/$port &amp;&amp;</div>
<div id="_mcePaste">echo \&#8221;port $port is open\&#8221;" ||</div>
<div id="_mcePaste">echo &#8220;port $port is closed&#8221;</div>
<div id="_mcePaste">done</div>
]]></content:encoded>
			<wfw:commentRss>http://www.waimv.com/linux/232/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
