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

<channel>
	<title>blog.witalis.net</title>
	<atom:link href="http://blog.witalis.net/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.witalis.net</link>
	<description>technotes</description>
	<lastBuildDate>Sun, 12 May 2013 14:01:33 +0000</lastBuildDate>
	<language>pl-PL</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>clear ip nat selectively</title>
		<link>http://blog.witalis.net/?p=898</link>
		<comments>http://blog.witalis.net/?p=898#comments</comments>
		<pubDate>Sun, 12 May 2013 14:01:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[net]]></category>
		<category><![CDATA[cisco]]></category>

		<guid isPermaLink="false">http://blog.witalis.net/?p=898</guid>
		<description><![CDATA[On cisco router device you can clear all ip nat translations once doing: [crayon-518fa1f074793/] but when you try remove only one translation you have to write long command i.e. [crayon-518fa1f0839be/] which also cannot be easy cut and past from show &#8230; <a href="http://blog.witalis.net/?p=898">Czytaj dalej <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>On cisco router device you can clear all ip nat translations once doing:</p><pre class="crayon-plain-tag">Router#clear ip nat translation *</pre><p>but when you try remove only one translation you have to write long command i.e.</p><pre class="crayon-plain-tag">Router#clear ip nat translation udp inside &lt;ip&gt; &lt;port&gt; &lt;ip&gt; &lt;port&gt; outside &lt;ip&gt; &lt;port&gt; &lt;ip&gt; &lt;port&gt;</pre><p>which also cannot be easy cut and past from show command result. Fortunetly in cisco device there is a TCL shell, activated by:</p><pre class="crayon-plain-tag">Router#tclsh</pre><p>Sample script to clear ip nat selectively:</p><pre class="crayon-plain-tag">proc clearnat {x} {
set result [exec {sh ip nat translation}]
set data [split $result "\n"]

foreach item $data {

    if {[string match *$x* $item]} {
        set wordList [regexp -all -inline {\S+} $item]
        set proto [ lindex $wordList 0 ]
        set insglob [ lindex $wordList 1 ]
        regsub -all ":" $insglob " " insglob
        set inslocal [ lindex $wordList 2 ]
        regsub -all ":" $inslocal " " inslocal
        set outlocal [ lindex $wordList 3 ]
        regsub -all ":" $outlocal " " outlocal
        set outglob [ lindex $wordList 4 ]
        regsub -all ":" $outglob " " outglob
        clear ip nat translation $proto inside $insglob $inslocal outside $outlocal $outglob
    }

}

}</pre><p>Paste it in tclsh and fire up with:</p><pre class="crayon-plain-tag">Router(tcl)#clearnat &lt;ip&gt;</pre><p>For me it was first met of tcl scripting, so it isn&#8217;t written optimally. TCL script looks pretty odd to my previous scripting experience ;)</p>
<br /><g:plusone href="http://blog.witalis.net/?p=898" size="small"  annotation="none"  ></g:plusone><br />]]></content:encoded>
			<wfw:commentRss>http://blog.witalis.net/?feed=rss2&#038;p=898</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>hidepid capabilities of procfs</title>
		<link>http://blog.witalis.net/?p=882</link>
		<comments>http://blog.witalis.net/?p=882#comments</comments>
		<pubDate>Wed, 01 May 2013 11:39:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[hidepid]]></category>

		<guid isPermaLink="false">http://blog.witalis.net/?p=882</guid>
		<description><![CDATA[RHEL 5.9 introduces new feature which allow to hide some sensitive information about process activity to non-root users.  Release notes about new RHEL version doesn&#8217;t tell us too much: [crayon-518fa1f0c0e50/] more technical information about this patch is on http://www.openwall.com/lists/kernel-hardening/2011/11/15/3 how &#8230; <a href="http://blog.witalis.net/?p=882">Czytaj dalej <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>RHEL 5.9 introduces new feature which allow to hide some sensitive information about process activity to non-root users.  Release notes about new RHEL version doesn&#8217;t tell us too much:</p><pre class="crayon-plain-tag">Restricting Access to /proc/&lt;PID&gt;/
The hidepid= and gid= mount options have been added to procfs to allow
restricting of access to /proc/&lt;PID&gt;/ directories.</pre><p>more technical information about this patch is on</p>
<p><a href="http://www.openwall.com/lists/kernel-hardening/2011/11/15/3">http://www.openwall.com/lists/kernel-hardening/2011/11/15/3</a></p>
<p>how it looks like in practice:</p><pre class="crayon-plain-tag"># mount  | grep ^proc
proc on /proc type proc (rw)

# mount -o remount,hidepid=1 /proc
$ ps ax
  PID TTY      STAT   TIME COMMAND
 2054 pts/0    S      0:00 -bash
 2084 pts/0    R+     0:00 ps ax
$ ls -ld /proc/[0-9]*
dr-xr-xr-x 6 root       root         0 May  1 13:29 /proc/1
dr-xr-xr-x 6 root       root         0 May  1 13:29 /proc/10
$ ls -l /proc/[0-9]*
ls: /proc/1: Operation not permitted
ls: /proc/10: Operation not permitted
...

# mount -o remount,hidepid=2 /proc
$ ps ax
  PID TTY      STAT   TIME COMMAND
 2189 pts/0    S      0:00 -bash
 2218 pts/0    R+     0:00 ps ax
$ ls -ld /proc/[0-9]*
dr-xr-xr-x 6 w.duranek domain users 0 May  1 13:31 /proc/2189
$ id
uid=10000(w.duranek) gid=10(wheel)

# mount -o remount,hidepid=2,gid=10  /proc
$ ps ax
  PID TTY      STAT   TIME COMMAND
    1 ?        Ss     0:03 init [3]
    2 ?        S&lt;     0:00 [migration/0]
    3 ?        SN     0:00 [ksoftirqd/0]
...</pre><p>&nbsp;</p>
<br /><g:plusone href="http://blog.witalis.net/?p=882" size="small"  annotation="none"  ></g:plusone><br />]]></content:encoded>
			<wfw:commentRss>http://blog.witalis.net/?feed=rss2&#038;p=882</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scan for new hard disk</title>
		<link>http://blog.witalis.net/?p=876</link>
		<comments>http://blog.witalis.net/?p=876#comments</comments>
		<pubDate>Wed, 01 May 2013 11:01:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.witalis.net/?p=876</guid>
		<description><![CDATA[Useful especially in virtual environment to discover hot-added hard disk i.e.: [crayon-518fa1f0dfa91/] &#160;]]></description>
				<content:encoded><![CDATA[<p>Useful especially in virtual environment to discover hot-added hard disk i.e.:</p><pre class="crayon-plain-tag">echo "- - -" &gt; /sys/class/scsi_host/host2/scan</pre><p>&nbsp;</p>
<br /><g:plusone href="http://blog.witalis.net/?p=876" size="small"  annotation="none"  ></g:plusone><br />]]></content:encoded>
			<wfw:commentRss>http://blog.witalis.net/?feed=rss2&#038;p=876</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LinuxCon Europe 2012</title>
		<link>http://blog.witalis.net/?p=872</link>
		<comments>http://blog.witalis.net/?p=872#comments</comments>
		<pubDate>Tue, 13 Nov 2012 19:19:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.witalis.net/?p=872</guid>
		<description><![CDATA[Lots of interesting post conference materials: http://events.linuxfoundation.org/events/linuxcon-europe/slides]]></description>
				<content:encoded><![CDATA[<p>Lots of interesting post conference materials:</p>
<p><a href="http://events.linuxfoundation.org/events/linuxcon-europe/slides">http://events.linuxfoundation.org/events/linuxcon-europe/slides</a></p>
<br /><g:plusone href="http://blog.witalis.net/?p=872" size="small"  annotation="none"  ></g:plusone><br />]]></content:encoded>
			<wfw:commentRss>http://blog.witalis.net/?feed=rss2&#038;p=872</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perfect nagios plugin ?</title>
		<link>http://blog.witalis.net/?p=867</link>
		<comments>http://blog.witalis.net/?p=867#comments</comments>
		<pubDate>Sat, 10 Nov 2012 15:59:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.witalis.net/?p=867</guid>
		<description><![CDATA[How should look like almost perfect nagios plugin ? Look at http://folk.uio.no/trondham/software/check_openmanage.html]]></description>
				<content:encoded><![CDATA[<p>How should look like almost perfect nagios plugin ? Look at</p>
<p><a href="http://folk.uio.no/trondham/software/check_openmanage.html">http://folk.uio.no/trondham/software/check_openmanage.html</a></p>
<br /><g:plusone href="http://blog.witalis.net/?p=867" size="small"  annotation="none"  ></g:plusone><br />]]></content:encoded>
			<wfw:commentRss>http://blog.witalis.net/?feed=rss2&#038;p=867</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trusted Path Execution &#8211; reduce attack vector</title>
		<link>http://blog.witalis.net/?p=861</link>
		<comments>http://blog.witalis.net/?p=861#comments</comments>
		<pubDate>Sat, 10 Nov 2012 15:53:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tpe]]></category>

		<guid isPermaLink="false">http://blog.witalis.net/?p=861</guid>
		<description><![CDATA[TPE is a feature presented in Grsecurity, which denies users from executing programs that are not owned by root. This approach eliminates some parts of self uploaded exploits by users.  Using Grsecurity force us to prepare custom &#8211; mainly non-distribution &#8230; <a href="http://blog.witalis.net/?p=861">Czytaj dalej <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>TPE is a feature presented in Grsecurity, which denies users from executing programs that are not owned by root. This approach eliminates some parts of self uploaded exploits by users.  Using Grsecurity force us to prepare custom &#8211; mainly non-distribution kernel. Nowadays TPE is prepared as separate linux kernel module, which isn&#8217;t complicated to test, deploy in supported linux distribution (RHEL/Centos,Ubuntu). Moreover when you using TPE-LKM you get some extra features like hiding processes which doesn&#8217;t belong to user or hide from seeing linux kernel module list. Howto prepare, install and configure this module is pretty straightforward  [2]. Configuration is provided by sysctl variables described in [1]. Some of TPM-LKM extra features is duplicated by RHEL kernel extensions presented in 6.3 (hidepid parameter) [3], which also add dmesg_restrict feature [4].</p>
<p>[1] <a href="https://github.com/cormander/tpe-lkm">https://github.com/cormander/tpe-lkm</a></p>
<p>[2] <a href="https://github.com/cormander/tpe-lkm/blob/master/INSTALL">https://github.com/cormander/tpe-lkm/blob/master/INSTALL</a></p>
<p>[3] <a href="https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html-single/6.3_Release_Notes/index.html">https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html-single/6.3_Release_Notes/index.html</a></p>
<p>[4]<a href=" https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html-single/6.3_Technical_Notes/index.html"> https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html-single/6.3_Technical_Notes/index.html</a></p>
<br /><g:plusone href="http://blog.witalis.net/?p=861" size="small"  annotation="none"  ></g:plusone><br />]]></content:encoded>
			<wfw:commentRss>http://blog.witalis.net/?feed=rss2&#038;p=861</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache HTTP Server 2.4 &#8211; error logging</title>
		<link>http://blog.witalis.net/?p=855</link>
		<comments>http://blog.witalis.net/?p=855#comments</comments>
		<pubDate>Tue, 10 Jul 2012 16:13:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[inne]]></category>
		<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://blog.witalis.net/?p=855</guid>
		<description><![CDATA[Apache 2.4 was introduces couple months ago. Comprehensive list of changes doesn&#8217;t contain pretty useful enhancement of error logs, now it includes AH mark before each log entry. So you can easy extract and collect what kind of errors were &#8230; <a href="http://blog.witalis.net/?p=855">Czytaj dalej <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Apache 2.4 was introduces couple months ago. <a href="http://httpd.apache.org/docs/2.4/new_features_2_4.html">Comprehensive list of changes</a> doesn&#8217;t contain pretty useful enhancement of error logs, now it includes AH mark before each log entry. So you can easy extract and collect what kind of errors were logged. List of errors: <a href="http://wiki.apache.org/httpd/ListOfErrors">http://wiki.apache.org/httpd/ListOfErrors</a></p>
<br /><g:plusone href="http://blog.witalis.net/?p=855" size="small"  annotation="none"  ></g:plusone><br />]]></content:encoded>
			<wfw:commentRss>http://blog.witalis.net/?feed=rss2&#038;p=855</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monitoring HTTP on-the-fly</title>
		<link>http://blog.witalis.net/?p=849</link>
		<comments>http://blog.witalis.net/?p=849#comments</comments>
		<pubDate>Sun, 13 May 2012 12:01:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[inne]]></category>

		<guid isPermaLink="false">http://blog.witalis.net/?p=849</guid>
		<description><![CDATA[On my day to day work sometimes I have to discover what request are really pushed to my web servers without digging into access logs. So I found some handy tools. console ready: http://justniffer.sourceforge.net/  &#8211;  pretty nice multi purpose sniffer &#8230; <a href="http://blog.witalis.net/?p=849">Czytaj dalej <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>On my day to day work sometimes I have to discover what request are really pushed to my web servers without digging into access logs. So I found some handy tools.</p>
<p><span id="more-849"></span></p>
<p>console ready:</p>
<ul>
<li><a href="http://justniffer.sourceforge.net/">http://justniffer.sourceforge.net/</a>  &#8211;  pretty nice multi purpose sniffer with http support</li>
<li><a href="http://dumpsterventures.com/jason/httpry/">http://dumpsterventures.com/jason/httpry/</a>  &#8211;  packet sniffer for http traffic</li>
<li><a href="http://www.wireshark.org/docs/man-pages/tshark.html">http://www.wireshark.org/docs/man-pages/tshark.html</a> - comes from wireshark tool</li>
<li><a href="http://www.circlemud.org/jelson/software/tcpflow/">http://www.circlemud.org/jelson/software/tcpflow/</a> - multi purpose sniffer with convenient file store format</li>
<li><a href="http://www.rhythm.cx/~steve/devel/tcptrack/">http://www.rhythm.cx/~steve/devel/tcptrack/</a> - it is not a sniffer, but it shows us source,amount, tcp state of traffic</li>
<li><a href="http://www.tcpdump.org/">http://www.tcpdump.org/</a> - of course</li>
</ul>
<p>gui ready:</p>
<ul>
<li><a href="http://www.wireshark.org/">http://www.wireshark.org/</a> - with remote capture <a href="http://wiki.wireshark.org/CaptureSetup#Step_5:_Capture_traffic_using_a_remote_machine">http://wiki.wireshark.org/CaptureSetup#Step_5:_Capture_traffic_using_a_remote_machine</a></li>
</ul>
<p>gui but with capturing http traffic from end user perspective:</p>
<ul>
<li><a href="http://www.fiddler2.com/fiddler2/">http://www.fiddler2.com/fiddler2/</a></li>
<li><a href="https://addons.mozilla.org/pl/firefox/addon/live-http-headers/">https://addons.mozilla.org/pl/firefox/addon/live-http-headers/</a></li>
<li><a href="http://getfirebug.com/network">http://getfirebug.com/network</a></li>
<li>and much more&#8230;</li>
</ul>
<br /><g:plusone href="http://blog.witalis.net/?p=849" size="small"  annotation="none"  ></g:plusone><br />]]></content:encoded>
			<wfw:commentRss>http://blog.witalis.net/?feed=rss2&#038;p=849</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Are you Red Hat enterprise ready ?</title>
		<link>http://blog.witalis.net/?p=844</link>
		<comments>http://blog.witalis.net/?p=844#comments</comments>
		<pubDate>Sun, 13 May 2012 11:14:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[inne]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[redhat]]></category>

		<guid isPermaLink="false">http://blog.witalis.net/?p=844</guid>
		<description><![CDATA[Easy to find out just try to download one of the free evaluation copy of RHEL.  I&#8217;m definitely not ready: We noticed that your Red Hat Login uses a personal email address. We&#8217;re sorry, but users must have an enterprise &#8230; <a href="http://blog.witalis.net/?p=844">Czytaj dalej <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Easy to find out just try to download one of the free evaluation copy of RHEL.  I&#8217;m definitely not ready:</p>
<p><em>We noticed that your Red Hat Login uses a personal email address. We&#8217;re sorry, but users must have an enterprise or business email address to obtain product evaluations.</em></p>
<p>Proof of the absurd.</p>
<br /><g:plusone href="http://blog.witalis.net/?p=844" size="small"  annotation="none"  ></g:plusone><br />]]></content:encoded>
			<wfw:commentRss>http://blog.witalis.net/?feed=rss2&#038;p=844</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Collect data about working system</title>
		<link>http://blog.witalis.net/?p=825</link>
		<comments>http://blog.witalis.net/?p=825#comments</comments>
		<pubDate>Sun, 15 Apr 2012 10:35:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://blog.witalis.net/?p=825</guid>
		<description><![CDATA[Pretty simple task get information about particular system, answer read documentation about it. But what if there is no documentation or it&#8217;s outdated. One of the solution is to write down some outputs of basic commands, the second solution is &#8230; <a href="http://blog.witalis.net/?p=825">Czytaj dalej <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Pretty simple task get information about particular system, answer read documentation about it. But what if there is no documentation or it&#8217;s outdated. One of the solution is to write down some outputs of basic commands, the second solution is to use dedicated software.<span id="more-825"></span></p>
<p>The first one which I would recommend is cfg2html [1] it generates pretty nice looking output in html about collected data. It covers vast amount of services running on unix based operating system. It&#8217;s a good start point for doing maintenance job, because you know what was before.</p>
<p>The second one is sos. It&#8217;s a software bundled in RHEL and its derivates distros, mainly used to help support team to resolve your problems. You can collect data about particular service:</p><pre class="crayon-plain-tag">&lt;span style=&quot;color: #ff9900;&quot;&gt;#&nbsp;sosreport -o ssh&lt;/span&gt;</pre><p></p><pre class="crayon-plain-tag">&lt;span style=&quot;color: #ff9900;&quot;&gt;
&lt;/span&gt;</pre><p>or choose all plugins which covers whole operating system. Report it&#8217;s placed in /tmp directory.</p>
<p>[1]  <a href="http://cfg2html.com/">http://cfg2html.com/</a></p>
<br /><g:plusone href="http://blog.witalis.net/?p=825" size="small"  annotation="none"  ></g:plusone><br />]]></content:encoded>
			<wfw:commentRss>http://blog.witalis.net/?feed=rss2&#038;p=825</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
