<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"><channel><title>Security, networking and system integration</title><description></description><managingEditor>noreply@blogger.com (Zeljko Milinovic, MSc)</managingEditor><pubDate>Fri, 1 Nov 2024 02:53:37 -0700</pubDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">86</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">25</openSearch:itemsPerPage><link>http://itstuffallaround.blogspot.com/</link><language>en-us</language><item><title/><link>http://itstuffallaround.blogspot.com/2022/08/oracle-exadata-smart-scan-conditions.html</link><category>Exadata</category><category>Oracle</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Tue, 9 Aug 2022 03:02:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-3736965696811039879</guid><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;h1 style="text-align: center;"&gt;Oracle Exadata Smart Scan conditions&lt;/h1&gt;&lt;div style="text-align: justify;"&gt;Exadata Smart Scan gives a possiblity to the Oracle Database to offload SQL processing to the Exadata Storage Servers.&amp;nbsp;In order to make usage of Smart Scan features of Exadata, the initialization parameter cell_offload_processing must be set to TRUE.&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;SQL&amp;gt; show parameter cell_offload_pr&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;cell_offload_processing boolean TRUE&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The Smart Scan magic SQL processing happens at the storage tier, instead of the database tier, to improve query performance. It reduces the volume of data sent to the database tier thereby reducing the CPU usage on database nodes.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/a/AVvXsEjmTSvFH0F89fJKPM2Ef5goXhFIcsScANRdbc7BJu3LI0GtQ4TL7qqqtESkUfkFD-ofQRFdmHlNimiTJA9MkW6uc3ZzalcPaYMFrBr491jWfTwJpWlEmVd42MGcIT9NaAhlDuQEEa70M30TnYlYUC_eKXThH_AtK09IvohSdWD4p4HP8IK1zoc-Kv4HYg" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img alt="" data-original-height="264" data-original-width="637" height="237" src="https://blogger.googleusercontent.com/img/a/AVvXsEjmTSvFH0F89fJKPM2Ef5goXhFIcsScANRdbc7BJu3LI0GtQ4TL7qqqtESkUfkFD-ofQRFdmHlNimiTJA9MkW6uc3ZzalcPaYMFrBr491jWfTwJpWlEmVd42MGcIT9NaAhlDuQEEa70M30TnYlYUC_eKXThH_AtK09IvohSdWD4p4HP8IK1zoc-Kv4HYg=w573-h237" width="573" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;source: oracle.com&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;We have 4 basic conditions for Smart Scan to be triggered&lt;/div&gt;&lt;div&gt;- There must be a full scan of an object.&lt;/div&gt;&lt;div&gt;- Oracle’s Direct Path Read mechanis must be used, and path reads are generally used when we read&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp; into PGA memory (not the buffer cache).&lt;/div&gt;&lt;div&gt;- Each segment being scanned must be on a Cell disk group (usually with ASSM it is).&lt;/div&gt;&lt;div&gt;- We need the CELL_OFFLOAD_PROCESSING initialization parameter to be enabled.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;img alt="" data-original-height="41" data-original-width="418" height="41" src="https://blogger.googleusercontent.com/img/a/AVvXsEjo5JHwhhcRqN7dAiL7Op14fIP5tGi0omLp74rYLce7R6pzvoCcX2hGvW_XiXoH_w3fBDdds4pXKttk4zoIxoZIBxPNnwx3gNncePKLM-BS7c-BJJ2bTbvwTWaQBfRNuEeJLHq5XacLcMEY0NIyElSfhnDnJQkD2JcVU3R6qPWGGOFTWi9iL8ARGtY3mQ=w422-h41" width="422" /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: left;"&gt;&lt;div&gt;If we get the STORAGE keyword in the explanation plan, does not guarantee that the offload will occur. Sometimes Exadata Storage Server could decide that Smart Scan will not produce any performance.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/a/AVvXsEjmTSvFH0F89fJKPM2Ef5goXhFIcsScANRdbc7BJu3LI0GtQ4TL7qqqtESkUfkFD-ofQRFdmHlNimiTJA9MkW6uc3ZzalcPaYMFrBr491jWfTwJpWlEmVd42MGcIT9NaAhlDuQEEa70M30TnYlYUC_eKXThH_AtK09IvohSdWD4p4HP8IK1zoc-Kv4HYg=s72-w573-h237-c" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><georss:featurename xmlns:georss="http://www.georss.org/georss">Graz, Austria</georss:featurename><georss:point xmlns:georss="http://www.georss.org/georss">47.070714 15.439504</georss:point><georss:box xmlns:georss="http://www.georss.org/georss">18.760480163821157 -19.716746 75.380947836178848 50.595754</georss:box></item><item><title>Detect slow PostgreSQL queries, pg_stat vs auto logging overhead.</title><link>http://itstuffallaround.blogspot.com/2021/10/detect-slow-postgresql-queries-pgstat.html</link><category>PostgreSQL</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Mon, 18 Oct 2021 00:33:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-6837814091782191494</guid><description>&lt;h1 style="text-align: center;"&gt;&amp;nbsp;Detect slow PostgreSQL queries, pg_stat vs auto logging overhead&lt;/h1&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph;"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US;"&gt;To be able to find and detect slow
queries on a RDBMS PostgreSQL is an important thing as the database tends to
grow. Optimizing performance and expensive SQL queries is one of the major task
of the database system maintainers. These problems can be approached with many
ways and external systems, but I have tried to obtain the fast and “keep it
simple” way, which I will try to explain in this blog post.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkWPaCpldb3v1aZm8nRjTUJbvGLKRk0BxbHle67u1xR9gHHfoGFhMJBWNrsP5FR5U2lZqIJHeCEBGBAPk4I7YOp2RswDQXShPbGfbtXiS9O0BdbPe9mhm-Qj4plYfl1jhBs_Hfoymo9NQd/" style="margin-left: auto; margin-right: auto;"&gt;&lt;img alt="" data-original-height="441" data-original-width="881" height="160" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkWPaCpldb3v1aZm8nRjTUJbvGLKRk0BxbHle67u1xR9gHHfoGFhMJBWNrsP5FR5U2lZqIJHeCEBGBAPk4I7YOp2RswDQXShPbGfbtXiS9O0BdbPe9mhm-Qj4plYfl1jhBs_Hfoymo9NQd/" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;source: stackify&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph;"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US;"&gt;One of the cool PostgreSQL features is
the auto_explain module , which provides a means for logging execution plans of
slow statements automatically, without having to run EXPLAIN by hand (stated by
the documentation). It is also stated in the documentation that there is a
price in overhead for that. I would suggest not using the excessive logging
from auto_explain on production systems.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph;"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US;"&gt;The alternative that I am using
often is the pg_stat_statements module which can be easily configured on a
production or test system.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p align="center" class="MsoNormal" style="text-align: center;"&gt;&lt;/p&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRxqBtS6Dgcw5o7jBq0YLc8TTOrDOOY-2VKUl5HJU6YgG6nRl4CNVfraivQFZNGYs-CCtr0XCAP0mS9-bpDspsMmHmlI91czYHgOSG9PCRmyKvht8JQSOEKVyrm0ffdpm7koFWq47VltHF/" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img alt="" data-original-height="46" data-original-width="336" height="44" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRxqBtS6Dgcw5o7jBq0YLc8TTOrDOOY-2VKUl5HJU6YgG6nRl4CNVfraivQFZNGYs-CCtr0XCAP0mS9-bpDspsMmHmlI91czYHgOSG9PCRmyKvht8JQSOEKVyrm0ffdpm7koFWq47VltHF/" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;

&lt;p align="center" class="MsoNormal" style="text-align: center;"&gt;&lt;/p&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEileuohfzEZVUSa_nIuWg4R574TRPPi9twqrLHNCSrpnm_MoMjAv0Mk1R9mHn0f7zal0HnkBCeGlHtJXk1wCFc4aIFa5n4vPWOiCXv_Q85n2NPkCflVul9tfXV7zReQpe7INjw5qz3jQxII/" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img alt="" data-original-height="52" data-original-width="454" height="37" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEileuohfzEZVUSa_nIuWg4R574TRPPi9twqrLHNCSrpnm_MoMjAv0Mk1R9mHn0f7zal0HnkBCeGlHtJXk1wCFc4aIFa5n4vPWOiCXv_Q85n2NPkCflVul9tfXV7zReQpe7INjw5qz3jQxII/" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;After that
we need to run CREATE EXTENSION pg_stat_statements in our databases, which will
allow PostgreSQL to create a view for us.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align="center" class="MsoNormal" style="text-align: center;"&gt;&lt;b&gt;&lt;span style="background: #E8F2FE; color: maroon; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; line-height: 107%;"&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;span style="background: rgb(232, 242, 254); font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 107%;"&gt; * &lt;/span&gt;&lt;b&gt;&lt;span style="background: #E8F2FE; color: maroon; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10.0pt; line-height: 107%;"&gt;FROM&lt;/span&gt;&lt;/b&gt;&lt;span style="background: rgb(232, 242, 254); font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 107%;"&gt;
pg_stat_statement&lt;/span&gt;&lt;span lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;The created
view is able to tell us, which query has been executed how often and show us
insights about the total runtime of this type of query as well as about the distribution
of runtimes for those particular queries.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: center;"&gt;&lt;/p&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDRM_RFvWWcbSuh5fEfkAfecd_u6H2Dbhs85QfxEz2ZgjjMwg17urmSdcbQ-NwMQoynJt3KCshL3DNLjsgk31zGmRA3pA868TtN1YIJHCZrLkJQNKSjpjrfKjEmEf4u1tqm_FhSgrPHPi6/" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img alt="" data-original-height="301" data-original-width="605" height="322" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDRM_RFvWWcbSuh5fEfkAfecd_u6H2Dbhs85QfxEz2ZgjjMwg17urmSdcbQ-NwMQoynJt3KCshL3DNLjsgk31zGmRA3pA868TtN1YIJHCZrLkJQNKSjpjrfKjEmEf4u1tqm_FhSgrPHPi6/w649-h322/image.png" width="649" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-US"&gt;





