<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7316065293959022108</id><updated>2011-11-14T00:18:01.030-08:00</updated><category term='spca5xx'/><category term='osiris'/><category term='snmptrapd'/><category term='recover deleted file'/><category term='syncookies'/><category term='Sleuth'/><category term='Foremost'/><category term='security'/><category term='barnyard'/><category term='syslog'/><category term='ssh'/><category term='nikto'/><category term='traptoemail'/><category term='shred'/><category term='nessus'/><category term='afick'/><category term='stall'/><category term='dbad'/><category term='libnet'/><category term='swatch'/><category term='ilo'/><category term='oinkmaster'/><category term='libpcap'/><category term='grep'/><category term='tcptraceroute'/><category term='snare'/><category term='snmp'/><category term='scp'/><category term='chkrootkit'/><category term='firewall'/><category term='spcaview'/><category term='lockdown'/><category term='snort'/><category term='sudosh'/><category term='motion'/><title type='text'>Linux Security Guide</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://linuxsecure.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://linuxsecure.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jephe Wu</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>17</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7316065293959022108.post-8858637599340947893</id><published>2008-12-07T03:12:00.000-08:00</published><updated>2008-12-07T03:13:09.619-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='recover deleted file'/><category scheme='http://www.blogger.com/atom/ns#' term='grep'/><title type='text'>looking for the missing data in partition</title><content type='html'># grep -a -B10 -A100 -i fibonacci /dev/hda2 &gt; fabonacci.out&lt;br /&gt;note:&lt;br /&gt;a. searching string fibonacci in partition /dev/hda2, it was in a deleted file.&lt;br /&gt;b. you need a few Mbytes free on the partition while running this command&lt;br /&gt;&lt;br /&gt;-a treat device as a series of ASCII characters&lt;br /&gt;-BN before N line&lt;br /&gt;-AN after N line&lt;br /&gt;-i not case-sensitive&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316065293959022108-8858637599340947893?l=linuxsecure.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxsecure.blogspot.com/feeds/8858637599340947893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7316065293959022108&amp;postID=8858637599340947893' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/8858637599340947893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/8858637599340947893'/><link rel='alternate' type='text/html' href='http://linuxsecure.blogspot.com/2008/12/looking-for-missing-data-in-partition.html' title='looking for the missing data in partition'/><author><name>Jephe Wu</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316065293959022108.post-624348466916964931</id><published>2008-12-07T03:10:00.000-08:00</published><updated>2008-12-07T03:12:36.958-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sleuth'/><category scheme='http://www.blogger.com/atom/ns#' term='Foremost'/><title type='text'>use Sleuth kit to recover deleted files</title><content type='html'>1. install Sleuth , just make will do&lt;br /&gt;2. making sure /usr/local/sleuthkit/bin is in your path before running the following command&lt;br /&gt;3. dd if=/dev/disk-or-partition bs=1024 of=nameofimagefile conv=noerror&lt;br /&gt;&lt;br /&gt;Sleuth is great for recoving text files&lt;br /&gt;&lt;br /&gt;a. use TSK's dls command to extract all of the unallocated space froom the disk image into a single file, which expedites the process of searching for the file that you've deleted.&lt;br /&gt;&lt;br /&gt;# dls hd5_image_etc_files_deleted.img &gt; dls_output.dls&lt;br /&gt;&lt;br /&gt;b. use standard strings command to search for all text strings in the output file&lt;br /&gt;# strings -t d dls_output.dls &gt; dls_output.dls.str&lt;br /&gt;&lt;br /&gt;c. use grep to search for a string that identifies the file you're looking for&lt;br /&gt;grep ":0:0" dls_output.dls.str&lt;br /&gt;131698688 root:x:0:0&lt;br /&gt;.....&lt;br /&gt;&lt;br /&gt;d. divide the above number by block size of file system (4096 for ext2/ext3 file system)&lt;br /&gt;echo "131698688/4096" | bc&lt;br /&gt;32153&lt;br /&gt;&lt;br /&gt;e. dcalc -u 32153 hd5_image_etc_filess_deleted.img&lt;br /&gt;&lt;br /&gt;f. dcat hd5_image_etc_files_deleted.img [&gt; filename]&lt;br /&gt;root:x:0.0...&lt;br /&gt;bin:x:1:1&lt;br /&gt;.....&lt;br /&gt;&lt;br /&gt;....&lt;br /&gt;&lt;br /&gt;g. another tools is Foremost (http://foremost.sf.net)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316065293959022108-624348466916964931?l=linuxsecure.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxsecure.blogspot.com/feeds/624348466916964931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7316065293959022108&amp;postID=624348466916964931' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/624348466916964931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/624348466916964931'/><link rel='alternate' type='text/html' href='http://linuxsecure.blogspot.com/2008/12/use-sleuth-kit-to-recover-deleted-files.html' title='use Sleuth kit to recover deleted files'/><author><name>Jephe Wu</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316065293959022108.post-667726707827312352</id><published>2008-10-29T00:00:00.000-07:00</published><updated>2008-10-29T00:01:19.677-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='nikto'/><title type='text'>use Nikto for Web server security test</title><content type='html'>http://www.cirt.net/nikto2&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316065293959022108-667726707827312352?l=linuxsecure.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxsecure.blogspot.com/feeds/667726707827312352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7316065293959022108&amp;postID=667726707827312352' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/667726707827312352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/667726707827312352'/><link rel='alternate' type='text/html' href='http://linuxsecure.blogspot.com/2008/10/use-nikto-for-web-server-security-test.html' title='use Nikto for Web server security test'/><author><name>Jephe Wu</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316065293959022108.post-5336711469562177517</id><published>2008-05-27T06:50:00.000-07:00</published><updated>2008-05-28T08:06:24.230-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firewall'/><category scheme='http://www.blogger.com/atom/ns#' term='ssh'/><category scheme='http://www.blogger.com/atom/ns#' term='scp'/><category scheme='http://www.blogger.com/atom/ns#' term='stall'/><title type='text'>scp stalled through firewall, ssh no problem</title><content type='html'>&lt;ul&gt;&lt;li&gt;someone says:&lt;/li&gt;&lt;/ul&gt; I have seen similar effects by several reasons:&lt;br /&gt;- disallow icmp and mtu mismatch between networks (e.g. different&lt;br /&gt;networks with then ethernet).&lt;br /&gt;- Split routes&lt;br /&gt;- &lt;b style="color: black; background-color: rgb(255, 255, 102);"&gt;firewall&lt;/b&gt; timeouts&lt;br /&gt;- auto negotiation&lt;br /&gt;========&lt;br /&gt;&lt;span class="section" id="link3"&gt;&lt;b style="color: black; background-color: rgb(160, 255, 255);"&gt;Stalled&lt;/b&gt; "&lt;b style="color: black; background-color: rgb(255, 255, 102);"&gt;scp&lt;/b&gt;" session&lt;/span&gt;               &lt;div class="subparagraph"&gt;Symptom: When "&lt;b style="color: black; background-color: rgb(255, 255, 102);"&gt;scp&lt;/b&gt;" huge files (&gt; 4GB) between hosts, it stalls forever at random instants. It even happens with ftp/rsync. Two reasons may attribute to this problem:&lt;br /&gt;1. Since &lt;b style="color: black; background-color: rgb(255, 255, 102);"&gt;scp&lt;/b&gt; greedyly grabs as much bandwidth of the network as possible when it transfers files, any delay caused by the network switch or the SuSE &lt;b style="color: black; background-color: rgb(153, 255, 153);"&gt;firewall&lt;/b&gt; can easily make the TCP connection &lt;b style="color: black; background-color: rgb(160, 255, 255);"&gt;stalled&lt;/b&gt;.               &lt;br /&gt;For this reason, the solution is to limit the bandwidth quota for &lt;b style="color: black; background-color: rgb(255, 255, 102);"&gt;scp&lt;/b&gt; as below:&lt;/div&gt;               &lt;div class="console"&gt;username@localhost&gt; &lt;b style="color: black; background-color: rgb(255, 255, 102);"&gt;scp&lt;/b&gt; -l 2000 SOURCE DESTINATION                &lt;span class="emphasis"&gt;# The option "-l 2000" limits the bandwidth up to 2000 Kbit/s which is safe and fast enough.&lt;/span&gt; &lt;/div&gt;               &lt;div class="subparagraph"&gt;2. It is due to the Linux SACK implementation problem for               &lt;br /&gt;both 2.4 and 2.6 when the TCP window is &gt; 20 MB. Linux               &lt;br /&gt;takes such long time to locate the SACKed packet that               &lt;br /&gt;a TCP timeout is easily reached and CWND goes back to               &lt;br /&gt;the first packet when there are too many packets in flight               &lt;br /&gt;and a SACK event is invoked.               &lt;br /&gt;Please refer to the following links for information about               &lt;br /&gt;SACK:               &lt;br /&gt;http://www.ietf.org/rfc/rfc2018.txt               &lt;br /&gt;http://www.ietf.org/rfc/rfc1072.txt               &lt;br /&gt;It might be working to restrict the TCP buffer size to about 12 MB. However,               &lt;br /&gt;the total throughput is limited. The better solution may be:&lt;/div&gt;               &lt;div class="console"&gt;username@localhost&gt; su               &lt;span class="emphasis"&gt;# Enter the root password&lt;/span&gt;                &lt;br /&gt;append "net.ipv4.tcp_sack=0" to /etc/sysctl.conf               &lt;br /&gt;username@localhost&gt; sysctl -p&lt;/div&gt;               &lt;div class="subparagraph"&gt;Or&lt;/div&gt;               &lt;div class="console"&gt;username@localhost&gt; su               &lt;span class="emphasis"&gt;# Enter the root password&lt;/span&gt;                &lt;br /&gt;username@localhost&gt; cat 0 &gt; /proc/sys/net/ipv4/tcp_sack&lt;/div&gt;               &lt;div class="subparagraph"&gt;Or&lt;/div&gt;               &lt;div class="console"&gt;username@localhost&gt; su               &lt;span class="emphasis"&gt;# Enter the root password&lt;/span&gt;                &lt;br /&gt;username@localhost&gt; sysctl -w net.ipv4.tcp_sack=0&lt;/div&gt;               &lt;div class="subparagraph"&gt;With this configuration, the SSH transfer of huge-sized file will stall occasionally with every short period of less than 1 second and then recover automatically. That means the simple cumulative acknowledgement scheme of TCP is robust enough.&lt;br /&gt;FYI: There are many other suggestions through the internet as listed below (unfortunately, non of them worked on my machine):               &lt;br /&gt;1. Eliminating all the DROP rules for port 22 inside the iptables.               &lt;br /&gt;2. Turning off SuSEfirewall2.               &lt;br /&gt;3. Limiting the bandwidth by:&lt;/div&gt;               &lt;div class="console"&gt;username@localhost&gt; &lt;b style="color: black; background-color: rgb(255, 255, 102);"&gt;scp&lt;/b&gt; -l 2000&lt;/div&gt;               &lt;div class="subparagraph"&gt;4. Changing the MTU of NIC by:&lt;/div&gt;               &lt;div class="console"&gt;username@localhost&gt; ifconfig eth0 mtu xxx&lt;/div&gt;               &lt;div class="subparagraph"&gt;5. Increasing the queue for transmission by &lt;/div&gt;               &lt;div class="console"&gt;username@localhost&gt; ifconfig eth0 txqueuelen 2000&lt;/div&gt;               &lt;div class="subparagraph"&gt;6. Tuning TCP performance by &lt;/div&gt;               &lt;div class="console"&gt;net.core.rmem_max=16777216               &lt;br /&gt;net.core.wmem_max=16777216               &lt;br /&gt;net.core.netdev_max_backlog=2500               &lt;br /&gt;net.ipv4.tcp_rmem=4096 87380 16777216               &lt;br /&gt;net.ipv4.tcp_wmem=4096 65536 16777216               &lt;br /&gt;net.ipv4.tcp_no_metrics_save=1               &lt;br /&gt;net.ipv4.tcp_timestamps=0&lt;/div&gt;               &lt;div class="subparagraph"&gt;7. Turning off the buggy TCP segmentation offload by&lt;/div&gt;               &lt;div class="console"&gt;username@localhost&gt; ethtool -K eth0 tso off&lt;/div&gt;               &lt;div class="subparagraph"&gt;8. Compressing the files being transfered by&lt;/div&gt;               &lt;div class="console"&gt;username@localhost&gt; &lt;b style="color: black; background-color: rgb(255, 255, 102);"&gt;scp&lt;/b&gt; -C&lt;/div&gt;               &lt;div class="subparagraph"&gt;9. Using pipe and std io to avoid possible "&lt;b style="color: black; background-color: rgb(255, 255, 102);"&gt;scp&lt;/b&gt;" huge file               &lt;br /&gt;limitation by&lt;/div&gt;               &lt;div class="console"&gt;username@localhost&gt; cat localfile | ssh ravana cat "&gt;" remotefile&lt;/div&gt;               &lt;div class="subparagraph"&gt;Or&lt;/div&gt;               &lt;div class="console"&gt;username@localhost&gt; tar cf - . | ssh ravana tar xvpf -&lt;/div&gt;               &lt;div class="subparagraph"&gt;10. Clamping MSS by &lt;/div&gt;               &lt;div class="console"&gt;username@localhost&gt; iptables -I FORWARD 1 -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu"&lt;br /&gt;&lt;br /&gt;====for my company, I used the following over 2M lease line link&lt;br /&gt;&lt;br /&gt; scp -l 1500 VMware-server-1.0.5-80187.i386.rpm 1.2.3.4:/tmp&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316065293959022108-5336711469562177517?l=linuxsecure.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxsecure.blogspot.com/feeds/5336711469562177517/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7316065293959022108&amp;postID=5336711469562177517' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/5336711469562177517'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/5336711469562177517'/><link rel='alternate' type='text/html' href='http://linuxsecure.blogspot.com/2008/05/scp-stalled-through-firewall-ssh-no.html' title='scp stalled through firewall, ssh no problem'/><author><name>Jephe Wu</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316065293959022108.post-6878195251190343690</id><published>2008-05-06T19:56:00.000-07:00</published><updated>2008-05-06T19:59:51.701-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tcptraceroute'/><category scheme='http://www.blogger.com/atom/ns#' term='libpcap'/><category scheme='http://www.blogger.com/atom/ns#' term='libnet'/><title type='text'>setup tcptraceroute under CentOS 5</title><content type='html'>&lt;ul&gt;&lt;li&gt;download tcptraceroute from http://michael.toren.net/code/tcptraceroute/&lt;br /&gt;&lt;/li&gt;&lt;li&gt;install libpcap package on CentOS 5 using yum&lt;/li&gt;&lt;/ul&gt;#yum install libpcap* &lt;br /&gt;  including libpcap-devel package so that libpcap.h can be used for 'make'&lt;br /&gt;&lt;ul&gt;&lt;li&gt;install libnet package&lt;/li&gt;&lt;/ul&gt;# yum install libnet  (without *)&lt;br /&gt;&lt;ul&gt;&lt;li&gt;run 'ldconfig -v' before compiling tcproute&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;compile tcproute&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;# ./configure;make;make install&lt;br /&gt;&lt;ul&gt;&lt;li&gt;done&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316065293959022108-6878195251190343690?l=linuxsecure.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxsecure.blogspot.com/feeds/6878195251190343690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7316065293959022108&amp;postID=6878195251190343690' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/6878195251190343690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/6878195251190343690'/><link rel='alternate' type='text/html' href='http://linuxsecure.blogspot.com/2008/05/setup-tcptraceroute-under-centos-5.html' title='setup tcptraceroute under CentOS 5'/><author><name>Jephe Wu</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316065293959022108.post-6453644952550012015</id><published>2008-04-10T00:29:00.000-07:00</published><updated>2008-04-10T19:23:15.874-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sudosh'/><category scheme='http://www.blogger.com/atom/ns#' term='swatch'/><title type='text'>setup sudosh and swatch on Linux server</title><content type='html'>&lt;ul&gt;&lt;li&gt;purpose:&lt;/li&gt;&lt;/ul&gt;assuming root password is locked in safebox, normal user like 'jephe' can only use 'sudo sudosh' to become root, after that, everything will be recorded and can be replayed later.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;install sudosh&lt;/li&gt;&lt;/ul&gt;download it from DAG website(search google for 'DAG sudosh')  for using 'yum install sudosh' from CentOS 5 or run 'yum install sudosh' from RHEL 5 after registering with RHN using command 'rhnreg_ks --proxy=http://x.y.z.k:port --username=user1 --password=pass1&lt;br /&gt;&lt;ul&gt;&lt;li&gt;put the folllowing to /etc/sudoers&lt;/li&gt;&lt;/ul&gt;jephe ALL=/usr/bin/sudosh&lt;br /&gt;&lt;ul&gt;&lt;li&gt;initialize sudo folder by running 'sudosh -i', the permission should be like this:&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;[root@jephe ~]# ls -ld /var/log/sudosh&lt;br /&gt;drwx-wx-wx 2 root root 4096 Apr 10 15:37 /var/log/sudosh&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;install swatch to realtime scan /var/log/secure to monitor 'su, sudo and console root login'&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;1. installing swatch rpm using the same method as sudosh&lt;br /&gt;2. put the following to /etc/swatch.conf&lt;br /&gt;[root@jephe ~]# more /etc/swatch.conf&lt;br /&gt;watchfor /sudo:.*/&lt;br /&gt;mail root,subject=--- server sudo alert! ---&lt;br /&gt;&lt;br /&gt;watchfor /su:.*/&lt;br /&gt;mail root,subject=--- server su alert! ---&lt;br /&gt;&lt;br /&gt;watchfor /login: ROOT LOGIN.*/&lt;br /&gt;mail root,subject=--- server console login alert! ---&lt;br /&gt;3. set root alias in /etc/alias, then run 'newaliases', for those environment that doesn't have DNS server, using /etc/mail/service.switch&lt;br /&gt;[root@jephe ~]# cd /etc/mail&lt;br /&gt;[root@jephe mail]# more service.switch&lt;br /&gt;hosts files&lt;br /&gt;4. put the following to /etc/rc.local&lt;br /&gt;/usr/bin/swatch -c /etc/swatch.conf  -t /var/log/secure --daemon&lt;br /&gt;5. put the following to /etc/logrotate.d/syslog&lt;br /&gt;[root@jephe logrotate.d]# more syslog&lt;br /&gt;/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {&lt;br /&gt;   sharedscripts&lt;br /&gt;   postrotate&lt;br /&gt;       /bin/kill -HUP `cat /var/run/syslogd.pid 2&gt; /dev/null` 2&gt; /dev/null || true&lt;br /&gt;&lt;br /&gt;##added by Jephe####&lt;br /&gt; kill -9 `ps -ef | grep -e swatch -e '/usr/bin/tail -n 0' | grep -v grep | awk '{print $2}'`&lt;br /&gt;       sleep 5&lt;br /&gt;       /usr/bin/swatch -c /etc/swatch.conf -t /var/log/secure --daemon&lt;br /&gt;###end#####&lt;br /&gt;   endscript&lt;br /&gt;}&lt;br /&gt;6. put the following to /usr/local/sbin/restartsw (for restarting swatch)&lt;br /&gt;[root@db7 logrotate.d]# more /usr/local/sbin/restartsw&lt;br /&gt;#!/bin/sh&lt;br /&gt;kill -9 `ps -ef | grep -e swatch -e '/usr/bin/tail -n 0' | grep -v grep | awk '{print $2}'`&lt;br /&gt;sleep 2&lt;br /&gt;/usr/bin/swatch -c /etc/swatch.conf -t /var/log/secure --daemon&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;configuring sendmail.mc to masquerade in non-dns environment&lt;/li&gt;&lt;/ul&gt;[root@db7 mail]# diff sendmail.mc.orig sendmail.mc&lt;br /&gt;39a40&lt;br /&gt;&gt; define(`SMART_HOST',`mailrelay')dnl&lt;br /&gt;103c104&lt;br /&gt;&lt;&gt; dnl EXPOSED_USER(`root')dnl&lt;br /&gt;160c161&lt;br /&gt;&lt;&gt; MASQUERADE_AS(`newdomain.com')dnl&lt;br /&gt;164c165&lt;br /&gt;&lt;&gt; FEATURE(masquerade_envelope)dnl&lt;br /&gt;168c169&lt;br /&gt;&lt;&gt; FEATURE(masquerade_entire_domain)dnl&lt;br /&gt;170,172c171,173&lt;br /&gt;&lt;&gt; MASQUERADE_DOMAIN(localhost)dnl&lt;br /&gt;&gt; MASQUERADE_DOMAIN(localhost.localdomain)dnl&lt;br /&gt;&gt; MASQUERADE_DOMAIN(domain.com)dnl&lt;br /&gt;&lt;br /&gt;note: assuming server hostname is jephe.domain.com, so swatch will send out email using root@jephe.domain.com normally, which is not-exist domain, but newdomain.com is valid, so we masquerade it to root@newdomain.com.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316065293959022108-6453644952550012015?l=linuxsecure.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxsecure.blogspot.com/feeds/6453644952550012015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7316065293959022108&amp;postID=6453644952550012015' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/6453644952550012015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/6453644952550012015'/><link rel='alternate' type='text/html' href='http://linuxsecure.blogspot.com/2008/04/setup-sudosh-and-swatch-on-linux-server.html' title='setup sudosh and swatch on Linux server'/><author><name>Jephe Wu</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316065293959022108.post-7575935252563051162</id><published>2008-04-10T00:12:00.000-07:00</published><updated>2008-04-10T00:29:31.937-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='osiris'/><title type='text'>setup osiris for Windows</title><content type='html'>&lt;ul&gt;&lt;li&gt;purpose: for recording down system user/group changes and Windows directory and any other directories changes.&lt;/li&gt;&lt;li&gt;how it works: osiris on Windows is agent, the management tool and daemon are residing on Linux server. You need to configure it on Linux sever after installing software on Windows. Then it will generate a base database for comparing every 24 hours by default, then send out email alert for any changes&lt;br /&gt;&lt;/li&gt;&lt;li&gt;install it on Windows&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;if you are installing it through terminal service, it will install to wrong place.&lt;br /&gt;Solution:&lt;br /&gt;1. after installing , copy c:\document and settings\sysmgr\windows\osiris directory to c:\win2k03&lt;br /&gt;2. copy c:\documents and setting\sysmgr\windows\osiris to c:\win2k03\system32&lt;br /&gt;3. startup osiris service again&lt;br /&gt;&lt;br /&gt;note: if you encounter error saying "error writing to file osimessage.dll", u can rename c:\windows\system32\osimessage.dll first&lt;br /&gt;&lt;ul&gt;&lt;li&gt;osiris on Linux&lt;/li&gt;&lt;/ul&gt;1. ./configure;make;make install&lt;br /&gt;2. enable tcp port 2265 and 2266 for iptables host firewall&lt;br /&gt;3. enable in-between firewall ports too for above 2 ports&lt;br /&gt;4. on server, configure management console&lt;br /&gt;# osiris&lt;br /&gt;# login as username and password&lt;br /&gt;# add-host&lt;br /&gt;all the way to default, except for email alert part choose (y,y,n,y)&lt;br /&gt;&lt;br /&gt;copy configuration file to the windows server name to be monitored&lt;br /&gt;start-scan servername&lt;br /&gt;list-db servername&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316065293959022108-7575935252563051162?l=linuxsecure.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxsecure.blogspot.com/feeds/7575935252563051162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7316065293959022108&amp;postID=7575935252563051162' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/7575935252563051162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/7575935252563051162'/><link rel='alternate' type='text/html' href='http://linuxsecure.blogspot.com/2008/04/setup-osiris-for-windows.html' title='setup osiris for Windows'/><author><name>Jephe Wu</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316065293959022108.post-699416353768788567</id><published>2008-04-09T22:52:00.000-07:00</published><updated>2008-04-10T00:11:33.916-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='syslog'/><category scheme='http://www.blogger.com/atom/ns#' term='snare'/><title type='text'>setup Snare for Windows for centralized system log</title><content type='html'>&lt;ul&gt;&lt;li&gt;download snare for Windows &lt;/li&gt;&lt;li&gt;after install, access it using http://localhost:6161&lt;/li&gt;&lt;li&gt;go to 'network configuration' to give the remote Linux syslog-ng server ip at 'Destination Snare Server address', also give 'Destination Port which is 514 for syslog-ng'&lt;/li&gt;&lt;li&gt;go to 'remote control' to setup password&lt;/li&gt;&lt;li&gt;access it next time using username and password pair 'snare/password you gave'&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316065293959022108-699416353768788567?l=linuxsecure.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxsecure.blogspot.com/feeds/699416353768788567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7316065293959022108&amp;postID=699416353768788567' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/699416353768788567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/699416353768788567'/><link rel='alternate' type='text/html' href='http://linuxsecure.blogspot.com/2008/04/setup-snare-for-windows-for-centralized.html' title='setup Snare for Windows for centralized system log'/><author><name>Jephe Wu</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316065293959022108.post-3932047933589919579</id><published>2008-03-06T19:34:00.000-08:00</published><updated>2008-03-06T21:33:35.483-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='oinkmaster'/><category scheme='http://www.blogger.com/atom/ns#' term='snort'/><category scheme='http://www.blogger.com/atom/ns#' term='barnyard'/><title type='text'>setup Snort on CentOS 5</title><content type='html'>&lt;ol&gt;&lt;li&gt;follow the documentation on www.internetsecurityguru.com&lt;/li&gt;&lt;li&gt;certain things to take note as follow:&lt;/li&gt;&lt;/ol&gt;&lt;ul&gt;&lt;li&gt;selinux&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;vi /etc/selinux/config, change to disabled, then reboot&lt;br /&gt;&lt;ul&gt;&lt;li&gt;yum -y update, and you might want to add 'export http_proxy=http://10.0.0.252:8080' to /etc/profile&lt;/li&gt;&lt;li&gt;oinkmaster&lt;/li&gt;&lt;/ul&gt;login to snort website as registered user, go to rules-download rules, from there you will know how to get the oinkmaster code for automatic download rules for registered user.&lt;br /&gt;&lt;br /&gt;after setting up oinkmaster cronjob script, you might want to add root cronjob to restart snort itself also, in case the new rules are downloaded by oinkmaster, then it can be used snort&lt;br /&gt;&lt;br /&gt;cronjob -l -u snort&lt;br /&gt;30 5 * * *  export http_proxy=http://1.2.3.4:8080; /usr/bin/oinkmaster.pl -C /etc/pinkmaster.conf -C /etc/autodisable.conf -b /etc/snort/backup &gt; /tmp/snort.cron 2&gt;&amp;amp;1 ;sync;sync;sync;sleep 15; (echo:snort@domain.com";echo "Subject: snort rules daily update";echo "";cat /tmp/snort.cron) | /usr/sbin/sendmail -f snort@domain.com jephe@domain.com&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;pear config-show&lt;/li&gt;&lt;/ul&gt;use pear config-set to set http_proxy as 1.2.3.4:8080 then run 'pear install xxxxx'&lt;br /&gt;&lt;ul&gt;&lt;li&gt;perl -MCPAN -e shell&lt;/li&gt;&lt;/ul&gt;install Net::RawIP or force install Net::RawIP&lt;br /&gt;&lt;ul&gt;&lt;li&gt;barnyard&lt;/li&gt;&lt;/ul&gt;download it from www.snort.org&lt;br /&gt;./configure --enable-mysql;make;make install&lt;br /&gt;use the following configuration for /etc/snort/barnyard.conf&lt;br /&gt;config localtime&lt;br /&gt;config hostname: localhost&lt;br /&gt;config interface: eth1&lt;br /&gt;output alert_fast&lt;br /&gt;output log_dump&lt;br /&gt;output log_acid_db: mysql, database snort, server localhost, user snort, password snort, detail full&lt;br /&gt;&lt;br /&gt;you only need to modify bylog.waldo once, after that, barnyard will update it automatically.&lt;br /&gt;&lt;br /&gt;here is the init script for barnyard:&lt;br /&gt;--------------------&lt;br /&gt;#!/bin/sh&lt;br /&gt;#&lt;br /&gt;# chkconfig: 2345 99 82&lt;br /&gt;# description: Starts and stops Barnyard&lt;br /&gt;#&lt;br /&gt;# config: /etc/snort/barnyard.conf&lt;br /&gt;# processname: barnyard&lt;br /&gt;&lt;br /&gt;# Source function library&lt;br /&gt;. /etc/rc.d/init.d/functions&lt;br /&gt;&lt;br /&gt;# program name&lt;br /&gt;BASE=barnyard&lt;br /&gt;&lt;br /&gt;# program options&lt;br /&gt;CONF="/etc/snort/barnyard.conf"&lt;br /&gt;GEN_MAP="/etc/snort/gen-msg.map"&lt;br /&gt;SID_MAP="/etc/snort/sid-msg.map"&lt;br /&gt;LOG_DIR="/var/log/snort"&lt;br /&gt;LOG_FILE="snort.log"&lt;br /&gt;WALDO_FILE="/var/log/snort/bylog.waldo"&lt;br /&gt;DAEMON="-D"&lt;br /&gt;&lt;br /&gt;# Check that $BASE exists.&lt;br /&gt;[ -f /usr/local/bin/$BASE ] || exit 0&lt;br /&gt;&lt;br /&gt;# Source networking configuration.&lt;br /&gt;. /etc/sysconfig/network&lt;br /&gt;&lt;br /&gt;# Check that networking is up.&lt;br /&gt;[ ${NETWORKING} = "no" ] &amp;amp;&amp;amp; exit 0&lt;br /&gt;&lt;br /&gt;RETVAL=0&lt;br /&gt;&lt;br /&gt;# See how we were called.&lt;br /&gt;case "$1" in&lt;br /&gt;start)&lt;br /&gt;if [ -n "`/sbin/pidof $BASE`" ]; then&lt;br /&gt;echo -n $"$BASE: already running"&lt;br /&gt;echo ""&lt;br /&gt;exit $RETVAL&lt;br /&gt;fi&lt;br /&gt;echo -n "Starting Barnyard service: "&lt;br /&gt;/usr/local/bin/$BASE -c $CONF -g $GEN_MAP -s $SID_MAP -d $LOG_DIR -f $LOG_FILE -w $WALDO_FILE $DAEMON&lt;br /&gt;sleep 1&lt;br /&gt;action "" /sbin/pidof $BASE&lt;br /&gt;RETVAL=$?&lt;br /&gt;[ $RETVAL -eq 0 ] &amp;amp;&amp;amp; touch /var/lock/subsys/barnyard&lt;br /&gt;;;&lt;br /&gt;stop)&lt;br /&gt;echo -n "Shutting down Barnyard service: "&lt;br /&gt;killproc /usr/local/bin/$BASE&lt;br /&gt;RETVAL=$?&lt;br /&gt;echo&lt;br /&gt;[ $RETVAL -eq 0 ] &amp;amp;&amp;amp; rm -f /var/lock/subsys/barnyard&lt;br /&gt;;;&lt;br /&gt;restart|reload)&lt;br /&gt;$0 stop&lt;br /&gt;$0 start&lt;br /&gt;RETVAL=$?&lt;br /&gt;;;&lt;br /&gt;status)&lt;br /&gt;status $BASE&lt;br /&gt;RETVAL=$?&lt;br /&gt;;;&lt;br /&gt;*)&lt;br /&gt;echo "Usage: snort {start|stop|restart|reload|status}"&lt;br /&gt;exit 1&lt;br /&gt;esac&lt;br /&gt;&lt;br /&gt;exit $RETVAL&lt;br /&gt;--------------------------&lt;br /&gt;&lt;ul&gt;&lt;li&gt;snort.conf&lt;/li&gt;&lt;/ul&gt;output alert_syslog: LOG_LOCAL1&lt;br /&gt;output alert_unified: filename snort.alert, limit 128&lt;br /&gt;output log_unified: filename snort.log, limit 128&lt;br /&gt;&lt;br /&gt;change interface to eth1 in /etc/init.d/snort script&lt;br /&gt;&lt;br /&gt;cronjob for snort:&lt;br /&gt;50 5 * * * /sbin/service snort restart 2&gt;&amp;amp;1 &gt; /tmp/snortrestart.cron;sleep 5;(echo "From:sensor1@domain.com";echo "Subject:snort daily restart";echo "";cat /tmp/snortrestart.cron)| /usr/sbin/sendmail -f snort@domain.com jephe@domain.com&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;swatch&lt;/li&gt;&lt;/ul&gt;more /etc/swatch.conf:&lt;br /&gt;watchfor /snort.*Priority.* -&gt; .*/&lt;br /&gt;mail jephe@domain.com:wu@domain.com,subject=--- Sensor1 Snort Alert! ---&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;syslog&lt;/li&gt;&lt;/ul&gt;add the following to /etc/logrotate.d/syslog&lt;br /&gt;/var/log/snortalert {&lt;br /&gt;  daily&lt;br /&gt;   sharedscripts&lt;br /&gt;   postrotate&lt;br /&gt;       /bin/kill -HUP `cat /var/run/syslogd.pid 2&gt; /dev/null` 2&gt; /dev/null || true&lt;br /&gt;       kill -9 `ps -ef | grep -e swatch -e '/usr/bin/tail -n 0' | grep -v grep | awk '{print $2}'`&lt;br /&gt;       sleep 5&lt;br /&gt;       /usr/bin/swatch -c /etc/swatch.conf -t /var/log/snortalert --daemon&lt;br /&gt;   endscript&lt;br /&gt;}&lt;br /&gt;grep snort /etc/syslog.conf&lt;br /&gt;local1.*                                                /var/log/snortalert&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;/etc/rc.local&lt;/li&gt;&lt;/ul&gt;/usr/bin/swatch -c /etc/swatch.conf  -t /var/log/snortalert --daemon&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;sendmail&lt;/li&gt;&lt;/ul&gt;masqrade root@snort.domain.com to root@domain.com&lt;br /&gt;a. change DS part to DS[1.2.3.5] which is smtp server&lt;br /&gt;b. put the following to /etc/mail/sendmail.mc&lt;br /&gt;masquerade_as('domain.com')&lt;br /&gt;feature(masquerade_envelope)&lt;br /&gt;feature(masquerade_entire_domain)&lt;br /&gt;masquerade_domain(localhost)&lt;br /&gt;masquerade_domain(localhost.domain)&lt;br /&gt;then go to /etc/mail/sendmail.cf to commen out C{E} root&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;conclusion&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;use snort, oinkmaster update rules daily then require snort restart, swatch to watch /var/log/snortalert to send out email notification, but after syslog rotation, need to restart swatch. barnyard is doing mysql database recording for snort alert.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316065293959022108-3932047933589919579?l=linuxsecure.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxsecure.blogspot.com/feeds/3932047933589919579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7316065293959022108&amp;postID=3932047933589919579' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/3932047933589919579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/3932047933589919579'/><link rel='alternate' type='text/html' href='http://linuxsecure.blogspot.com/2008/03/setup-snort-on-centos-5.html' title='setup Snort on CentOS 5'/><author><name>Jephe Wu</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316065293959022108.post-5127021574389712201</id><published>2008-01-11T01:53:00.001-08:00</published><updated>2008-01-14T02:01:21.932-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ilo'/><category scheme='http://www.blogger.com/atom/ns#' term='snmp'/><category scheme='http://www.blogger.com/atom/ns#' term='traptoemail'/><category scheme='http://www.blogger.com/atom/ns#' term='snmptrapd'/><title type='text'>enable snmptrapd to work with selinux under Fedora Core 3</title><content type='html'>Purpose: to make HP ILO to send out snmp trap to snmp trap server running snmptrapd, through which, to send out email using snmptraptoemail function.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;enable snmptrapd to work with selinux first&lt;/li&gt;&lt;/ol&gt;&lt;ul&gt;&lt;li&gt;download selinux-policy-targeted-sources-1.17.30-2.19.noarch.rpm then install it using rpm -ivh , after that, run the following commands&lt;/li&gt;&lt;/ul&gt;[root@mail policy]# pwd&lt;br /&gt;/etc/selinux/targeted/src/policy&lt;br /&gt;[root@mail policy]# dmesg |audit2allow&lt;br /&gt;allow snmpd_t bin_t:dir { search };&lt;br /&gt;allow snmpd_t device_t:sock_file { write };&lt;br /&gt;allow snmpd_t snmpd_t:fifo_file { write };&lt;br /&gt;&lt;br /&gt;then put the above lines to domains &lt;span style="font-weight: bold;"&gt;/etc/selinux/targeted/src/policy/domains/misc/local.te&lt;/span&gt;, after that, under policy folder, then '&lt;span style="font-weight: bold;"&gt;make load&lt;/span&gt;'&lt;br /&gt;finally, restart snmptrapd service before testing sending test snmp alert from ILO web interface.&lt;br /&gt;&lt;br /&gt;2. how to setup snmptrap to email?&lt;br /&gt;[root@mail snmp]# more /etc/snmp/snmptrapd.conf&lt;br /&gt;traphandle default /usr/bin/perl /usr/bin/traptoemail -s localhost -f hpsnmptrap@yourdomain.com youremailaddress&lt;br /&gt;&lt;br /&gt;You can put multiple lines for above snmptrapd.conf configuration&lt;br /&gt;&lt;br /&gt;3. go to ILO - Administration - SNMP/ Insight Manager Setting to enable SNMP ILO Alert and put your snmp trap server IP address, send test alert out now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316065293959022108-5127021574389712201?l=linuxsecure.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxsecure.blogspot.com/feeds/5127021574389712201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7316065293959022108&amp;postID=5127021574389712201' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/5127021574389712201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/5127021574389712201'/><link rel='alternate' type='text/html' href='http://linuxsecure.blogspot.com/2008/01/enable-snmptrapd-to-work-with-selinux.html' title='enable snmptrapd to work with selinux under Fedora Core 3'/><author><name>Jephe Wu</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316065293959022108.post-8284313078381558495</id><published>2007-10-25T23:47:00.000-07:00</published><updated>2007-10-26T05:35:15.264-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spcaview'/><category scheme='http://www.blogger.com/atom/ns#' term='spca5xx'/><category scheme='http://www.blogger.com/atom/ns#' term='motion'/><title type='text'>set up webcam for home security under CentOS 4</title><content type='html'>step:&lt;br /&gt;&lt;br /&gt;1. yum install  *sdl*&lt;br /&gt;this will install DSL and devel-DSL and a lot of xorg-x11 rpm packages if you don't have X11 installed&lt;br /&gt;&lt;br /&gt;2. modprobe video&lt;br /&gt;&lt;br /&gt;3. install kernel devel rpm packages for compiling spca5xx&lt;br /&gt;&lt;br /&gt;4.  download spca5xx driver and spcaview package from docs.maxposs.com/docs/spca5xx&lt;br /&gt;then do 'make; make install ' for them&lt;br /&gt;&lt;br /&gt;5. modprobe spca5xx&lt;br /&gt;&lt;br /&gt;6.  ssh -X jephe.dyndns.org&lt;br /&gt;xterm&lt;br /&gt;spcaview (default device is /dev/video0)&lt;br /&gt;&lt;br /&gt;7. install libjpeg-devel* using yum&lt;br /&gt;&lt;br /&gt;8. download motion tar file from http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome&lt;br /&gt;then compile it&lt;br /&gt;&lt;br /&gt;9. cd /usr/local/share/doc/motion-3.2.8/examples&lt;br /&gt;cp /usr/local/share/doc/motion-3.2.8/examples/motion.init-RH to /etc/init.d/motion&lt;br /&gt;chkconfig motion on&lt;br /&gt;&lt;br /&gt;cd /usr/local/etc/&lt;br /&gt;cp /usr/local/etc/motion-dist.conf to /usr/local/etc/motion.conf&lt;br /&gt;vi /usr/local/etc/motion.conf to change&lt;br /&gt;webcam_quality 300&lt;br /&gt;webcam_localhost off&lt;br /&gt;control_localhost off&lt;br /&gt;&lt;br /&gt;10. service motion restart&lt;br /&gt;&lt;br /&gt;11. point your firefox to http://192.168.100.150:8081/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316065293959022108-8284313078381558495?l=linuxsecure.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxsecure.blogspot.com/feeds/8284313078381558495/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7316065293959022108&amp;postID=8284313078381558495' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/8284313078381558495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/8284313078381558495'/><link rel='alternate' type='text/html' href='http://linuxsecure.blogspot.com/2007/10/set-up-webcam-for-home-security-under.html' title='set up webcam for home security under CentOS 4'/><author><name>Jephe Wu</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316065293959022108.post-140840725036792998</id><published>2007-10-23T18:58:00.000-07:00</published><updated>2007-10-23T19:05:55.162-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='chkrootkit'/><category scheme='http://www.blogger.com/atom/ns#' term='afick'/><title type='text'>afick and chkrootkit</title><content type='html'>1. define alias  in configuration file which is linux.conf&lt;br /&gt;2. running fick&lt;br /&gt;#afick -c linux.conf -i&lt;br /&gt;#afick -c linux.conf -k&lt;br /&gt;#crontab -e&lt;br /&gt;#afick -c linux.conf -u&lt;br /&gt;&lt;br /&gt;0 1 * * * rot /path/to/afick.cron&lt;br /&gt;&lt;br /&gt;3. http://www.chkrootkit.org/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316065293959022108-140840725036792998?l=linuxsecure.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxsecure.blogspot.com/feeds/140840725036792998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7316065293959022108&amp;postID=140840725036792998' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/140840725036792998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/140840725036792998'/><link rel='alternate' type='text/html' href='http://linuxsecure.blogspot.com/2007/10/afick-and-chkrootkit.html' title='afick and chkrootkit'/><author><name>Jephe Wu</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316065293959022108.post-2525469185161138040</id><published>2007-09-17T17:09:00.000-07:00</published><updated>2007-09-17T17:10:19.312-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lockdown'/><title type='text'>lockdown an account</title><content type='html'># passwd -l webserv&lt;br /&gt;# usermod -s /bin/false webserv&lt;br /&gt;&lt;br /&gt;# grep webserv /etc/shadow&lt;br /&gt;# grep webserv /etc/passwd&lt;br /&gt;# login webserv&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316065293959022108-2525469185161138040?l=linuxsecure.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxsecure.blogspot.com/feeds/2525469185161138040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7316065293959022108&amp;postID=2525469185161138040' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/2525469185161138040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/2525469185161138040'/><link rel='alternate' type='text/html' href='http://linuxsecure.blogspot.com/2007/09/lockdown-account.html' title='lockdown an account'/><author><name>Jephe Wu</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316065293959022108.post-1502223441262733458</id><published>2007-09-17T17:06:00.000-07:00</published><updated>2007-09-17T17:09:02.144-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='syncookies'/><title type='text'>enable syn_cookies</title><content type='html'># echo 4096 &gt; /proc/sys/net/ipv4/tcp_max_syn_backlog&lt;br /&gt;# echo "net.ipv4.tcp_max_syn_backlog = 1" &gt;&gt; /etc/sysctl.conf&lt;br /&gt;# echo 1 &gt; /proc/sys/net/ipv4/tcp_syncookies&lt;br /&gt;# echo "net.ipv4.tcp_syncookies =1 " &gt;&gt; /etc/sysctl.conf&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316065293959022108-1502223441262733458?l=linuxsecure.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxsecure.blogspot.com/feeds/1502223441262733458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7316065293959022108&amp;postID=1502223441262733458' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/1502223441262733458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/1502223441262733458'/><link rel='alternate' type='text/html' href='http://linuxsecure.blogspot.com/2007/09/enable-syncookies.html' title='enable syn_cookies'/><author><name>Jephe Wu</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316065293959022108.post-1642575519980277890</id><published>2007-09-12T21:25:00.000-07:00</published><updated>2007-10-29T23:08:38.905-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dbad'/><category scheme='http://www.blogger.com/atom/ns#' term='shred'/><title type='text'>useful security tools</title><content type='html'>&lt;ul&gt;&lt;li&gt;http://www.net-square.com/httprint/   - web server fingherprint tool&lt;/li&gt;&lt;li&gt;logwatch - log file analysis daily&lt;br /&gt;&lt;/li&gt;&lt;li&gt;swatch - simple logfile watcher&lt;/li&gt;&lt;li&gt;portsentry&lt;/li&gt;&lt;li&gt;http://osiris.shmoo.com/ - host intergrity tool&lt;/li&gt;&lt;li&gt;ssldump&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.blogger.com/www.securityfocus.com"&gt;www.securityfocus.com&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;Forensic Analysis&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Penguin Sleuth Kit(&lt;a href="http://www.linux-forensics.com"&gt;www.linux-forensics.com&lt;/a&gt;)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;F.I.R.E (Forensic and Incident Response Environment) &lt;a href="www.linux-forensics.com"&gt;http://fire.dmzs.com&lt;/a&gt;&lt;/li&gt;&lt;li&gt;BSD fans, use Snarl Bootal Forensics CD&lt;a href="http://snarl.eecue.com/"&gt; http://snarl.eecue.com/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;Permanently delete files or hard disk&lt;br /&gt;&lt;ul&gt;&lt;li&gt;shred -n 3 -vz filename  (-u)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;note: random data for 3 pass ( -n 3), be verbose (-v) and write a final pass of zeros over the file after completing the random overwrite passes (z),&lt;br /&gt;if you don't specify -n 3, it will overwrite 25 times by default.&lt;br /&gt;In most cases, when you shredding a file, you would also use -u option to tell shred to truncate the delete the file after overwriting it.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;shred -n 3 -vz /dev/hda&lt;/li&gt;&lt;li&gt;Darik's Boot and Nuke &lt;a href="http://dban.sf.net"&gt;http://dban.sf.net&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316065293959022108-1642575519980277890?l=linuxsecure.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxsecure.blogspot.com/feeds/1642575519980277890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7316065293959022108&amp;postID=1642575519980277890' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/1642575519980277890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/1642575519980277890'/><link rel='alternate' type='text/html' href='http://linuxsecure.blogspot.com/2007/09/useful-security-tools.html' title='useful security tools'/><author><name>Jephe Wu</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316065293959022108.post-4142423512383833452</id><published>2007-09-10T01:46:00.000-07:00</published><updated>2007-09-10T03:18:41.410-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nessus'/><title type='text'>How to setup Nessus 3 under CentOS 5</title><content type='html'>&lt;ul&gt;&lt;li&gt;download Nessus server and command line tool 'nessus', it should be binary rpm package. After you registered, it will provide a link to download.&lt;/li&gt;&lt;li&gt;For running a GUI client, you need to download NessusClient (a GUI client for Linux/Windows Nessusd), it's rpm package too&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Automatic plug-in update&lt;/li&gt;&lt;/ul&gt;&lt;ol&gt;&lt;li&gt;run the following command to check whether you registered or not&lt;/li&gt;&lt;/ol&gt;# /opt/nessus/bin/nessus-fetch --check&lt;br /&gt;You should obtain the following output:&lt;br /&gt;nessus-fetch is properly configured to receive a direct feed or&lt;br /&gt;nessus-fetch is properly configured to receive a registered feed&lt;br /&gt;&lt;br /&gt;    2.  after registeration, you should receive activation code for the Nessus plugin feed through email, follow the instruction in email to activate your installation, you can register online or offline&lt;br /&gt;&lt;br /&gt;   3.   use the following command to auto update plugin&lt;br /&gt;   /opt/nessus/sbin/nessus-update-plugins -v&lt;br /&gt;   4.  make sure option 'auto_update' is set to yes in /opt/nessus/etc/nessus/nessusd.conf (this is the default)&lt;br /&gt;&lt;ul&gt;&lt;li&gt;    generate SSL certification&lt;/li&gt;&lt;/ul&gt;# cd /opt/nessus/sbin&lt;br /&gt;# ./nessus-mkcert&lt;br /&gt;answer questions to  generate SSL keys&lt;br /&gt;# ./nessus-adduser&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;start up NessesClient&lt;/li&gt;&lt;/ul&gt;# cd /opt/nessus/bin&lt;br /&gt;# ./NessusClient&lt;br /&gt;note: edit server to specify the username and password you typed in above 'nessus-adduser' command.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;command line mode&lt;/li&gt;&lt;/ul&gt;# cd /opt/nessus/bin&lt;br /&gt;# ./nessus -q -T html localhost 1241 nessus nessus /tmp/target /tmp/result.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316065293959022108-4142423512383833452?l=linuxsecure.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxsecure.blogspot.com/feeds/4142423512383833452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7316065293959022108&amp;postID=4142423512383833452' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/4142423512383833452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/4142423512383833452'/><link rel='alternate' type='text/html' href='http://linuxsecure.blogspot.com/2007/09/how-to-setup-nessus-3-under-centos-5.html' title='How to setup Nessus 3 under CentOS 5'/><author><name>Jephe Wu</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7316065293959022108.post-6452595842996622164</id><published>2007-09-06T01:57:00.000-07:00</published><updated>2007-09-12T07:35:39.027-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='snort'/><title type='text'>Snort related OSS tools</title><content type='html'>&lt;ul&gt;&lt;li&gt;snort  - IDS&lt;br /&gt;&lt;/li&gt;&lt;li&gt;snort inline (google search it - IPS)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;snortsam (IPS works with PF)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;snortalog (command line log generator)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;nessus (Linux and Windows, beat commercial ones)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;nikto  - web server scanner&lt;/li&gt;&lt;li&gt;acid/base (base is better)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;aanval (commercial one, but has one sensor free version)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;www.intertnetsecurityguru.com&lt;br /&gt;&lt;/li&gt;&lt;li&gt;apache/php/pcre/mysql/adodb&lt;/li&gt;&lt;li&gt;olinkmaster - autoupdate snort rules&lt;/li&gt;&lt;li&gt;loghog (google search)&lt;/li&gt;&lt;li&gt;swatch (google search)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7316065293959022108-6452595842996622164?l=linuxsecure.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://linuxsecure.blogspot.com/feeds/6452595842996622164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7316065293959022108&amp;postID=6452595842996622164' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/6452595842996622164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7316065293959022108/posts/default/6452595842996622164'/><link rel='alternate' type='text/html' href='http://linuxsecure.blogspot.com/2007/09/snort-related-oss-tools.html' title='Snort related OSS tools'/><author><name>Jephe Wu</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
