<?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>System Network Programming Solution - Linux - windows - centos- security- cpanel - plesk -directadmin helm&#187; ddos</title>
	<atom:link href="http://thegioinguonmo.com/tag/ddos/feed/" rel="self" type="application/rss+xml" />
	<link>http://thegioinguonmo.com</link>
	<description>SHARING EVERYTHING</description>
	<lastBuildDate>Sat, 19 May 2012 21:40:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Detecting DoS / DDoS Attack on a Windows 2003 / 2008 Server</title>
		<link>http://thegioinguonmo.com/os/windows/detecting-dos-ddos-attack-windows-2003-2008-server.html</link>
		<comments>http://thegioinguonmo.com/os/windows/detecting-dos-ddos-attack-windows-2003-2008-server.html#comments</comments>
		<pubDate>Tue, 27 Mar 2012 09:39:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[windows]]></category>
		<category><![CDATA[ddos]]></category>
		<category><![CDATA[DDoS Attack]]></category>
		<category><![CDATA[Detecting DoS]]></category>
		<category><![CDATA[Firewall]]></category>
		<category><![CDATA[ipsec]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Windows Server]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=2548</guid>
		<description><![CDATA[Question: How do I detect a DDOS (Distributed denial of service) / DOS attack on a Windows Server 2003 / 2000 / 2008? Can I use Linux netstat command syntax to detect DDoS attacks? Answer:A denial-of-service attack (DoS attack) or distributed denial-of-service attack (DDoS attack) is an attempt to make a computer resource unavailable to its intended users. [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;"><strong>Question</strong></span>: How do I detect a DDOS (Distributed denial of service) / DOS attack on a Windows Server 2003 / 2000 / 2008? Can I use <a rel="nofollow" target="_blank" href="http://www.cyberciti.biz/tips/netstat-command-tutorial-examples.html">Linux netstat command syntax to detect DDoS</a> attacks?</p>
<p><strong><span style="color: #008000;">Answer</span></strong>:A denial-of-service attack (DoS attack) or distributed denial-of-service attack (DDoS attack) is an attempt to make a computer resource unavailable to its intended users.</p>
<p>You can always use netstat command to get list of connections under Windows. Open command prompt by visiting Start &gt; Run &gt; Type “cmd” in box.</p>
<p>netstat is a command line utility which displays protocol statistics and current TCP/IP network connections in a system. Type the following command to see all connections:<br />
<code>netstat -noa</code><br />
Where,</p>
<ol>
<li><strong>n</strong>: Displays active TCP connections, however, addresses and port numbers are expressed numerically and no attempt is made to determine names.</li>
<li><strong>o</strong>: Displays active TCP connections and includes the process ID (PID) for each connection. You can find the application based on the PID on the Processes tab in Windows Task Manager.</li>
<li><strong>a</strong>: Displays all active TCP connections and the TCP and UDP ports on which the computer is listening.</li>
</ol>
<p>You can use find command as filter to searches for a specific string of text in a file. In the following example you are filtering out port 80 traffic:<br />
<code>netstat -ano | find /c "80"</code><br />
Find the IP address which is having maximum number of connection and block it using Cisco firewall or IPSec. Another protective measurement is to <a rel="nofollow" target="_blank" href="http://msdn.microsoft.com/en-us/library/aa302363.aspx">harden the TCP/IP stack</a>.</p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/os/windows/detecting-dos-ddos-attack-windows-2003-2008-server.html" title="ddos programing">ddos programing</a> (1)</li><li><a href="http://thegioinguonmo.com/os/windows/detecting-dos-ddos-attack-windows-2003-2008-server.html" title="detecting dos on web server">detecting dos on web server</a> (1)</li><li><a href="http://thegioinguonmo.com/os/windows/detecting-dos-ddos-attack-windows-2003-2008-server.html" title="netstat cmd udp tcp ip">netstat cmd udp tcp ip</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/os/windows/detecting-dos-ddos-attack-windows-2003-2008-server.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick check for a ddos via number of connections</title>
		<link>http://thegioinguonmo.com/os/linux/quick-check-for-a-ddos-via-number-of-connections.html</link>
		<comments>http://thegioinguonmo.com/os/linux/quick-check-for-a-ddos-via-number-of-connections.html#comments</comments>
		<pubDate>Thu, 05 Jan 2012 21:44:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[ddos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[sort]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=188</guid>
		<description><![CDATA[A quick and usefull command for checking if a server is under ddos is: netstat -anp &#124;grep ‘tcp\&#124;udp’ &#124; awk ‘{print $5}’ &#124; cut -d: -f1 &#124; sort &#124; uniq -c &#124; sort -n That will list the IPs taking the most amount of connections to a server. It is important to remember that the [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>A quick and usefull command for checking if a server is under ddos is:</p>
<p>netstat -anp |grep ‘tcp\|udp’ | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n</p>
<p>That will list the IPs taking the most amount of connections to a server. It is important to remember that the ddos is becoming more sophistcated and they are using fewer connections with more attacking ips. If this is the case you will still get low number of connections even while you are under a DDOS.</p>
</div>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/os/linux/quick-check-for-a-ddos-via-number-of-connections.html" title="check network connections ddos linux">check network connections ddos linux</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/quick-check-for-a-ddos-via-number-of-connections.html" title="find open network conections centos cpanel">find open network conections centos cpanel</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/quick-check-for-a-ddos-via-number-of-connections.html" title="how to check number of system in network">how to check number of system in network</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/quick-check-for-a-ddos-via-number-of-connections.html" title="how to grep which subdomain was ddosed">how to grep which subdomain was ddosed</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/quick-check-for-a-ddos-via-number-of-connections.html" title="network ddos linux">network ddos linux</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/os/linux/quick-check-for-a-ddos-via-number-of-connections.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding hosts which opens N+ TCP connections probably a DDoS attack</title>
		<link>http://thegioinguonmo.com/security/finding-hosts-opens-tcp-connections-ddos-attack.html</link>
		<comments>http://thegioinguonmo.com/security/finding-hosts-opens-tcp-connections-ddos-attack.html#comments</comments>
		<pubDate>Tue, 03 Jan 2012 17:13:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[ddos]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=2168</guid>
		<description><![CDATA[It is good to learn all the ip addresses which holds N+ tcp connection to your server. For example, if we want to list ip addresses and connection counts of hosts which has 25+ connection right now: netstat -n --tcp --udp --numeric-hosts &#124; \ grep -v 127.0.0.1 &#124; \ awk '{if (/(tcp&#124;udp)/) { print $5 [...]]]></description>
			<content:encoded><![CDATA[<p>It is good to learn all the ip addresses which holds N+ tcp connection to your server. For example, if we want to list ip addresses and connection counts of hosts which has 25+ connection right now:</p>
<pre class="brush:shell">netstat -n --tcp --udp --numeric-hosts | \
grep -v 127.0.0.1 | \
awk '{if (/(tcp|udp)/) { print $5 }}' | \
sed 's/:.*//' | \
sort | \
uniq -c | \
sort -n | \
awk '{if ($1 &gt; 25) {print "Count: "$1"\t"$2; }}'</pre>
<p>and here is an example output:</p>
<blockquote><p>Count: 26       92.80.103.61<br />
Count: 27       77.246.104.149<br />
Count: 35       88.232.169.103<br />
Count: 44       88.226.7.150</p></blockquote>
<p>If we want to list only the ip addresses, not the counter, change the last line as below:</p>
<pre class="brush:shell">awk '{if ($1 &gt; 25) {print $2; }}'</pre>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/security/finding-hosts-opens-tcp-connections-ddos-attack.html" title="after scanning/curing composite object is clean">after scanning/curing composite object is clean</a> (2)</li><li><a href="http://thegioinguonmo.com/security/finding-hosts-opens-tcp-connections-ddos-attack.html" title="count tcp connections centos">count tcp connections centos</a> (1)</li><li><a href="http://thegioinguonmo.com/security/finding-hosts-opens-tcp-connections-ddos-attack.html" title="linux find tcp connections">linux find tcp connections</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/security/finding-hosts-opens-tcp-connections-ddos-attack.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Defend slowloris DDoS With mod_qos (Apache2 On Debian [Lenny])</title>
		<link>http://thegioinguonmo.com/os/linux/how-to-defend-slowloris-ddos-with-mod_qos-apache2-on-debian-lenny.html</link>
		<comments>http://thegioinguonmo.com/os/linux/how-to-defend-slowloris-ddos-with-mod_qos-apache2-on-debian-lenny.html#comments</comments>
		<pubDate>Mon, 28 Nov 2011 11:13:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[ddos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[TLS]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=227</guid>
		<description><![CDATA[how to install a mail server based on sendmail that is capable of SMTP-AUTH and TLS. It should work (maybe with slight changes concerning paths etc.) on all *nix operating systems. I tested it on Debian Woody so far. This howto is meant as a practical guide; it does not cover the theoretical backgrounds. They [...]]]></description>
			<content:encoded><![CDATA[<p>how to install a mail server based on sendmail that is capable of SMTP-AUTH<br />
and TLS. It should work (maybe with slight changes concerning paths etc.) on<br />
all *nix operating systems. I tested it on Debian Woody so far.</p>
<p>This howto is meant<br />
as a practical guide; it does not cover the theoretical backgrounds. They are<br />
treated in a lot of other documents in the web.</p>
<p>This document comes<br />
without warranty of any kind!</p>
<p><strong>1 Get the Sources</strong></p>
<p>We need the following<br />
software: openssl, cyrus-sasl2, and sendmail. We will install the software from<br />
the <em>/tmp</em> directory.</p>
<p><em>cd /tmp</em></p>
<p><em>wget http://www.openssl.org/source/openssl-0.9.7c.tar.gz</em></p>
<p><em>wget –passive-ftp ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.17.tar.gz</em></p>
<p><em>wget –passive-ftp<br />
ftp://ftp.sendmail.org/pub/sendmail/sendmail.8.12.11.tar.gz</em></p>
<p><strong>2 Install Openssl</strong></p>
<p><em>tar xvfz openssl-0.9.7c.tar.gz</em></p>
<p><em> cd openssl-0.9.7c</em></p>
<p><em>./config</em></p>
<p><em>make</em></p>
<p><em>make install</em></p>
<p><em>ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl</em></p>
<p><strong>3 Install Cyrus-sasl2</strong></p>
<p><em>cd /tmp</em></p>
<p><em>tar<br />
xvfz cyrus-sasl-2.1.17.tar.gz</em></p>
<p><em>cd cyrus-sasl-2.1.17</em></p>
<p><em>./configure –enable-anon –enable-plain –enable-login –disable-krb4 –with-saslauthd=/var/run/saslauthd<br />
–with-pam –with-openssl=/usr/local/ssl –with-plugindir=/usr/local/lib/sasl2<br />
–enable-cram –enable-digest –enable-otp</em> (1<br />
line!)</p>
<p><em>make</em></p>
<p><em> make install</em></p>
<p>If <em>/usr/lib/sasl2</em><br />
exists:</p>
<p><em>mv /usr/lib/sasl2 /usr/lib/sasl2_orig</em></p>
<p><em>echo “pwcheck_method:<br />
saslauthd” &gt; /usr/local/lib/sasl2/Sendmail.conf</em></p>
<p><em> echo “mech_list: login plain” &gt;&gt; /usr/local/lib/sasl2/Sendmail.conf</em></p>
<p><em>mkdir -p /var/run/saslauthd</em></p>
<p><strong>4 Create Certificates<br />
for TLS</strong></p>
<p><em>mkdir -p /etc/mail/certs</em></p>
<p><em>cd /etc/mail/certs</em></p>
<p><em> openssl req -new -x509 -keyout cakey.pem -out cacert.pem -days 365</em></p>
<p>&lt;- Enter your<br />
password for smtpd.key.</p>
<p>&lt;- Enter your Country Name (e.g., “DE”).</p>
<p>&lt;- Enter your State or Province Name.</p>
<p>&lt;- Enter your City.</p>
<p>&lt;- Enter your Organization Name (e.g., the name of your company).</p>
<p>&lt;- Enter your Organizational Unit Name (e.g. “IT Department”).</p>
<p>&lt;- Enter the Fully Qualified Domain Name of the system (e.g. “server1.example.com”).</p>
<p>&lt;- Enter your Email Address.</p>
<p><em>openssl req -nodes -new<br />
-x509 -keyout sendmail.pem -out sendmail.pem -days 365</em></p>
<p>&lt;- Again, enter<br />
your password for smtpd.key.</p>
<p>&lt;- Enter your Country Name (e.g., “DE”).</p>
<p>&lt;- Enter your State or Province Name.</p>
<p>&lt;- Enter your City.</p>
<p>&lt;- Enter your Organization Name (e.g., the name of your company).</p>
<p>&lt;- Enter your Organizational Unit Name (e.g. “IT Department”).</p>
<p>&lt;- Enter the Fully Qualified Domain Name of the system (e.g. “server1.example.com”).</p>
<p>&lt;- Enter your Email Address.</p>
<p><em>openssl x509 -noout -text<br />
-in sendmail.pem</em></p>
<p><em> chmod 600 ./sendmail.pem</em></p>
<p><strong>5 Install Sendmail</strong></p>
<p><em>cd /tmp</em></p>
<p><em>tar xvfz sendmail.8.12.11.tar.gz</em></p>
<p><em>cd sendmail-8.12.11/devtools/Site/</em></p>
<p>Create the<br />
file <em>site.config.m4<br />
</em>(<em>in<br />
devtools/Site/</em>):</p>
<blockquote><p># SASL2 (smtp authentication)<br />
APPENDDEF(`confENVDEF’, `-DSASL=2′)<br />
APPENDDEF(`conf_sendmail_LIBS’, `-lsasl2′)<br />
#<br />
# STARTTLS (smtp + tls/ssl)<br />
APPENDDEF(`conf_sendmail_ENVDEF’, `-DSTARTTLS’)<br />
APPENDDEF(`conf_sendmail_ENVDEF’, `-D_FFR_SMTP_SSL’)<br />
APPENDDEF(`conf_sendmail_LIBS’, `-lssl -lcrypto -L/usr/local/ssl/lib’)</p></blockquote>
<p><em>mkdir -p /usr/man</em></p>
<p><em>mkdir -p /usr/man/man1</em></p>
<p><em>mkdir -p /usr/man/man8</em></p>
<p><em>cp -pfr /usr/local/lib/sasl2 /usr/lib/sasl2</em></p>
<p><em>echo /usr/lib/sasl2 &gt;&gt; /etc/ld.so.conf</em></p>
<p><em> ldconfig</em></p>
<p><em>ln -s /usr/local/ssl/include/openssl /usr/include/openssl</em></p>
<p>Now we can compile<br />
sendmail:</p>
<p><em>cd /tmp/sendmail-8.12.11/</em></p>
<p><em>useradd smmsp</em></p>
<p><em>groupadd smmsp</em></p>
<p><em>sh Build -c</em></p>
<p><em> sh Build install</em></p>
<p>Let’s create our<br />
sendmail.cf:</p>
<p><em>cd cf/cf/</em></p>
<p><em> </em>Create the file<br />
<em>sendmail.mc</em> with the<br />
following contents:</p>
<blockquote><p>### do SMTPAUTH<br />
define(`confAUTH_MECHANISMS’, `LOGIN PLAIN DIGEST-MD5 CRAM-MD5′) ;<br />
TRUST_AUTH_MECH(`LOGIN PLAIN DIGEST-MD5 CRAM-MD5′) ;</p>
<p>### do STARTTLS<br />
define(`confCACERT_PATH’, `/etc/mail/certs’) ;<br />
define(`confCACERT’, `/etc/mail/certs/cacert.pem’) ;<br />
define(`confSERVER_CERT’, `/etc/mail/certs/sendmail.pem’) ;<br />
define(`confSERVER_KEY’, `/etc/mail/certs/sendmail.pem’) ;<br />
define(`confCLIENT_CERT’, `/etc/mail/certs/sendmail.pem’) ;<br />
define(`confCLIENT_KEY’, `/etc/mail/certs/sendmail.pem’) ;<br />
DAEMON_OPTIONS(`Family=inet, Port=465, Name=MTA-SSL, M=s’) ;</p>
<p>###<br />
define(`confDEF_CHAR_SET’, `iso-8859-1′) ;<br />
define(`confMAX_MESSAGE_SIZE’, `15000000′) ; Denial of Service Attacks<br />
define(`confMAX_DAEMON_CHILDREN’, `30′) ; Denial of Service Attacks<br />
define(`confCONNECTION_RATE_THROTTLE’, `2′) ; Denial of Service Attacks<br />
define(`confMAXRCPTSPERMESSAGE’, `50′) ; Denial of service Attacks<br />
define(`confSINGLE_LINE_FROM_HEADER’, `True’) ;<br />
define(`confSMTP_LOGIN_MSG’, `$j’) ;<br />
define(`confDONT_PROBE_INTERFACES’, `True’) ;<br />
define(`confTO_INITIAL’, `6m’) ;<br />
define(`confTO_CONNECT’, `20s’) ;<br />
define(`confTO_HELO’, `5m’) ;<br />
define(`confTO_HOSTSTATUS’, `2m’) ;<br />
define(`confTO_DATAINIT’, `6m’) ;<br />
define(`confTO_DATABLOCK’, `35m’) ;<br />
define(`confTO_DATAFINAL’, `35m’) ;<br />
define(`confDIAL_DELAY’, `20s’) ;<br />
define(`confNO_RCPT_ACTION’, `add-apparently-to’) ;<br />
define(`confALIAS_WAIT’, `0′) ;<br />
define(`confMAX_HOP’, `35′) ;<br />
define(`confQUEUE_LA’, `5′) ;<br />
define(`confREFUSE_LA’, `12′) ;<br />
define(`confSEPARATE_PROC’, `False’) ;<br />
define(`confCON_EXPENSIVE’, `true’) ;<br />
define(`confWORK_RECIPIENT_FACTOR’, `1000′) ;<br />
define(`confWORK_TIME_FACTOR’, `3000′) ;<br />
define(`confQUEUE_SORT_ORDER’, `Time’) ;<br />
define(`confPRIVACY_FLAGS’, `authwarnings,goaway,restrictmailq,restrictqrun,needmailhelo’) ;<br />
OSTYPE(linux) ;<br />
FEATURE(`delay_checks’) ;<br />
FEATURE(`generics_entire_domain’) ;<br />
FEATURE(`local_procmail’) ;<br />
FEATURE(`masquerade_envelope’) ;<br />
FEATURE(`nouucp’,`reject’) ;<br />
FEATURE(`redirect’) ;<br />
FEATURE(`relay_entire_domain’) ;<br />
FEATURE(`use_cw_file’)dnl<br />
FEATURE(`virtuser_entire_domain’)dnl</p>
<p>FEATURE(dnsbl,`blackholes.mail-abuse.org’,<br />
` Mail from $&amp;{client_addr} rejected; see http://mail-abuse.org/cgi-bin/lookup?$&amp; {client_addr}’) ;<br />
FEATURE(dnsbl,`dialups.mail-abuse.org’,<br />
` Mail from dial-up rejected; see http://mail-abuse.org/dul/enduser.htm’) ;</p>
<p>FEATURE(`virtusertable’,`hash -o /etc/mail/virtusertable’) ;<br />
FEATURE(access_db) ;<br />
FEATURE(lookupdotdomain) ;<br />
FEATURE(`blacklist_recipients’) ;<br />
FEATURE(`no_default_msa’) ;<br />
DAEMON_OPTIONS(`Port=smtp, Name=MTA’) ;<br />
MAILER(local) ;<br />
MAILER(smtp) ;<br />
MAILER(procmail) ;</p></blockquote>
<p>In order to create<br />
<em> /etc/mail/sendmail.cf</em><br />
run the following commands:</p>
<p><em>sh Build sendmail.cf</em></p>
<p><em>cp sendmail.cf /etc/mail/sendmail.cf</em></p>
<p>Finally we have<br />
to create some files:</p>
<p><em>cd /etc/mail/</em></p>
<p><em>touch /etc/mail/local-host-names</em></p>
<p><em>touch /etc/mail/virtusertable</em></p>
<p><em>/usr/sbin/makemap hash virtusertable &lt; virtusertable</em></p>
<p><em> mkdir -p /var/spool/mqueue</em></p>
<p><em>chmod 700 /var/spool/mqueue</em></p>
<p><em>chown root:root /var/spool/mqueue</em></p>
<p><em>chown root:root /etc/mail/sendmail.cf</em></p>
<p><em>chmod 444 /etc/mail/sendmail.cf</em></p>
<p><em>chown root:root /etc/mail/submit.cf</em></p>
<p><em> chmod 444 /etc/mail/submit.cf</em></p>
<p><em>touch /etc/mail/aliases</em></p>
<p><em>newaliases</em></p>
<p><em>touch /etc/mail/access</em></p>
<p><em>/usr/sbin/makemap hash access &lt; access</em></p>
<p>We need an init<br />
script for sendmail (this should be copied to <em>/etc/init.d/sendmail</em>):</p>
<blockquote><p>#! /bin/sh</p>
<p>case “$1″ in<br />
start)<br />
echo “Initializing SMTP port. (sendmail)”<br />
/usr/sbin/sendmail -bd -q1h<br />
;;<br />
stop)<br />
echo “Shutting down SMTP port:”<br />
killall /usr/sbin/sendmail<br />
;;<br />
restart|reload)<br />
$0 stop &amp;&amp; $0 start<br />
;;<br />
*)<br />
echo “Usage: $0 {start|stop|restart|reload}”<br />
exit 1<br />
esac<br />
exit 0</p></blockquote>
<p><em>chmod 755 /etc/init.d/sendmail</em></p>
<p>In order to start<br />
<em>sendmail</em> at boot time<br />
do the following:</p>
<p><em>ln -s /etc/init.d/sendmail<br />
/etc/rc2.d/S20sendmail</em></p>
<p><em>ln -s /etc/init.d/sendmail /etc/rc3.d/S20sendmail</em></p>
<p><em> ln -s /etc/init.d/sendmail /etc/rc4.d/S20sendmail</em></p>
<p><em>ln -s /etc/init.d/sendmail /etc/rc5.d/S20sendmail</em></p>
<p><em>ln -s /etc/init.d/sendmail /etc/rc0.d/K20sendmail</em></p>
<p><em>ln -s /etc/init.d/sendmail /etc/rc1.d/K20sendmail</em></p>
<p><em>ln -s /etc/init.d/sendmail /etc/rc6.d/K20sendmail</em></p>
<p><strong>6 Configure<br />
Saslauthd</strong></p>
<p>Create <em>/etc/init.d/saslauthd</em>:</p>
<blockquote><p>#!/bin/sh -e</p>
<p>NAME=saslauthd<br />
DAEMON=”/usr/sbin/${NAME}”<br />
DESC=”SASL Authentication Daemon”<br />
DEFAULTS=/etc/default/saslauthd</p>
<p>test -f “${DAEMON}” || exit 0</p>
<p># Source defaults file; edit that file to configure this script.<br />
if [ -e "${DEFAULTS}" ]; then<br />
. “${DEFAULTS}”<br />
fi</p>
<p># If we’re not to start the daemon, simply exit<br />
if [ "${START}" != "yes" ]; then<br />
exit 0<br />
fi</p>
<p># If we have no mechanisms defined<br />
if [ "x${MECHANISMS}" = "x" ]; then<br />
echo “You need to configure ${DEFAULTS} with mechanisms to be used”<br />
exit 0<br />
fi</p>
<p># Add our mechanimsms with the necessary flag<br />
for i in ${MECHANISMS}; do<br />
PARAMS=”${PARAMS} -a ${i}”<br />
done</p>
<p># Consider our options<br />
case “${1}” in<br />
start)<br />
echo -n “Starting ${DESC}: ”<br />
ln -fs /var/spool/postfix/var/run/${NAME} /var/run/${NAME}<br />
${DAEMON} ${PARAMS}<br />
echo “${NAME}.”<br />
;;<br />
stop)<br />
echo -n “Stopping ${DESC}: ”<br />
PROCS=`ps aux | grep -iw ‘/usr/sbin/saslauthd’ | grep -v ‘grep’ |awk ‘{print $2}’ | tr ‘\n’ ‘ ‘`<br />
if [ "x${PROCS}" != "x" ]; then<br />
kill -15 ${PROCS} &amp;&gt; /dev/null<br />
fi<br />
echo “${NAME}.”<br />
;;<br />
restart|force-reload)<br />
$0 stop<br />
sleep 1<br />
$0 start<br />
echo “${NAME}.”<br />
;;<br />
*)<br />
echo “Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}” &gt;&amp;2<br />
exit 1<br />
;;<br />
esac</p>
<p>exit 0</p></blockquote>
<p><em>chmod 755 /etc/init.d/saslauthd</em></p>
<p>In order to start<br />
<em>saslauthd</em> at boot time<br />
do the following:</p>
<p><em>ln -s /etc/init.d/saslauthd<br />
/etc/rc2.d/S20saslauthd</em></p>
<p><em> ln -s /etc/init.d/saslauthd /etc/rc3.d/S20saslauthd</em></p>
<p><em>ln -s /etc/init.d/saslauthd /etc/rc4.d/S20saslauthd</em></p>
<p><em>ln -s /etc/init.d/saslauthd /etc/rc5.d/S20saslauthd</em></p>
<p><em>ln -s /etc/init.d/saslauthd /etc/rc0.d/K20saslauthd</em></p>
<p><em>ln -s /etc/init.d/saslauthd /etc/rc1.d/K20saslauthd</em></p>
<p><em>ln -s /etc/init.d/saslauthd /etc/rc6.d/K20saslauthd</em></p>
<p>Then create <em>/etc/default/saslauthd</em>:</p>
<blockquote><p># This needs to be uncommented before saslauthd will be run automatically<br />
START=yes</p>
<p># You must specify the authentication mechanisms you wish to use.<br />
# This defaults to “pam” for PAM support, but may also include<br />
# “shadow” or “sasldb”<br />
MECHANISMS=shadow</p></blockquote>
<p>If you find out<br />
that <em>saslauthd</em> is located<br />
in <em>/usr/local/sbin</em> instead<br />
of <em>/usr/sbin</em> create a<br />
symbolic link:</p>
<p><em>ln -s /usr/local/sbin/saslauthd<br />
/usr/sbin/saslauthd</em></p>
<p>Then start <em>saslauthd</em><br />
and <em>sendmail</em>:</p>
<p><em>/etc/init.d/saslauthd start</em></p>
<p><em>/etc/init.d/sendmail start</em></p>
<p><strong>7 Test your<br />
Configuration</strong></p>
<p>To verify that<br />
your sendmail was compiled with the right options type</p>
<p><em>/usr/sbin/sendmail -d0.1<br />
-bv root</em></p>
<p>You should see<br />
that sendmail was compiled with <em>SASLv2</em><br />
and <em>STARTTLS</em>:</p>
<p><img src="http://images.howtoforge.com/http:/www.falkotimme.com/howtos/sendmail_smtp_auth_tls/images/compiled_with.gif" alt="compiled with How To Defend slowloris DDoS With mod qos (Apache2 On Debian [Lenny]) " width="624" height="181" title="How To Defend slowloris DDoS With mod qos (Apache2 On Debian [Lenny]) " /></p>
<p>To see if SMTP-AUTH<br />
and TLS work properly now run the following command:</p>
<p><em>telnet<br />
localhost 25</em></p>
<p>After you have<br />
established the connection to your sendmail mail server type</p>
<p><em>ehlo<br />
localhost</em></p>
<p>If you see the<br />
lines</p>
<p><em>250-STARTTLS</em></p>
<p>and</p>
<p><em>250-AUTH</em></p>
<p>everything is fine.</p>
<p><img src="http://images.howtoforge.com/http:/www.falkotimme.com/howtos/sendmail_smtp_auth_tls/images/telnet_25.gif" alt="telnet 25 How To Defend slowloris DDoS With mod qos (Apache2 On Debian [Lenny]) " width="579" height="234" title="How To Defend slowloris DDoS With mod qos (Apache2 On Debian [Lenny]) " /></p>
<p>Type</p>
<p><em>quit</em></p>
<p>to return to the<br />
system’s shell.</p>
<p><strong>Links</strong></p>
<p>Sendmail MTA: <a rel="nofollow" target="_blank" href="http://www.sendmail.org/" target="_blank">http://www.sendmail.org/</a></p>
<p>OpenSSL: <a rel="nofollow" target="_blank" href="http://www.openssl.org/" target="_blank">http://www.openssl.org/</a></p>
<p>Cyrus-SASL: <a rel="nofollow" target="_blank" href="http://asg.web.cmu.edu/sasl/" target="_blank">http://asg.web.cmu.edu/sasl/</a></p>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/os/linux/how-to-defend-slowloris-ddos-with-mod_qos-apache2-on-debian-lenny.html" title="mod_qos centos">mod_qos centos</a> (10)</li><li><a href="http://thegioinguonmo.com/os/linux/how-to-defend-slowloris-ddos-with-mod_qos-apache2-on-debian-lenny.html" title="cpanel mod_qos">cpanel mod_qos</a> (6)</li><li><a href="http://thegioinguonmo.com/os/linux/how-to-defend-slowloris-ddos-with-mod_qos-apache2-on-debian-lenny.html" title="mod_qos cpanel">mod_qos cpanel</a> (4)</li><li><a href="http://thegioinguonmo.com/os/linux/how-to-defend-slowloris-ddos-with-mod_qos-apache2-on-debian-lenny.html" title="mod_qos directadmin">mod_qos directadmin</a> (4)</li><li><a href="http://thegioinguonmo.com/os/linux/how-to-defend-slowloris-ddos-with-mod_qos-apache2-on-debian-lenny.html" title="install mod_qos in centos">install mod_qos in centos</a> (2)</li><li><a href="http://thegioinguonmo.com/os/linux/how-to-defend-slowloris-ddos-with-mod_qos-apache2-on-debian-lenny.html" title="install mod_qos debian">install mod_qos debian</a> (2)</li><li><a href="http://thegioinguonmo.com/os/linux/how-to-defend-slowloris-ddos-with-mod_qos-apache2-on-debian-lenny.html" title="wget slowloris">wget slowloris</a> (2)</li><li><a href="http://thegioinguonmo.com/os/linux/how-to-defend-slowloris-ddos-with-mod_qos-apache2-on-debian-lenny.html" title="how to defend slowloris ddos with mod_qos">how to defend slowloris ddos with mod_qos</a> (2)</li><li><a href="http://thegioinguonmo.com/os/linux/how-to-defend-slowloris-ddos-with-mod_qos-apache2-on-debian-lenny.html" title="plesk mod_qos">plesk mod_qos</a> (2)</li><li><a href="http://thegioinguonmo.com/os/linux/how-to-defend-slowloris-ddos-with-mod_qos-apache2-on-debian-lenny.html" title="mod_qos windows">mod_qos windows</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/os/linux/how-to-defend-slowloris-ddos-with-mod_qos-apache2-on-debian-lenny.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>To find ddos attack</title>
		<link>http://thegioinguonmo.com/os/linux/to-find-ddos-attack.html</link>
		<comments>http://thegioinguonmo.com/os/linux/to-find-ddos-attack.html#comments</comments>
		<pubDate>Mon, 28 Nov 2011 08:44:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[ddos]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[print]]></category>
		<category><![CDATA[sort]]></category>

		<guid isPermaLink="false">http://thegioinguonmo.com/?p=169</guid>
		<description><![CDATA[netstat -an &#124;grep 80 netstat -plan&#124;grep :80&#124;awk {’print $5′}&#124;cut -d: -f 1&#124;sort&#124;uniq -c&#124;sort -nk 1 netstat -plan&#124;grep :25&#124;awk {’print $5′}&#124;cut -d: -f 1&#124;sort&#124;uniq -c&#124;sort -nk 1 watch -n 5 ‘w; ls -alS /usr/local/apache/domlogs/ ‘ Incoming search terms:centos ddos (3)ddos centos (2)apache detect ddos (1)locate ddos file in linux (1)linux find * -name (1)how to detect [...]]]></description>
			<content:encoded><![CDATA[<div>
<div>
<p>netstat -an |grep 80</p>
<p>netstat -plan|grep :80|awk {’print $5′}|cut -d: -f 1|sort|uniq -c|sort -nk 1</p>
<p>netstat -plan|grep :25|awk {’print $5′}|cut -d: -f 1|sort|uniq -c|sort -nk 1</p>
<p>watch -n 5 ‘w; ls -alS /usr/local/apache/domlogs/ ‘</p>
</div>
</div>
<h4>Incoming search terms:</h4><ul><li><a href="http://thegioinguonmo.com/os/linux/to-find-ddos-attack.html" title="centos ddos">centos ddos</a> (3)</li><li><a href="http://thegioinguonmo.com/os/linux/to-find-ddos-attack.html" title="ddos centos">ddos centos</a> (2)</li><li><a href="http://thegioinguonmo.com/os/linux/to-find-ddos-attack.html" title="apache detect ddos">apache detect ddos</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/to-find-ddos-attack.html" title="locate ddos file in linux">locate ddos file in linux</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/to-find-ddos-attack.html" title="linux find * -name">linux find * -name</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/to-find-ddos-attack.html" title="how to detect ddos linux no shell">how to detect ddos linux no shell</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/to-find-ddos-attack.html" title="find_ddos windows">find_ddos windows</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/to-find-ddos-attack.html" title="ddos script windows">ddos script windows</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/to-find-ddos-attack.html" title="ddos script linux">ddos script linux</a> (1)</li><li><a href="http://thegioinguonmo.com/os/linux/to-find-ddos-attack.html" title="check for ddos centos">check for ddos centos</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://thegioinguonmo.com/os/linux/to-find-ddos-attack.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: thegioinguonmo.com @ 2012-05-20 18:26:02 -->