&lt;span lang="EN-US" style="font-family: &amp;quot;Calibri&amp;quot;,sans-serif; font-size: 11.0pt; line-height: 107%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: DengXian; mso-fareast-language: ZH-CN; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;"&gt;This allows me to get a quick overview of the
CPU percentage being used and a quick overview of the I/O behavior of many
types of queries, which could be a great deal of the reason that causes high
loads on your production systems.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;/div&gt;&lt;p align="center" class="MsoNormal" style="text-align: center;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkWPaCpldb3v1aZm8nRjTUJbvGLKRk0BxbHle67u1xR9gHHfoGFhMJBWNrsP5FR5U2lZqIJHeCEBGBAPk4I7YOp2RswDQXShPbGfbtXiS9O0BdbPe9mhm-Qj4plYfl1jhBs_Hfoymo9NQd/s72-c" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><georss:featurename xmlns:georss="http://www.georss.org/georss">Austria</georss:featurename><georss:point xmlns:georss="http://www.georss.org/georss">47.516231 14.550072</georss:point><georss:box xmlns:georss="http://www.georss.org/georss">-32.351761222528843 -126.074928 90 155.175072</georss:box></item><item><title>Oracle Blockchain contributions</title><link>http://itstuffallaround.blogspot.com/2019/10/oracle-blockchain-contributions.html</link><category>Blockchain</category><category>Oracle</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Tue, 1 Oct 2019 02:30:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-1608894741767844685</guid><description>&lt;h2 style="text-align: center;"&gt;
Oracle Blockchain Contributions&lt;/h2&gt;
&lt;div style="text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Oracle has added developer-oriented productivity enhancements, enhanced privacy, confidentiality, and identity management features that are critical to diverse organizations conducting business transactions. New DevOps capabilities make the platform easier to integrate with existing business and IT systems. Additionally, as blockchain becomes an important data store in the enterprise, the platform enables Oracle Autonomous Data Warehouse customers to transparently capture blockchain transaction history and current state data for analytics and to integrate it with other data sources&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://cdn.app.compendium.com/uploads/user/e7c690e8-6ff9-102a-ac6d-e4aebca50425/03391c68-5c5e-493c-95a5-a92b492b9025/File/da42eccf945d4a07f962578452af76a3/shutterstock_649874284.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" data-original-height="534" data-original-width="800" height="265" src="https://cdn.app.compendium.com/uploads/user/e7c690e8-6ff9-102a-ac6d-e4aebca50425/03391c68-5c5e-493c-95a5-a92b492b9025/File/da42eccf945d4a07f962578452af76a3/shutterstock_649874284.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;source: Oracle Blog&lt;/td&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style="text-align: justify;"&gt;
I found one of the new cool features to be much welcome in the portfolio:&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
- Rich history database shadows transaction history into a relational database schema in the Autonomous Data Warehouse or other Oracle databases, which transparently enables analytics integration for interactive dashboards and reports. Here is an example of the use of rich history stored on Oracle's Autonomous Datawarehouse and visualized using Oracle Analytics Cloud.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
One more important thing is the introduction of the Third-party certificate support for registering client organizations on the blockchain network to enable them to use existing certificates issued by trusted third parties. The security was a major topic in the Enterprise world, so did the Oracle what other big developing companies do, introduce the standard methods of security.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
To avoid the Lock-In seen in the previous licensing models, the big companies need to contribute to the development of Blockchain services with the same speed as other smaller communities do. This is the only way to hold the sustainabillity of the Blockchain Ecosystem.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Server side request forgery (SSRF) attack</title><link>http://itstuffallaround.blogspot.com/2019/04/server-side-request-forgery-ssrf-attack.html</link><category>Firewall</category><category>Security</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Tue, 23 Apr 2019 22:09:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-5841192371288026055</guid><description>&lt;h2 style="text-align: center;"&gt;
Server side request forgery (SSRF) attack&lt;/h2&gt;
&lt;div style="text-align: justify;"&gt;
In a Server-Side Request Forgery (SSRF) attack, the attacker can abuse functionality on the server to read or update internal resources. The attacker can supply or a modify a URL which the code running on the server will read or submit data to, and by carefully selecting the URLs, the attacker may be able to read server configuration such as AWS metadata, connect to internal services like http enabled databases or perform post requests towards internal services which are not intended to be exposed.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCYHkEXsPBFHrvEwZBdeV75kkiN3ykxH8N9_ZKDQ8DrPQMUlS9SyuPVmCVPJSCMIikIl1vZTO6aU85Km2hzC6wkAGeYh4Z9ELYww21PfA3-FAGmLTb4ef3aPrJPNqF550GIYtuywOI3AHH/s1600/ssrf.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;span style="color: black;"&gt;&lt;img border="0" data-original-height="426" data-original-width="1024" height="165" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCYHkEXsPBFHrvEwZBdeV75kkiN3ykxH8N9_ZKDQ8DrPQMUlS9SyuPVmCVPJSCMIikIl1vZTO6aU85Km2hzC6wkAGeYh4Z9ELYww21PfA3-FAGmLTb4ef3aPrJPNqF550GIYtuywOI3AHH/s400/ssrf.png" width="400" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;span style="font-size: small;"&gt;source: Acunetix&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
You can no longer request information from internal systems, but can still make internal API-calls. Imagine the following PHP code (source Detectify):&lt;br /&gt;
&lt;div&gt;
&lt;div style="text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div style="text-align: center;"&gt;
&lt;i&gt;//getimage.php&lt;/i&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style="text-align: center;"&gt;
&lt;i&gt;$content = file_get_contents($_GET['url']);&lt;/i&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style="text-align: center;"&gt;
&lt;i&gt;file_put_contents(‘image.jpg’, $content);&lt;/i&gt;&lt;/div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
The above code will fetch data from a URL using PHP’s file_get_contents() function and then save it to the disk. A legitime request would then look like:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;i&gt;GET&amp;nbsp; /getimage.php?url=https://website.com/images/cat.jpg&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
And the web application would make a request to https://website.com/images/cat.jpg. This code could be exploited with SSRF. Such an attack could look something like:&lt;/div&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;i&gt;GET&amp;nbsp; /getimage.php?url=http://127.0.0.1/api/v1/getuser/id/1&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
In this case the vulnerable web application would make a GET request to the internal REST API service, trying to access the /api/v1/getuser/id/1 endpoint. This REST API service is only accessible on the local network, but due to a SSRF vulnerability it was possible for the attacker to make such an internal request and read that response.&amp;nbsp; &amp;nbsp;Sometimes you can make a request to an external server, and the request itself may contain sensitive headers. One of many examples would be HTTP basic passwords, if a proxy has been used. SSRF can therefore be carried out to both internal and external services.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Due to microservices and serverless platforms, SSRF will probably be a bigger thing in the future. Making internal requests now means that you can interact with other parts of the service, pretending to be the actual service.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3 style="text-align: justify;"&gt;
Mitigation&lt;/h3&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
The most robust way to avoid Server Side Request Forgery (SSRF) is to whitelist the DNS name or IP address that your application needs to access. If a whitelist approach does not suit you and you must rely on a blacklist, it’s important to validate user input properly. For example, do not allow requests to private (non-routable) IP addresses.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
To prevent response data leaking to the attacker, you must ensure that the received response is as expected. Under no circumstances should the raw response body from the request sent by the server be delivered to the client.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
If your application only uses HTTP or HTTPS to make requests, allow only these URL schemas. If you disable unused URL schemas, the attacker will be unable to use the web application to make requests using potentially dangerous schemas such as file:///, dict://, ftp:// and gopher://&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCYHkEXsPBFHrvEwZBdeV75kkiN3ykxH8N9_ZKDQ8DrPQMUlS9SyuPVmCVPJSCMIikIl1vZTO6aU85Km2hzC6wkAGeYh4Z9ELYww21PfA3-FAGmLTb4ef3aPrJPNqF550GIYtuywOI3AHH/s72-c/ssrf.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Uncomplicated Firewall with Python</title><link>http://itstuffallaround.blogspot.com/2019/04/uncomplicated-firewall-with-python.html</link><category>Firewall</category><category>Linux</category><category>Python</category><category>Security</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Tue, 23 Apr 2019 00:53:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-3165712923207143447</guid><description>&lt;h2 style="text-align: center;"&gt;
Uncomplicated Firewall with Python &lt;/h2&gt;
&lt;div style="text-align: justify;"&gt;
Uncomplicated Firewall, is an interface to iptables that simplifyies the process of configuring a firewall. Iptables is flexible, it can be difficult for beginners to learn how to use it to properly configure a firewall.&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
In the example below is a python program that makes it easy allowing and blocking various services by IP address.&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC2"&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt;# Description :&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC3"&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt;#    Generate ip-host binding list for a list of nodes, when internal DNS is missing.&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC4"&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt;#    1. For existing nodes, allow traffic from new nodes&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC5"&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt;#    2. For new nodes, allow traffic from all nodes&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC6"&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt;#&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC7"&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt;# Sample:&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC8"&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt;#    python ./ufw_allow_ip.py --old_ip_list_file /tmp/old_ip_list --new_ip_list_file /tmp/new_ip_list \&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC9"&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt;#           --ssh_username root --ssh_port 22 --ssh_key_file ~/.ssh/id_rsa&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC10"&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt;#&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC11"&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt;#-------------------------------------------------------------------&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC12"&gt;&lt;span class="pl-k"&gt;import&lt;/span&gt; os, sys&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC13"&gt;&lt;span class="pl-k"&gt;import&lt;/span&gt; paramiko&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC14"&gt;&lt;span class="pl-k"&gt;import&lt;/span&gt; argparse&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC15"&gt;
&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC16"&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; multiple threading for a list of ssh servers&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC17"&gt;&lt;span class="pl-k"&gt;import&lt;/span&gt; Queue&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC18"&gt;&lt;span class="pl-k"&gt;import&lt;/span&gt; threading&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC19"&gt;
&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC20"&gt;&lt;span class="pl-k"&gt;import&lt;/span&gt; logging&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC21"&gt;log_folder &lt;span class="pl-k"&gt;=&lt;/span&gt; &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;span class="pl-c1"&gt;%s&lt;/span&gt;/log&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt; &lt;span class="pl-k"&gt;%&lt;/span&gt; (os.path.expanduser(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;~&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;))&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC22"&gt;&lt;span class="pl-k"&gt;if&lt;/span&gt; os.path.exists(log_folder) &lt;span class="pl-k"&gt;is&lt;/span&gt; &lt;span class="pl-c1"&gt;False&lt;/span&gt;:&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC23"&gt;    os.makedirs(log_folder)&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC24"&gt;log_file &lt;span class="pl-k"&gt;=&lt;/span&gt; &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;span class="pl-c1"&gt;%s&lt;/span&gt;/&lt;span class="pl-c1"&gt;%s&lt;/span&gt;.log&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt; &lt;span class="pl-k"&gt;%&lt;/span&gt; (log_folder, os.path.basename(&lt;span class="pl-c1"&gt;__file__&lt;/span&gt;).rstrip(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;\.py&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;))&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC25"&gt;
&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC26"&gt;logging.basicConfig(&lt;span class="pl-v"&gt;filename&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;log_file, &lt;span class="pl-v"&gt;level&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;logging.&lt;span class="pl-c1"&gt;DEBUG&lt;/span&gt;, &lt;span class="pl-v"&gt;format&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;span class="pl-c1"&gt;%(asctime)s&lt;/span&gt; &lt;span class="pl-c1"&gt;%(message)s&lt;/span&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;)&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC27"&gt;logging.getLogger().addHandler(logging.StreamHandler())&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC28"&gt;
&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC29"&gt;&lt;span class="pl-k"&gt;def&lt;/span&gt; &lt;span class="pl-en"&gt;get_list_from_file&lt;/span&gt;(&lt;span class="pl-smi"&gt;fname&lt;/span&gt;):&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC30"&gt;    l &lt;span class="pl-k"&gt;=&lt;/span&gt; []&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC31"&gt;    &lt;span class="pl-k"&gt;with&lt;/span&gt; &lt;span class="pl-c1"&gt;open&lt;/span&gt;(fname,&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;r&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;) &lt;span class="pl-k"&gt;as&lt;/span&gt; f:&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC32"&gt;        &lt;span class="pl-k"&gt;for&lt;/span&gt; row &lt;span class="pl-k"&gt;in&lt;/span&gt; f:&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC33"&gt;            row &lt;span class="pl-k"&gt;=&lt;/span&gt; row.strip()&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC34"&gt;            &lt;span class="pl-k"&gt;if&lt;/span&gt; row.startswith(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;#&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;) &lt;span class="pl-k"&gt;or&lt;/span&gt; row &lt;span class="pl-k"&gt;==&lt;/span&gt; &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;:&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC35"&gt;                &lt;span class="pl-k"&gt;continue&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC36"&gt;            l.append(row)&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC37"&gt;    &lt;span class="pl-k"&gt;return&lt;/span&gt; l&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC38"&gt;
&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC39"&gt;&lt;span class="pl-k"&gt;def&lt;/span&gt; &lt;span class="pl-en"&gt;ufw_allow_ip_list&lt;/span&gt;(&lt;span class="pl-smi"&gt;server_ip&lt;/span&gt;, &lt;span class="pl-smi"&gt;ip_list&lt;/span&gt;, &lt;span class="pl-smi"&gt;ssh_connect_args&lt;/span&gt;):&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC40"&gt;    &lt;span class="pl-k"&gt;if&lt;/span&gt; &lt;span class="pl-c1"&gt;len&lt;/span&gt;(ip_list) &lt;span class="pl-k"&gt;==&lt;/span&gt; &lt;span class="pl-c1"&gt;0&lt;/span&gt;:&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC41"&gt;        &lt;span class="pl-c1"&gt;print&lt;/span&gt;(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;Skip run ufw update in &lt;span class="pl-c1"&gt;%s&lt;/span&gt;, since ip_list is empty&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt; &lt;span class="pl-k"&gt;%&lt;/span&gt; (server_ip))&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC42"&gt;        &lt;span class="pl-k"&gt;return&lt;/span&gt;(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;OK&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;, &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;)&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC43"&gt;
&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC44"&gt;    [ssh_username, ssh_port, ssh_key_file, key_passphrase] &lt;span class="pl-k"&gt;=&lt;/span&gt; ssh_connect_args&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC45"&gt;    ssh_command &lt;span class="pl-k"&gt;=&lt;/span&gt; &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC46"&gt;    &lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; &lt;span class="pl-k"&gt;TODO&lt;/span&gt;: improve this command, by using a library&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC47"&gt;    &lt;span class="pl-k"&gt;for&lt;/span&gt; ip &lt;span class="pl-k"&gt;in&lt;/span&gt; ip_list:&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC48"&gt;        ssh_command &lt;span class="pl-k"&gt;=&lt;/span&gt; &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;span class="pl-c1"&gt;%s&lt;/span&gt; &amp;amp;&amp;amp; ufw allow from &lt;span class="pl-c1"&gt;%s&lt;/span&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt; &lt;span class="pl-k"&gt;%&lt;/span&gt; (ssh_command, ip)&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC49"&gt;    &lt;span class="pl-k"&gt;if&lt;/span&gt; ssh_command.startswith(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt; &amp;amp;&amp;amp; &lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;):&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC50"&gt;        ssh_command &lt;span class="pl-k"&gt;=&lt;/span&gt; ssh_command[&lt;span class="pl-c1"&gt;len&lt;/span&gt;(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt; &amp;amp;&amp;amp; &lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;):]&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC51"&gt;
&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC52"&gt;    &lt;span class="pl-c1"&gt;print&lt;/span&gt;(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;Update ufw in &lt;span class="pl-c1"&gt;%s&lt;/span&gt;. ssh_command: &lt;span class="pl-c1"&gt;%s&lt;/span&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt; &lt;span class="pl-k"&gt;%&lt;/span&gt; (server_ip, ssh_command))&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC53"&gt;    output &lt;span class="pl-k"&gt;=&lt;/span&gt; &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC54"&gt;    &lt;span class="pl-k"&gt;try&lt;/span&gt;:&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC55"&gt;        ssh &lt;span class="pl-k"&gt;=&lt;/span&gt; paramiko.SSHClient()&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC56"&gt;        ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC57"&gt;        key &lt;span class="pl-k"&gt;=&lt;/span&gt; paramiko.RSAKey.from_private_key_file(ssh_key_file, &lt;span class="pl-v"&gt;password&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;key_passphrase)&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC58"&gt;        ssh.connect(server_ip, &lt;span class="pl-v"&gt;username&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;ssh_username, &lt;span class="pl-v"&gt;port&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;ssh_port, &lt;span class="pl-v"&gt;pkey&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;key)&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC59"&gt;        stdin, stdout, stderr &lt;span class="pl-k"&gt;=&lt;/span&gt; ssh.exec_command(ssh_command)&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC60"&gt;        output &lt;span class="pl-k"&gt;=&lt;/span&gt; &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;span class="pl-cce"&gt;\n&lt;/span&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;.join(stdout.readlines())&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC61"&gt;        output &lt;span class="pl-k"&gt;=&lt;/span&gt; output.rstrip(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;span class="pl-cce"&gt;\n&lt;/span&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;)&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC62"&gt;        &lt;span class="pl-c1"&gt;print&lt;/span&gt;(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;Command output in &lt;span class="pl-c1"&gt;%s&lt;/span&gt;: &lt;span class="pl-c1"&gt;%s&lt;/span&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt; &lt;span class="pl-k"&gt;%&lt;/span&gt; (server_ip, output))&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC63"&gt;        ssh.close()&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC64"&gt;    &lt;span class="pl-k"&gt;except&lt;/span&gt;:&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC65"&gt;        &lt;span class="pl-k"&gt;return&lt;/span&gt; (&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;ERROR&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;, &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;Unexpected on server: &lt;span class="pl-c1"&gt;%s&lt;/span&gt; error: &lt;span class="pl-c1"&gt;%s&lt;/span&gt;&lt;span class="pl-cce"&gt;\n&lt;/span&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt; &lt;span class="pl-k"&gt;%&lt;/span&gt; (server_ip, sys.exc_info()[&lt;span class="pl-c1"&gt;0&lt;/span&gt;]))&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC66"&gt;    &lt;span class="pl-k"&gt;return&lt;/span&gt; (&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;OK&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;, output)&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC67"&gt;
&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC68"&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt;##############################################################&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC69"&gt;
&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC70"&gt;&lt;span class="pl-k"&gt;if&lt;/span&gt; &lt;span class="pl-c1"&gt;__name__&lt;/span&gt; &lt;span class="pl-k"&gt;==&lt;/span&gt; &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;__main__&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;:&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC71"&gt;    &lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; get parameters from users&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC72"&gt;    parser &lt;span class="pl-k"&gt;=&lt;/span&gt; argparse.ArgumentParser()&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC73"&gt;    parser.add_argument(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;--old_ip_list_file&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="pl-v"&gt;required&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-c1"&gt;True&lt;/span&gt;, \&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC74"&gt;                        &lt;span class="pl-v"&gt;help&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;IP list of current cluster&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;, &lt;span class="pl-v"&gt;type&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-c1"&gt;str&lt;/span&gt;)&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC75"&gt;    parser.add_argument(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;--new_ip_list_file&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="pl-v"&gt;required&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-c1"&gt;True&lt;/span&gt;, \&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC76"&gt;                        &lt;span class="pl-v"&gt;help&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;IP list of new nodes&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;, &lt;span class="pl-v"&gt;type&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-c1"&gt;str&lt;/span&gt;)&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC77"&gt;    parser.add_argument(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;--ssh_username&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="pl-v"&gt;required&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-c1"&gt;False&lt;/span&gt;, &lt;span class="pl-v"&gt;default&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;root&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;, \&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC78"&gt;                        &lt;span class="pl-v"&gt;help&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;Which OS user to ssh&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;, &lt;span class="pl-v"&gt;type&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-c1"&gt;str&lt;/span&gt;)&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC79"&gt;    parser.add_argument(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;--ssh_port&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="pl-v"&gt;required&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-c1"&gt;False&lt;/span&gt;, &lt;span class="pl-v"&gt;default&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;22&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;, \&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC80"&gt;                        &lt;span class="pl-v"&gt;help&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;Which port to connect sshd&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;, &lt;span class="pl-v"&gt;type&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-c1"&gt;int&lt;/span&gt;)&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC81"&gt;    parser.add_argument(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;--ssh_key_file&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="pl-v"&gt;required&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-c1"&gt;False&lt;/span&gt;, &lt;span class="pl-v"&gt;default&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;span class="pl-c1"&gt;%s&lt;/span&gt;/.ssh/id_rsa&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt; &lt;span class="pl-k"&gt;%&lt;/span&gt; os.path.expanduser(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;~&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;), \&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC82"&gt;                        &lt;span class="pl-v"&gt;help&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;ssh key file to connect&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;, &lt;span class="pl-v"&gt;type&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-c1"&gt;str&lt;/span&gt;)&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC83"&gt;    parser.add_argument(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;--key_passphrase&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="pl-v"&gt;required&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-c1"&gt;False&lt;/span&gt;, &lt;span class="pl-v"&gt;default&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;, \&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC84"&gt;                        &lt;span class="pl-v"&gt;help&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;Which OS user to ssh&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;, &lt;span class="pl-v"&gt;type&lt;/span&gt;&lt;span class="pl-k"&gt;=&lt;/span&gt;&lt;span class="pl-c1"&gt;str&lt;/span&gt;)&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC85"&gt;
&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC86"&gt;    l &lt;span class="pl-k"&gt;=&lt;/span&gt; parser.parse_args()&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC87"&gt;    ssh_connect_args &lt;span class="pl-k"&gt;=&lt;/span&gt; [l.ssh_username, l.ssh_port, l.ssh_key_file, l.key_passphrase]&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC88"&gt;
&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC89"&gt;    old_ip_list &lt;span class="pl-k"&gt;=&lt;/span&gt; get_list_from_file(l.old_ip_list_file)&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC90"&gt;    new_ip_list &lt;span class="pl-k"&gt;=&lt;/span&gt; get_list_from_file(l.new_ip_list_file)&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC91"&gt;
&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC92"&gt;    has_error &lt;span class="pl-k"&gt;=&lt;/span&gt; &lt;span class="pl-c1"&gt;False&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC93"&gt;    &lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; &lt;span class="pl-k"&gt;TODO&lt;/span&gt;: speed up this process by multiple threading&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC94"&gt;    &lt;span class="pl-k"&gt;for&lt;/span&gt; old_ip &lt;span class="pl-k"&gt;in&lt;/span&gt; old_ip_list:&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC95"&gt;        (status, output) &lt;span class="pl-k"&gt;=&lt;/span&gt; ufw_allow_ip_list(old_ip, new_ip_list, ssh_connect_args)&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC96"&gt;        &lt;span class="pl-k"&gt;if&lt;/span&gt; status &lt;span class="pl-k"&gt;!=&lt;/span&gt; &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;OK&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;:&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC97"&gt;            has_error &lt;span class="pl-k"&gt;=&lt;/span&gt; &lt;span class="pl-c1"&gt;True&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC98"&gt;            &lt;span class="pl-c1"&gt;print&lt;/span&gt;(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;Error in &lt;span class="pl-c1"&gt;%s&lt;/span&gt;. errmsg: &lt;span class="pl-c1"&gt;%s&lt;/span&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt; &lt;span class="pl-k"&gt;%&lt;/span&gt; (old_ip, output))&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC99"&gt;
&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC100"&gt;    &lt;span class="pl-k"&gt;for&lt;/span&gt; new_ip &lt;span class="pl-k"&gt;in&lt;/span&gt; new_ip_list:&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC101"&gt;        (status, output) &lt;span class="pl-k"&gt;=&lt;/span&gt; ufw_allow_ip_list(new_ip, new_ip_list &lt;span class="pl-k"&gt;+&lt;/span&gt; old_ip_list, ssh_connect_args)&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC102"&gt;        &lt;span class="pl-k"&gt;if&lt;/span&gt; status &lt;span class="pl-k"&gt;!=&lt;/span&gt; &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;OK&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;:&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC103"&gt;            has_error &lt;span class="pl-k"&gt;=&lt;/span&gt; &lt;span class="pl-c1"&gt;True&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC104"&gt;            &lt;span class="pl-c1"&gt;print&lt;/span&gt;(&lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;Error in &lt;span class="pl-c1"&gt;%s&lt;/span&gt;. errmsg: &lt;span class="pl-c1"&gt;%s&lt;/span&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt; &lt;span class="pl-k"&gt;%&lt;/span&gt; (new_ip, output))&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC105"&gt;
&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC106"&gt;    &lt;span class="pl-k"&gt;if&lt;/span&gt; has_error &lt;span class="pl-k"&gt;is&lt;/span&gt; &lt;span class="pl-c1"&gt;True&lt;/span&gt;:&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
sys.exit(&lt;span class="pl-c1"&gt;1&lt;/span&gt;)&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC1"&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt;!/usr/bin/python&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Benefits of Blockchain</title><link>http://itstuffallaround.blogspot.com/2018/09/benefits-of-blockchain.html</link><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Thu, 20 Sep 2018 06:39:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-8449639823220775120</guid><description>&lt;h2 style="text-align: center;"&gt;
Benefits of Blockchain&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Blockchain’s promise is “the decentralization of trust, enabling value flow without intermediaries”. It allows financial transactions to be verified and cleared without the need for a trusted third party sitting between market participants. Removing intermediaries reduces costs and complexity.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcPXol4lbdYDVzU8EIwiYP0KJvAFyZrsBRkjzx9csR497VZrJ0YQtAWbvlBDQHyBA03sdDf8X0YjCDz5RYHE9rt01ae0JQMSdQZ0YSB7HTMPH4wkGFe-bGczTq8hmnNLJrwIVMArVCfuy0/s1600/1234.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" data-original-height="600" data-original-width="1500" height="256" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcPXol4lbdYDVzU8EIwiYP0KJvAFyZrsBRkjzx9csR497VZrJ0YQtAWbvlBDQHyBA03sdDf8X0YjCDz5RYHE9rt01ae0JQMSdQZ0YSB7HTMPH4wkGFe-bGczTq8hmnNLJrwIVMArVCfuy0/s640/1234.jpeg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div&gt;
The blockchain’s security and privacy protocols are based on the use of a “cryptographic hash function” — each block (of transactions) in the chain is identified by its own “hash” key. This approach was developed to prevent the “double spending” of&amp;nbsp; Bitcoins. The complexity of the crypto hash function reduces the blockchain’s susceptibility to fraud.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
The distributed ledger approach means that all the members of a financial market (the network) share an identical system of record, rather than each maintaining their own proprietary view of it. This replicated, shared ledger provides consensus, provenance, immutability and finality for the transactions concerned — payments, asset transfers, etc. This shared approach removes the need for reconciliations.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
New transactions are only accepted for posting to the distributed ledger (through the creation of new blocks for the chain) once all the computers in the network achieve consensus as to their validity. The&lt;/div&gt;
&lt;div&gt;
verification of transactions by all network users reduces error rates and queries.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
At the heart of blockchain is a new type of distributed database. This provides for the exchange of information in a synchronous and even manner, as well as allows it to be updated constantly, providing near-instant clearing and settlement. The provision of faster settlement means less risk in the financial system and so reduces the capital requirements of market participants.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
The new distributed database functionality also allows code to run with the blockchain to modify data (both on and off the chain) automatically. This&amp;nbsp;enables the blockchain to support self-enforcing
or “smart” contracts, allowing the automation of a
variety of business functions.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Supply chain and trade finance&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
• Plays directly to many of the blockchain’s principal strengths&lt;/div&gt;
&lt;div&gt;
• Mathematics is used to achieve trust between the parties to a transaction&lt;/div&gt;
&lt;div&gt;
- The current role of banks in trade transactionsis principally to accept risk, thereby allowing the&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;parties to trust each other.&lt;/div&gt;
&lt;div&gt;
• Allows shared access for all parties within the supply chain (buyers, suppliers, banks, logistics companies, insurance companies, customs and health authorities, etc.) to the single view of the truth&lt;/div&gt;
&lt;div&gt;
• A private, permissioned blockchain can restrict access only to those parties involved in the supply&lt;/div&gt;
&lt;div&gt;
chain concerned • The delivery and use of rich information — i.e., transactions on the chain would include invoice numbers, certificates of origin, bills of lading, bills of exchange, insurance documents, customs documents, health certificates, etc.&lt;/div&gt;
&lt;div&gt;
• “Smart contract” capabilities enable automated decision making and information handling.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
In summary, the focus on blockchain has shifted and is now on understanding the technology and the value it offers, as opposed to some months ago when it was more of a collective huddle and a focus on collaboration and shared intent. However, there is still no clear emergence of where blockchain its in terms of technology, business benefits and application. “We don’t know who will own it and who will benefit so maybe the wrong group within a bank is looking at the benefit?” said one interviewee.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
So where next? The banks did not plan for blockchain, but the direction is clear. Few people fully understand blockchain within banks, but everyone is asking powerful questions as to what it is and what it offers. It is not seen as a lethal threat to banking, but it is seen as disruptive new technology they have to understand more fully, and for which they must develop a strategic approach to deployment. As one interviewee said: “I actually don’t understand how we have reached such a stage of involvement in the bank without ownership or control. We need a blockchain czar.”&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
What is absolutely clear is the recognition that there is a need to separate the hype from the reality and from an executive and strategic perspective, to take a fresh look at what blockchain offers banks, and what banks must do to adopt it.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Source: ACI Worldwide&lt;/div&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcPXol4lbdYDVzU8EIwiYP0KJvAFyZrsBRkjzx9csR497VZrJ0YQtAWbvlBDQHyBA03sdDf8X0YjCDz5RYHE9rt01ae0JQMSdQZ0YSB7HTMPH4wkGFe-bGczTq8hmnNLJrwIVMArVCfuy0/s72-c/1234.jpeg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Application Centric Infrastructure with Python</title><link>http://itstuffallaround.blogspot.com/2017/02/application-centric-infrastructure-with.html</link><category>Cisco</category><category>Python</category><category>SDN</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Mon, 20 Feb 2017 04:59:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-5057304437076733949</guid><description>&lt;div style="text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style="text-align: justify;"&gt;
In application-centric networking, troubleshooting does not mean logging into discrete devices and examining networking state information. If a web application is not performing, you start with the web application. The fact that relevant state information might exist within a router, switch, or even a web server is secondary. You want to gather intelligence on the application itself. That data needs to be collected and correlated. And you aren’t done until the application is up and running as it should.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
There are several questions you need to ask: Can you see how applications are talking across your network? For distributed applications, do you have a view of which components are where? Can you see how data is flowing between them?&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Here I would like to present a small Python programm that I adapted from the Cisco code repository.&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;table class="highlight tab-size js-file-line-container" data-tab-size="8" style="text-align: justify;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="blob-code blob-code-inner js-file-line" id="LC15"&gt;&lt;span class="pl-c"&gt;&lt;i&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; Copyright (c) 2015 Cisco Systems                                             #&lt;/i&gt;&lt;/span&gt;&lt;/td&gt;
      &lt;/tr&gt;
&lt;tr&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span class="pl-c"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span class="pl-c"&gt;&lt;i&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; All Rights Reserved.&amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class="pl-c"&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;"""&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;Simple application that logs on to the APIC and displays all&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;of the Interfaces.&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;"""&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;import sys&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;import re&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;import json&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;import acitoolkit.acitoolkit as aci&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;def main():&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; """&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; Main execution routine&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; :return: None&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; """&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; # Take login credentials from the command line if provided&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; # Otherwise, take them from your environment variables file ~/.profile&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; description = 'Simple application that logs on to the APIC and displays all of the Interfaces.'&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; creds = aci.Credentials('apic', description)&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; args = creds.get()&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; # Login to APIC&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; session = aci.Session(args.url, args.login, args.password)&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; resp = session.login()&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; if not resp.ok:&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print('%% Could not login to APIC')&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sys.exit(0)&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; resp = session.get('/api/class/ipv4Addr.json')&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; intfs = json.loads(resp.text)['imdata']&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; data = {}&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; for i in intfs:&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ip = i['ipv4Addr']['attributes']['addr']&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; op = i['ipv4Addr']['attributes']['operSt']&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cfg = i['ipv4Addr']['attributes']['operStQual']&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dn = i['ipv4Addr']['attributes']['dn']&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; node = dn.split('/')[2]&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; intf = re.split(r'\[|\]', dn)[1]&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; vrf = re.split(r'/|dom-', dn)[7]&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if vrf not in data.keys():&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data[vrf] = []&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data[vrf].append((node, intf, ip, cfg, op))&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; for k in data.keys():&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; header = 'IP Interface Status for VRF "{}"'.format(k)&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print header&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; template = "{0:15} {1:10} {2:20} {3:8} {4:10}"&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(template.format("Node", "Interface", "IP Address ", "Admin Status", "Status"))&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for rec in sorted(data[k]):&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print(template.format(*rec))&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;if __name__ == '__main__':&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;main()&lt;/i&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
With the help of the ACI Toolkit library from Cisco we could define and create many functions and procedures needed to manipulate and programm the ACI Fabric. As an universal data format JSON is used to retrieve data from the APIC controller. The data interested to us are VRFs, IPs, VLANs and so on. In the final function we define a loop that that will search for all of the the values stored inside the dictionary data structure from Python and sort them using a template.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
For those wanted to know more about the ACI please checkout the source text from the SDX Central.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Cisco ACI is a tightly coupled policy-driven solution that integrates software and hardware. The hardware for Cisco ACI is based on the Cisco Nexus 9000 family of switches. The software and integration points for ACI include a few components, including Additional Data Center Pod, Data Center Policy Engine, and Non-Directly Attached Virtual and Physical Leaf Switches. While there isn’t an explicit reliance on any specific virtual switch, at this point, policies can only be pushed down to the virtual switches if Cisco’s Application Virtual Switch (AVS) is used, though there has been talk about extending this to Open vSwitch in the near future.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
In a leaf-spine ACI fabric, Cisco is provisioning a native Layer 3 IP fabric that supports equal-cost multi-path (ECMP) routing between any two endpoints in the network, but uses overlay protocols, such as virtual extensible local area network (VXLAN) under the covers to allow any workload to exist anywhere in the network. Supporting overlay protocols is what will give the fabric the ability to have machines, either physical or virtual, in the same logical network (Layer 2 domain), even while running Layer 3 routing down to the top of each rack. Cisco ACI supports VLAN, VXLAN, and network virtualization using generic routing encapsulation (NV-GRE), which can be combined and bridged together to create a logical network/domain as needed.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
From a management perspective, the central SDN Controller of the ACI solution, the Application Policy Infrastructure Controller (APIC) manages and configures the policy on each of the switches in the ACI fabric. Hardware becomes stateless with Cisco ACI, much like it is with Cisco’s UCS Computing Platform. This means no configuration is tied to the device. The APIC acts as a central repository for all policies and has the ability to rapidly deploy and re-deploy hardware, as needed, by using this stateless computing model.&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Feel free to comment.&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Quick peek inside Kubernetes Containers.</title><link>http://itstuffallaround.blogspot.com/2016/10/quick-peek-inside-kubernetes-containers.html</link><category>Containers</category><category>Kubernetes</category><category>Linux</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Sun, 2 Oct 2016 09:14:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-8104750216597148276</guid><description>&lt;h2 style="text-align: center;"&gt;
Quick peek inside Kubernetes Containers&lt;/h2&gt;
&lt;div style="text-align: justify;"&gt;
To get a fresh start inside the Container world I have tested a couple of technologies. The new and interresting container managament project that I tested is called Kubernetes. The Wiki definition follows:&amp;nbsp;Kubernetes (commonly referred to as "k8s") is an open source container cluster manager originally designed by Google and donated to the Cloud Native Computing Foundation. It aims to provide a "platform for automating deployment, scaling, and operations of application containers across clusters of hosts".&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
On my simple home Lab I will install and quickly deploy Kubernetes on a fresh Centos 7 server with minimal desktop features. So let us get started.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
First what we need is to disable firewall services.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div&gt;
&lt;i&gt;&amp;nbsp;systemctl disable firewalld.service&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&amp;nbsp;systemctl stop firewalld.service&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
After this what we need to install is the network daemon service:&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;yum -y install ntp&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;i&gt;systemctl start ntpd&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;systemctl enable ntpd&lt;/i&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
To download the packages need for the Kubernetes cluster manager we need to add a new repository to the Centos defaults. We do this creating a file inside the &lt;i&gt;/etc/yum.repos.d &lt;/i&gt;folder called&amp;nbsp;&lt;i&gt;virt7-docker-common-release.repo&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
This file should contain the following Urls and content for us to be able to download the Kubernetes packages need for the setup of the container manager:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;i&gt;[root@Cent01 yum.repos.d]# cat virt7-docker-common-release.repo&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;[virt7-docker-common-release]&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;name=virt7-docker-common-release&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;baseurl=http://cbs.centos.org/repos/virt7-docker-common-release/x86_64/os/&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;gpgcheck=0&lt;/i&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
Now are ready to download the basic Kubernetes managament packages and install them:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;yum install docker etcd kubernetes&amp;nbsp;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
As the packages are downloaded from the repository they will be automatically installed using the Yellow dog manager for Centos packages. If you need more info or want to see the verbose informatons add the --v switch after the install command.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
To restart and enable the services we would need to define a FOR loop:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;i&gt;for SERVICE in docker etcd kube-apiserver kube-controller-manager kube-scheduler kube-proxy kubelet; do&amp;nbsp;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; systemctl restart $SERVICE&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; systemctl enable $SERVICE&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;done&lt;/i&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
To make the managament available over the Web GUI (which I find very handy from the beginning) we would need to install the Cockpit manager.&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;i&gt;yum install cockpit cockpit-kubernetes&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;systemctl enable cockpit.socket&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;systemctl start cockpit.socket&lt;/i&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
That was for now on installing the packages. The next step would be to start the web GUI using the port 9090. You just need to call this url:&amp;nbsp;&lt;i&gt;https://server_ip:9090&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The base image of the Cockpit Kubernetes manager will show us the options needed to create and monitor the container Also the cluster managament is prepared and deployment of Micro services.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_NlOReyQsKMHZkmQvTA5xU-KNNlP6JQDk2xatQT4PaJ4L2j9McyzBu71mg5Txzf05bCiPFdtsEIGmBf7Ee412V08wZqo2l3Z2cUtBx6KiDiBS0vLPwKFde4oSS2umrh451xKSnbif00Fx/s1600/pic1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="289" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_NlOReyQsKMHZkmQvTA5xU-KNNlP6JQDk2xatQT4PaJ4L2j9McyzBu71mg5Txzf05bCiPFdtsEIGmBf7Ee412V08wZqo2l3Z2cUtBx6KiDiBS0vLPwKFde4oSS2umrh451xKSnbif00Fx/s640/pic1.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Under Tools we can still maintain the Bare metal Centos 7 server using the command line.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIqCCuWU-vsl1fAEkIq234mVg2ryWJQnVMdYcdO6wPcBhJ6UGbaxHGn3p7pHkIZWjgi0JNdOqO_VYCKppZAeVE5bhXdCTXgvB-ceqlLgti5pFXwHhtPnrjrPEdpPWwhRy6Ju-xM5ItM_4G/s1600/pi2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="408" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIqCCuWU-vsl1fAEkIq234mVg2ryWJQnVMdYcdO6wPcBhJ6UGbaxHGn3p7pHkIZWjgi0JNdOqO_VYCKppZAeVE5bhXdCTXgvB-ceqlLgti5pFXwHhtPnrjrPEdpPWwhRy6Ju-xM5ItM_4G/s640/pi2.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
And as simpel as that we can find many Docker container images from the repositories and download them. From simple web servers to complex MySQL redundant scenarios. As simple as download-click-run image system is a performance booster.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGzZ7EfZqxQe3_0RiqfGJ-qCOV03fTRj3uTJ82l7jGsDx8kWUUkm5Ck3EnCp0LDZnVR-TTQK7pcHIhQJu6AenFz_puCeK7hw_CyXR2p0YJnu7wqiOpawATrXrHrh6QCLXV3ujLr-1WBfxO/s1600/pic3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="438" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGzZ7EfZqxQe3_0RiqfGJ-qCOV03fTRj3uTJ82l7jGsDx8kWUUkm5Ck3EnCp0LDZnVR-TTQK7pcHIhQJu6AenFz_puCeK7hw_CyXR2p0YJnu7wqiOpawATrXrHrh6QCLXV3ujLr-1WBfxO/s640/pic3.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
What I also find interresant is the possibility to build the apps from Manifest files and deploy them as Micro Services. OpenShift supported from RedHat could be also used as a great tool to build the applications on Docker Container technology.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGmrVPvqpsEET53sLxpSNFQ3CCOwvPednLLGGuA9Nk4Kw0pRDz0XFQRUXO_Z4c2Qw1VRlWA11gc1UayGpzlweqkpZehzXSSIV0Mh1dCmpuTTu6yQpS0ZViFpF_tKdT6vnL83U9ExIdBHil/s1600/pic4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="340" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGmrVPvqpsEET53sLxpSNFQ3CCOwvPednLLGGuA9Nk4Kw0pRDz0XFQRUXO_Z4c2Qw1VRlWA11gc1UayGpzlweqkpZehzXSSIV0Mh1dCmpuTTu6yQpS0ZViFpF_tKdT6vnL83U9ExIdBHil/s640/pic4.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
And in a matter of minutes we can have a running cluster based container image managament orchestra. The deploy of manifests will be explained in the next blog where I will research more on Openshift and app buiding.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Stay tuned and follow me and please send your comments.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_NlOReyQsKMHZkmQvTA5xU-KNNlP6JQDk2xatQT4PaJ4L2j9McyzBu71mg5Txzf05bCiPFdtsEIGmBf7Ee412V08wZqo2l3Z2cUtBx6KiDiBS0vLPwKFde4oSS2umrh451xKSnbif00Fx/s72-c/pic1.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Automate Mysql with Puppet </title><link>http://itstuffallaround.blogspot.com/2014/11/automate-mysql-with-puppet.html</link><category>Linux</category><category>Puppet</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Sun, 30 Nov 2014 02:49:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-26558018961237838</guid><description>&lt;h2 style="text-align: center;"&gt;
Automate Mysql with Puppet &lt;/h2&gt;
&lt;div style="text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Puppet, based on my personal experience is a great technology that allows new ways in DevOps environments and automation. With this technology people can code and manage the complete IT infrastructure from a central location, or a within a cloud infrastructure. It has completely changed the way on providing IT services and managing the same. Some cool features like role based access control and activity login allow people to define stable management strategy.&lt;br /&gt;
&lt;br /&gt;
To get started, I created a simple Client / Server based puppet scenario in which we will automate Mysql server implementation in a linux environment. Puppet master server is configured to provide modules, manifests and classes to the agent servers in the complete infrastructure.&lt;br /&gt;
&lt;br /&gt;
After installing the puppet master server the users can use the following folder &lt;i&gt;etc/puppet/manifests&lt;/i&gt;&amp;nbsp; to develop and write some code for deploying the services to the agent servers.&lt;br /&gt;
&lt;br /&gt;
First, on the puppet master server we should download and install the package module for the Mysql server using the following command:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;sudo puppet module search mysql&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
After the successful installation you should verify that the folder mysql exists in the /etc/puppet/modules folder with the source installation of mysql server.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinFKRiduOIw_brbIKoQ0YXOJA8PJNd0jp9Kgt7Izr2Isl1e0aVYTPpyTjsyRAHoMCTCnreA26RK38YM2-mxKON4DaGrk98-Hp4Q3IQpHUXIO5izbSi9yKO2rPbGrvmZWbwFttjc1Y6CstC/s1600/mysql2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinFKRiduOIw_brbIKoQ0YXOJA8PJNd0jp9Kgt7Izr2Isl1e0aVYTPpyTjsyRAHoMCTCnreA26RK38YM2-mxKON4DaGrk98-Hp4Q3IQpHUXIO5izbSi9yKO2rPbGrvmZWbwFttjc1Y6CstC/s1600/mysql2.jpg" height="180" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
After the validation of folder existence , the source file are located there. Now we have to define the site.pp file inside the /etc/puppet/manifests as a manifest file that will send the code execution of installing the mysql server on an agent server. The content of the file should look like the following:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;node 'agent_node01' { include mysql::server } &lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
This line of code defines the agent_node01 will look for the installation of mysql server inside the mysql server module installation on the puppet master server. The next step is to connect to the agent node and start the puppet agent service.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;nbsp;sudo /etc/init.d/puppet start &lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
After restarting the service I will initiate the agent test command to force the pulling the package and the module from the puppet master.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTzDxQU5mR_YIKUDe3aJqPCTP2aC_1DAWUkW94K68H0O4c9-Cp9wneSSSzgx4hVOGmkCWbknut1OuCGaM5yZzcZMfLwAZuKCxEfSN66uilfRxqiun0Sxpj5KIlDQhaXJLq_kMfXDeJmw-B/s1600/installed.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTzDxQU5mR_YIKUDe3aJqPCTP2aC_1DAWUkW94K68H0O4c9-Cp9wneSSSzgx4hVOGmkCWbknut1OuCGaM5yZzcZMfLwAZuKCxEfSN66uilfRxqiun0Sxpj5KIlDQhaXJLq_kMfXDeJmw-B/s1600/installed.jpg" height="290" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
As we can see the catalog is finished and the Mysql server service is up and running. The allow_virtual parameter can be ignored as that is a deprecation warning by default.&lt;br /&gt;
&lt;br /&gt;
Feel free to test and comment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinFKRiduOIw_brbIKoQ0YXOJA8PJNd0jp9Kgt7Izr2Isl1e0aVYTPpyTjsyRAHoMCTCnreA26RK38YM2-mxKON4DaGrk98-Hp4Q3IQpHUXIO5izbSi9yKO2rPbGrvmZWbwFttjc1Y6CstC/s72-c/mysql2.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Make linux process invisible with new Centos kernel </title><link>http://itstuffallaround.blogspot.com/2014/09/make-linux-process-invisible-with-new.html</link><category>Linux</category><category>Security</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Sat, 27 Sep 2014 11:34:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-4269288527538150392</guid><description>&lt;h2 style="text-align: center;"&gt;
Make linux process invisible with new Centos kernel&amp;nbsp;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Processes carry out tasks within the operating system. A program is a set of machine code instructions and data stored in an executable image on disk and is, as such, a passive entity; a process can be thought of as a computer program in action.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
After I have compiled the new version of Centos 3.2 kernel I have decided to test some &lt;b&gt;security &lt;/b&gt;features that this version offers. How to check which kernel version you have installed, well easy:&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div&gt;
&lt;i&gt;[root@centos01 ~]# &lt;b&gt;uname -r&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;u&gt;3.2.48&lt;/u&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;[root@centos01 ~]#&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
As many other Linux servers, they run in a multi-user enviroments. That means that every user are using shared hardware and software resources of the server. From a security stand point of view, informations of user/usage processes ownership is not relevant for every user to see it. To prevent these informations to every shared resource we are going to tamper a little bit with the /proc filesystem. So if you have the Centos 3.2+ kernel compiled and installed on your test or production machine you can develope this situation further.&lt;/div&gt;
&lt;div&gt;
The task is simple, all we have to configure is the /proc file system mount with new security options, so that reading of every process can be delegated only to the owner of the process. The new option that we are going to introduce is &lt;b&gt;hidepid.&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
We have three options available:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;hidepid=0 - &lt;/i&gt;anyone can read the /proc/pid files&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;hidepid=1 - &lt;/i&gt;this option prevents users to access /proc directories , except of their own. Important&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; background tasks of the server are now prevented to be shown.&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;hidepid=2 - &lt;/i&gt;this option is an addition to the option 1 , with more security, denying everybody the information about the running processes. Now an &lt;b&gt;intruder &lt;/b&gt;is not able to list sensitive data.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Before setting this security options we had a normal situation where a local user could read all of the root and system processes informations.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaaUOAmtTnupD4xcZG3-fMqRdUKQCkG31piZK-5A4NaoN6mWRwBMGECjcCD-FnFJGYHwQ19rZpdo3877iHQQJ8gijs3cAcwyl_wLzm0Lx_wr150O9qO4mriTxElEsD3I2MNkEaQoBllLwi/s1600/sl1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaaUOAmtTnupD4xcZG3-fMqRdUKQCkG31piZK-5A4NaoN6mWRwBMGECjcCD-FnFJGYHwQ19rZpdo3877iHQQJ8gijs3cAcwyl_wLzm0Lx_wr150O9qO4mriTxElEsD3I2MNkEaQoBllLwi/s1600/sl1.png" height="212" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
To continue setting this to prevent users information leakage we have to type further commands:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;mount -o remount,rw,hidepid=2 /proc&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
To have the configuration over a rebooted server we have to update the FSTAB file.&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;vi /etc/fstab&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
And we have to add the following info to the file:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;proc &amp;nbsp; &amp;nbsp;/proc &amp;nbsp; &amp;nbsp;proc &amp;nbsp; &amp;nbsp;defaults,hidepid=2 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
Save and update the file.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
This is all to it. Log into a stanard user and use the following command to list the processes:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;ps -ef&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
As a standard user you should not be able to see the processes from other users and applications.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Feel free to test and comment.&lt;/div&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaaUOAmtTnupD4xcZG3-fMqRdUKQCkG31piZK-5A4NaoN6mWRwBMGECjcCD-FnFJGYHwQ19rZpdo3877iHQQJ8gijs3cAcwyl_wLzm0Lx_wr150O9qO4mriTxElEsD3I2MNkEaQoBllLwi/s72-c/sl1.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Using tcpdump with Linux</title><link>http://itstuffallaround.blogspot.com/2014/08/using-tcpdump-with-linux.html</link><category>Linux</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Sat, 16 Aug 2014 11:36:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-496703097494981997</guid><description>&lt;h2 style="text-align: center;"&gt;
Using tcpdump with Linux&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
I find &lt;b&gt;tcpdump &lt;/b&gt;as a very powerfull and useful tool to sniff network traffic from a Linux box. It is independent on the distro you are working and very easy to learn. It`s simplicity is inside the command line shell and can be very useful for remote troubleshooting of server and desktop systems.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmPoDUNpfMaQ1mt-YGSvHTek5gdcCIQPsZ-XQ30GQLBsUVjM3j65UE3b7DQZT1MxuqKkNJHudZsM8NWCfpj3TRxU1O3jbvRVNUCwbBLFz7jftfSQB1JsYuB3XCxzV3iYuPduoM3Q19-NSo/s1600/tcpdump.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmPoDUNpfMaQ1mt-YGSvHTek5gdcCIQPsZ-XQ30GQLBsUVjM3j65UE3b7DQZT1MxuqKkNJHudZsM8NWCfpj3TRxU1O3jbvRVNUCwbBLFz7jftfSQB1JsYuB3XCxzV3iYuPduoM3Q19-NSo/s1600/tcpdump.jpg" height="146" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
It is a built in package that exists in various distros and can be used to capture received and transfered packets over a complete network or only from a host. There are a set of options and switch flags thah can be used with this command.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
I will try to demonstrate a couple of them with explanation, the ones that I find useful:&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;-i any &lt;/b&gt;listen on any interface that is available on the system&lt;/li&gt;
&lt;li&gt;&lt;b&gt;-n &lt;/b&gt;do not resolve hostnames&lt;/li&gt;
&lt;li&gt;&lt;b&gt;-c &lt;/b&gt;get number of certain packets and then stop (usefull in not getting to much informations)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;-e &lt;/b&gt;get the Ethernet header along with the capture&lt;/li&gt;
&lt;li&gt;&lt;b&gt;-E&lt;/b&gt; decrypt IPSEC traffic with providing a password key&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Simple usage of tcpdump for viewing packets can be done with a couple of command line options. Whether you would like to go into the details of the packets or only the basic view it can be displayed on the command line.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #0b5394;"&gt;tcpdump -nS &lt;/span&gt;simple communication of packets inside the network&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #0b5394;"&gt;tcpdump -nnvvS&lt;/span&gt; more advanced packet view with more verbosity&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #0b5394;"&gt;tcpdump -nnvvXS &lt;/span&gt;a more deeper look into the package with the content details (derrived from the GUI)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
We could do now an example of a displaying only two packages TCP with and inside deeper view of the content. This simple command will show us a two packets with their content and headers.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #0b5394;"&gt;tcpdump -nnvXSs 0 -c2 tcp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #0b5394;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggw4XnWmxMAY6tGHy4ClEU3qVLi4HSvyEoX8W5p0l8w1sDsQZ5T122IBOFr432n02URp2zKEjzx74VMQLHn2pexIpyzT0NxiUm7F8WTj4I0BFTiRl5KaUE6dzodr04YW4Vklab9-xWP1Wu/s1600/tcpdumptwo.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggw4XnWmxMAY6tGHy4ClEU3qVLi4HSvyEoX8W5p0l8w1sDsQZ5T122IBOFr432n02URp2zKEjzx74VMQLHn2pexIpyzT0NxiUm7F8WTj4I0BFTiRl5KaUE6dzodr04YW4Vklab9-xWP1Wu/s1600/tcpdumptwo.jpg" height="380" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #0b5394;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #0b5394;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
A more specific network goal is not to have too many traffic displayed on the shell. This leaves the options that are not needed out of the picture, and makes troubleshooting much easier.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
To see the traffic derrived from a particular host we can use the following command:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #0b5394;"&gt;tcpdump host 192.168.1.100&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #0b5394;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
Another useful command is writting a certain type of traffic inside a text file for later troubleshooting:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #0b5394;"&gt;tcpdump -s 1514 port 21 -w output.txt&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #0b5394;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
And for the final packet show command in this blog, you can use a simple switch only to filter IPV6 traffic:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #0b5394;"&gt;tcpdump ip6&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: #0b5394;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
This is only a small demonstration of this powerfull tool. More can be read through the MAN pages, or from similar sysadmin books. Feel free to share and comment.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmPoDUNpfMaQ1mt-YGSvHTek5gdcCIQPsZ-XQ30GQLBsUVjM3j65UE3b7DQZT1MxuqKkNJHudZsM8NWCfpj3TRxU1O3jbvRVNUCwbBLFz7jftfSQB1JsYuB3XCxzV3iYuPduoM3Q19-NSo/s72-c/tcpdump.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Very Secure FTP on Centos Server</title><link>http://itstuffallaround.blogspot.com/2014/05/very-secure-ftp-on-centos-server.html</link><category>Linux</category><category>Security</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Fri, 23 May 2014 02:53:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-1620212724320047543</guid><description>&lt;h2 style="text-align: center;"&gt;
Very Secure FTP on Centos Server&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
For this blog post I will be using a VSFTPD as a fast, realible and very secure SFTP server for transferring data between client and server sites. One notice FTP is inherently insecure. If you must use FTP, consider securing your FTP connection with SSL/TLS. Otherwise, it is best to use SFTP, a secure alternative to FTP.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
I have a basic built of Centos 6.5 server that is updated with the latest kernel and important security packages for this example. Once we have configured and installed the SFTP server, you will need a SFTP client application to test the connection. I often use Filezilla or WinScp as a alternative application.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Login via ssh to your Linux server and use the &lt;b&gt;su &lt;/b&gt;command to become root and start the package installation. At the picture below this is a simple first step.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL3ojpo78vZ4Em_BDqevOFg97lTS4T6CwHCg_93iFu95vD86fGDyD4b3MzRPK_lxjg13MkDna56FlXwQogWV0lfiZZWJ9pU-xKEbsmy4NLpXUOICcU35Bt2A683A8-c7OpE04ICsibXMVI/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL3ojpo78vZ4Em_BDqevOFg97lTS4T6CwHCg_93iFu95vD86fGDyD4b3MzRPK_lxjg13MkDna56FlXwQogWV0lfiZZWJ9pU-xKEbsmy4NLpXUOICcU35Bt2A683A8-c7OpE04ICsibXMVI/s1600/1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
After this issues a simple command to install the VSFTPD package on your linux server:&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;yum install vsftpd&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
After this command issued you should have the package installed and as an example on the next picture I have shown here.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghC_nYg3vgt9skIR_dlTv_HF3BU3OsqZOl9bMncCKvVBPBaJvCn4-vk65If4mILfDw9C_2TMqpJK8VjSJxodNo5KvkSMLWUtLY2DvbGT_O5VFFKWvhskEXXqTMJ8ta-9Ugv9zrK7iX3Osm/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghC_nYg3vgt9skIR_dlTv_HF3BU3OsqZOl9bMncCKvVBPBaJvCn4-vk65If4mILfDw9C_2TMqpJK8VjSJxodNo5KvkSMLWUtLY2DvbGT_O5VFFKWvhskEXXqTMJ8ta-9Ugv9zrK7iX3Osm/s1600/2.png" height="143" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Also for a public server, should be a FTP connection availlable if the client has no possibility to use the SFTP protocol with this software. Then we can install also these packages.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;yum install ftp&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Now a ftp server should be installed and default configured as an service on your Centos machine.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFR0gCVaWp-q8eWa7nhB6xotR-dEi1S4duUDsghl35DsdqOUauJBbb9-0bCCuAzL4Kf9Ez5GoVWBVQgGd5F446s7lY04D2PrORPUhsnEURCnJG6AFkHnZN92-QJgvzhcdhQqy7h0nbENGM/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFR0gCVaWp-q8eWa7nhB6xotR-dEi1S4duUDsghl35DsdqOUauJBbb9-0bCCuAzL4Kf9Ez5GoVWBVQgGd5F446s7lY04D2PrORPUhsnEURCnJG6AFkHnZN92-QJgvzhcdhQqy7h0nbENGM/s1600/3.png" height="164" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
BASIC VSFTPD CONFIGURATION&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
The default file for the configuration of this service is located under the /etc/vsftpd folder. I will use Nano editor to change the settings here.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;nano /etc/vsftpd/vsftpd.conf&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
The first item you should configure , is the option to disable anoymous login:&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;anonymous_enable = NO&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Next one is to enable local user logins with the command below:&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;locale_enable = yes&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Next very important configuration to uncomment and set is the chroot option. This option will make a possibility for users, only to use their dedicated home folders on the server, and not able to traverse over different folders. This is a good security practice.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;chroot_local_user=YES&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
So now bassically these are the most command and important settings to get the server up and running. You can fine tune the other settings , like change the default port, or certificates and etc. But this is not needed in this blog demontstration of basic secure server setttings.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
We should now restart the service and make it a startup one on boot time of the Centos server. We achieve this with two simple commands:&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div&gt;
&lt;i&gt;service vsftpd restart&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;chkconfig vsftpd on&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirxeUQALWZr1pgw1YJRA7GAiYdeJh4QVnVvz-zVtvbfIAcOVDoSS7KBeagSOO_DVwjuZ4F-ZEqW8qNpmcYf_6aXXYROiY0y6ZAKFdmzVR8Rl24NtuDdkqnuCDAFVWI-gWEuuftXeFVWIL8/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirxeUQALWZr1pgw1YJRA7GAiYdeJh4QVnVvz-zVtvbfIAcOVDoSS7KBeagSOO_DVwjuZ4F-ZEqW8qNpmcYf_6aXXYROiY0y6ZAKFdmzVR8Rl24NtuDdkqnuCDAFVWI-gWEuuftXeFVWIL8/s1600/4.png" height="136" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
That is all to it. Now we can test our connection with a SFTP or FTP client.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh73yW-Fk7GUSdDpwOwkgAzB25_jN9a1bP6zAgWFnWqUYTdXt6aLbC8fGwZNUPra31fHRK49-knY78a22F0HpZwOSHThzC_Y-bGiBnnqjCW4xPLFYgZ_yGxHooS7cDNo6LPLEXdaK_vjdW7/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh73yW-Fk7GUSdDpwOwkgAzB25_jN9a1bP6zAgWFnWqUYTdXt6aLbC8fGwZNUPra31fHRK49-knY78a22F0HpZwOSHThzC_Y-bGiBnnqjCW4xPLFYgZ_yGxHooS7cDNo6LPLEXdaK_vjdW7/s1600/5.png" height="163" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
I have used the Filezilla with a SFTP protocol and I have succesfully connected to my server via a secure channel.&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5qnnqspp4XvvtlK5afkAZq0eD37WKL60aCIMec_-LlA9qYT2U3BjFU3pwkM698rH8mF-IvtNi5q0GY4rPwyX0ZlOlhkeW5jAHJngpExj3gAn4VRghmo8a8i_93M78W7nfh1H86jjP0PsX/s1600/7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5qnnqspp4XvvtlK5afkAZq0eD37WKL60aCIMec_-LlA9qYT2U3BjFU3pwkM698rH8mF-IvtNi5q0GY4rPwyX0ZlOlhkeW5jAHJngpExj3gAn4VRghmo8a8i_93M78W7nfh1H86jjP0PsX/s1600/7.png" height="416" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Up and ready for receiving traffic. Now the users can enjoy security, performance and stability in your network.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Feel free to comment and suggest more topics.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL3ojpo78vZ4Em_BDqevOFg97lTS4T6CwHCg_93iFu95vD86fGDyD4b3MzRPK_lxjg13MkDna56FlXwQogWV0lfiZZWJ9pU-xKEbsmy4NLpXUOICcU35Bt2A683A8-c7OpE04ICsibXMVI/s72-c/1.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Flushing infected mail traffic from Postfix server</title><link>http://itstuffallaround.blogspot.com/2014/03/flushing-infected-mail-traffic-from.html</link><category>Linux</category><category>Postfix</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Sun, 2 Mar 2014 09:36:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-6993864905410885011</guid><description>&lt;h2 style="text-align: center;"&gt;
Flushing infected mail traffic from Postfix server&lt;/h2&gt;
&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
Postfix consists of a combination of server programs that run in the background, and client programs that are invoked by user programs or by system administrators.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
The Postfix core consists of several dozen server programs that run in the background, each handling one specific aspect of email delivery. Examples are the SMTP server, the scheduler, the address rewriter, and the local delivery server. For damage-control purposes, most server programs run with fixed reduced privileges, and terminate voluntarily after processing a limited number of requests. To conserve system resources, most server programs terminate when they become idle.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Client programs run outside the Postfix core. They interact with Postfix server programs through mail delivery instructions in the user's ~/.forward file, and through small "gate" programs to submit mail or to request queue status information.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Other programs provide administrative support to start or stop Postfix, query status information, manipulate the queue, or to examine or update its configuration files.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigddD3njAh43-wMJtmOtpWCBd2zQp3OBTRpRlN5EW_EWe-pbBv5Q7s7Qa5S8axuxN0JwwBq_S2y_47KvafPloQKHaQOBA94LrhB_s5cM_RAb99O_xHrD4yVV7185Q8QgSi5mMT91-AFXlN/s1600/postfix.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigddD3njAh43-wMJtmOtpWCBd2zQp3OBTRpRlN5EW_EWe-pbBv5Q7s7Qa5S8axuxN0JwwBq_S2y_47KvafPloQKHaQOBA94LrhB_s5cM_RAb99O_xHrD4yVV7185Q8QgSi5mMT91-AFXlN/s1600/postfix.png" height="224" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
If Postfix cannot deliver a message to a recipient it is placed in the deferred queue. &amp;nbsp;The queue manager will scan the deferred queue to see it if can place mail back into the active queue. &amp;nbsp;How often this scan occurs is determined by the queue_run_delay. &amp;nbsp;Postfix will scan the incoming queue at the same time as the deferred queue just to make sure that one does not take all the resources and so each can continue to move messages.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
The real question is, What is causing messages to be deferred? &amp;nbsp;One of the major reasons that messages are deferred is that your server is going to place mail to “unknown recipients” into the deferred queue if they do not have a legitimate user to go to.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
First thing that should be done to analyze the mails that are stuck in the queue is typing the &lt;b&gt;mailq&lt;/b&gt;&amp;nbsp;command. If you see a lot of mails in the queue shown in the output, than something fishy is going on on you server. Just looking on the mails, IT people should recognize the domain that has the most mails in the queue. When you find out the domain &lt;b&gt;example.com&lt;/b&gt;&amp;nbsp;than the next step to do is to run a bash script that will delete only those mails that are from the infected domain.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;#!/bin/bash&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;match="$1"&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;find /var/spool/postfix/deferred/*/ -type f -exec grep -l $match '{}' \; | xargs -n1 basename | xargs -n1 postsuper -d&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;find /var/spool/postfix/active/ -type f -exec grep -l $match '{}' \; | xargs -n1 basename | xargs -n1 postsuper -d&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
This simple scripts are using bash language to find the deferred and active mails from the user keyboard input on the CLI. After that the script is executing the postsuper -d command that is flushing the queue with that specific domain.&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;b style="font-style: italic;"&gt;match="$1" &lt;/b&gt;is a simple&amp;nbsp;regex that matched text by the first capturing group, in our case a user inputed domain.&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
After this the mail queue should be emptied with the infected mails and the server will have some freed up resources. Another faster or simple solution, if the mails are not important at the moment, is to flush the complete queue in the deferred folder.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
For this we have a simple command:&amp;nbsp;&lt;i&gt;postsuper -d ALL deferred&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Feel free to comment..&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigddD3njAh43-wMJtmOtpWCBd2zQp3OBTRpRlN5EW_EWe-pbBv5Q7s7Qa5S8axuxN0JwwBq_S2y_47KvafPloQKHaQOBA94LrhB_s5cM_RAb99O_xHrD4yVV7185Q8QgSi5mMT91-AFXlN/s72-c/postfix.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Server 2008 R2 as RADIUS for CISCO ASA VPN Clients</title><link>http://itstuffallaround.blogspot.com/2014/02/server-2008-r2-as-radius-for-cisco-asa.html</link><category>ASA</category><category>Microsoft</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Sat, 1 Feb 2014 13:44:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-2991073997071863941</guid><description>&lt;h2 style="text-align: center;"&gt;
Server 2008 R2 as RADIUS for CISCO ASA VPN Clients&lt;/h2&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
As in every Enterprise or a private Data Centar network one must use various of IT systems to insure the security of via meshed systems. The other day I implemented a Cisco 5520 Failover scenario and the main problem I had with the users, is how will they manage so many passwords for VPN, AD, Mail and etc. So I thought why not use Kerberos for VPN and simplify the tasks.&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
This easy done task I will explain as short and much I can. The main goal is to make Cisco ASA failover to use the Active Directory for authenticating the users against VPN policy.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-kwGwr2sNF7HnilyuwiTJAQl5Muw9dXTU6zH8nJU527-RtEhyphenhyphenzZqNygizTSw3MLBjfmdgFdrAxjRNVNGrDBrkFpbknXVGs6gEiHLXa_QGmRSejwRCRM8cuCysCcIJCqotq9l8sXY-DlqQ/s1600/123456.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-kwGwr2sNF7HnilyuwiTJAQl5Muw9dXTU6zH8nJU527-RtEhyphenhyphenzZqNygizTSw3MLBjfmdgFdrAxjRNVNGrDBrkFpbknXVGs6gEiHLXa_QGmRSejwRCRM8cuCysCcIJCqotq9l8sXY-DlqQ/s1600/123456.jpg" height="120" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Easiest way to configure ASA quick is using the ASDM utility. I use CLI only for initial interface and http commands , after that all is downstream.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQZPQhCBIyMx-Obq1DvjvJqBhRXtXGeLcmy-Yz97VfeJgaOfDQPReDM2j2ZYRhpbYALK3pordi6FI7pGqc-p60CIvlaDh9RfwOhnxMHAHhAgsor-ehGEOLbpSmmQda447g3k3qpp3vhm4o/s1600/Windows+Server+2008+Enterprise+Button+Banner_2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQZPQhCBIyMx-Obq1DvjvJqBhRXtXGeLcmy-Yz97VfeJgaOfDQPReDM2j2ZYRhpbYALK3pordi6FI7pGqc-p60CIvlaDh9RfwOhnxMHAHhAgsor-ehGEOLbpSmmQda447g3k3qpp3vhm4o/s1600/Windows+Server+2008+Enterprise+Button+Banner_2.png" height="141" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
First we need to configure an object:&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Using the &lt;b&gt;Firewall&lt;/b&gt;&amp;nbsp;section we expand Objects and select IP names. Then click ADD and describe the Radius server. After that we enter the IP address of the Intranet located Domain controller.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Next step is to define a &lt;b&gt;AAA&lt;/b&gt; Radius group:&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div&gt;
Click the Remote Access VPN section.&lt;/div&gt;
&lt;div&gt;
Expand AAA Setup and select AAA Server Groups.&lt;/div&gt;
&lt;div&gt;
Click the Add button to the right of the AAA Server Groups section.&lt;/div&gt;
&lt;div&gt;
Give the server group a name, like TEST-AD, and make sure the RADIUS protocol is selected.&lt;/div&gt;
&lt;div&gt;
Accept the default for the other settings.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
And click OK.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Next step is to add our &lt;b&gt;RADIUS&lt;/b&gt; server to this created group:&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Select the server group created in the step above.&lt;/div&gt;
&lt;div&gt;
Click the Add button to the right of Servers in the Select Group.&lt;/div&gt;
&lt;div&gt;
Under the Interface Name select the interface on the ASA that will have access to the RADIUS server, most likely inside.&lt;/div&gt;
&lt;div&gt;
Under Server Name or IP Address enter the IP Name you created for the RADIUS server above.&lt;/div&gt;
&lt;div&gt;
Skip to the Server Secret Key field and create a complex password. Make sure you document this as it is required when configuring the RADIUS server. Re-enter the secret in the Common Password field.&lt;/div&gt;
&lt;div&gt;
Leave the rest of the settings at the defaults and click Ok.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
To enable RADIUS on &lt;b&gt;Server 2008&lt;/b&gt; we must add a role:&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Connect to the Windows Server 2008 server and launch Server Manager.&lt;/div&gt;
&lt;div&gt;
Click the Roles object and then click the Add Roles link on the right.&lt;/div&gt;
&lt;div&gt;
Click Next on the Before You Begin page.&lt;/div&gt;
&lt;div&gt;
Select the Network Policy and Access Services role and click Next.&lt;/div&gt;
&lt;div&gt;
Under Role Service select only the Network Policy Server service and click Next.&lt;/div&gt;
&lt;div&gt;
Click Install.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
After launching the NPS tool right-click on the entry NPS(Local) and click the Register Server in Active Directory. Follow the default prompts.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
We need to define a Radius &lt;b&gt;CLIENT&lt;/b&gt; on Server 2008 for our ASA Cluster:&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Right-click on RADIUS Clients and select New RADIUS Client.&lt;/div&gt;
&lt;div&gt;
Create a Friendly Name for the ASA device. I used “CiscoASA” but if you had more than one you might want to make it more unique and identifiable. Make sure you document the Friendly Name used as it will be used later in some of the policies created.&lt;/div&gt;
&lt;div&gt;
Enter the Server Secret Key specified on during the ASA configuration in the Shared secret and Confirm shared secret field.&lt;/div&gt;
&lt;div&gt;
Leave the default values for the other settings and click OK. See Figure 1 for all the complete RADIUS Client properties.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlgkczsY8xSn2-SvXk0O5nYhjZH3oPRjx23wT-8fFi__F34YMlzXawegd9RVwBBWCbt9Uwiwsw5_wI9JdQKItecOG7L4Z19sXrGixhJNJ9CYoU4xHboI2xmM8TXoI9b7aliOlv5iLkl9lE/s1600/asa223.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlgkczsY8xSn2-SvXk0O5nYhjZH3oPRjx23wT-8fFi__F34YMlzXawegd9RVwBBWCbt9Uwiwsw5_wI9JdQKItecOG7L4Z19sXrGixhJNJ9CYoU4xHboI2xmM8TXoI9b7aliOlv5iLkl9lE/s1600/asa223.png" height="400" width="351" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;b&gt;Connection Request Policy&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Expand the Policies folder.&lt;/div&gt;
&lt;div&gt;
Right-click on the Connection Request Policies and click New.&lt;/div&gt;
&lt;div&gt;
Set the Policy Nameto something meaningful. I used CiscoASA because this policy is geared specifically for that RADIUS client. Leave the Type of network access server as Unspecified and click Next.&lt;/div&gt;
&lt;div&gt;
Under Conditions click Add. Scroll down and select the Client Friendly Name condition and click Add…&lt;/div&gt;
&lt;div&gt;
Specify the friendly name that you used when creating the RADIUS Client above. Click OK and Next.&lt;/div&gt;
&lt;div&gt;
On the next two pages leave the default settings and click Next.&lt;/div&gt;
&lt;div&gt;
Under the Specify a Realm Name select the Attribute option on the left. From the drop down menu next to Attribute: on the right select User-Name. Click Next again.&lt;/div&gt;
&lt;div&gt;
Review the settings on the next page and click Finish.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Create a Network Policy&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Right-click the Network Policy folder and click New.&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Set the Policy Name to something meaningful. Leave the Type of network access server as Unspecified and click Next.&lt;/div&gt;
&lt;div&gt;
Under Conditions click Add.&lt;/div&gt;
&lt;div&gt;
Add a UsersGroup condition to limit access to a specific AD user group. You can use a generic group like Domain Users or create a group specifically to restrict access.&lt;/div&gt;
&lt;div&gt;
Add a Client Friendly Name condition and again specify the Friendly Name you used for your RADIUS client.&lt;/div&gt;
&lt;div&gt;
Click Next. Leave Access granted selected and click Next again.&lt;/div&gt;
&lt;div&gt;
(Important Step) On the authentication methods leave the default selection and add Unencrypted authentication (PAP, SPAP).&lt;/div&gt;
&lt;div&gt;
Accept the default Constraints and click Next.&lt;/div&gt;
&lt;div&gt;
Accept the default Radius Settings and click Next. Review the settings and click Finish.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
Restart the Network Policy Server service.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
The last thing left is to &lt;b&gt;Test and Save&lt;/b&gt; the config.&lt;/div&gt;
&lt;div&gt;
If necessary re-launch the ASDM utility.&lt;/div&gt;
&lt;div&gt;
Return to Configuration -&amp;gt; Remote Access VPN -&amp;gt; AAA Setup -&amp;gt; AAA Server Groups.&lt;/div&gt;
&lt;div&gt;
Select the new Server Group you created.&lt;/div&gt;
&lt;div&gt;
From the Servers in the Selected Group section highlight the server you created. Click the Test button on the right.&lt;/div&gt;
&lt;div&gt;
Select the Authentication radio button. Enter the Username and Password of a user that meets the conditions specified in the Network Policy created above then click OK.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Feel free to comment.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-kwGwr2sNF7HnilyuwiTJAQl5Muw9dXTU6zH8nJU527-RtEhyphenhyphenzZqNygizTSw3MLBjfmdgFdrAxjRNVNGrDBrkFpbknXVGs6gEiHLXa_QGmRSejwRCRM8cuCysCcIJCqotq9l8sXY-DlqQ/s72-c/123456.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Security ethical hacking checklist</title><link>http://itstuffallaround.blogspot.com/2014/01/security-ethical-hacking-checklist.html</link><category>Ethical Hacking</category><category>Pentest</category><category>Security</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Mon, 6 Jan 2014 13:28:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-1340712860545848063</guid><description>&lt;h2 style="text-align: center;"&gt;
Security ethical hacking checklist&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
We can define an Ethical Hacking Expert as a person who has many skills in many segments of Information Technology. On behalf of the owners of the Information Technology Systems an expert in Network and Systems attacks the complete organization. The main goal is to find vulnerabilities that would a malicious person use to exploit to gain important informations.&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3T4BljPYMCqBmvGSK-Hv9UJBuA7WqkCkiATyWcgb9IyDMu7w9L-mTPWqqCOwmtLYJqqmns_X2Lp9ajN6Pj8o5sOAtIld75cL4NSN-xJHrI81WmgXDDgSqxtmQ6q40LI6ZquRrg2n6bCg_/s1600/whitehat.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3T4BljPYMCqBmvGSK-Hv9UJBuA7WqkCkiATyWcgb9IyDMu7w9L-mTPWqqCOwmtLYJqqmns_X2Lp9ajN6Pj8o5sOAtIld75cL4NSN-xJHrI81WmgXDDgSqxtmQ6q40LI6ZquRrg2n6bCg_/s1600/whitehat.jpg" height="200" width="193" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
These tasks include Penetration testing, risk assessment and intrusion testing. Many companies also involve some code reviewers to scan the web application code. Complete set of tasks that are involved in, for example a penetration test, are useful to find weaknesses in open source code that is used often in application development. Developers often are too busy in creating the applications and contributing to the opensource community, so the security concerns are not always highlighted.&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
These situations require an expertise from people that can objectively look at the code and to verify the completion of the cycles needed for application implementation.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I will explain some basic steps in my White Hat general checklist that every IT security concerned people should know and use.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3&gt;
RECONNAISSANCE&lt;/h3&gt;
&lt;div style="text-align: justify;"&gt;
This is a military term that was used to seek out the intentions and plans of the enemy, using various methods to find out capabilities and composition of the enemy. In ethical hacking world this word is used for information gathering of the target. This is useful to find the weakest spot in the target Information Technology system to exploit and use it for the final goal.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
There is also another side of &amp;nbsp;&lt;i&gt;footprinting&lt;/i&gt;&amp;nbsp;that is used for protecting the system instead of attacking it. First of the basic methods of information gathering is:&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;b&gt;PING the remote target system&lt;/b&gt;&amp;nbsp;to gather basic IP info.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
For example Start-Run-CMD&amp;gt; &amp;nbsp;&lt;i&gt;ping www.google.com&lt;/i&gt; &amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Or some other range of public IP addresses to see if there are some hosts that are alive on the other side. This is a good starting point for every information gathering.&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;b&gt;PORT scanning &lt;/b&gt;of the remote services running on the target system. These TCP scans can be individual or we can scan a range of ports to identify different services. We can use a great tool found on www.nmap.org&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
An example of a command line scan: &amp;nbsp; NMAP -T4 -A -v scanme.nmap.org&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;b&gt;Target public information&lt;/b&gt;&amp;nbsp;such as company info, telephone numbers, email addresses and many other are very useful to create a big picture. This can be done via &lt;b&gt;whois &lt;/b&gt;lookups of the company domain and gathering info from DNS protocol. There are some great online sites for this&amp;nbsp;&lt;a href="http://www.uwhois.com/"&gt;http://www.uwhois.com/&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;b&gt;EMAIL tracking&lt;/b&gt;&amp;nbsp;is a good way to analyze the email header which will provide us the informations on the IP stack of the mail servers and other gateway functionalities. A good application that can be used for this is the EmailTracker that can be found on&amp;nbsp;&lt;a href="http://www.emailtrackerpro.com/"&gt;http://www.emailtrackerpro.com/&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;b&gt;Network Connections&lt;/b&gt;&amp;nbsp;from your computer or from the target systems can be useful to find out incoming and outgoing connections that are persistent and important for the target users. A free command utility called &lt;b&gt;netstat &lt;/b&gt;is the best and fastest way to achieve this.&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
An example command line: &amp;nbsp; &lt;i&gt;netstat -ano&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;b&gt;Explore the internet libraries &lt;/b&gt;to find out the history of the web page is sometimes important. Some URLs are useful in this information gathering.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;a href="https://archive.org/"&gt;https://archive.org/&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;a href="http://www.thememoryhole.org/"&gt;http://www.thememoryhole.org/&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;b&gt;Company location &lt;/b&gt;can be found using Google Earth. This is important if the company has IT storage rooms in many countries and from a network standpoint, a clear picture on GeoIP locations.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;b&gt;Network nodes&lt;/b&gt;&amp;nbsp;displaying will show us the information on various path we can get to the target system. This is useful to find out the most optimized way to enumerate services in the target systems. A cool application for this is called NeoTrace and can be found on this link:&amp;nbsp;&lt;a href="http://neotrace-pro.en.softonic.com/"&gt;http://neotrace-pro.en.softonic.com/&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;b&gt;DNS Enumeration&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
By Enumerating DNS it is possible to get some important public (May be sometime Private information too) information such as Server name, Server IP address, Sub-domain etc.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Useful PERL script called &lt;b&gt;dnsenum.pl&lt;/b&gt;&amp;nbsp;can be found on this &lt;a href="http://code.google.com/p/dnsenum/downloads/detail?name=dnsenum-1.2.2.tar.gz&amp;amp;can=2&amp;amp;q=" target="_blank"&gt;URL&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3&gt;
SCANNING&lt;/h3&gt;
&lt;div style="text-align: justify;"&gt;
In general we have three types of scanning:&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;ul&gt;
&lt;li&gt;Port scanning&lt;/li&gt;
&lt;li&gt;Network scanning&lt;/li&gt;
&lt;li&gt;Vulnerability scanning&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Active information gathering produces more details about your network and helps you see your systems from an attacker’s perspective. We can see which server systems are alive and what services they are providing for the target users. The important fact is the system operating systems and the architecture that they are using.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I can number some types of PORT scanning methods:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
- Vanilla: the scanner attempts to connect to all 65,535 ports&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
-&amp;nbsp;Fragmented packets: the scanner sends packet fragments that get through simple packet filters in a firewall&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
- UDP: the scanner looks for open UDP ports&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
- Sweep: the scanner connects to the same port on more than one machine&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
-&amp;nbsp;Stealth scan: the scanner blocks the scanned computer from recording the port scan activities&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Network Scanning is the process of examining the activity on a network, which can include monitoring data flow as well as monitoring the functioning of network devices. Network Scanning serves to promote both the security and performance of a network. Network Scanning may also be employed from outside a network in order to identify potential network vulnerabilities.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Vulnerability scanning employs software that seeks out security flaws based on a database of known flaws, testing systems for the occurrence of these flaws and generating a report of the findings that an individual or an enterprise can use to tighten the network's security.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;b&gt;SUBNET Information &lt;/b&gt;whether public or private is very important for time consuming security testing methods. A very useful tool for gathering the subnet information is the AngryIP application. This application is available on this location&amp;nbsp;&lt;a href="http://angryip.org/w/Home"&gt;http://angryip.org/w/Home&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
There are some useful tools used for target system scannings:&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;b&gt;Mcafee superscan tool&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
http://www.mcafee.com/us/downloads/free-tools/superscan.aspx&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;b&gt;Network port scanning&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div&gt;
Scan network ports with &lt;a href="http://www.netscantools.com/" target="_blank"&gt;NetScanTools &lt;/a&gt;Pro or Nmap.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;UDP &lt;/b&gt;ports scanner, very fast and powerfull &lt;a href="http://ntsecurity.nu/toolbox/wups/" target="_blank"&gt;WUPS&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;b&gt;Unicornscan &lt;/b&gt;is an attempt at a User-land Distributed TCP/IP stack for information gathering and correlation&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
The app can be found on http://www.unicornscan.org/&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3&gt;
&lt;/h3&gt;
&lt;h3&gt;
ENUMERATION&lt;/h3&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Using the previous gathered information the attacker usually start scanning against the victim such as Port scanning, Banner Grabbing, Vulnerability Scanning, Finding Username/Emails address. This is usually active attack(May get detected by IDs or may get blocked by Firewalls.&lt;/div&gt;
&lt;div&gt;
Enumeration is the first attack on target network; Enumeration is a process to gather the information about user names, machine names, network resources, shares and services ; Enumeration makes a fixed active connection to a system&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Null session - &lt;/b&gt;exploitation of Windows &lt;b&gt;SMB&amp;nbsp;&lt;/b&gt;communications network protocols.&lt;/div&gt;
&lt;div&gt;
We can exploit a remote machine without any credentials using: &lt;i&gt;net use \\ip address\\IPC$ ""/u:""&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
If we have only one authenticated user credentials we can use this exploit for many machines in the domain. Also a good tool for enumeration these weak spots is enum4linux.pl found on this &lt;a href="http://www.portcullis-security.com/tools/free/enum4linux-0.7.0.tar.gz" target="_blank"&gt;url&lt;/a&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;NetBios/over/TCP/IP&lt;/b&gt;&amp;nbsp;can be used with a integrated tool &lt;b&gt;nbtstat&lt;/b&gt;&amp;nbsp;that will display protocol statistics and current TCP/IP connections. We can also provide our information database with the MAC address.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
Usage: &amp;nbsp; nbtstat -A 192.168.1.1&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;FTP Enumeration&lt;/b&gt;&amp;nbsp;- a crafty tool on NIX is useful for enumerating the TCP port 21 with useful information like server version and the &lt;b&gt;list &lt;/b&gt;of users on the target system.&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
# perl -MCPAN -e shell&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;cpan&amp;gt; install Getopt::Std &amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
This is used for the installation. And the usage on the target system&lt;/div&gt;
&lt;div&gt;
Usage: ftp-user-enum.pl [options] (-u username|-U file-of-usernames) (-t host|-T file-of-targets)&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;TELNET&lt;/b&gt; to a service on different number of ports to see if a service is running on the remote server.&lt;/div&gt;
&lt;div&gt;
Usage: telnet &amp;lt;IP or FQDN&amp;gt; &amp;lt;port&amp;gt;&lt;/div&gt;
&lt;div&gt;
List of ports for services can be found on this &lt;a href="http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers%20" target="_blank"&gt;URL&lt;/a&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
A list of some useful tools used for enumeration:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
IP Tools&lt;/div&gt;
&lt;div&gt;
&lt;a href="http://www.ks-soft.net/ip-tools.eng/downpage.htm"&gt;http://www.ks-soft.net/ip-tools.eng/downpage.htm&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
SoftPerfect Network Scanner is a free multi-threaded IP, NetBIOS and SNMP scanner with a modern interface and many advanced features. It is intended for both system administrators and general users interested in computer security. The program pings computers, scans for listening TCP/UDP ports and displays which types of resources are shared on the network, including system and hidden ones.&lt;/div&gt;
&lt;div&gt;
&lt;a href="http://www.softperfect.com/products/networkscanner/"&gt;http://www.softperfect.com/products/networkscanner/&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
SomarSoft's DumpSec is a (free) security auditing program for Microsoft Windows NT/2000. It dumps the permissions (DACLs) and audit settings (SACLs) for the file system, registry, printers and shares in a concise, readable format, so that holes in system security are readily apparent. DumpSec also dumps user, group and replication information. DumpSec is a must-have product for Windows NT systems administrators and computer security auditors.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;a href="https://www.enisa.europa.eu/activities/cert/support/chiht/tools/dumpsec-dump-windows-acl-and-audit-settings"&gt;https://www.enisa.europa.eu/activities/cert/support/chiht/tools/dumpsec-dump-windows-acl-and-audit-settings&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Enumerate some devices like routers, printers, servers, backup devices and similar with default passwords. Many useful passwords can be found on google searches, and one of the list can be found on this &lt;a href="http://www.phenoelit-us.org/dpl/dpl.html" target="_blank"&gt;URL&lt;/a&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Netcat is a simple networking utility which reads and writes data across network connections using the TCP/IP protocol. It's a wonderful tool for debugging all kinds of network problems. It allows you to read and write data over a network socket just as simply as you can read data from stdin or write to stdout. I have put together a few examples of what this can be used to accomplish.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Establishing a connection and getting some data over HTTP:#&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
nc example.com 80&lt;/div&gt;
&lt;div&gt;
GET / HTTP/1.0&lt;/div&gt;
&lt;div&gt;
&amp;lt;HTML&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;lt;!-- site's code here --&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;lt;/HTML&amp;gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3&gt;
HACKING&lt;/h3&gt;
&lt;div&gt;
When above steps has be done the attacker start exploiting the all found vulnerability which may lead to compromise the System or an website.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
There are of four types of password attack:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
1. Passive online attack - man in the middle, sniffing and similar&lt;/div&gt;
&lt;div&gt;
2. Active online attack - password guessing&lt;/div&gt;
&lt;div&gt;
3. Offline attack - brute force attack, directory attack and hybrid attacks&lt;/div&gt;
&lt;div&gt;
4. Non technical attack - social engineering&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
A &lt;b&gt;rootkit&lt;/b&gt; is a stealthy type of software, typically malicious, designed to hide the existence of certain processes or programs from normal methods of detection and enable continued privileged access to a computer.[1] The term rootkit is a concatenation of "root" (the traditional name of the privileged account on Unix operating systems) and the word "kit" (which refers to the software components that implement the tool.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Steganography&lt;/b&gt; (Listen) is the art and science of encoding hidden messages in such a way that no one, apart from the sender and intended recipient, suspects the existence of the message. It is a form of security through obscurity.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
An ethical hacker should equip himself with a database and dictionaries of default password. Some useful URLs can be a good starting point.&lt;br /&gt;
&lt;br /&gt;
http://www.defaultpassword.com/?char=&amp;amp;action=dpl&lt;br /&gt;
http://www.cirt.net/passwords&lt;br /&gt;
http://www.virus.org/default-password%20&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;LOPTHCRACK &lt;/b&gt;can be used as a useful tool to recover passwords&lt;br /&gt;
Can be found on this &lt;a href="http://1337x.org/torrent/42867/0/" target="_blank"&gt;URL&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;HACKING Windows Server &lt;/b&gt;administrator password is a powerful method of gaining access of target systems. Windows servers use the SAM database to encrypt and store passwords. There are many tools to exploit these passwords. One of them is offline NT password recovery tool that can be found on this &lt;a href="http://pogostick.net/~pnh/ntpasswd/bootdisk.html" target="_blank"&gt;URL&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Keyloggers &lt;/b&gt;are useful software tools that log every keystroke that a user generates on the keyboard. These stealth tools are useful to capture credentials on target systems.&lt;br /&gt;
Free versions can be found on this &lt;a href="http://download.cnet.com/Free-Keylogger-Pro/3000-2162_4-75886072.html" target="_blank"&gt;URL&lt;/a&gt;&amp;nbsp;More stealthy keyloggers are &lt;b&gt;USB&lt;/b&gt;&amp;nbsp;ones that hold the keylogger software on the USB stick, that can be manipulated inside the organization and can send credentials outside the corporate networks. Useful software can be downloaded from this &lt;a href="http://www.keyghost.com/USB-Keylogger.htm" target="_blank"&gt;URL&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Scapy&lt;/b&gt; is a powerful interactive packet manipulation program. It is able to forge or decode packets of a wide number of protocols, send them on the wire, capture them, match requests and replies, and much more.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Openpuff &lt;/b&gt;is a opensource stganography tool that can be used to create hidden scripts and apps inside cool extensions like PDF and JPG. Can be found on this &lt;a href="http://embeddedsw.net/zip/OpenPuffv340.zip" target="_blank"&gt;URL&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Lynis&lt;/b&gt; is an auditing tool for Unix/Linux. It performs a security scan and determines the hardening state of the machine. Any detected security issues will be provided in the form of a suggestion or warning. Beside security related information it will also scan for general system information, installed packages and possible configuration errors.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Yersinia&lt;/b&gt; is a network hacking tool designed to take advantage of the weaknesses in some network protocols. It pretends to be a framework for analyzing deployed networks and systems. It implements a number of attacks for the following protocols: STP, CDP, DTP, DHCP, VTP, ISL and etc.&lt;br /&gt;
&lt;br /&gt;
The &lt;b&gt;Metasploit&lt;/b&gt; Framework is an open-source development platform for creating security tools and exploits. The framework is used to test systems, verify patch installations, and perform regression testing. The framework allows users to configure exploit modules and test systems against attack.&lt;br /&gt;
&lt;br /&gt;
The &lt;b&gt;PsEXEC &lt;/b&gt;tool allows white hat people to remote execute applications&amp;nbsp;and processes on target systems. It can launch interactive command prompts on remote computers.&lt;br /&gt;
Syntax: &amp;nbsp; &amp;nbsp; &amp;nbsp; psexec \\computer[,computer[,..] [options] command [arguments]&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;Core Impact&lt;/b&gt; is a penetration-testing tool for testing security threats. It allows systems administrators to test&lt;br /&gt;
security patches, network infrastructure, and system upgrades before an attacker does. It is frequently updated,so it is likely to stay ahead of new exploits.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Ratproxy &lt;/b&gt;is a semiautomated and largely passive Web application security audit tool. It detects and annotates potential problems and security-relevant design patterns based on the observation of existing and user-initiated traffic. It does not generate a high volume of traffic, taking very little bandwidth.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this blog I tried to create a small checklist of tools I use , and some of the I have skipped (to be continued). Also the checklist methodology I think will be a good starting point for enthusiastic people that are concerned for the security of their IT systems.&lt;br /&gt;
&lt;br /&gt;
To be continued ...&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3T4BljPYMCqBmvGSK-Hv9UJBuA7WqkCkiATyWcgb9IyDMu7w9L-mTPWqqCOwmtLYJqqmns_X2Lp9ajN6Pj8o5sOAtIld75cL4NSN-xJHrI81WmgXDDgSqxtmQ6q40LI6ZquRrg2n6bCg_/s72-c/whitehat.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Check status of IMAP server</title><link>http://itstuffallaround.blogspot.com/2013/12/check-status-of-imap-server.html</link><category>Linux</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Sun, 29 Dec 2013 05:22:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-9016115828766490591</guid><description>&lt;h2 style="text-align: center;"&gt;
Check status of IMAP server&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
The Internet Message Access Protocol (commonly known as IMAP) is an Application Layer Internet protocol that allows an e-mail client to access e-mail on a remote mail server. The current version, IMAP version 4 revision 1 (IMAP4rev1), is defined by RFC 3501. An IMAP server typically listens on well-known port 143.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2qbfpGqLuenhmnnH5OqVE1cwrap1FMyXtDGBs-QMvh27tgYxxreezeubGFGjlTAEUpYLehsOBHafbiA9zkfsu8K-k0CkEaVFbBQyYbDnbZU8UCyYO_GYNkRu2p9kBEFmluSoNzSL9r2tR/s1600/IMAP.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2qbfpGqLuenhmnnH5OqVE1cwrap1FMyXtDGBs-QMvh27tgYxxreezeubGFGjlTAEUpYLehsOBHafbiA9zkfsu8K-k0CkEaVFbBQyYbDnbZU8UCyYO_GYNkRu2p9kBEFmluSoNzSL9r2tR/s1600/IMAP.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
I had configured a Dovecot server with IMAP status, for many users , so I needed a mechanism to check if the server is responding on client requests during the high traffic. I wanted to do this using a Cron job and a simple script. This script will telnet to the IMAP port on the Linux server and check the status every 60 seconds. This is how often I configured the Cron job, it can be configured on every 5 minutes or so.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Now let us take a look on this simple code I wrote:&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;#!/bin/bash&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;#http://itstuffallaround.blogspot.com/&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;#program to check if connection is possible with Dovecot and log errors and success full connections&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;if telnet localhost 143 &amp;lt;/dev/null 2&amp;gt;&amp;amp;1 | grep -q Escape; then&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&amp;nbsp; echo "Connected Dovecot on $(date)" &amp;gt;&amp;gt; DOVSTATUS.txt&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;else&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&amp;nbsp; echo "No connection to Dovecot on $(date)" &amp;nbsp;&amp;gt;&amp;gt; DOVSTATUS.txt&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;fi&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
The simple BASH language script is constructed of a single loop, that telnets to port 143 and returns the status of the service to a dovstatus.txt file.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
The parameter /dev/null 2&amp;gt;&amp;amp;1 was very useful to me, because it will disable returning the on screen prompt for action on telnet, and Escape the login sequence because it is not neccessary, it will redirect both the output and the error streams. Even if your program writes to stderr, that output will not be shown. After this rename the file as .sh and add the execute perrmissions on it. Configure it as a cron job and wait for the results in the dovstatus.txt file.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Feel free to code more!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2qbfpGqLuenhmnnH5OqVE1cwrap1FMyXtDGBs-QMvh27tgYxxreezeubGFGjlTAEUpYLehsOBHafbiA9zkfsu8K-k0CkEaVFbBQyYbDnbZU8UCyYO_GYNkRu2p9kBEFmluSoNzSL9r2tR/s72-c/IMAP.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Improved Linux DDOS detection program</title><link>http://itstuffallaround.blogspot.com/2013/12/improved-linux-ddos-detection-program.html</link><category>Bash</category><category>Linux</category><category>Security</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Wed, 4 Dec 2013 08:02:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-7318905970161218542</guid><description>&lt;h2 style="text-align: center;"&gt;
Improved Linux DDOS detection program&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
With a lot of help with some friend on the Linux comunity, I have improved the DDOS detection program on Linux systems. This BASH code gives the IT people possibility to fine list what is currently going on at their servers. And what is more important where from.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
The code presented in the following blog is not to be used in loops of any sort becuase it would deny the admin resources to log on.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div&gt;
&amp;nbsp;&lt;i&gt;&lt;b&gt;#Zeljko Milinovic - http://itstuffallaround.blogspot.com/&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;#Cached lookup of ddos whois IP sockets&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;#v1.1&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;#!/bin/bash&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;cachefile="$HOME/ddostestercache"&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;# return 0 if address is to be filtered from the processed&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;filter()&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;{&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;case "$1" in&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;0.* | 127.* | 10.* | 172.1[6-9].* | 172.2[0-9].* | 172.3[0-1].* | 192.168.* | 169.254.*)&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;return 0&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;;;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;esac&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;return 1&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;}&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;remote_ips()&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;{&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;# print only IPv4 addresses&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;netstat -tun4 | awk '/:/ {gsub(/:.*/,"",$5);print $5}' | sort -n | uniq -c&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;}&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;get_country()&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;{&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;local country=$(sed -nr "s/^$1 (.*)/\1/p" $cachefile 2&amp;gt;/dev/null)&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;if [ -z "$country" ];then&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;# some queries produce multiple lines so for now use only the first line..&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;country=$(whois "$1" | sed -nr 's/^country:[[:space:]]+(.*)/\1/ip' | head -1)&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;country=${country:-unknown}&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;# cache search result for future use&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;echo "$1 $country" &amp;gt;&amp;gt; $cachefile&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;fi&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;# let's not print the text "unknown" to screen&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;[ "$country" = "unknown" ] &amp;amp;&amp;amp; unset country&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;echo "$country"&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;}&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;remote_ips | while read count ip;do&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;if ! filter $ip;then&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;echo "$count $ip $(get_country $ip)"&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;fi&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&amp;nbsp;done&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
And finally the output for the script:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;1 50.31.xxx.xxx US&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;9 98.28.xxx.xxx DK&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;1 109.12.xxx.xxx BA&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
As we can see, in the output we have 3 IP addresses, numbered, listed with concurrent connections , and their country origin. This is very useful to detect where from is the attack, and to mitigate fast.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Feel free to code more and comment.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Linux Security script to determine DDOS origin location</title><link>http://itstuffallaround.blogspot.com/2013/11/linux-security-script-to-determine-ddos.html</link><category>Bash</category><category>Linux</category><category>Security</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Sat, 30 Nov 2013 13:21:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-240412578883071033</guid><description>&lt;h2 style="text-align: center;"&gt;
Linux Security script to determine DDOS origin location&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
In computing, a denial-of-service attack (DoS attack) or distributed denial-of-service attack (DDoS attack) is an attempt to make a machine or network resource unavailable to its intended users. Although the means to carry out, motives for, and targets of a DoS attack may vary, it generally consists of efforts to temporarily or indefinitely interrupt or suspend services of a host connected to the Internet.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
On various Nix server setups we are always exposed to the DDOS attacks from various other similar setups or intended use. Often in some cases our server is used as a Botnet machine to exploit resources on other systems.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvgBoqDSRCCwviiBsx1EwPN0rejfKi1DLTQy7O8jw2f7q4YjgXfJJI0U3in59fsyhX9LqlK8BucLMj-pg-JSlH9Q57683oMHTuX5UvLQ6fn4v10bRfFKC2lFsOSy8iLzZ_xWwofsjVgSXN/s1600/d9F4NgH.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvgBoqDSRCCwviiBsx1EwPN0rejfKi1DLTQy7O8jw2f7q4YjgXfJJI0U3in59fsyhX9LqlK8BucLMj-pg-JSlH9Q57683oMHTuX5UvLQ6fn4v10bRfFKC2lFsOSy8iLzZ_xWwofsjVgSXN/s200/d9F4NgH.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;
&lt;br /&gt;
These attacks can be verified from the shell in a form of many open sockets from one or more IP addresses. Often these open sockets are more than 150 , which is not normal. Many IT people are using a DDOS prevention scripts to ban those IP addresses. I stumbled upon a request from a friend to write a script that will tell us the Country of attack origin. This was always missing in our troubleshooting.&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
So I have written a small and useful script, that is a combination of often used Netstat and Whois commands that can be found online. Also similar script code can be found on the internet, and people can adjust the code to their needs. I needed a script that will associate and display the origin of country and the IP socket combination.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;
Code&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="color: red;"&gt;&lt;b&gt;#!/bin/bash&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="color: red;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="color: red;"&gt;&lt;b&gt;{&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="color: red;"&gt;&lt;b&gt;cat=$( netstat -ntu &amp;nbsp;| &amp;nbsp;grep ':' &amp;nbsp;| &amp;nbsp;awk '{print $5}' &amp;nbsp;| &amp;nbsp;sed 's/::ffff://' &amp;nbsp;| &amp;nbsp;cut -f1 -d ':' &amp;nbsp;| &amp;nbsp;sort &amp;nbsp;| &amp;nbsp;sort -nr | less);&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="color: red;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="color: red;"&gt;&lt;b&gt;for i in $cat; do&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="color: red;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="color: red;"&gt;&lt;b&gt;Country=$( whois $i | grep -i Country | awk '{print $2}' );&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="color: red;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="color: red;"&gt;&lt;b&gt;echo "Land+IP= &amp;nbsp;$Country $i ";&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="color: red;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="color: red;"&gt;&lt;b&gt;done;&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="color: red;"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
end of code.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
To elaborate more on code I will explain the details. I am using the Bash shell scripting, which is very common. This code is using a Netstat command from the classic and tuned ddos Deflate script that is common for fighting DDOS attacks.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;netstat -ntu &amp;nbsp;| &amp;nbsp;grep ':' &amp;nbsp;| &amp;nbsp;awk '{print $5}' &amp;nbsp;| &amp;nbsp;sed 's/::ffff://' &amp;nbsp;| &amp;nbsp;cut -f1 -d ':' &amp;nbsp;| &amp;nbsp;sort &amp;nbsp;| &amp;nbsp;sort -nr | less&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
This command gives us the output of IP sockets and we print them out using the &lt;a href="http://en.wikipedia.org/wiki/AWK" target="_blank"&gt;AWK&lt;/a&gt;&amp;nbsp;for text processing. I have attached the sed switch to replace the empty addresses and space with null ffff value.&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
The sort and less switches are helpful for sorting and properly displaying the addresses. I have put this into on &lt;i&gt;CAT &lt;/i&gt;function and defined this concencated output with a $ sign as a variable.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
The variable is further used for a loop that is needed for the WHOIS command which will tel use the Country of origin. Classic for loop is using a i for the increment value.&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;Country=$( whois $i | grep -i Country | awk '{print $2}' );&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
If we use the whois command with the grep function for the Contry it will only display us the Country of origin. So I have used this command with the incremented concencated display in the loop.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Simple enough we get a display of current IP sockets with Country of origin:&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div&gt;
&lt;i&gt;Land+IP= &amp;nbsp;BA 71.222.xxx.xxx&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;Land+IP= &amp;nbsp;BA 71.222.xxx.xxx&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;Land+IP= &amp;nbsp;BA 71.222.xxx.xxx&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;Land+IP= &amp;nbsp;BA 71.222.xxx.xxx&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;Land+IP= &amp;nbsp;IT 88.138.xxx.xxx&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;Land+IP= &amp;nbsp;IT 88.138.xxx.xxx&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;Land+IP= &amp;nbsp;IT 88.138.xxx.xxx&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;Land+IP= &amp;nbsp;IT 88.138.xxx.xxx&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;Land+IP= &amp;nbsp;BA 61.38.xxx.xxx&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;Land+IP= &amp;nbsp;BA 61.38.xxx.xxx&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;Land+IP= &amp;nbsp;BA 61.38.xxx.xxx&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;Land+IP= &amp;nbsp;BA 61.38.xxx.xxx&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;Land+IP= &amp;nbsp;BA 61.38.xxx.xxx&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So this output will generate all the Sockets, and if we see many exact same sockets from one Country we can pinpoint the location and origin from the attack. Script can be more fine tuned so everyone is welcome.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Feel free to code.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvgBoqDSRCCwviiBsx1EwPN0rejfKi1DLTQy7O8jw2f7q4YjgXfJJI0U3in59fsyhX9LqlK8BucLMj-pg-JSlH9Q57683oMHTuX5UvLQ6fn4v10bRfFKC2lFsOSy8iLzZ_xWwofsjVgSXN/s72-c/d9F4NgH.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Configure Corefig as a free managament tool for Hyper-V 2012</title><link>http://itstuffallaround.blogspot.com/2013/11/configure-corefig-as-free-managament.html</link><category>Microsoft</category><category>Virtualization</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Mon, 18 Nov 2013 06:26:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-8731487957833148583</guid><description>&lt;h2 style="text-align: center;"&gt;
Configure Corefig as a free managament tool for Hyper-V 2012&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Reading a lot of articles online I have found that Hyper-V 2012 has some cool new features that are free to use. Some of them are in battle with VMware, like HA and the new SMB 3.0 protocol. I have installed a nested Hyper-V 2012 under the VMware setup to test the management tools.&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
One tool I have found as a useful collection of PowerShell scripts is the &lt;b&gt;Corefig.&lt;/b&gt;&amp;nbsp;Here are some steps to use with this management tool and how to configure it.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
On a fresh install of the Hyper-V Hypervisor one should enable the Remote Managament under the initial powershell options. To copy the files from the downloaded Corefig site firewall should be disabled on the Hyper-V 2012. This can be done via a simple command using &lt;i&gt;netsh.&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgouNObbYnYAWN4rspy9u4ZZzD8lir1IkB_DR6WzQE5gXSXPRG8r_4RnjqPIVGiSD7siuOiw76B_BMvJISlfMA1sRyy8Y4MBvNTB9482YqPPVIs0jHNCgRgnPBHFJHSzxLZxASEkDsDf9wi/s1600/fw-hyper-v.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="138" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgouNObbYnYAWN4rspy9u4ZZzD8lir1IkB_DR6WzQE5gXSXPRG8r_4RnjqPIVGiSD7siuOiw76B_BMvJISlfMA1sRyy8Y4MBvNTB9482YqPPVIs0jHNCgRgnPBHFJHSzxLZxASEkDsDf9wi/s640/fw-hyper-v.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
The next step is to download the Corefig.zip file and copy it to the Hyper-V hypervisor. One can copy the files using the Netbios protocol, and simply typing the \\hyper-vsrv location and creating a folder under the root of the Hypervisor called &lt;b&gt;Corefig.&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
The link for the Corefig installation can be found &lt;a href="http://corefig.codeplex.com/downloads/get/640586" target="_blank"&gt;here&lt;/a&gt;.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
After extracting the files , we should start the Powershell script to initialize the Corefig installation process and to make it as a startup service. This can be done via a simple command:&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div&gt;
&lt;i&gt;CD C:\COREFIG&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;POWERSHELL .\COREFIG.PS1&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
Soon after that we have an instance of the Corefig started and can use all of the managament functions it offers us. A simple screenshot will show the GUI of the tool.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYpRDCAy6hXiRFLZ9GOuq7WcDo5wC9PXnjhH__bgK7AqpKK4tjtqbyIee2NJ9yLbA5IrVkGdCWqJsA0Hv7p9U8rLElc45lbCs-Kh6HbJsZk9yBbtjGIk9Sc_8bki_BON_orNn2keHvhyphenhyphen6J/s1600/COREFIG.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="500" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYpRDCAy6hXiRFLZ9GOuq7WcDo5wC9PXnjhH__bgK7AqpKK4tjtqbyIee2NJ9yLbA5IrVkGdCWqJsA0Hv7p9U8rLElc45lbCs-Kh6HbJsZk9yBbtjGIk9Sc_8bki_BON_orNn2keHvhyphenhyphen6J/s640/COREFIG.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
We can easily change the network settings, a small Control Panel utilities, and general Hyper-V settings. One great security tool is to manage the firewall via the GUI is easy for creating the first initial rules. I have disabled the firewall for testing purposes.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ1rn4XkX0rWRuUbca31zrgkYVYSyGh2VZfQsCB47EarCF1j2ii0NgnZwX-soc7D3aTsjDy8-oIxn8Iy5HJjnG2BoCNBqz8GQrD38AtIO57nlxWszllI5STRQNpjf5fps3Xcd5JUwGfKiH/s1600/corefirewall.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="521" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ1rn4XkX0rWRuUbca31zrgkYVYSyGh2VZfQsCB47EarCF1j2ii0NgnZwX-soc7D3aTsjDy8-oIxn8Iy5HJjnG2BoCNBqz8GQrD38AtIO57nlxWszllI5STRQNpjf5fps3Xcd5JUwGfKiH/s640/corefirewall.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Acording to Microsoft this tools is verified to work with these setups:&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;Verified: Microsoft Windows Server 2012 (Core Installation)&lt;/li&gt;
&lt;li&gt;Verified: Microsoft Windows Server 2012 (Complete GUI Installation)&lt;/li&gt;
&lt;li&gt;Verified: Microsoft Hyper-V Server 2012&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Feel free to use the tool and comment on it.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgouNObbYnYAWN4rspy9u4ZZzD8lir1IkB_DR6WzQE5gXSXPRG8r_4RnjqPIVGiSD7siuOiw76B_BMvJISlfMA1sRyy8Y4MBvNTB9482YqPPVIs0jHNCgRgnPBHFJHSzxLZxASEkDsDf9wi/s72-c/fw-hyper-v.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Windows Server 2008 PKI Single Tier CDP</title><link>http://itstuffallaround.blogspot.com/2013/11/windows-server-2008-pki-single-tier-cdp.html</link><category>Microsoft</category><category>PKI</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Mon, 18 Nov 2013 00:06:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-4680339662638758831</guid><description>&lt;h2 style="text-align: center;"&gt;
Windows Server 2008 PKI Single Tier CDP&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
In cryptography, a PKI is an arrangement that binds public keys with respective user identities by means of a certificate authority (CA). The user identity must be unique within each CA domain. The third-party validation authority (VA) can provide this information on behalf of CA. The binding is established through the registration and issuance process, which, depending on the assurance level of the binding, may be carried out by software at a CA or under human supervision.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Active Directory Certificate Services (AD CS) is an Identity and Access Control security technology that provides customizable services for creating and managing public key certificates used in software security systems that employ public key technologies.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
A system or systems where the CRL (Certificate Revocation List) is placed for retrieval by Relying Parties or others throughout the PKI environment. A &lt;b&gt;CDP&lt;/b&gt; should be referenced in each Certificate so that Relying Parties can readily check the CRL before relying on the Certificate. Most &lt;b&gt;CDP&lt;/b&gt;s are accessible via HTTP or LDAP.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
In this small setup we have a Windows Server 2008 R2 with following rolles installed :&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;ul&gt;
&lt;li&gt;Active Directory Certificate Services&lt;/li&gt;
&lt;li&gt;Active Directory Domain Services&lt;/li&gt;
&lt;li&gt;DNS Server&lt;/li&gt;
&lt;li&gt;Web Server (IIS)&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
We have a client Windows 7 desktop machine that is joined to the domain. We want to test if the machine has got a certificate for negotiating the authentification and other domain procedures. And also we want to ensure that the AutoEnrollement is turned so that every other machine in the domain will do this automatically.&lt;/div&gt;
&lt;div&gt;
After installing the roles we should create a Certificate Authority policy file as a template for all the other certificates and save it under the c:\windows folder as a CaPolicy.inf.&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;[Version]&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;Signature="$Windows NT$"&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;[PolicyStatementExtension]&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;Policies=InternalPolicy&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;[InternalPolicy]&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;OID= 1.2.3.4.1455.67.89.5&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;Notice="Legal Policy Statement"&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;URL=http://pki.corp.local/cps.txt&amp;nbsp;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;[Certsrv_Server]&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;RenewalKeyLength=2048&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;RenewalValidityPeriod=Years&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;RenewalValidityPeriodUnits=10&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;LoadDefaultTemplates=0&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;AlternateSignatureAlgorithm=1&lt;/i&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
To see the location of the CDP we point ourselves to the Start&amp;gt;AdministrativeTools&amp;gt;Certification Authority&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgABYlBJo0Hu1tTzOWMG_1NQkCkuVwwC3mNsOffvBZSSBow-2EG8MldLiaT142VLNUfeHq8ixcL0d282-hiIBNQW2OT6JBbmTwL5VL64LIPS6UdTA5Ak5cJP9OIgpbDmyEvemcXlmO3Ojc4/s1600/CORPCDP.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgABYlBJo0Hu1tTzOWMG_1NQkCkuVwwC3mNsOffvBZSSBow-2EG8MldLiaT142VLNUfeHq8ixcL0d282-hiIBNQW2OT6JBbmTwL5VL64LIPS6UdTA5Ak5cJP9OIgpbDmyEvemcXlmO3Ojc4/s640/CORPCDP.png" width="476" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
No to ensure that all the PCs in the Active Directory domain called corp.local enroll these certificates we should modify the default domain Group Policy. This can be done via the gpmc.msc policy command.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXfb6XYn3ngcaXZR68D-9dHmOLtQT52TaU4VAOPl4LULmkCP3MVdjjsbtsOBxJ8KNrfW6rdvUdCzVDE0hHLm-0sQ7k1d0kcyVTkkmwop7h-MKX6g2Mzxaf1T5JaEjMhx-u-J75C0lzES02/s1600/GroupPolicyAuto.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="537" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXfb6XYn3ngcaXZR68D-9dHmOLtQT52TaU4VAOPl4LULmkCP3MVdjjsbtsOBxJ8KNrfW6rdvUdCzVDE0hHLm-0sQ7k1d0kcyVTkkmwop7h-MKX6g2Mzxaf1T5JaEjMhx-u-J75C0lzES02/s640/GroupPolicyAuto.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
To review the Cetificate Enrollment we should checkout the local GPO settings on the client machine. This can be done using the MMC console on the Client Windows 7 machine. The Snapint is the Certificate Authority to manage all the local certificates.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJZz2Qm0cN9eczMT28n3z0AaHRnKghnip8-yOHnhepF0qviaqk-HlwJrG1hq2ANPD7LAmjrPWP_u9wkZdVD9BMcNislUTApFBOX8w3p7NhK1h61fci7uETb63VExAMOyBVbFFuhAXAxIGS/s1600/CACERT.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="340" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJZz2Qm0cN9eczMT28n3z0AaHRnKghnip8-yOHnhepF0qviaqk-HlwJrG1hq2ANPD7LAmjrPWP_u9wkZdVD9BMcNislUTApFBOX8w3p7NhK1h61fci7uETb63VExAMOyBVbFFuhAXAxIGS/s640/CACERT.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
We can see that we have enrolled the certificate from the DC1 that is our Domain Controller. And the last thing to see is the purpose of the certificate.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNEgSzPZW0Twu_G9OaTRDkFQkh6Zt3Io2YV7SbXsUiXhGgWa4PY2M5FBn885vag9kHiD1y-o5J-YbekTWYyZeiFKWsdk8k6WPqbIBD1QVLYSJHQS_pjr9PbAj6q_uP9xbX4Mlq8I-DuVH_/s1600/CERTIFICATE1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNEgSzPZW0Twu_G9OaTRDkFQkh6Zt3Io2YV7SbXsUiXhGgWa4PY2M5FBn885vag9kHiD1y-o5J-YbekTWYyZeiFKWsdk8k6WPqbIBD1QVLYSJHQS_pjr9PbAj6q_uP9xbX4Mlq8I-DuVH_/s400/CERTIFICATE1.png" width="318" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
We can see that we have got the All Issuance Policies certificate installed. This also means that the Windows 7 recognized the OID numbers from the CaPolicy.inf file. To research further one can use the Microsoft Technet for other CA purposes.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Feel free to comment.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgABYlBJo0Hu1tTzOWMG_1NQkCkuVwwC3mNsOffvBZSSBow-2EG8MldLiaT142VLNUfeHq8ixcL0d282-hiIBNQW2OT6JBbmTwL5VL64LIPS6UdTA5Ak5cJP9OIgpbDmyEvemcXlmO3Ojc4/s72-c/CORPCDP.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Compile Source of Apache/MySQL/PHP on a Linux VPS</title><link>http://itstuffallaround.blogspot.com/2013/11/compile-source-of-apachemysqlphp-on.html</link><category>Linux</category><category>MySQL</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Wed, 13 Nov 2013 12:47:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-3375780441103438000</guid><description>&lt;h2 style="text-align: center;"&gt;
&lt;span style="font-family: inherit;"&gt;Compile Source of Apache/MySQL/PHP on a Linux VPS&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;Linux IT Engineers often use the Debina APT, or RedHat YUM repositories for an quick and easy install of the services on their servers. But , in some cases we often need to test the latest packages. For example the latest version of MySQL is 5.7 and we cannot get it via the apt, we have to manually download and install in on our Virtual Private Server. Then we can configure it to our production enviroment.&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;I have configured the VPS server with the 12.04 LTS versions. I prefer the LTS version because of the support for the security and long term update.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
First we start with creating the sources folder and downloading the Apache packages that are needed for our web server:&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;sudo mkdir /usr/src/sources&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;wget http://httpd.apache.org/dev/dist/httpd-2.4.2.tar.gz&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;tar xvfz httpd-2.4.2.tar.gz&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: inherit;"&gt;After downloading the httpd packages and extracting them we can move on further in our process. We now need the APR utilities and the APR package itself. The APR stands for&amp;nbsp;&lt;/span&gt;Apache Portable Runtime.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;wget&amp;nbsp;http://apache.spinellicreations.com//apr/apr-1.4.8.tar.gz&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;tar -xzf apr-1.4.8.tar.gz&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;rm apr-1.4.8.tar.gz&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;cd apr-1.4.8/&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;sudo apt-get install make&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;sudo ./configure&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;sudo make&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;sudo make install&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: inherit;"&gt;Then we need the APR Utils to be configured.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;wget http://mirrors.axint.net/apache//apr/apr-util-1.4.1.tar.gz&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;tar -xvzf apr-util-1.4.1.tar.gz&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;cd apr-util-1.4.1&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;./configure --with-apr=/usr/local/apr&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;make&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;make install&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;cd ..&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: inherit;"&gt;Now we can return to the HTTPD folder to compile and install the Apache:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;cd /usr/local/sources/httpd-2.4.2&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;./configure --enable-file-cache --enable-cache --enable-disk-cache --enable-mem-cache --enable-deflate --enable-expires --enable-headers --enable-usertrack --enable-ssl --enable-cgi --enable-vhost-alias --enable-rewrite --enable-so --with-apr=/usr/local/apr/&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;make&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;make install&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;cd ..&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: inherit;"&gt;To startup the Web server we will create a soft link to a startup script and copy the startup script to the init.d folder for startup options.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;ln -s /usr/local/apache2/bin/apachectl /usr/bin/apachectl&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;cp /usr/local/apache2/bin/apachectl /etc/init.d&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;update-rc.d apachectl defaults&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: inherit;"&gt;Now we can reboot the server and check if it is running. And we can see that the daemon is running.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style="font-family: Verdana, sans-serif; font-style: italic;"&gt;
root@ubsrv1:~# ps aux | grep httpd&lt;/div&gt;
&lt;div style="font-family: Verdana, sans-serif; font-style: italic;"&gt;
root &amp;nbsp; &amp;nbsp; &amp;nbsp;1063 &amp;nbsp;0.0 &amp;nbsp;0.2 &amp;nbsp; &amp;nbsp; 0:00 /usr/local/apache2/bin/httpd -k start&lt;/div&gt;
&lt;div style="font-family: Verdana, sans-serif; font-style: italic;"&gt;
daemon &amp;nbsp; &amp;nbsp;1065 &amp;nbsp;0.0 &amp;nbsp;0.2 &amp;nbsp; &amp;nbsp; 0:00 /usr/local/apache2/bin/httpd -k start&lt;/div&gt;
&lt;div style="font-family: Verdana, sans-serif; font-style: italic;"&gt;
daemon &amp;nbsp; &amp;nbsp;1066 &amp;nbsp;0.0 &amp;nbsp;0.2 3 &amp;nbsp; 0:00 /usr/local/apache2/bin/httpd -k start&lt;/div&gt;
&lt;div style="font-family: Verdana, sans-serif; font-style: italic;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: inherit;"&gt;Next what we should do is to continue with the PHP support and installation.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;cd /usr/src/sources&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;wget&amp;nbsp;http://us2.php.net/get/php-5.5.5.tar.gz/from/ar2.php.net/mirror&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;tar xfvz php-5.5.5.tar.gz&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;cd &amp;nbsp;php-5.5.5&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;i&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;./configure --prefix=/var/www/ --with-apxs2=/var/apache2/bin/apxs --with-config-file- path=/var/www/php --with-mysql&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;i&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;make&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;i&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;make install&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;i&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: inherit;"&gt;The --prefix folder depends on the folder where you installed the apache, you can change this to your needs. And the final step is to install the MySQL server.&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;groupadd mysql&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;useradd -r -g mysql mysql&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;cd /usr/src/sources&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;wget&amp;nbsp;&lt;span style="text-align: justify;"&gt;http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.14.tar.gz/from/http://cdn.mysql.com/&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;&lt;span style="text-align: justify;"&gt;tar zxvf&amp;nbsp;&lt;/span&gt;&lt;span style="text-align: justify;"&gt;mysql-5.6.14.tar.gz&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;&lt;span style="text-align: justify;"&gt;ln -s&amp;nbsp;&lt;/span&gt;/usr/src/sources/&lt;span style="text-align: justify;"&gt;mysql-5.6.14&lt;/span&gt;&lt;span style="text-align: justify;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="text-align: justify;"&gt;/usr/local/mysql&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="text-align: justify;"&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;cd /usr/local/mysql&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="text-align: justify;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style="font-family: Verdana, sans-serif; font-style: italic; text-align: justify;"&gt;
&lt;span style="text-align: justify;"&gt;chown -R mysql .&lt;/span&gt;&lt;/div&gt;
&lt;span style="text-align: justify;"&gt;
&lt;div style="font-family: Verdana, sans-serif; font-style: italic; text-align: justify;"&gt;
chgrp -R mysql .&lt;/div&gt;
&lt;div style="font-family: Verdana, sans-serif; font-style: italic; text-align: justify;"&gt;
scripts/mysql_install_db --user=mysql&lt;/div&gt;
&lt;div style="font-family: Verdana, sans-serif; font-style: italic; text-align: justify;"&gt;
chown -R root .&lt;/div&gt;
&lt;div style="font-family: Verdana, sans-serif; font-style: italic; text-align: justify;"&gt;
chown -R mysql data&lt;/div&gt;
&lt;div style="font-family: Verdana, sans-serif; font-style: italic; text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;Here we have a simply longer procedure. First we create &amp;nbsp;a user and group. Then download the source files, extract them, create a soft link and run the mysql_install_db script. Add the permissions to the folders and that is all.&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-family: Verdana, sans-serif; font-style: italic; text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;Now we can restart the server and everything should work fine. If not check out some cool tutorials on Ubuntu community.&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;Source&amp;nbsp;&lt;a href="http://community.ubuntu.com/" style="text-align: left;"&gt;http://community.ubuntu.com/&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="text-align: justify;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Linux SWAP Partition as twice the RAM size - why ?</title><link>http://itstuffallaround.blogspot.com/2013/11/linux-swap-partition-as-twice-ram-size.html</link><category>Linux</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Mon, 11 Nov 2013 02:29:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-870093645479166929</guid><description>&lt;h2 style="text-align: center;"&gt;
&lt;span style="font-family: inherit;"&gt;Linux SWAP Partition as twice the RAM size - why ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Linux divides its physical RAM (random access memory) into chucks of memory called pages. Swapping is the process whereby a page of memory is copied to the preconfigured space on the hard disk, called swap space, to free up that page of memory. The combined sizes of the physical memory and the swap space is the amount of virtual memory available.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Swapping is necessary for two important reasons. First, when the system requires more memory than is physically available, the kernel swaps out less used pages and gives memory to the current application (process) that needs the memory immediately. Second, a significant number of the pages used by an application during its startup phase may only be used for initialization and then never used again. The system can swap out those pages and free the memory for other applications or even for the disk cache.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
To see a VPS machine with 512 MB of physical RAM and the ratio of SWAP space we can use &lt;i&gt;&lt;b&gt;free -m&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtkxuZ3Ng1MaNOsmBY6C8NEOfdOxYS2nGLBu_wUyBdpthhn0Aek3PKG1F84EizbdR7HRKWpkUU9b-hPiXI1tczaBwDGtLlKGggGIr83peDJlIyySrhCaguAMyTcKEE2fKbgrBSShTrjpwl/s1600/MEM1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="152" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtkxuZ3Ng1MaNOsmBY6C8NEOfdOxYS2nGLBu_wUyBdpthhn0Aek3PKG1F84EizbdR7HRKWpkUU9b-hPiXI1tczaBwDGtLlKGggGIr83peDJlIyySrhCaguAMyTcKEE2fKbgrBSShTrjpwl/s640/MEM1.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;i&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
The picture shows us that we have total of 490 MB of physical ram and twice the size of the SWAP memory on the hdd (which is not yet used) of 991 MB. As this server has small amount of free memory (only 76MB) I had to investigate further. I have used the HTOP utility to see the real memory consumer.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcmpqOI4TLOtl0J4hr6Dc1MNQlTC4pDHJKXwlS5QMZ5B4j-8J18NZOcqkrN7L-UjDCKCxc65CNGmfrYzXbDtPC2YEIS7rhnbSOAQK_f22cZrdjbeN9E_wNPQ8bq5dZ4QO41KKjOOI-JTw7/s1600/MEM@.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="259" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcmpqOI4TLOtl0J4hr6Dc1MNQlTC4pDHJKXwlS5QMZ5B4j-8J18NZOcqkrN7L-UjDCKCxc65CNGmfrYzXbDtPC2YEIS7rhnbSOAQK_f22cZrdjbeN9E_wNPQ8bq5dZ4QO41KKjOOI-JTw7/s640/MEM@.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
The process with the ID of 1310 is using some memory resources dynamically. We cannot see the real proccess name, because it is assigned to multiple instances of one application. To investigate further we should use the PID number to see which service is killing the VPS machine.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
This can be done with the PMP command : &amp;nbsp;&lt;b&gt;&lt;i&gt;pmap -x 1310&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6UMP8S68s9lNebbwo0nHOg2zOeOIPNn6IZVBcy5bPg5mZsYwlosOrk68UXCxR596m8x2722X8pMpA7o0PDksiXgchX0dFUIvoRJQUwA2h9d8QdbAYRVcCC45E4fl7EKteaYhlXV28_okK/s1600/SAMBAMEM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="376" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6UMP8S68s9lNebbwo0nHOg2zOeOIPNn6IZVBcy5bPg5mZsYwlosOrk68UXCxR596m8x2722X8pMpA7o0PDksiXgchX0dFUIvoRJQUwA2h9d8QdbAYRVcCC45E4fl7EKteaYhlXV28_okK/s640/SAMBAMEM.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
The output shows us that the SAMBA libraries are attached to the PID. Simply stopping the SAMBA service I will free up some memory.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg98dkjmAI042A7yqdxwe94h-ykXWCbRpJcLmHNhenz_k3aZyQhUet-TFi1j7b8JpnLKZ1-MY6CSzibEenOTwvTfKNI4Sg3tPYBkoaLjksOyP5mv6cbI-xLFoQ9EGa0ksiwNjOwPXslaISn/s1600/SAMBRAFREEMEM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="152" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg98dkjmAI042A7yqdxwe94h-ykXWCbRpJcLmHNhenz_k3aZyQhUet-TFi1j7b8JpnLKZ1-MY6CSzibEenOTwvTfKNI4Sg3tPYBkoaLjksOyP5mv6cbI-xLFoQ9EGa0ksiwNjOwPXslaISn/s640/SAMBRAFREEMEM.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
To get back on the inital question , I will try to have a short explanation of the SWAP size. The memory hirearchy presented to application by the Linux system is arranged in few levels:&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;Processor/CPU registers - bits in size&lt;/li&gt;
&lt;li&gt;L1 Cache - kbits in size&lt;/li&gt;
&lt;li&gt;L2 Cache - MBs in size&lt;/li&gt;
&lt;li&gt;L3 cache - 100 of MBs in size&lt;/li&gt;
&lt;li&gt;RAM - GBs in size&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
The data that is used in application loading is moved to RAM, and some of that data need the L3 cache also. The used application data is often moved to the faster L2 and L1 cache memory. As we can see the data is moved from the RAM up to the last CPU register table. In this order we can get that the SWAP data should be between 1.5 and 2 times the Actual RAM is.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
This is the main reason why we should create the SWAP twice the RAM. And applications should not allocate that data to other HDDs, especially large ones, because of the slow I/O operations. If your RAM is free then there is no use of swap partition.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Feel free to comment.&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtkxuZ3Ng1MaNOsmBY6C8NEOfdOxYS2nGLBu_wUyBdpthhn0Aek3PKG1F84EizbdR7HRKWpkUU9b-hPiXI1tczaBwDGtLlKGggGIr83peDJlIyySrhCaguAMyTcKEE2fKbgrBSShTrjpwl/s72-c/MEM1.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Linux service security - Deny Hosts</title><link>http://itstuffallaround.blogspot.com/2013/11/linux-service-security-deny-hosts.html</link><category>Linux</category><category>Security</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Sun, 10 Nov 2013 01:28:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-3629731934004336877</guid><description>&lt;h2 style="text-align: center;"&gt;
Linux service security - Deny Hosts&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style="text-align: justify;"&gt;
DenyHosts is a log-based intrusion prevention security tool for SSH servers written in Python. It is intended to prevent brute-force attacks on SSH servers by monitoring invalid login attempts in the authentication log and blocking the originating IP addresses.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
DenyHosts checks the end of the authentication log for recent failed login attempts. It records information about their originating IP addresses and compares the number of invalid attempts to a user-specified threshold. If there have been too many invalid attempts it assumes a dictionary attack is occurring and prevents the IP address from making any further attempts by adding it to /etc/hosts.deny on the server.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
To install and configure the DenyHosts we should use the EPEL repository. A simple BASH command:&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;yum --enablerepo=epel install denyhosts&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhexlFmOrYTevPSd9cDe7r2PKq4lul6-NRFzvFpklZexWhlgWrkk346UkleLmRuJ9CSfuogzttZPcaflTeWekcnAnyp_s6pFME0X26OMP25UTQBLPP3RNfXF0nq1Y5vD6GrWat_o8Lae6ka/s1600/DENYHOSTS.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="313" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhexlFmOrYTevPSd9cDe7r2PKq4lul6-NRFzvFpklZexWhlgWrkk346UkleLmRuJ9CSfuogzttZPcaflTeWekcnAnyp_s6pFME0X26OMP25UTQBLPP3RNfXF0nq1Y5vD6GrWat_o8Lae6ka/s640/DENYHOSTS.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;After a successfull installation we should take a first look at the configuration file to allow certain secure IP addresses to log into the server console.&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;nano /etc/hosts.allow&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjk36G0hPslQv3lWOs4UzrzEe8MKOGiPTgw_6VLtw76vPAk5qt3d5lU339hfkdXNazvCUgmz7OeojQUFdsSX2m-iy4nFZ31nTGcIMBUSYmVHbB5CVaQp3FEaklOUXpAWT_RS4lRFk3DmB69/s1600/allowedhosts.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="281" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjk36G0hPslQv3lWOs4UzrzEe8MKOGiPTgw_6VLtw76vPAk5qt3d5lU339hfkdXNazvCUgmz7OeojQUFdsSX2m-iy4nFZ31nTGcIMBUSYmVHbB5CVaQp3FEaklOUXpAWT_RS4lRFk3DmB69/s640/allowedhosts.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;I have added a Local Area Network IP address to have access to the SSH service. All other IP addresses are blocked by default to log into the ssh server.&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;Optionally and IT admin can use the &lt;b&gt;/etc/denyhosts.conf&lt;/b&gt;&amp;nbsp;file to create email alerts if a user tries to log on to the server from a different IP address.&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmCOVFx5_wieS4STtYfhyphenhyphenNpM7fumAauBelhMrEyJMt5fawIchEzWO2C7RCOPzJAJg8aIVi3yMPkkkuvyyMcRZ9m5a2j_M01iJEq4hNUy7toOBgVvxYPD-5rva79bu7YU66PtDs-dQfgoTZ/s1600/DENYHT.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="408" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmCOVFx5_wieS4STtYfhyphenhyphenNpM7fumAauBelhMrEyJMt5fawIchEzWO2C7RCOPzJAJg8aIVi3yMPkkkuvyyMcRZ9m5a2j_M01iJEq4hNUy7toOBgVvxYPD-5rva79bu7YU66PtDs-dQfgoTZ/s640/DENYHT.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
To comply to the setting we should now restart the denyhosts service and add it as a startup script.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;chkconfig denyhosts on&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;service denyhosts start&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
To see the logs on tried and failled logins , or a simulated attack we should tail a log file:&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;tail -f /var/log/secure&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPQjoXxrVYyRQZIkreaw8DyunikrP3uK0UDC1d9iqXkCyyQ62VLdv3u6s32Dq6uu9CSGByiFLcTLGSMO2colWA1h7qvzDsQjU3VN4ruKjx5UpYfq7SRB6LqN7TJvuYcMBw5k8Hx4Tvk4Z2/s1600/succesdeny.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="193" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPQjoXxrVYyRQZIkreaw8DyunikrP3uK0UDC1d9iqXkCyyQ62VLdv3u6s32Dq6uu9CSGByiFLcTLGSMO2colWA1h7qvzDsQjU3VN4ruKjx5UpYfq7SRB6LqN7TJvuYcMBw5k8Hx4Tvk4Z2/s640/succesdeny.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;We see that we have an Accepted password from our IP address that we allowed.&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
If you’ve list of static IP address that you want to whitelist permanently. Open the file &lt;b&gt;/var/lib/denyhosts/allowed-hosts file&lt;/b&gt;. Whatever IP address included in this file will not be banned by default.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Feel free to comment.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhexlFmOrYTevPSd9cDe7r2PKq4lul6-NRFzvFpklZexWhlgWrkk346UkleLmRuJ9CSfuogzttZPcaflTeWekcnAnyp_s6pFME0X26OMP25UTQBLPP3RNfXF0nq1Y5vD6GrWat_o8Lae6ka/s72-c/DENYHOSTS.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Soft File links in Linux</title><link>http://itstuffallaround.blogspot.com/2013/11/soft-file-links-in-linux.html</link><category>Linux</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Thu, 7 Nov 2013 11:18:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-7742549672098506744</guid><description>&lt;h2 style="text-align: center;"&gt;
Soft File links in Linux&lt;/h2&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style="text-align: justify;"&gt;
A symbolic or “soft” link points to a file by name. When the kernel comes upon a symbolic link in the course of looking up a pathname, it redirects its attention to the pathname stored as the contents of the link. The difference between hard links and symbolic links is that a hard link is a direct reference, whereas a symbolic link is a reference by name. Symbolic links are distinct from the files they point to.&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Symbolic links operate transparently for most operations: programs that read or write to files named by a symbolic link will behave as if operating directly on the target file. However, programs that need to handle symbolic links specially (e.g., backup utilities) may identify and manipulate them directly.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div&gt;
To create a symbolic link in Unix or Linux, at the shell prompt, enter the following command:&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;i&gt;ln -s {target-filename} {symbolic-filename}&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
So let us make a simple example of a index.php file in the web server directory.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8LuZGCh-54tOyc_8oCwc7F68BluiLqoClc2das9jBLkfHz3E2zAoXrtsq7KbQtG0DueNNKLNXao-ZXFCT637Ztp0FFhgf8AJIaYvAY_o8bh-3IAPt_Pll4ZxhYQ_So5kTSzfi75ceC9Y_/s1600/SymLink.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="100" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8LuZGCh-54tOyc_8oCwc7F68BluiLqoClc2das9jBLkfHz3E2zAoXrtsq7KbQtG0DueNNKLNXao-ZXFCT637Ztp0FFhgf8AJIaYvAY_o8bh-3IAPt_Pll4ZxhYQ_So5kTSzfi75ceC9Y_/s640/SymLink.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div style="text-align: justify;"&gt;
The file /home/guru/index.php could then be moved elsewhere without causing the symbolic link to stop working (not that moving this directory is advisable).&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div&gt;
It is a common mistake to think that the first argument to ln -s is interpreted relative to your current working directory. However, it is not resolved as a filename by ln; it’s simply a literal string that becomes the target of the symbolic link.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
After creating the symbolic link, it may generally be treated as an alias for the target. Any file system management commands (e.g., cp, rm) may be used on the symbolic link. Commands which read or write file contents will access the contents of the target file. The rm (delete file) command, however, removes the link itself, not the target file.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8LuZGCh-54tOyc_8oCwc7F68BluiLqoClc2das9jBLkfHz3E2zAoXrtsq7KbQtG0DueNNKLNXao-ZXFCT637Ztp0FFhgf8AJIaYvAY_o8bh-3IAPt_Pll4ZxhYQ_So5kTSzfi75ceC9Y_/s72-c/SymLink.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>HTOP Interactive process viewer on Linux</title><link>http://itstuffallaround.blogspot.com/2013/11/htop-interactive-process-viewer-on-linux.html</link><category>Linux</category><author>noreply@blogger.com (Zeljko Milinovic, MSc)</author><pubDate>Thu, 7 Nov 2013 04:11:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4824625792255148367.post-6570330980138012394</guid><description>&lt;h2 style="text-align: center;"&gt;
HTOP Interactive process viewer on Linux&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Htop is an interactive system-monitor process-viewer written for Linux. It is designed to replace the Unix program top. It shows a frequently updated list of the processes running on a computer, normally ordered by the amount of CPU usage. Unlike top, htop provides a full list of processes running, instead of the top resource-consuming processes. Htop uses color and gives visual information about processor, swap and memory status.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Users often deploy htop in cases where Unix top does not provide enough information about the systems processes, for example when trying to find minor memory leaks in applications. Compared to top, it provides a more convenient, cursor-controlled interface for killing processes.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
It is a very simple forward package installation on Centos server.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;yum install htop&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: Verdana, sans-serif;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: inherit;"&gt;And that is all to it. You start the the application just by typing the &lt;b&gt;&lt;i&gt;htop&lt;/i&gt;&lt;/b&gt; command in shell.&amp;nbsp;&lt;/span&gt;Let us take a look at the interface.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCadjeih7mUX3B-TqyBHKG36M81ilFHIgpms9clIoj_sSaRrKKBFYv5dpxTOCgnOIiPZI4FmGuL2nwsb_hjoa-3K03InSH6MBCkscAQN5Yfb-gXilOd34IsFHwFOkPp0iL06fqrlhKQXzW/s1600/HTOP1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="371" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCadjeih7mUX3B-TqyBHKG36M81ilFHIgpms9clIoj_sSaRrKKBFYv5dpxTOCgnOIiPZI4FmGuL2nwsb_hjoa-3K03InSH6MBCkscAQN5Yfb-gXilOd34IsFHwFOkPp0iL06fqrlhKQXzW/s640/HTOP1.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
You can use a cool features for filtering and killing the processes you think that are using up the resources on the server. I often use the SortBy command to sort the processes by either the CPU or the MEMORY usage.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJaJF7QQhT1-xyn1v33HWJtsnZERKsbgB6jyAxnN87st16UJ6Fks8sUbL7HVxyOzsRoEIg2ShEEjIZocva0pO9AEC_U-k3RLlYWtjXbWvL8e3wAf9-Hscxmlmw0HaR8Z2YY8vLv-ZAF-I_/s1600/HTOP2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="572" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJaJF7QQhT1-xyn1v33HWJtsnZERKsbgB6jyAxnN87st16UJ6Fks8sUbL7HVxyOzsRoEIg2ShEEjIZocva0pO9AEC_U-k3RLlYWtjXbWvL8e3wAf9-Hscxmlmw0HaR8Z2YY8vLv-ZAF-I_/s640/HTOP2.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Have fun!!!&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Source &lt;a href="http://htop.sourceforge.net/index.php?page=main" target="_blank"&gt;HTOP&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCadjeih7mUX3B-TqyBHKG36M81ilFHIgpms9clIoj_sSaRrKKBFYv5dpxTOCgnOIiPZI4FmGuL2nwsb_hjoa-3K03InSH6MBCkscAQN5Yfb-gXilOd34IsFHwFOkPp0iL06fqrlhKQXzW/s72-c/HTOP1.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item></channel></rss>