<?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>Security &#8211; Johnny Morano&#039;s Tech Articles</title>
	<atom:link href="https://jmorano.moretrix.com/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>https://jmorano.moretrix.com</link>
	<description>Ramblings of an old-fashioned space cowboy</description>
	<lastBuildDate>Wed, 20 Apr 2022 07:09:43 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>

<image>
	<url>https://jmorano.moretrix.com/wp-content/uploads/2022/04/cropped-jmorano_emblem-32x32.png</url>
	<title>Security &#8211; Johnny Morano&#039;s Tech Articles</title>
	<link>https://jmorano.moretrix.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Time based network access control on OpenBSD</title>
		<link>https://jmorano.moretrix.com/2022/03/time-based-network-access-control-on-openbsd/</link>
					<comments>https://jmorano.moretrix.com/2022/03/time-based-network-access-control-on-openbsd/#respond</comments>
		
		<dc:creator><![CDATA[Johnny Morano]]></dc:creator>
		<pubDate>Tue, 01 Mar 2022 13:14:17 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[OpenBSD]]></category>
		<category><![CDATA[PF]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[UNIX]]></category>
		<guid isPermaLink="false">https://jmorano.moretrix.com/?p=1293</guid>

					<description><![CDATA[Time based ACL (access control lists) features do not exist in BSD&#8217;s packet filter (PF). Having your network&#8230;]]></description>
										<content:encoded><![CDATA[
<p>Time based ACL (access control lists) features do not exist in BSD&#8217;s packet filter (<code>PF</code>). Having your network &#8220;shut down&#8221; at certain times (for instance, allow certain network ranges or specific IP addresses only during &#8220;business hours&#8221; or a specific time range), can be achieved with a simple <code>PF</code> table and a <code>cronjob</code>.</p>



<p>First, let&#8217;s set up the <code>PF</code> table which will control the traffic. Add the following to your <code>/etc/pf.conf</code> :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># add time block table
table &lt;time_block> { } persist
</pre>



<p>Next, create a <code>PF</code> rule which block traffic for all entries in the <code>time_block</code> table:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># block all CIDR addresses in the time block table
block in quick log from &lt;time_block> to any
</pre>



<p>Since the <code>time_block</code> table is still empty, no traffic is actually blocked.</p>



<p>The last thing to implement, is periodically manipulating the <code>time_block</code> table. This could be done by creating two <code>cronjobs</code>:</p>



<ol class="wp-block-list"><li>allow traffic at the beginning of &#8220;business hours&#8221;</li><li>block traffic at the end of &#8220;business hours&#8221;</li></ol>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">crontab -e
# Allow traffic
0 7 * * * /usr/local/scripts/allow_employees.sh > /dev/null 2>&amp;1
# Block traffic
0 17 * * * /usr/local/scripts/block_employees.sh > /dev/null 2>&amp;1
﻿</pre>



<p>The <code>allow_employees.sh</code> script will allow certain network ranges by ensuring those are removed from the <code>time_block</code> table:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#!/bin/sh

/sbin/pfctl -Td -t time_block 10.1.0.0/24
/sbin/pfctl -Td -t time_block 10.2.0.0/24
</pre>



<p>The <code>block_employees.sh</code> script will do the exact opposite: it will add ranges to the <code>time_block</code> table so that their network access will be blocked by the firewall:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#!/bin/sh

/sbin/pfctl -Ta -t time_block 10.1.0.0/24
/sbin/pfctl -Ta -t time_block 10.2.0.0/24
</pre>



<p>Finally deploy your new PF rules (first test them!)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">pfctl -nf /etc/pf.conf
pfctl -f /etc/pf.conf</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://jmorano.moretrix.com/2022/03/time-based-network-access-control-on-openbsd/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Block countries on OpenBSD using pf</title>
		<link>https://jmorano.moretrix.com/2022/03/block-countries-on-openbsd-using-pf/</link>
					<comments>https://jmorano.moretrix.com/2022/03/block-countries-on-openbsd-using-pf/#respond</comments>
		
		<dc:creator><![CDATA[Johnny Morano]]></dc:creator>
		<pubDate>Tue, 01 Mar 2022 12:28:09 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenBSD]]></category>
		<category><![CDATA[PF]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[UNIX]]></category>
		<guid isPermaLink="false">https://jmorano.moretrix.com/?p=1291</guid>

					<description><![CDATA[Same as in the previous article, full countries can be easily blocked on OpenBSD firewall using the pf&#8230;]]></description>
										<content:encoded><![CDATA[
<p>Same as in the <a href="https://jmorano.moretrix.com/2022/03/block-countries-using-iptables/" data-type="post" data-id="1285">previous article</a>, full countries can be easily blocked on OpenBSD firewall using the <code>pf</code> command and <a rel="noreferrer noopener" href="https://ipdeny.com/" target="_blank">https://ipdeny.com/</a>.</p>



<p>The zone files provided by <a rel="noreferrer noopener" href="https://ipdeny.com/" target="_blank">https://ipdeny.com/</a> need to be stored locally. A simple way to achieve this is by having a <code>cronjob</code> downloading those periodically (for instance once per day):</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#!/bin/sh

# download the latest country zone files
curl -s https://www.ipdeny.com/ipblocks/data/countries/ru.zone > /etc/ru.zone
curl -s https://www.ipdeny.com/ipblocks/data/countries/cn.zone > /etc/cn.zone
﻿</pre>



<p>We store them directly to <code>/etc</code> in the above example.</p>



<p>In the <code>/etc/pf.conf</code>, first add a table based on the files you have generated with the above statements:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># add a bad hosts table based on local disk text files
# one CIDR per line
table &lt;badhosts> persist file "/etc/ru.zone" file "/etc/cn.zone"
</pre>



<p>In the above example, we have created a table called <code>badhosts</code> based on two local files.</p>



<p>Finally we need some rules which actually blocks from and to these network ranges, an example <code>PF</code> block rule could be:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># block bad IP addresses
block from &lt;badhosts> to any
block from any to &lt;badhosts>
</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://jmorano.moretrix.com/2022/03/block-countries-on-openbsd-using-pf/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Block countries using IPtables and IPDeny.com</title>
		<link>https://jmorano.moretrix.com/2022/03/block-countries-using-iptables/</link>
					<comments>https://jmorano.moretrix.com/2022/03/block-countries-using-iptables/#comments</comments>
		
		<dc:creator><![CDATA[Johnny Morano]]></dc:creator>
		<pubDate>Tue, 01 Mar 2022 07:12:28 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[IPTables]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<guid isPermaLink="false">https://jmorano.moretrix.com/?p=1285</guid>

					<description><![CDATA[Certain server setups do not require access for all countries or just want to block certain countries since&#8230;]]></description>
										<content:encoded><![CDATA[
<p>Certain server setups do not require access for all countries or just want to block certain countries since they are know for their malicious activity.</p>



<p>One simple (not full bullet-proof) way of doing this, is by setting up block rules on firewall level, which can be achieved on Linux servers with <code>iptables</code> and zone files of <a rel="noreferrer noopener" href="https://www.ipdeny.com/" target="_blank">https://www.ipdeny.com/</a>. These zone files contain the network ranges assigned to a specific country.</p>



<p>The network ranges are fed to a tool called <code>ipset</code>, which sets up of hash map that can be easily used within <code>iptables</code> rules.</p>



<p>On Debian/Ubuntu systems, <code>ipset</code> can be installed with the <code>apt</code> command:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="monokai" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">apt install ipset</pre>



<p>Next, create an iptables chain called &#8220;<code>blocked_countries</code>&#8220;, to which we will add rules afterwards. Add this chain to the beginning of the <code>INPUT</code> and <code>FORWARD</code> chain, to have early blocking in your ruleset.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="monokai" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">iptables -N blocked_countries
iptables -I INPUT -j blocked_countries -m comment --comment "Blocked countries"
iptables -I FORWARD -j blocked_countries -m comment --comment "Blocked countries"</pre>



<p>Finally, create a shell script which will download the required zone files from <a rel="noreferrer noopener" href="https://ipdeny.com/" target="_blank">https://ipdeny.com/</a> and which feeds them to <code>ipset</code>. The  example script will try to block the countries China, Russia and Belarus:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="monokai" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#!/bin/bash

COUNTRIES=('cn' 'ru' 'by')

for COUNTRY in "${COUNTRIES[@]}"; do
    ipset create "countries_${COUNTRY}" hash:net
done

iptables -v -F blocked_countries

for i in "${COUNTRIES[@]}"; do
    echo "Ban IP of country ${i}"
    ipset flush "countries_${i}"


    for IP in $(wget -O - https://www.ipdeny.com/ipblocks/data/countries/${i}.zone)
    do
        ipset add "countries_${i}" $IP
    done
    iptables -I blocked_countries   -m set --match-set "countries_${i}" src  -j LOGDROP -m comment   --comment "Block .${i}"
done
﻿</pre>



<p>You can check the <code>blocked_countries</code> chain if packets are being blocked by your new rules:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="shell" data-enlighter-theme="monokai" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">iptables -v -n -L blocked_countries 
# Warning: iptables-legacy tables present, use iptables-legacy to see them
Chain blocked_countries (2 references)
 pkts bytes target     prot opt in     out     source               destination         
    2   104 LOGDROP    all  --  *      *       0.0.0.0/0            0.0.0.0/0            match-set countries_by src /* Block .by */
 2182  155K LOGDROP    all  --  *      *       0.0.0.0/0            0.0.0.0/0            match-set countries_ru src /* Block .ru */
  344 21370 LOGDROP    all  --  *      *       0.0.0.0/0            0.0.0.0/0            match-set countries_cn src /* Block .cn */
﻿</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://jmorano.moretrix.com/2022/03/block-countries-using-iptables/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>OSSEC: building an OpenBSD package</title>
		<link>https://jmorano.moretrix.com/2016/03/ossec-building-an-openbsd-package/</link>
					<comments>https://jmorano.moretrix.com/2016/03/ossec-building-an-openbsd-package/#comments</comments>
		
		<dc:creator><![CDATA[Johnny Morano]]></dc:creator>
		<pubDate>Tue, 15 Mar 2016 07:28:29 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[OpenBSD]]></category>
		<category><![CDATA[HIDS]]></category>
		<category><![CDATA[OSSEC]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=1101</guid>

					<description><![CDATA[OSSEC is an Open Source Host-based Intrusion Detection System that performs log analysis, file integrity checking, policy monitoring,&#8230;]]></description>
										<content:encoded><![CDATA[
<p><a title="OSSEC Website" href="http://www.ossec.net/" target="_blank" rel="noopener">OSSEC</a> is an Open Source Host-based Intrusion Detection System that performs log analysis, file integrity checking, policy monitoring, rootkit detection, real-time alerting and active response.</p>



<p>It runs on most operating systems, including Linux, MacOS, Solaris, HP-UX, AIX and OpenBSD.</p>



<p>There is no OSSEC package available on the OSSEC website or in the OpenBSDs ports repositry, so I&#8217;ve decided to create an OpenBSD on my own.<br />OpenBSD packages are pretty easy to create and are very useful when installing, upgrading or deleting software on a server.</p>



<p>One of the disadvantages when creating an OpenBSD package, is that you will need to have X11 installed on your OpenBSD system.<br />In the following example I have used <a href="http://openbsd.org" target="_blank" rel="noopener">OpenBSD 5.8</a> to create a package for <a href="http://ossec.github.io/" target="_blank" rel="noopener">OSSEC 2.8.2</a> (OSSEC 2.8.3 doesn&#8217;t compile on OpenBSD 5.8)</p>



<h2 class="wp-block-heading">Step 1: Prerequisites</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">cd /tmp
wget http://ftp.eu.openbsd.org/pub/OpenBSD/5.8/amd64/xbase58.tgz 
wget http://ftp.eu.openbsd.org/pub/OpenBSD/5.8/amd64/xshare58.tgz
wget http://ftp.eu.openbsd.org/pub/OpenBSD/5.8/amd64/comp58.tgz
tar -C / -xzvphf xbase58.tgz
tar -C / -xzvphf xshare58.tgz
tar -C / -xzvphf comp58.tgz

cd /tmp
ftp http://ftp.eu.openbsd.org/pub/OpenBSD/$(uname -r)/ports.tar.gz
ftp http://ftp.eu.openbsd.org/pub/OpenBSD/$(uname -r)/SHA256.sig
signify -Cp /etc/signify/openbsd-$(uname -r | cut -c 1,3)-base.pub -x SHA256.sig ports.tar.gz

cd /usr
tar xzf /tmp/ports.tar.gz</pre>



<p>You will also need a compiler:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">pkg_add gcc</pre>



<h2 class="wp-block-heading">Step 2: Download and repack the source</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">ossec_version="2.8.2"
cd /usr/src
wget https://github.com/ossec/ossec-hids/archive/${ossec_version}.tar.gz 
mv ${ossec_version}.tar.gz ossec-hids-${ossec_version}.tar.gz 
tar xfz ossec-hids-${ossec_version}.tar.gz
cd ossec-hids-${ossec_version}
</pre>



<p>Since the Makefile for OSSEC is in the <em>src/</em> sub directory, we will create a proxy Makefile in <em>/usr/src/ossec-hids-2.8.2</em></p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">cd ossec-hids-2.8.2
vim Makefile</pre>



<p>I have actually taken the original Makefile from<em> src/</em> and narrowed it down to the following:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># Makefile
# http://www.ossec.net/hids/

none:
 @echo "Nothing selected ..."
 @echo "\"make all\" to compile everything."
 @echo "\"make server\" to build the server."
 @echo "\"make local\" to build the local."
 @echo "\"make agent\" to build the agent."
 @echo "\"make clean\" to clean anything built."

clean:
 cd src/ ; $(MAKE) clean

all:
 cd src/ ; $(MAKE) all
 
test:
 cd src/ ; $(MAKE) test

server:
 cd src/ ; $(MAKE) server

local:
 cd src/ ; $(MAKE) local

agent:
 cd src/ ; $(MAKE) agent

</pre>



<p>We will also edit the &#8216;<em>ossec-clients.sh</em>&#8216; script, because we will use this script as a start/stop script. We will have to set the path name in this script.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">vim src/init/ossec-client.sh
# LOCAL=/var/ossec
# cd ${LOCAL}
# PWD=`pwd`
DIR=/var/ossec
cd ${DIR}
</pre>



<p>And that&#8217;s the only thing we will need to change in the sources, we can now repackage it.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">cd ..
tar czf /usr/ports/distfiles/ossec-hids-2.8.2.tar.gz ossec-hids-2.8.2/
</pre>



<h2 class="wp-block-heading">Step 3: Prepare the ports directory</h2>



<p>The following steps explain how to set up a ports directory in <em>/usr/ports</em> for OSSEC, in order to build the package.<br />Custom made packages are built in<em> /usr/ports/mystuff</em>. In there, we will have to one sub directory for the package category (we will use security) and in there the package name, which in our case will be ossec-hids.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">cd /usr/ports/mystuff
mkdir -p security/ossec-hids
</pre>



<p>The configuration file for building an OpenBSD package is a Makefile. There is a template file in <em>/usr/ports/infrastructure/templates/Makefile.template</em> which can be used.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">cd security/ossec-hids
cp /usr/ports/infrastructure/templates/Makefile.template Makefile
</pre>



<p>This file of course needs editing. Not everything is required in this file, so I have narrowed the Makefile down to what I need it for:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># $OpenBSD: Makefile.template,v 1.68 2013/10/02 07:34:45 ajacoutot Exp $
# $FreeBSD/NetBSD: credit FreeBSD/NetBSD if thats where the port came from $
# Original from: credit the original author here
COMMENT =               OSSEC is an Open Source HIDS
DISTNAME =              ossec-hids-2.8.2
CATEGORIES =            security
HOMEPAGE =              http://www.ossec.net/
MAINTAINER =            Johnny Morano &amp;lt;jmorano@moretrix.com&amp;gt;;
MASTER_SITES =          https://github.com/ossec/ossec-hids/

PERMIT_PACKAGE_CDROM =  Yes
PERMIT_PACKAGE_FTP =    Yes
PERMIT_DISTFILES_FTP =  Yes

PKG_ARCH =              *
PREFIX = /var/ossec

do-install:
        mkdir -p ${PREFIX}/bin
        mkdir -p ${PREFIX}/logs
        mkdir -p ${PREFIX}/var/run
        mkdir -p ${PREFIX}/queue
        mkdir -p ${PREFIX}/active-response/bin
        mkdir -p ${PREFIX}/agentless
        mkdir -p ${PREFIX}/etc/orig/shared
        mkdir -p ${PREFIX}/doc
        ${INSTALL_SCRIPT} ${WRKSRC}/active-response/firewalls/pf.sh ${PREFIX}/active-response/bin/
        ${INSTALL_SCRIPT} ${WRKSRC}/src/agentlessd/scripts/* ${PREFIX}/agentless
        ${INSTALL_SCRIPT} ${WRKSRC}/src/os_execd/ossec-execd ${PREFIX}/bin/
        ${INSTALL_SCRIPT} ${WRKSRC}/src/logcollector/ossec-logcollector ${PREFIX}/bin/
        ${INSTALL_SCRIPT} ${WRKSRC}/src/client-agent/ossec-agentd ${PREFIX}/bin/
        ${INSTALL_SCRIPT} ${WRKSRC}/src/addagent/manage_agents ${PREFIX}/bin/
        ${INSTALL_SCRIPT} ${WRKSRC}/src/syscheckd/ossec-syscheckd ${PREFIX}/bin/
        ${INSTALL_SCRIPT} ${WRKSRC}/src/os_auth/agent-auth ${PREFIX}/bin/
        ${INSTALL_SCRIPT} ${WRKSRC}/src/init/ossec-client.sh ${PREFIX}/bin/
        ${INSTALL_SCRIPT} ${WRKSRC}/doc/*.txt ${PREFIX}/doc/
        ${INSTALL_SCRIPT} ${WRKSRC}/doc/README.config ${PREFIX}/doc/
        ${INSTALL_SCRIPT} ${WRKSRC}/etc/*.conf ${PREFIX}/etc/orig/
        ${INSTALL_SCRIPT} ${WRKSRC}/etc/*.xml ${PREFIX}/etc/orig/
        ${INSTALL_SCRIPT} ${WRKSRC}/src/rootcheck/db/* ${PREFIX}/etc/orig/shared/

.include &amp;lt;bsd.port.mk&amp;gt;;
</pre>



<p>The above Makefile will install OSSEC in<em> /var/ossec</em> and will only install the agent files. It does not install the server files.</p>



<h2 class="wp-block-heading">Step 4: Test the settings</h2>



<p>First we will make a checksum and then we will start a fake compile run, to see if everything compiles nicely.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">make makesum 
===&amp;gt;  Checking files for ossec-hids-2.8.2
`/usr/ports/distfiles/ossec-hids-2.8.2.tar.gz' is up to date.

make fake
===&amp;gt;  Checking files for ossec-hids-2.8.2
`/usr/ports/distfiles/ossec-hids-2.8.2.tar.gz' is up to date.
&amp;gt;&amp;gt; (SHA256) ossec-hids-2.8.2.tar.gz: OK
===&amp;gt;  Extracting for ossec-hids-2.8.2
===&amp;gt;  Patching for ossec-hids-2.8.2
===&amp;gt;  Configuring for ossec-hids-2.8.2
===&amp;gt;  Building for ossec-hids-2.8.2
***snip***</pre>



<p>If there were no errors, then we are ready to create the actual package.</p>



<h2 class="wp-block-heading">Step 5: Create the OpenBSD package</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">mkdir pkg
echo "OSSEC is an Open Source HIDS" &amp;amp;gt; pkg/DESCR
make plist
vim pkg/PLIST
</pre>



<p>Normally we do not need to edit the PLIST file, but I wanted to create an ossec user upon installation and chown the <em>/var/ossec</em> directory to that user.<br />So I have added the following lines to the top of <em>pkg/PLIST</em>:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">@comment $OpenBSD$
@newgroup ossec:1002
@newuser ossec:1005:ossec:daemon:OSSEC User:/var/ossec:/bin/sh</pre>



<p>And these to the bottom:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">@exec-add mkdir -p /var/ossec
@exec-add chown -R ossec.ossec /var/ossec
@exec-add cp %D/bin/ossec-client.sh /etc/rc.d/ossec</pre>



<p>Afterwards you will need to run:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">make plist</pre>



<p>Now we are ready to build the package:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">make package
`/usr/ports/pobj/ossec-hids-2.8.2/fake-amd64/.fake_done' is up to date.
===&amp;gt;  Building package for ossec-hids-2.8.2
Create /usr/ports/packages/amd64/no-arch/ossec-hids-2.8.2.tgz
Link to /usr/ports/packages/amd64/all/ossec-hids-2.8.2.tgz
Link to /usr/ports/packages/amd64/ftp/ossec-hids-2.8.2.tgz
Link to /usr/ports/packages/amd64/cdrom/ossec-hids-2.8.2.tgz</pre>



<p>That&#8217;s it! This package can now be installed with the <code>pkg_add</code> command.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">pkg_add ./ossec-hids-2.8.2.tgz 
quirks-2.114 signed on 2015-08-09T11:57:52Z
UNSIGNED PACKAGE file:./ossec-hids-2.8.2.tgz: install anyway ? [y/N/a] y
ossec-hids-2.8.2: ok
UNSIGNED PACKAGES: ossec-hids-2.8.2</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://jmorano.moretrix.com/2016/03/ossec-building-an-openbsd-package/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>OpenSSH 6.2.x and LDAP authentication</title>
		<link>https://jmorano.moretrix.com/2013/09/openssh-6-2-x-ldap-authentication/</link>
					<comments>https://jmorano.moretrix.com/2013/09/openssh-6-2-x-ldap-authentication/#comments</comments>
		
		<dc:creator><![CDATA[Johnny Morano]]></dc:creator>
		<pubDate>Tue, 17 Sep 2013 11:42:56 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=993</guid>

					<description><![CDATA[Since the release of OpenSSH 6.2, two new configuration parameters have been added: AuthorizedKeysCommand AuthorizedKeysCommandUser These parameters allow&#8230;]]></description>
										<content:encoded><![CDATA[<p>Since the release of OpenSSH 6.2, two new configuration parameters have been added:</p>
<ul>
<li>AuthorizedKeysCommand</li>
<li>AuthorizedKeysCommandUser</li>
</ul>
<p>These parameters allow to create any kind of authentication method for OpenSSH, including LDAP authentication, and therefore patches like the LPK patch for OpenSSH are not required anymore.<br />
The only thing the script needs to do is return either an empty string or the public key of the user.</p>
<p>In our example below, we have created an extra check which will verify if a user is in a certain group.<br />
The script is a very simple Bash script and can be rewritten to any kind of script or program, important is what it returns to STDOUT.</p>
<pre class="brush:bash">
#!/bin/bash
# $Id: ldap_ssh_key.sh 138 2013-09-14 08:24:39Z jmorano $
#
# Check if the user is in the right group 
#  and afterwards retrieve the SSH public key from LDAP
# Logs directly in Syslog
#
#
# sshd_config for OpenSSH 6.2 or higher:
#
#  AuthorizedKeysCommand /usr/local/bin/ldap_keys.sh
#  AuthorizedKeysCommandUser nobody
# 

LDAP_SERVER="ldap-server"
BASE_DN="ou=users,dc=company,dc=example,dc=com"
ALLOWED_GROUP="6667"

# load local configuration if available
if [ -f /etc/example/ldap.cfg ]; then
    . /etc/example/ldap.cfg
fi

SSH_USER=$1

if id "${SSH_USER}" | egrep -q "${ALLOWED_GROUP}";
then
	logger -t sshd -p info "User $SSH_USER is a member of the group"
else 
	logger -t sshd -p warn "User $SSH_USER is not allowed to log in, access denied"
	echo 
	exit 0
fi


KEY=$(ldapsearch -o ldif-wrap=no -S sshPublicKey -c -h "${LDAP_SERVER}" -b "${BASE_DN}" -x -LLL "uid=${SSH_USER}" sshPublicKey | grep -v 'dn:' | perl -pe 's/sshPublicKey: //;')

logger -t sshd -p info "Sent LDAP SSH public key for user $SSH_USER"
echo "${KEY}"

</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://jmorano.moretrix.com/2013/09/openssh-6-2-x-ldap-authentication/feed/</wfw:commentRss>
			<slash:comments>11</slash:comments>
		
		
			</item>
		<item>
		<title>Secure Password Generator in Perl</title>
		<link>https://jmorano.moretrix.com/2013/08/secure-password-generator-perl/</link>
					<comments>https://jmorano.moretrix.com/2013/08/secure-password-generator-perl/#comments</comments>
		
		<dc:creator><![CDATA[Johnny Morano]]></dc:creator>
		<pubDate>Tue, 13 Aug 2013 13:27:18 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Crypto]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=953</guid>

					<description><![CDATA[A secure and very random password generator module written in Perl.It can be used to generate passwords or&#8230;]]></description>
										<content:encoded><![CDATA[
<p>A secure and very random password generator module written in Perl.<br />It can be used to generate passwords or unique strings which can be used in sorts of operations.</p>



<p>The default character set is alpha-numerical based, but can be set to any kind of character list.</p>



<p>The complete handling and generating is implemented in a module, which exports one function: &#8216;<code>generate_password</code>&#8216;.<br />This function can take (optional) as arguments:</p>



<ul class="wp-block-list"><li>a length</li><li>a character list</li></ul>



<p>The entropy is generated with Bytes::Random::Secure and random numbers are generated with <code>Math::Random::ISAAC</code>.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">package MORETRIX::Password;
#===============================================================================
#  DESCRIPTION: A password generator module
#     REVISION: $Id: Password.pm 71 2013-07-02 12:28:42Z jmorano $
#===============================================================================

use strict;
use warnings;
use Digest;
use Exporter qw/import/;
use Time::HiRes qw/time/;
use Bytes::Random::Secure;
use Math::Random::ISAAC;

our @EXPORT    = qw/generate_password/;
our @EXPORT_OK = qw/generate_password/;

my $random_state;
my $CHARLIST = q{abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!"$%&amp;/\()=?{}[]*+#;:.,-_&lt;>|^~'};

# Generate a cryptographic safe random password
# default length: 12
#
sub generate_password {
    my ($length, $charlist) = @_;
    $length   //= 12;
    $charlist //= $CHARLIST;

    my @temp_passwords;
    foreach my $loop ( 0 .. int(random_number(100)) ){
        my $password = '';
        while (length($password) &lt; $length) {
            $password .= substr($charlist, (int(myrand(length($charlist)))), 1);
        }
        push @temp_passwords, $password;
    }

    return $temp_passwords[int(random_number(length(scalar @temp_passwords)))];
}

sub random_number {
    my ($seed) = @_;

    my $r = Math::Random::ISAAC->new($seed);
    return $r->rand();
}

sub mysrand{
    my $seed = shift || (time ^ $ ^ int(random_number(time)) ^ int(random_number(2048 ^ 128)));
    $random_state = {
        digest  => new Digest ("SHA-512"),
        counter => 0,
        waiting => [],
        prev    => $seed
    };
}

sub myrand{
    my $range = shift || 1.0;
    mysrand() unless defined $random_state;

    if (! @{$random_state->{waiting}}){
        $random_state->{digest}->reset();
        $random_state->{digest}->add( generate_entropy(4096) .
                                     $random_state->{counter}++ .
                                     $random_state->{prev});
        $random_state->{prev} = $random_state->{digest}->digest();
        my @ints = unpack("L*", $random_state->{prev}); # 32 bit unsigned integers
        $random_state->{waiting} = \@ints;
    }
    my $int = shift @{$random_state->{waiting}};
    return $range * $int / 2**32;
}

sub generate_entropy {
    my ($length) = @_;

    $length //= 1024;

    my $random = Bytes::Random::Secure->new( NonBlocking => 1, Bits => 4096 );
    return $random->string_from($CHARLIST, $length);
}

1;</pre>



<p>Example script:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="python" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#!/usr/bin/env perl 

use strict;
use warnings;
use utf8;
use MORETIX::Password;

my $length = shift @ARGV;
$length //= 32;

print generate_password($length) . "\n";
print generate_password($length) . "\n";
print generate_password($length) . "\n";
print generate_password($length) . "\n";
print generate_password($length) . "\n";</pre>



<p>References:</p>



<ul class="wp-block-list"><li>http://wellington.pm.org/archive/200704/randomness/#slide0</li></ul>
]]></content:encoded>
					
					<wfw:commentRss>https://jmorano.moretrix.com/2013/08/secure-password-generator-perl/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Syslog event generator with Net::RawIP (perl)</title>
		<link>https://jmorano.moretrix.com/2011/06/syslog-event-generator-with-netrawip-perl/</link>
					<comments>https://jmorano.moretrix.com/2011/06/syslog-event-generator-with-netrawip-perl/#comments</comments>
		
		<dc:creator><![CDATA[insaniac]]></dc:creator>
		<pubDate>Wed, 29 Jun 2011 09:34:25 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Dev]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Spoof]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<guid isPermaLink="false">http://jmorano.moretrix.com/?p=632</guid>

					<description><![CDATA[Recently I have been asked to write a Syslog event generator, but not just a normal syslog generator,&#8230;]]></description>
										<content:encoded><![CDATA[<p>Recently I have been asked to write a Syslog event generator, but not just a normal syslog generator, it had to be able to generate events coming from different hosts.</p>
<p>The normal &#8216;logger&#8217; command sends Syslog messages using the machine&#8217;s IP address, so logger wasn&#8217;t very useful. The only thing useful seem to be, to generate my own Syslog packets in which I spoof the source address. After writing this handy little script, I realized that I&#8217;ve actually created a monster. A very evil scary kinda looking mean monster! I will show an example for creating Syslog event generator (and later on one for creating SNMP events), but the code can be used for much more. Please keep in mind I post this code just for educational and debugging reasons. If you want to use it for other reasons&#8230; well that&#8217;s up to you! <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /><br />
<span id="more-632"></span><br />
The example shown overhere is a bit more worked out and put in an object oriented structure. It could have also been a simple quick and dirty script.</p>
<p>The module we will use is called <a href="https://jmorano.moretrix.com/go/RawIPGenerator/">Net::RawIP</a> and it will allow us to create our TCP or UDP packets. We just need to figure out how packets should be created in order for the Syslog daemon to accept them.</p>
<p>At first I&#8217;ve created a Packet.pm class. This is the main base class, which creates the constructor and defines the class interface.</p>
<pre class="brush:perl">
package Packet;
# $Id: Packet.pm 828 2011-06-28 13:05:03Z insaniac $
use strict; use warnings;
use Net::RawIP;

sub new {
    my($class, $opts) = @_;

    my $self = bless {}, $class || ref $class;
    $self->{rawip} = Net::RawIP->new($opts);

    return $self;
}

sub pkt_payload {
}

sub pkt_size {
}

sub pkt_debug {
}

sub pkt_send {
    my($self, $delay, $amount) = @_;

    $self->pkt_debug();
    $self->{rawip}->send($delay, $amount);
}

1;
</pre>
<p>Secondly I&#8217;ll need an UDP base class, from which the Syslog module will inherit.</p>
<pre class="brush:perl">
package Packet::UDP;
# $Id: UDP.pm 837 2011-06-28 15:05:10Z insaniac $
use strict; use warnings;
use base qw/Packet/;
use POSIX qw{strftime};

#
# src => IP:PORT
# dst => IP:PORT
#
sub new {
    my($class, $src, $dst) = @_;
    my($saddr, $sport) = split /:/, $src;
    my($daddr, $dport) = split /:/, $dst;

    my $self = $class->SUPER::new({
            ip => {
                saddr    => $saddr,
                daddr    => $daddr,
                frag_off => 0,
                tos      => 0,
                id       => $$ + strftime('%s', localtime()),
            },
            udp => {
                source => $sport,
                dest   => $dport,
            },
            });
}

sub pkt_size {
    my($self)= @_;

    my($src, $dst, $data) = $self->{rawip}->get( {
                udp => [qw/source dest data/]
            },
    );
    my $size = length($src) + length($dst) + length($data);

    # set 'check' to 0 to recalculate the UDP checksum
    $self->{rawip}->set( {
            udp => {
                len   => $size,
                check => 0,
            }
    });

    return $size;
}

sub pkt_payload {
}

sub pkt_debug {
    my($self) = @_;

    my(@udp_fields) = qw/source dest len data/;
    my(@ip_fields)  = qw/version ihl tos id frag_off ttl protocolsaddr daddr/;
    my(@udp_data)   = $self->{rawip}->get({ udp => @udp_fields });
    my(@ip_data)    = $self->{rawip}->get({ ip  => @ip_fields });

    print "IP FIELDSn";
    print "=========n";
    print "- $ip_fields[$_]: $ip_data[$_]n" foreach 0 ..  $#ip_data;
    print "UDP FIELDSn";
    print "=========n";
    print "- $udp_fields[$_]: $udp_data[$_]n" foreach 0 ..  $#udp_data;

}

1;
</pre>
<p>Having all the base classes in place, we can finally focus on creating our Syslog class, a module which will allow us to send Syslog messages, allowing us to change the source IP address.</p>
<pre class="brush:perl">
package Packet::UDP::Syslog;
# $Id: Syslog.pm 838 2011-06-28 15:08:07Z insaniac $
use strict; use warnings;
use base qw/Packet::UDP/;

sub new {
    my ($class, $src, $dst) = @_;
    my $self = $class->SUPER::new("$src:1666", "$dst:514");
    return $self;
}

# TAG               CODE    DESCRIPTION
# =====================================
# kernel            0       kernel messages
# user              1       user-level messages
# mail              2       mail system
# system            3       system daemons
# security          4       security/authorization messages (note 1)
# internal          5       messages generated internally by syslogd
# print             6       line printer subsystem
# news              7       network news subsystem
# uucp              8       UUCP subsystem
# clock             9       clock daemon (note 2)
# security2        10       security/authorization messages (note 1)
# ftp              11       FTP daemon
# ntp              12       NTP subsystem
# logaudit         13       log audit (note 1)
# logalert         14       log alert (note 1)
# clock2           15       clock daemon (note 2)
# local0           16       local use 0  (local0)
# local1           17       local use 1  (local1)
# local2           18       local use 2  (local2)
# local3           19       local use 3  (local3)
# local4           20       local use 4  (local4)
# local5           21       local use 5  (local5)
# local6           22       local use 6  (local6)
# local7           23       local use 7  (local7)
my $i = 0;
my %fac_map = map {$_ => $i++ } qw/kernel user mail system security internal print news uucp clock security2 ftp ntp logaudit logalert clock2 local0 local1 local2 local3 local4 local5 local6 local7/;

# TAG             CODE    DESCRIPTION
# =====================================
# emerg           0       Emergency: system is unusable
# alert           1       Alert: action must be taken immediately
# crit            2       Critical: critical conditions
# err             3       Error: error conditions
# warn            4       Warning: warning conditions
# notice          5       Notice: normal but significant condition
# info            6       Informational: informational messages
# debug           7       Debug: debug-level messages
$i = 0;
my %sev_map = map {$_ => $i++} qw/emerg alert crit err warn notice info debug/;

sub pkt_payload {
    my($self, $facility, $severity, $msg) = @_;

    my ($fac_sev) = ($fac_map{$facility} << 3) + $sev_map{$severity};
    $self->{rawip}->set({
            udp => { 
                data => "<$fac_sev>$msg�" 
                } 
            }
    );

    # call and set the size
    $self->pkt_size();
}

1;
</pre>
<p>Our OO structure is now ready, all we need is a script which will call all this code.</p>
<pre class="brush:perl">
#!/usr/bin/perl
use strict; use warnings;
use lib './';
use Packet::UDP::Syslog;
use POSIX qw/strftime/;

my @sources = qw{
    166.59.83.200 166.59.83.1 166.59.83.206 192.168.0.99
    192.168.1.99
};

my @messages = (
        {severity => 'info',  payload => 'the planet is going down'},
        {severity => 'err',   payload => 'BOOM BOOM BOOM'},
        {severity => 'emerg', payload => 'The house is on fire!'},
        {severity => 'alert', payload => "Do NOT forget to feed the monkeysnAnd the bearsnand the cows!"},
        {severity => 'debug', payload => 'We should have a look into this'},
);

foreach my $src (@sources){
    my $syslog = Packet::UDP::Syslog->new($src, "192.168.1.3");
    foreach my $msg (@messages) {
        my $datetime = strftime("%b %d %H:%M:%S", localtime());
        $syslog->pkt_payload('local7', $msg->{severity}, $datetime." $src: ".$msg->{payload});
        $syslog->pkt_send(1,1);
    }
}

</pre>
<p>Running the script:</p>
<pre class="brush:bash">
root@yamamoto:/home/insaniac/dev/Net# perl raw_pkt.pl
IP FIELDS
=========
- version: 4
- ihl: 5
- tos: 0
- id: 1309286460 
- frag_off: 0
- ttl: 64
- protocolsaddr: 3232235779
UDP FIELDS
=========
- source: 1666   
- dest: 514
- len: 68
- data: <190>Jun 28 17:12:13 166.59.83.200: the planet is going down
IP FIELDS
=========
- version: 4
- ihl: 5
- tos: 0
- id: 1309286460 
- frag_off: 0
- ttl: 64
- protocolsaddr: 3232235779
UDP FIELDS
=========
- source: 1666   
- dest: 514
- len: 58
- data: <187>Jun 28 17:12:14 166.59.83.200: BOOM BOOM BOOM
*** snip output ***
</pre>
<p>And that&#8217;s it! If we would check our receiving network interface (on IP address 192.168.1.3) with tcpdump, we would see our packets arriving:</p>
<pre class="brush:bash">
17:13:24.218196 IP (tos 0x0, ttl 64, id 8359, offset 0, flags [none], proto UDP (17), length 96)
    166.59.83.206.1666 > musashi_vpn.syslog: [udp sum ok] SYSLOG, length: 68
        Facility local7 (23), Severity debug (7)
        Msg: Jun 28 17:13:24 166.59.83.206: We should have a look into this�x00
        0x0000:  3c31 3931 3e4a 756e 2032 3820 3137 3a31
        0x0010:  333a 3234 2031 3636 2e35 392e 3833 2e32
        0x0020:  3036 3a20 5765 2073 686f 756c 6420 6861
        0x0030:  7665 2061 206c 6f6f 6b20 696e 746f 2074
        0x0040:  6869 7300
        0x0000:  4500 0060 20a7 0000 4011 9e31 a63b 53ce
        0x0010:  c0a8 0103 0682 0202 004b cc9e 3c31 3931
        0x0020:  3e4a 756e 2032 3820 3137 3a31 333a 3234
        0x0030:  2031 3636 2e35 392e 3833 2e32 3036 3a20
        0x0040:  5765 2073 686f 756c 6420 6861 7665 2061
        0x0050:  206c 6f6f 6b20 696e 746f 2074 6869 7300
17:13:25.219101 IP (tos 0x0, ttl 64, id 8364, offset 0, flags [none], proto UDP (17), length 88)
    192.168.0.99.1666 > musashi_vpn.syslog: [udp sum ok] SYSLOG, length: 60
        Facility local7 (23), Severity info (6)
        Msg: Jun 28 17:13:25 192.168.0.99: the planet is going down�x00
        0x0000:  3c31 3930 3e4a 756e 2032 3820 3137 3a31
        0x0010:  333a 3235 2031 3932 2e31 3638 2e30 2e39
        0x0020:  393a 2074 6865 2070 6c61 6e65 7420 6973
        0x0030:  2067 6f69 6e67 2064 6f77 6e00
        0x0000:  4500 0058 20ac 0000 4011 d732 c0a8 0063
        0x0010:  c0a8 0103 0682 0202 0043 70bf 3c31 3930
        0x0020:  3e4a 756e 2032 3820 3137 3a31 333a 3235
        0x0030:  2031 3932 2e31 3638 2e30 2e39 393a 2074
        0x0040:  6865 2070 6c61 6e65 7420 6973 2067 6f69
        0x0050:  6e67 2064 6f77 6e00
</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://jmorano.moretrix.com/2011/06/syslog-event-generator-with-netrawip-perl/feed/</wfw:commentRss>
			<slash:comments>10</slash:comments>
		
		
			</item>
	</channel>
</rss>
