<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-5554915078212081470</atom:id><lastBuildDate>Tue, 07 May 2013 16:36:12 +0000</lastBuildDate><category>Steganography</category><category>cyberraid</category><category>clustering</category><category>mediawiki</category><category>BlackHat2008</category><category>usb thumb drive hardware hack mod artistic</category><category>tools</category><category>sysadmin</category><category>steampunk book review fiction rant</category><category>assessment</category><category>news</category><category>Old School</category><category>movies</category><category>reconfigure</category><category>vulnerability</category><category>certifications</category><category>scifi</category><category>malware</category><category>brightkite</category><category>end-user</category><category>privacy</category><category>ozymandns</category><category>brainstorm</category><category>lvm</category><category>Windows</category><category>Apple</category><category>openvas</category><category>spreadsheets</category><category>safety</category><category>socialengineering</category><category>mainframe</category><category>xampp</category><category>make</category><category>caffeine</category><category>awk</category><category>backtrack</category><category>locks</category><category>xkcd</category><category>CCTV</category><category>2600</category><category>EFS</category><category>thinclient</category><category>email</category><category>DefCon16</category><category>solaris</category><category>z80</category><category>chdk</category><category>hackersforcharity</category><category>dc16badge</category><category>rant</category><category>kids</category><category>patch</category><category>IBM</category><category>facebook</category><category>drama</category><category>attack</category><category>retro</category><category>handhelds</category><category>CAD</category><category>unixtips</category><category>intro</category><category>cheaters</category><category>DefCon17</category><category>screensaver</category><category>metasploit</category><category>memory</category><category>chroot</category><category>OSX</category><category>networking</category><category>dc17badge</category><category>OpenSolaris</category><category>HiD</category><category>heatsink</category><category>ftpd</category><category>desktop</category><category>fire</category><category>flickr</category><category>hackerspace</category><category>worm</category><category>buffer overflow</category><category>QPST</category><category>defense</category><category>meetings</category><category>ubuntu</category><category>jornada</category><category>pfsense</category><category>ccckc</category><category>AIX</category><category>BONJOUR</category><category>svn</category><category>subversion</category><category>google</category><category>RIM</category><category>space</category><category>poe</category><category>virtualization</category><category>Eugene Rabinowitch</category><category>mail</category><category>baz</category><category>education</category><category>Vista</category><category>DefCon18</category><category>dnstunnel</category><category>support</category><category>skills</category><category>contests</category><category>perl</category><category>1U rackmount</category><category>tunneling</category><category>diagnostics</category><category>computer hacker</category><category>newlisp</category><category>risk</category><category>tracing</category><category>leadership</category><category>mechanical</category><category>sleep</category><category>physicalsecurity</category><category>opensource</category><category>charity</category><category>shell</category><category>potty-humor</category><category>frogman</category><category>spyware</category><category>bc</category><category>InfoSec</category><category>clickjacking</category><category>physics</category><category>DIYLockpickSeries</category><category>firewall</category><category>ham</category><category>tether</category><category>hardware</category><category>readingroom</category><category>ethernet</category><category>hack</category><category>recovery</category><category>knowledge</category><category>aesthetic</category><category>explosives</category><category>radio</category><category>threat</category><category>heat</category><category>boot</category><category>ZCN</category><category>robotics</category><category>netbook design evolution</category><category>photography</category><category>Surveillance</category><category>ZendFramework</category><category>ssh</category><category>music</category><category>socialnetworking</category><category>RENDEVOUS</category><category>hackers</category><category>pranks</category><category>linksys</category><category>awareness</category><category>seo</category><category>literature</category><category>phishing</category><category>sudo</category><category>blackberry</category><category>epoch</category><category>wireless</category><category>ipod</category><category>outdoors</category><category>identity</category><category>unix</category><category>netbook</category><category>twitter</category><category>log</category><category>compliance</category><category>coffee</category><category>career</category><category>jasager</category><category>conventions</category><category>package management</category><category>transportation</category><category>install</category><category>mobile</category><category>cable</category><category>Magazines</category><category>rsync</category><category>Websecurity</category><category>Bitblocker</category><category>evasion</category><category>hackerfuel</category><category>storage</category><category>vx8550</category><category>droid2global</category><category>fiction sf literature</category><category>wtf</category><category>application security</category><category>presentation</category><category>holywar</category><category>hamster</category><category>encryption</category><category>base64</category><category>RSS</category><category>sun</category><category>IP</category><category>fon</category><category>web filter</category><category>repair</category><category>insider</category><category>lockpicking</category><category>DumpsterDiving</category><category>cron</category><category>blogs</category><category>laptop</category><category>backup</category><category>humor</category><category>overview</category><category>virtualbox</category><category>terror</category><category>openbsd</category><category>reviews</category><category>mysql</category><category>x11</category><category>LOAD OF CRAP</category><category>FreeBSD</category><category>cloud</category><category>timex sinclair</category><category>foo</category><category>links</category><category>Geek100</category><category>forensics</category><category>bsideskc</category><category>craft</category><category>x10</category><category>software</category><category>scanning</category><category>CPAP</category><category>ssl</category><category>web browser</category><category>stories</category><category>redundancy</category><category>ferret</category><category>oamp</category><category>FreeStuff</category><category>scam</category><category>kansascity</category><category>exploit</category><category>Polls</category><category>e815</category><category>computing</category><category>motion</category><category>mind</category><category>secret</category><category>proxy</category><category>javascript</category><category>rickroll</category><category>build cheap</category><category>postfix</category><category>sidejacking</category><category>MAC</category><category>googlehacks</category><category>proximity card</category><category>find</category><category>Electronics</category><category>BitPIM</category><category>tech economy cheap</category><category>rumors</category><category>chat</category><category>script</category><category>debian</category><category>LG</category><category>the end</category><category>netbook design evolution technology</category><category>workbench</category><category>motorola</category><category>netbsd</category><category>science</category><category>apache</category><category>linux</category><category>key</category><category>CLI</category><category>wrong</category><category>emacs</category><category>office</category><category>fud</category><category>breach</category><category>kubuntu</category><category>php</category><category>ReactOS</category><category>conspiracy</category><category>programming</category><category>bsd</category><category>syslog</category><category>Gadgets</category><category>games</category><category>audit</category><category>biometric</category><category>nessus</category><category>Search</category><category>television</category><category>isync</category><category>toys</category><category>amp</category><category>guestposts</category><category>xorg</category><category>Stallman</category><category>bluetooth</category><category>antivirus</category><category>evilwifi</category><category>Operatingsystems</category><category>jobs</category><category>3D</category><category>hacks</category><category>RBAC</category><category>history</category><category>microsoft</category><category>white list</category><category>fail</category><category>HiR Info</category><category>fiction</category><category>password</category><category>accounting</category><category>Books</category><title>HiR Information Report</title><description>Covering security, programming, systems administration and other interesting topics.</description><link>http://www.h-i-r.net/</link><managingEditor>noreply@blogger.com (Ax0n)</managingEditor><generator>Blogger</generator><openSearch:totalResults>534</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/HiR" /><feedburner:info uri="hir" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-4845579675110320587</guid><pubDate>Tue, 07 May 2013 16:36:00 +0000</pubDate><atom:updated>2013-05-07T11:36:12.450-05:00</atom:updated><title>OpenBSD 5.3 Released</title><description>&lt;a href="http://www.openbsd.org/53.html"&gt;OpenBSD 5.3&lt;/a&gt; was released on May 1.&amp;nbsp; (I told you I'm running behind!)&lt;br /&gt;
&lt;br /&gt;
There are &lt;a href="http://www.openbsd.org/plus53.html"&gt;many enhancements and changes&lt;/a&gt;, including some much-needed tweaking to dhclient, making it a little less frustrating to use. While updating the &lt;a href="http://www.h-i-r.net/p/openbsd.html"&gt;nginx/MySQL/PHP-FPM how-to&lt;/a&gt;, I noticed that nginx is now defined in rc.conf like Apache has been for quite a while, so the setup procedure changed ever so slightly. The &lt;a href="http://www.h-i-r.net/p/hirs-secure-openbsd-apache-mysql-and.html"&gt;Apache/MySQL/PHP how-to&lt;/a&gt; remains basically unchanged, and it'll continue to be maintained so long as Apache is available in either the base distribution or from ports/packages. &lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=EiXhXqgMoi8:3STlYmULxGg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=EiXhXqgMoi8:3STlYmULxGg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=EiXhXqgMoi8:3STlYmULxGg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=EiXhXqgMoi8:3STlYmULxGg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=EiXhXqgMoi8:3STlYmULxGg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/EiXhXqgMoi8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/EiXhXqgMoi8/openbsd-53-released.html</link><author>noreply@blogger.com (Ax0n)</author><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2013/05/openbsd-53-released.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-6328528537952166856</guid><pubDate>Tue, 07 May 2013 16:25:00 +0000</pubDate><atom:updated>2013-05-07T11:28:13.262-05:00</atom:updated><title>xkcd on local administrator rights</title><description>Yes, I know, I'm running way behind, aren't I?&lt;br /&gt;
&amp;nbsp;&lt;a href="http://xkcd.com/1200/" imageanchor="1"&gt;&lt;img border="0" src="http://imgs.xkcd.com/comics/authorization.png" /&gt;&lt;/a&gt;&lt;br /&gt;
The thing is, authorization to your web-based accounts isn't why we recommend using an unprivileged account for your daily computing use.

On Windows, OS X and most popular desktop distributions of Linux, the first account that's created has administrator-level access. Increasingly, privilege escalation tools such as sudo, UAC and keychain access have made it to where you have to authenticate in order to make dramatic changes to the system (such as install drivers) but this protection can often be disabled or wholly bypassed.&lt;br /&gt;
&lt;br /&gt;
In any case, an administrator-level account on a computer can not only install drivers and software, but may unwittingly allow malware to set its hooks deep into the operating system. It's for this reason that people recommend setting up another user-level account without privileges to install software.&lt;br /&gt;
&lt;br /&gt;
As for protecting your sensitive data inside that user-level account, full-disk encryption is the way to go. This feature ships standard (although it is disabled by default) with OS X, many popular Linux distribution, and even the premium and enterprise versions of Windows. FDE has its flaws, but it's better than nothing.&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=EViidswlJHQ:0MRs0CjFHLU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=EViidswlJHQ:0MRs0CjFHLU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=EViidswlJHQ:0MRs0CjFHLU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=EViidswlJHQ:0MRs0CjFHLU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=EViidswlJHQ:0MRs0CjFHLU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/EViidswlJHQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/EViidswlJHQ/xkcd-on-local-administrator-rights.html</link><author>noreply@blogger.com (Ax0n)</author><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2013/05/xkcd-on-local-administrator-rights.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-6840169197742551888</guid><pubDate>Sun, 24 Mar 2013 18:33:00 +0000</pubDate><atom:updated>2013-03-25T17:20:46.256-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">javascript</category><category domain="http://www.blogger.com/atom/ns#">malware</category><category domain="http://www.blogger.com/atom/ns#">shell</category><title>Decoding obfuscated JavaScript: Shell Script Edition</title><description>I've been playing with a bunch of malware lately. Most security researchers have run across obfuscated JavaScript, and we all have our favorite ways of defeating it. &lt;a href="http://www.h-i-r.net/2011/12/intro-to-javascript-malware-analysis.html"&gt;I'd written about one way to decode this sort of thing back in 2011&lt;/a&gt;. &lt;br /&gt;
&lt;br /&gt;
Why bother decoding this stuff? Because encoded within this mess is 
another URL. Depending on the source of the obfuscated code it may be a 
link to a page full of exploit payloads or something similarly sinister.
 Unwrapping the layers of malware allows researchers to find out where 
the bad guys are actually hosting their stuff, and helps us identify 
providers who are willing to help with or at least turn a blind eye to 
cybercrime operations. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lately, I've become more determined to handle javascript de-obfuscation outside the browser. Over the last year or so, I've been experimenting with a bunch of techniques to make sense of blocks of code that look like this:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-BEwzyZ-2oPY/UU56RQelwPI/AAAAAAAAAbg/dpubOgvTPME/s1600/bh4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-BEwzyZ-2oPY/UU56RQelwPI/AAAAAAAAAbg/dpubOgvTPME/s1600/bh4.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
I think it goes without saying that this looks like a monumental pain in the ass. The truth is, it's not as bad as it appears, but I didn't say it was going to be easy.&lt;br /&gt;
&lt;br /&gt;
First, the basics. In JavaScript, FromCharCode() turns a decimal number between 0 and 255 into its ASCII character counterpart. You've all seen the &lt;a href="http://www.asciitable.com/"&gt;ASCII table&lt;/a&gt;, right? Same thing. &lt;br /&gt;
&lt;br /&gt;
I found a way to use printf in most shells to create a similar behavior, and I called this function "chr".&amp;nbsp; So let's start really simple. Here's a file containing a message encoded with CharCodes, and a quick way to decode it. It simply reads each number in (by replacing , with a space and using a for loop, then prints each character one at a time.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-x-j3T5_2iHM/UU6BA_bl0CI/AAAAAAAAAbs/CXTDFt_vclk/s1600/demo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-x-j3T5_2iHM/UU6BA_bl0CI/AAAAAAAAAbs/CXTDFt_vclk/s1600/demo.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
This is the basis for the rest of what we're about to do. Let's break down that obfuscated javascript:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-u_vt2zFCsYU/UU59s97jVOI/AAAAAAAAAbk/aSbxVgBlG5k/s1600/bh4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-u_vt2zFCsYU/UU59s97jVOI/AAAAAAAAAbk/aSbxVgBlG5k/s1600/bh4.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;br /&gt;
The yellow highlighted area is a bunch of numbers separated by the letter w. This is stored in an array labeled "f". If you look after the yellow, you can see that the code uses the letter w to split it.&lt;br /&gt;
&lt;br /&gt;
The blue highlighted area is the loop that handles decoding the numbers into characters. This is obfuscated code, so by definition they've made it a bit confusing, but the end result is that they keep appending each character to the end of the "s" variable.&lt;br /&gt;
&lt;br /&gt;
The bulk of the conversion of number to charcode (ascii decimal number of the character to be rendered) is here: (w[j]*1+41)&lt;br /&gt;
&lt;br /&gt;
This gets us to the essence of the article: &lt;b&gt;You'll need to use some brain power.&lt;/b&gt; The first thing I do is turn the data block into a string of comma-separated numbers so they're easier to work with, and I put these in their own file, like so. You can do this inside a text editor with search/replace, or on the CLI if you like.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-_1YjA15FziQ/UU6EPzh0IPI/AAAAAAAAAb4/emuEBE9k0o0/s1600/code4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-_1YjA15FziQ/UU6EPzh0IPI/AAAAAAAAAb4/emuEBE9k0o0/s1600/code4.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Then you need to figure out the math. In our example code, what is w? what is j? You'll probably run into a bunch of bizarre variable reassignment when trying to make sense of obfuscated code like this. Looking above, you can see between the yellow and blue blocks, w=f. So w is now a copy of that array full of numbers. Inside the blue block of code, you can see that j=i. So, w[j] points to the current number in the array.&amp;nbsp; But this number isn't the CharCode. There's still the "*1+41" part to deal with. Manually, we can see what's going on here. This is a very simple algorithm. The first 3 numbers are -32,-32,64.&lt;br /&gt;
&lt;br /&gt;
-32*1+41 = -32+41= 9 - CharCode 9 is a tab.&lt;br /&gt;
64*1+41 = 64+41 = 105 - CharCode 105 is a lowercase "i"&lt;br /&gt;
&lt;br /&gt;
Doing this manually would suck. The algorithm here is obvious. The CharCode is the number, plus 41. That's it.&amp;nbsp; Let's decode it with my script:&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-ExA67vuvnUI/UU6GnUb4h4I/AAAAAAAAAcE/Z7fZwn6jiFQ/s1600/decode4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-ExA67vuvnUI/UU6GnUb4h4I/AAAAAAAAAcE/Z7fZwn6jiFQ/s1600/decode4.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
So what happened here? This is the source of my relatively simple script.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;blockquote&gt;
#!/bin/sh
# Obfuscated JS Decoder
# Ax0n - 2013-03-22
# ax0n@h-i-r.net
#
if [ -z "$1" ]
then
  echo "$0 codefile algorithm"
  echo "c = placeholder for each number"
  echo "i = iterator"
  exit 1
fi

chr() {
  # http://mywiki.wooledge.org/BashFAQ/071
  # Turns a charcode into the ASCII byte
  printf \\$(printf '%03o' $1)
}
count=0
file=$1
shift
algo="$*"
for code in `cat $file | tr "," " " `;
do
  chr `echo "$algo" | \
    sed -e s/"i"/"$count"/g -e s/"c"/"$code"/g | \
    bc | cut -f1 -d\.` | tr -d "\r"
  count=`expr $count + 1`
done
echo
echo "----- done ----"

&lt;/blockquote&gt;
&lt;/pre&gt;
At the heart of the above script is a nifty function I found in the Bash FAQ. And then, I used a pair of sed&amp;nbsp;expressions to replace the "i" and "c" placeholders within the loop that handles the output. We call on the "bc" command-line calculator to work all the math magic.&amp;nbsp; tr -d "\r" fixes some broken newlines found in some of the samples I decoded. Let's see it in action:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;iframe width="420" height="315" src="http://www.youtube.com/embed/YI1piGki5B8" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, let's look at the one in the video. It has a much more complicated algorithm than simply adding 41 to each digit before converting it to the ASCII byte! It's hard to read in the video, so here it is:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-gF-1LFRFMFA/UU83JGgCjNI/AAAAAAAAAcU/vwMYCEHqnGw/s1600/bh1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-gF-1LFRFMFA/UU83JGgCjNI/AAAAAAAAAcU/vwMYCEHqnGw/s1600/bh1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Fortunately, this one already separates the codes with commas, so we can pretty much just copy and paste the numbers into a text file for decoding. As you can see on the 3rd-to-last line, the algorithm it uses for each character is this:&lt;br /&gt;
((w[j]*1+e(x+3)+11))&lt;br /&gt;
&lt;br /&gt;
Let's tear into it, shall we?&lt;br /&gt;
w[j] starts out just like the last example. We can see they set j=i and w is a copy of the array, so for each iteration, this is the digit. We can replace this with "c" in our algorithm expression.&lt;br /&gt;
&lt;br /&gt;
That leaves us to figure out what e and x are. Also like the last example, e is set to "eval" at the end of the second line. We'll ignore it. Let's look for x= in the code. &lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-46EXCI77YLI/UU847xW6_mI/AAAAAAAAAcc/deqe4uE70Cg/s1600/bh1a.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-46EXCI77YLI/UU847xW6_mI/AAAAAAAAAcc/deqe4uE70Cg/s1600/bh1a.png" /&gt;&lt;/a&gt;&lt;/div&gt;
There it is! j% - and remember, j = i, so it's the iterator. % is a mathematical modulus operator. -- that is, it divides two numbers and the output is the remainder. Example: 17 divided by 4 is 4 with a remainder of 1. &lt;br /&gt;
$ echo "17 % 4" | bc&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
(x+3) becomes essentially, (i % +3) and +3 just means "positive 3" in this context. We don't even need the +. &lt;br /&gt;
&lt;br /&gt;
((w[j]*1+e(x+3)+11)) becomes ((c * 1 + ( i % 3 ) + 11)) or simply "c + ( i % 3 ) + 11"&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-M7qDahvEVNM/UU87DlGWAeI/AAAAAAAAAck/e9oBN35ZNuQ/s1600/bh1decode.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-M7qDahvEVNM/UU87DlGWAeI/AAAAAAAAAck/e9oBN35ZNuQ/s1600/bh1decode.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
You can see these two examples plus two more here (the password is "infected"):&lt;br /&gt;
&lt;a href="http://stuff.h-i-r.net/bhlog.zip"&gt;http://stuff.h-i-r.net/bhlog.zip&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=zE6NkceyMhU:mR_8JqbMWfY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=zE6NkceyMhU:mR_8JqbMWfY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=zE6NkceyMhU:mR_8JqbMWfY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=zE6NkceyMhU:mR_8JqbMWfY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=zE6NkceyMhU:mR_8JqbMWfY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/zE6NkceyMhU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/zE6NkceyMhU/decoding-obfuscated-javascript-shell.html</link><author>noreply@blogger.com (Ax0n)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-BEwzyZ-2oPY/UU56RQelwPI/AAAAAAAAAbg/dpubOgvTPME/s72-c/bh4.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2013/03/decoding-obfuscated-javascript-shell.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-4296613659405636413</guid><pubDate>Wed, 27 Feb 2013 23:46:00 +0000</pubDate><atom:updated>2013-02-27T17:48:08.096-06:00</atom:updated><title>ISO-8601</title><description>This. So much this.&lt;br /&gt;

&lt;a href="http://xkcd.com/1179/" target="_BLANK"&gt;&lt;img border="0" src="http://imgs.xkcd.com/comics/iso_8601.png" /&gt;&lt;/a&gt;
&lt;BR /&gt;&lt;pre&gt;
In C:
&lt;blockquote&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;time.h&amp;gt;
#define SIZE 0x100
int main ()
{
    time_t t;
    char buffer[SIZE];
    struct tm ltime;
    t = time (0);
    localtime_r (&amp; t, &amp; ltime);
    strftime (buffer, SIZE, "%Y-%m-%d", &amp; ltime);
    printf ("%s\n", buffer);
    return 0;
}
&lt;/blockquote&gt;
In Bourne-derived shell:
&lt;blockquote&gt;#!/bin/sh
iso8601=`date +%Y-%m-%d`
echo $iso8601
&lt;/blockquote&gt;

In Perl:
&lt;blockquote&gt;#!/usr/bin/perl
use POSIX qw/strftime/;
my $date = strftime "%Y-%m-%d", localtime;
print "$date\n";
&lt;/blockquote&gt;

In Ruby:
&lt;blockquote&gt;#!/usr/bin/ruby
iso8601 = Time.now.strftime("%Y-%m-%d")
p iso8601
&lt;/blockquote&gt;

In PHP:
&lt;blockquote&gt;&amp;lt;?php
$iso8601=date('Y-m-d'); 
print $iso8601."\n";
&lt;/blockquote&gt;

In Python:
&lt;blockquote&gt;#!/usr/bin/python
from datetime import date
iso8601=date.today().isoformat()
print iso8601
&lt;/blockquote&gt;
&lt;/pre&gt;

Got it?  Good.&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=lRKYnJx--AI:PhWjltVLAms:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=lRKYnJx--AI:PhWjltVLAms:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=lRKYnJx--AI:PhWjltVLAms:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=lRKYnJx--AI:PhWjltVLAms:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=lRKYnJx--AI:PhWjltVLAms:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/lRKYnJx--AI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/lRKYnJx--AI/iso-8601.html</link><author>noreply@blogger.com (Ax0n)</author><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2013/02/iso-8601.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-7796724515557392417</guid><pubDate>Wed, 13 Feb 2013 01:11:00 +0000</pubDate><atom:updated>2013-02-12T19:12:39.323-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">openbsd</category><category domain="http://www.blogger.com/atom/ns#">bsd</category><title>Making a bootable USB installer for OpenBSD</title><description>When I first installed OpenBSD to my netbook, I had tried several ways to get the ISO written to a USB stick including unetbootin, using dd to directly write the image to USB, and a few other tricks. The Googles showed me &lt;a href="http://bsdgurl.net/pages/openbsdportable.html"&gt;a workable yet rather complicated way to do it&lt;/a&gt;, but that sounded like a pain in the butt. I didn't have an external USB optical drive, but I had the hardware to hack one up. This is really how I did that first OpenBSD install:&lt;br /&gt;
&lt;a href="http://www.flickr.com/photos/kc-bike/8469787640/" title="hacky by KC-Bike, on Flickr"&gt;&lt;img alt="hacky" src="http://farm9.staticflickr.com/8386/8469787640_d8ffeaf4c9_n.jpg" height="320" width="209" /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;
Earlier, I had actually installed OpenBSD to a USB stick, and run the whole system directly from USB, including a swap partition, logs going to /var and the whole nine yards. OpenBSD's gratuitous logging and swap utilization killed that USB stick in a matter of months after daily use, but the thought hit me to use that same method here. By default, the bsd.rd package is installed to the root filesystem to use in a recovery situation. This is an initial ramdisk, a bare-bones userland with just enough tools to install or rescue a system. So that's what we're going to do.&amp;nbsp; The TL;DR goes something like this:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Boot a desktop from the boot CD&lt;/li&gt;
&lt;li&gt;Insert the USB stick you wish to use&lt;/li&gt;
&lt;li&gt;Choose "Install" from the CD's menu.&lt;/li&gt;
&lt;li&gt;Format the USB stick, and install OpenBSD to it. If it's a 4GB stick or larger, the default partitioning scheme will work great. Otherwise, make one root partition without swap. Install only the base, bsd, bsd.rd and etc packages.&lt;/li&gt;
&lt;li&gt;After install, re-mount the cd and copy the install files to the root partition.&lt;/li&gt;
&lt;li&gt;Create an etc/boot.conf file on the USB stick (mounted to /mnt) with "bsd.rd" as the first and only line.&lt;/li&gt;
&lt;li&gt;Shut down the system. The USB stick will now boot on most servers and netbooks lacking optical drives, and will go directly to the installer. All the OpenBSD install packages will be right there on the USB stick.&lt;/li&gt;
&lt;/ol&gt;
&amp;nbsp;Here's the walk-through.&lt;br /&gt;
&lt;br /&gt;
I booted up the system, and after the installer menu popped up, I plugged in my USB stick. I did this to make it obvious what its device id is. You can tell it's sd0 in this image. Adjust accordingly. At the menu, I chose "I".&lt;br /&gt;
&lt;a href="http://www.flickr.com/photos/kc-bike/8468673643/" title="obsd-plugusb by KC-Bike, on Flickr"&gt;&lt;img alt="obsd-plugusb" src="http://farm9.staticflickr.com/8239/8468673643_29065d16a4.jpg" height="277" width="500" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
You can see I'm choosing sd0 here. Again, use the right device, or you may damage important filesystems.&lt;br /&gt;
&lt;a href="http://www.flickr.com/photos/kc-bike/8469768066/" title="obsd-disk by KC-Bike, on Flickr"&gt;&lt;img alt="obsd-disk" src="http://farm9.staticflickr.com/8518/8469768066_3a3e82dc49.jpg" height="277" width="500" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I just rolled with the default partition sizes here. The install files are a little over 100 megs, so they'll fit in the root partition. If you're an avid OpenBSD user, feel free to mess with the disk options here, but the defaults work well on a 4GB stick (the smallest I had laying around).
&lt;a href="http://www.flickr.com/photos/kc-bike/8468673639/" title="obsd-disk2 by KC-Bike, on Flickr"&gt;&lt;img alt="obsd-disk2" src="http://farm9.staticflickr.com/8526/8468673639_1432f986b2.jpg" height="277" width="500" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
When the time comes to install sets, the only ones you really need to get an installation environment up are bsd, bsd.rd, baseXX.tgz and etcXX.tgz (where XX is the release number) - I had an official OpenBSD 5.1 install set at my desk, so I used it for this example. The numbers will change for each release, but the process works the same.
&lt;a href="http://www.flickr.com/photos/kc-bike/8468673645/" title="obsd-sets by KC-Bike, on Flickr"&gt;&lt;img alt="obsd-sets" src="http://farm9.staticflickr.com/8370/8468673645_6b4a721d31.jpg" height="277" width="500" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
When the installer exits, it will un-mount the CD. You'll want to re-mount it to copy the install sets to USB. Also note that I set mnt/etc/boot.conf to "bsd.rd" - This forces the USB stick to boot directly to the installer ramdisk, so you'll be ready to go!
&lt;a href="http://www.flickr.com/photos/kc-bike/8469768062/" title="obsd-boot-sets by KC-Bike, on Flickr"&gt;&lt;img alt="obsd-boot-sets" src="http://farm9.staticflickr.com/8371/8469768062_6b4a721d31.jpg" height="279" width="500" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
To test, I put the USB stick into my netbook and fired it up. 
&lt;a href="http://www.flickr.com/photos/kc-bike/8468740333/" title="Untitled by KC-Bike, on Flickr"&gt;&lt;img alt="Untitled" src="http://farm9.staticflickr.com/8512/8468740333_413eaeefd6.jpg" height="282" width="500" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;a href="http://www.flickr.com/photos/kc-bike/8468739573/" title="Untitled by KC-Bike, on Flickr"&gt;&lt;img alt="Untitled" src="http://farm9.staticflickr.com/8373/8468739573_6fb883738e_n.jpg" height="299" width="320" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=oKGZgznDGuQ:YTZdQQkdXy0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=oKGZgznDGuQ:YTZdQQkdXy0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=oKGZgznDGuQ:YTZdQQkdXy0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=oKGZgznDGuQ:YTZdQQkdXy0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=oKGZgznDGuQ:YTZdQQkdXy0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/oKGZgznDGuQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/oKGZgznDGuQ/making-bootable-usb-installer-for.html</link><author>noreply@blogger.com (Ax0n)</author><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2013/02/making-bootable-usb-installer-for.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-4788742988195077452</guid><pubDate>Sat, 03 Nov 2012 06:35:00 +0000</pubDate><atom:updated>2012-12-22T11:05:17.152-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">mysql</category><category domain="http://www.blogger.com/atom/ns#">openbsd</category><category domain="http://www.blogger.com/atom/ns#">apache</category><category domain="http://www.blogger.com/atom/ns#">oamp</category><title>Introducing: nginx/MySQL/PHP stack on OpenBSD</title><description>While our walk-through for Apache/MySQL/PHP&amp;nbsp; on OpenBSD is quite popular, the &lt;a href="http://www.openbsd.org/faq/upgrade52.html"&gt;upgrade documentation for OpenBSD 5.2&lt;/a&gt; is quoted thus:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;a href="http://nginx.org/"&gt;nginx&lt;/a&gt; (see also
&lt;a href="http://www.openbsd.org/cgi-bin/man.cgi?query=nginx&amp;amp;sektion=8"&gt;nginx(8)&lt;/a&gt;)
has been added to OpenBSD, ultimately to replace the Apache 1.3 derived
&lt;a href="http://www.openbsd.org/cgi-bin/man.cgi?query=httpd&amp;amp;sektion=8"&gt;httpd(8)&lt;/a&gt;.
For new installations, you are encouraged to utilize nginx rather than
httpd, existing installations are encouraged to start planning replacing
the stock httpd with nginx.&amp;nbsp;
&lt;/blockquote&gt;
&lt;br /&gt;
With Apache 1.3 being awfully long in the tooth, most of us saw something like this coming. With that, there's a new walk-through that covers the basic configuration of nginx, MySQL and php-fpm to create a working, secure and chroot-enabled web application environment in OpenBSD 5.2.&lt;br /&gt;
&lt;br /&gt;
Introducing: &lt;a href="http://www.h-i-r.net/p/openbsd.html"&gt;The OpenBSD nginx/MySQL/PHP stack&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=KRB67wSecU0:YwFsCWKHZXo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=KRB67wSecU0:YwFsCWKHZXo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=KRB67wSecU0:YwFsCWKHZXo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=KRB67wSecU0:YwFsCWKHZXo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=KRB67wSecU0:YwFsCWKHZXo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/KRB67wSecU0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/KRB67wSecU0/introducing-nginxmysqlphp-stack-on.html</link><author>noreply@blogger.com (Ax0n)</author><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2012/11/introducing-nginxmysqlphp-stack-on.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-1454349356751179332</guid><pubDate>Fri, 02 Nov 2012 11:52:00 +0000</pubDate><atom:updated>2012-12-22T11:04:17.229-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">openbsd</category><title>OpenBSD 5.2 Released</title><description>&lt;a href="http://www.openbsd.org/52.html"&gt;OpenBSD 5.2&lt;/a&gt; was released yesterday; That means it's time to update the &lt;a href="http://www.h-i-r.net/p/hirs-secure-openbsd-apache-mysql-and.html"&gt;OpenBSD Apache/MySQL/PHP&lt;/a&gt; page!&lt;br /&gt;
&lt;br /&gt;
Some changes I noticed right away while updating the walk-through:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;pkg_add defaults to interactive mode. For example, when trying to resolve ambiguous packages (multiple versions available in the repository), it prompts you for which package you want to install. It will also do this for dependencies, and may ask other questions during installation.&lt;/li&gt;
&lt;li&gt;The MySQL Server package comes with an optional-use script to help lock down MySQL and remove all test data.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
You can see the detailed &lt;a href="http://www.openbsd.org/52.html"&gt;changelog&lt;/a&gt; for more details. I noticed that nginx ships by default now, and that there have been other improvements all around. This post is even coming from within Chrome on OpenBSD 5.2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=OfXPiFsfzpQ:t-P4oqNNwRo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=OfXPiFsfzpQ:t-P4oqNNwRo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=OfXPiFsfzpQ:t-P4oqNNwRo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=OfXPiFsfzpQ:t-P4oqNNwRo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=OfXPiFsfzpQ:t-P4oqNNwRo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/OfXPiFsfzpQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/OfXPiFsfzpQ/openbsd-52-released.html</link><author>noreply@blogger.com (Ax0n)</author><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2012/11/openbsd-52-released.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-1564435283475184046</guid><pubDate>Sun, 28 Oct 2012 23:26:00 +0000</pubDate><atom:updated>2012-10-29T12:00:16.753-05:00</atom:updated><title>MySQL logging for OSSec</title><description>From their website: "OSSEC 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."&lt;br /&gt;
&lt;br /&gt;
I use OSSec in several places. In my home lab and on my web servers (hosted elsewhere) for starters. While OSSec alone can't take the place of an enterprise-grade SIEM, the HIDS component can work well with them. If you're running a relatively small shop on a limited budget, it might be good enough, especially if you're willing to invest some time into tinkering.&lt;br /&gt;
&lt;br /&gt;
I thought it'd be easier to report on OSSec's alerts if it were somehow able to store them in a database. As it turns out, OSSec can be made to log much of its information to either MySQL or PostgreSQL, but the documentation is a bit spread out and hard to follow.&lt;br /&gt;
&lt;br /&gt;
First things first, you'll have to (re)compile OSSec, and and you'll need the MySQL bits and pieces for both OSSec MySQL connector as well as a working MySQL server, assuming you want MySQL to work locally with the OSSec server. So make sure you have all the packages you'll need:&lt;br /&gt;
&lt;br /&gt;
&lt;b id="internal-source-marker_0.863569418201223" style="font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;sudo apt-get install build-essential libmysqlclient-dev mysql-server&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b id="internal-source-marker_0.863569418201223" style="font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;Fet&lt;/span&gt;&lt;/b&gt;&lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family: Times; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;ch the OSSec source code and extract it. &lt;a href="http://www.ossec.net/"&gt;http://www.ossec.net/&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family: Times; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;On Ubuntu 12.04 LTS and with OSSec 2.6.0, I had to apply this patch: &lt;/span&gt;&lt;/span&gt;&lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family: Times; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;b id="internal-source-marker_0.863569418201223" style="font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;a href="http://pastebin.com/Pg3pDtr0"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;"&gt;http://pastebin.com/Pg3pDtr0&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;b id="internal-source-marker_0.863569418201223" style="font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;b id="internal-source-marker_0.863569418201223" style="font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;/span&gt;&lt;/b&gt; - It changes one line in a single Makefile, but it wouldn't compile properly otherwise.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family: Times; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;In the "src" directory of the OSSec source code, run "make setdb" and if the proper libraries are installed, you should see something like this:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b id="internal-source-marker_0.863569418201223" style="font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;Error: PostgreSQL client libraries not installed.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b id="internal-source-marker_0.863569418201223" style="font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;Info: Compiled with MySQL support.&lt;/span&gt;&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
Before you install OSSec, you need to create the database, add a MySQL user for OSSec to use, and import the schema.&amp;nbsp; You can change the username and password below to suit, obviously.&lt;br /&gt;
&lt;br /&gt;
&lt;b id="internal-source-marker_0.863569418201223" style="font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;mysql -uroot -p[password]&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;mysql&amp;gt; create database ossec;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;mysql&amp;gt; grant INSERT,SELECT,UPDATE,CREATE,DELETE,EXECUTE on ossec.* to ossec@localhost;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;mysql&amp;gt; set password for ossec@localhost=PASSWORD('53Cr37p4ss');&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;mysql&amp;gt; flush privileges;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family: Times; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;b id="internal-source-marker_0.863569418201223" style="font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b id="internal-source-marker_0.863569418201223" style="font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;b id="internal-source-marker_0.863569418201223" style="font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;cd src/os_dbd&lt;/span&gt; (in the OSSec source code directory)&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;b id="internal-source-marker_0.863569418201223" style="font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;b id="internal-source-marker_0.863569418201223" style="font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;br /&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;mysql ossec -uossec -p53Cr37p4ss &amp;lt; mysql.schema&lt;/span&gt;&lt;/b&gt; &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b id="internal-source-marker_0.863569418201223" style="font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b id="internal-source-marker_0.863569418201223" style="font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;Go back to&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family: Times; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;the OSSec source code base directory, and run install.sh (as root or with sudo) - Your options will vary, but the defaults are usually sane.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family: Times; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;Once OSSec is installed, you need to add the following snippet to the end of ossec.conf (usually in /var/ossec/etc) - Remember to make sure you edit this to reflect your actual database information.&lt;/span&gt;&lt;/span&gt;

&lt;pre style='color:#000000;background:#ffffff;'&gt;&lt;span style='color:#a65700; '&gt;&amp;lt;&lt;/span&gt;&lt;span style='color:#5f5035; '&gt;ossec_config&lt;/span&gt;&lt;span style='color:#a65700; '&gt;&gt;&lt;/span&gt;
    &lt;span style='color:#a65700; '&gt;&amp;lt;&lt;/span&gt;&lt;span style='color:#5f5035; '&gt;database_output&lt;/span&gt;&lt;span style='color:#a65700; '&gt;&gt;&lt;/span&gt;
        &lt;span style='color:#a65700; '&gt;&amp;lt;&lt;/span&gt;&lt;span style='color:#5f5035; '&gt;hostname&lt;/span&gt;&lt;span style='color:#a65700; '&gt;&gt;&lt;/span&gt;localhost&lt;span style='color:#a65700; '&gt;&amp;lt;/&lt;/span&gt;&lt;span style='color:#5f5035; '&gt;hostname&lt;/span&gt;&lt;span style='color:#a65700; '&gt;&gt;&lt;/span&gt;
        &lt;span style='color:#a65700; '&gt;&amp;lt;&lt;/span&gt;&lt;span style='color:#5f5035; '&gt;username&lt;/span&gt;&lt;span style='color:#a65700; '&gt;&gt;&lt;/span&gt;ossec&lt;span style='color:#a65700; '&gt;&amp;lt;/&lt;/span&gt;&lt;span style='color:#5f5035; '&gt;username&lt;/span&gt;&lt;span style='color:#a65700; '&gt;&gt;&lt;/span&gt;
        &lt;span style='color:#a65700; '&gt;&amp;lt;&lt;/span&gt;&lt;span style='color:#5f5035; '&gt;password&lt;/span&gt;&lt;span style='color:#a65700; '&gt;&gt;&lt;/span&gt;53Cr37p4ss&lt;span style='color:#a65700; '&gt;&amp;lt;/&lt;/span&gt;&lt;span style='color:#5f5035; '&gt;password&lt;/span&gt;&lt;span style='color:#a65700; '&gt;&gt;&lt;/span&gt;
        &lt;span style='color:#a65700; '&gt;&amp;lt;&lt;/span&gt;&lt;span style='color:#5f5035; '&gt;database&lt;/span&gt;&lt;span style='color:#a65700; '&gt;&gt;&lt;/span&gt;ossec&lt;span style='color:#a65700; '&gt;&amp;lt;/&lt;/span&gt;&lt;span style='color:#5f5035; '&gt;database&lt;/span&gt;&lt;span style='color:#a65700; '&gt;&gt;&lt;/span&gt;
        &lt;span style='color:#a65700; '&gt;&amp;lt;&lt;/span&gt;&lt;span style='color:#5f5035; '&gt;type&lt;/span&gt;&lt;span style='color:#a65700; '&gt;&gt;&lt;/span&gt;mysql&lt;span style='color:#a65700; '&gt;&amp;lt;/&lt;/span&gt;&lt;span style='color:#5f5035; '&gt;type&lt;/span&gt;&lt;span style='color:#a65700; '&gt;&gt;&lt;/span&gt;
    &lt;span style='color:#a65700; '&gt;&amp;lt;/&lt;/span&gt;&lt;span style='color:#5f5035; '&gt;database_output&lt;/span&gt;&lt;span style='color:#a65700; '&gt;&gt;&lt;/span&gt;
&lt;span style='color:#a65700; '&gt;&amp;lt;/&lt;/span&gt;&lt;span style='color:#5f5035; '&gt;ossec_config&lt;/span&gt;&lt;span style='color:#a65700; '&gt;&gt;&lt;/span&gt;
&lt;/pre&gt;

&lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family: Times; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;b id="internal-source-marker_0.863569418201223" style="font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family: Times; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;b id="internal-source-marker_0.863569418201223" style="font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;ossec_config&gt;&lt;/ossec_config&gt;&lt;/span&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre id="line1"&gt;&lt;/pre&gt;
&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;/span&gt;&lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family: Times; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&lt;b id="internal-source-marker_0.863569418201223" style="font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family: Times; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;To enable the ossec-dbd database logging, you must run /var/ossec/bin/ossec-control enable database&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family: Times; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;Restart ossec (/etc/init.d/ossec restart) and you should be good to go. On my installation, OSSec immediately begun populating the "signatures" table, and after a short while, alerts were logging to the "alert" and "data" tables.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family: Times; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"&gt;My next step is to generate some scheduled email summary reports, but all in all, having logs in a database will certainly make poring through them a much easier task. &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=KfXc7WviOuc:daumiX-d2ds:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=KfXc7WviOuc:daumiX-d2ds:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=KfXc7WviOuc:daumiX-d2ds:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=KfXc7WviOuc:daumiX-d2ds:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=KfXc7WviOuc:daumiX-d2ds:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/KfXc7WviOuc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/KfXc7WviOuc/mysql-logging-for-ossec.html</link><author>noreply@blogger.com (Ax0n)</author><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2012/10/mysql-logging-for-ossec.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-1558566972663534423</guid><pubDate>Wed, 01 Aug 2012 04:31:00 +0000</pubDate><atom:updated>2012-07-31T23:35:21.065-05:00</atom:updated><title>Emergency power show-down</title><description>Being an amateur radio operator and a nerd in general, I make sure I have emergency power available. This is in the form of gel cells, several UPS units and of course the obligatory inverter for road trips. I have a solar panel that can put a reasonable charge back into my gel cells with one bright day's worth of sunshine. I don't feel like I need a generator. If the power goes out for a week or two over a wide area, most of my gadgets will be marginally useless, and I'm pretty comfortable living without electricity, as I go backpacking and camping frequently.&lt;br /&gt;
&lt;br /&gt;
I do use my netbook for certain digital modes with amateur radio, and I could see it coming in handy for emergency operations. Considering the electronics I might choose to use sparingly in a power outage, I did some experimentation over the weekend. &lt;br /&gt;
&lt;br /&gt;
My netbook requires 19VDC, and It seemed silly to me to turn DC into AC, and step it all the way up to 120 volts, just to step it back down, rectify and filter it for devices that fundamentally operate on DC to begin with. The same goes for desktop PCs that take 120VAC and turn it into +-12VDC, 5VDC and 3.3VDC.  The rest of my "ham shack" runs fine on car batteries.  Why not my computers?&lt;br /&gt;
&lt;br /&gt;
In all of the following photos, you'll see amperes on the display, but I'll reference watts. The battery pack was sitting at 13.2 volts for all of these tests.&lt;br /&gt;
&lt;br /&gt;
To baseline this thing, I went with the obvious choice of plugging into one of my UPSes. I have a feeling this is how most folks would choose to operate their computer in a power outage if it were an option.&lt;br /&gt;
&lt;br /&gt;
The UPS consumes a paltry 5 watts without a load. This is looking pretty good. &lt;br /&gt;
&lt;a href="http://www.flickr.com/photos/kc-bike/7688777562/"&gt;&lt;img src="http://farm9.staticflickr.com/8164/7688777562_a481e13777_n.jpg" /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
Plugging the power brick in bumps consumption up less than a watt for a total of about 5.7 Watts. &lt;br /&gt;
&lt;a href="http://www.flickr.com/photos/kc-bike/7688782372/"&gt;&lt;img src="http://farm8.staticflickr.com/7265/7688782372_7710b4a052_n.jpg" /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
With the laptop booted up and running on the UPS, battery consumption tops out at around 20 watts. I noticed numbers higher than 1.5 amperes momentarily. One of our cats also has some obsession with laying on warm electronics such as power bricks.&lt;br /&gt;
&lt;a href="http://www.flickr.com/photos/kc-bike/7688807276/"&gt;&lt;img src="http://farm9.staticflickr.com/8161/7688807276_7644f37934_n.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, I tried my 450 Watt inverter. Without a load, it uses about 6.6 watts. Not terribly surprising. It has two noisy fans and a display to power as well.&lt;br /&gt;
&lt;a href="http://www.flickr.com/photos/kc-bike/7687084214/"&gt;&lt;img src="http://farm8.staticflickr.com/7114/7687084214_f9f2a9a39f_n.jpg" /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
Plugging the power brick in without any load bumped consumption up to 7.1 watts. This is similar to what happened with the UPS, but still less efficient.&lt;br /&gt;
&lt;a href="http://www.flickr.com/photos/kc-bike/7687086134/"&gt;&lt;img src="http://farm8.staticflickr.com/7120/7687086134_d46434e304_n.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Attaching the netbook spiked the load to about 43 watts total. Ouch!&lt;br /&gt;
&lt;a href="http://www.flickr.com/photos/kc-bike/7687078318/"&gt;&lt;img src="http://farm8.staticflickr.com/7277/7687078318_6071c99bbd_n.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, I tried operating my laptop on a DC-to-DC power supply. This was vastly more efficient than relying on an inverter, and considerably better than my UPS as well.  The DC-DC converter consumed 11 watts from my battery pack. &lt;br /&gt;
&lt;a href="http://www.flickr.com/photos/kc-bike/7687080520/"&gt;&lt;img src="http://farm8.staticflickr.com/7247/7687080520_cd65aed07d_n.jpg" /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The clear winner is obviously the DC-to-DC converter. If the laptop were the only thing in use, I could expect about four times the run time from the DC converter compared to using my inverter. &lt;br /&gt;
&lt;br /&gt;
The DC converter I used was originally for a Macintosh G3 PowerBook, and was set for 24 VDC. My netbook requires 19VDC, and I was fortunate enough to find a set of potentiometers on my old DC-DC supply to allow me to adjust the voltage, and then I hacked a plug onto it that works for my netbook.&lt;br /&gt;
&lt;br /&gt;
Most laptops require somewhere between 15-24 VDC, and are sensitive to dirty power. Good DC-DC converters are capable of dealing with 10-30+ volts of input and provide stable, clean power on the output suitable for sensitive electronics.  They're easy to find, if a little pricey compared to traditional transformer bricks. They are often sold as "&lt;a href="https://www.amazon.com/dp/B002UI2Y8Q/ref=as_li_ss_til?tag=kcbico-20&amp;amp;camp=0&amp;amp;creative=0&amp;amp;linkCode=as4&amp;amp;creativeASIN=B002UI2Y8Q&amp;amp;adid=13KYNRWN15HJFKK0KXQN&amp;amp;"&gt;Laptop Car Chargers&lt;/a&gt;"  &lt;br /&gt;
&lt;br /&gt;
Similarly, a company called &lt;a href="https://www.amazon.com/dp/B005TWE6B8/ref=as_li_ss_til?tag=kcbico-20&amp;amp;camp=0&amp;amp;creative=0&amp;amp;linkCode=as4&amp;amp;creativeASIN=B005TWE6B8&amp;amp;adid=0W5DW7S5ZJJZP1XQ6CFY&amp;amp;"&gt;PicoPSU&lt;/a&gt; makes a tiny solid-state DC-to-DC power supply that plugs directly into a computer motherboard's ATX connector and provides power cables for a few hard drives or other peripherals as needed. They're not designed to run powerful desktops or servers, but work fine for lower-power workstations or "book PCs." You'll have to find a way to power a monitor, though. Hint: many LCD displays can be powered by a DC-DC converter, too.&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=iyozJ_wjRhc:bfdtlSimWg8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=iyozJ_wjRhc:bfdtlSimWg8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=iyozJ_wjRhc:bfdtlSimWg8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=iyozJ_wjRhc:bfdtlSimWg8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=iyozJ_wjRhc:bfdtlSimWg8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/iyozJ_wjRhc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/iyozJ_wjRhc/emergency-power-show-down.html</link><author>noreply@blogger.com (Ax0n)</author><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2012/07/emergency-power-show-down.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-8916351492601159729</guid><pubDate>Wed, 25 Jul 2012 01:59:00 +0000</pubDate><atom:updated>2012-07-24T21:51:50.198-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">radio</category><category domain="http://www.blogger.com/atom/ns#">hackerspace</category><category domain="http://www.blogger.com/atom/ns#">hardware</category><title>Westlake Hardware: My hackerspace?</title><description>&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.flickr.com/photos/kc-bike/7640930076/"&gt;&lt;img height="500" src="http://farm8.staticflickr.com/7133/7640930076_e57baff886.jpg" width="282" /&gt; &amp;nbsp;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
It started as a simple trip to the hardware store. My mission was to find some 3/8" threadrod at 24 threads per inch. I was going to chop it with my dremel to a length of 6 and 9/32 inches long and use it as a 1/4 wavelength antenna in a mount similar to the one shown above. What I found were many kinds of threadrod, but nothing that would screw into either of my antenna bases.&lt;br /&gt;
&lt;br /&gt;
I opted for a piece of 3/8" smooth rod without threads, figuring I could just wander over to the hardware store's selection of threading dies and pick up the one I&amp;nbsp; needed to cut a dozen or so threads into the rod. There, I found many dies, but not the 3/8" x 24 I needed for the project. There was a spot for the die I needed, but it was empty.&lt;br /&gt;
&lt;br /&gt;
I finally cornered a sales associate, who looked up the part number, said they had one in stock, and even scoured the shelves looking to see if someone had placed it in the wrong spot.&amp;nbsp; What happened next took me by surprise. The associate went around to the back shop, pulled a full set of dies out of the tool chest, found the one I needed, and brought me around to the vise and tossed me some cutting oil and gloves so I could tap threads onto the rod myself. While I was working away, curiosity got the best of him. "What are you building?" he asked.&amp;nbsp; I explained that I was building a very cheap antenna, and explained that I was going to take it home and cut it to length so that it resonated at about 448 MHz. That's about the time he took me over to the chop saw with a cutoff wheel and a bench grinder. He found a couple pair of goggles and we got to work.&lt;br /&gt;
&lt;br /&gt;
So there you have it. I walked in, spent a few bucks on a steel rod, got about 20 minutes of free shop time and left with a finished product. Westlake, you're like having a hackerspace a mile from home!&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=c5lFKblhvSo:4y8FLNkiI1c:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=c5lFKblhvSo:4y8FLNkiI1c:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=c5lFKblhvSo:4y8FLNkiI1c:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=c5lFKblhvSo:4y8FLNkiI1c:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=c5lFKblhvSo:4y8FLNkiI1c:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/c5lFKblhvSo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/c5lFKblhvSo/westlake-hardware-my-hackerspace.html</link><author>noreply@blogger.com (Ax0n)</author><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2012/07/westlake-hardware-my-hackerspace.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-5450170816085220586</guid><pubDate>Fri, 20 Jul 2012 00:10:00 +0000</pubDate><atom:updated>2012-07-19T21:34:13.395-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Windows</category><category domain="http://www.blogger.com/atom/ns#">sysadmin</category><title>Windows SysAdmin trick: All your MMC snap-ins in one spot</title><description>At work, I frequently deal with both UNIX and Windows servers. My UNIX background has taught me to avoid logging in to systems -- even workstations -- with an administrative account unless you really need to use the power, even if you're a sysadmin. This works really well until it's time to start managing enterprise-wide settings like AD, DNS and DHCP. There are a variety of ways to solve the problem. Most places provide sysadmins with a user-level account and then an administrative-level account. You can log off from your workstation and log in with a domain administrator account to manage things. That's a genuine pain. You can remote desktop to a domain controller and log in with your admin account. You can even set up a terminal server with RSAT and other useful tools, and have your admins log in to that for routine enterprise maintenance.  
&lt;P&gt;&lt;/P&gt;
Alternatively, you can install &lt;a href="http://www.microsoft.com/en-us/download/details.aspx?id=7887"&gt;Remote Server Administration Tools&lt;/a&gt; onto Windows 7 Enterprise, and using a few quick tricks, you can have all of the MMC Snap-Ins you like at your fingertips, while still using an unprivileged domain account on your workstation. 
&lt;P&gt;&lt;/P&gt;
Once you get RSAT installed, you may need to also use "Programs and Features" to enable the Remote Server Administration Tools roles or its sub-roles as desired.
&lt;a href="http://farm9.staticflickr.com/8426/7592716646_f14031192f.jpg" imageanchor="1" style=""&gt;&lt;img border="0" width="400" src="http://farm9.staticflickr.com/8426/7592716646_f14031192f.jpg" /&gt;&lt;/a&gt;
&lt;P&gt;&lt;/P&gt;
After installing RSAT, you'll notice an "Administrative Tools" item in your start menu, but the tools won't work unless you have domain admin privileges.
&lt;P&gt;&lt;/P&gt;
There's a trick to launching an authentication prompt before running any program on Windows. Hold shift, then right-click the program, and select "Run as different user." While you can do this to any of the Administrative Tools items in the start menu, We're going to use this trick to launch the Microsoft Management console so that we can make life even easier. Hit Start, then use the search to find mmc.exe. Hold shift. Right click it. Run as different user.&lt;P&gt;&lt;/P&gt;
&lt;a href="http://farm8.staticflickr.com/7110/7592716864_4787542403_o.png" imageanchor="1" style=""&gt;&lt;img border="0" height="505" width="253" src="http://farm8.staticflickr.com/7110/7592716864_4787542403_o.png" /&gt;&lt;/a&gt;
&lt;P&gt;&lt;/P&gt;
Here, provide a domain administrator account. If you have UAC enabled (as you well should!) you'll be asked if you wish to allow mmc to make changes to your computer. Obviously, you do.
&lt;P&gt;&lt;/P&gt;
Once MMC is running, select "Add/Remove Snap-Ins" from the File menu. Here, you'll be able to load up a bunch of the individual modules from Start-&gt;Administrative Tools all into one MMC window.
&lt;P&gt;&lt;/P&gt;&lt;a href="http://farm9.staticflickr.com/8431/7592716718_46f61ec3db.jpg" imageanchor="1" style=""&gt;&lt;img border="0" width="400" src="http://farm9.staticflickr.com/8431/7592716718_46f61ec3db.jpg" /&gt;&lt;/a&gt;

&lt;P&gt;&lt;/P&gt;Once you have selected the tools you use frequently, you'll have a tree view of your favorite utilities, kind of like this:
&lt;P&gt;&lt;/P&gt;&lt;a href="http://farm8.staticflickr.com/7140/7592716522_8482ebc582.jpg" imageanchor="1" style=""&gt;&lt;img border="0" width="400" src="http://farm8.staticflickr.com/7140/7592716522_8482ebc582.jpg" /&gt;&lt;/a&gt;
&lt;P&gt;&lt;/P&gt;
Be sure to connect the individual snap-ins to the servers you need, if they require it (Hyper V, DNS and DHCP in the above example need to connect to other servers) and once you have everything configured the way you plan to use it, use the File-&gt; Save menu to stash the configuration file somewhere handy, such as on your network profile or hard drive.
&lt;P&gt;&lt;/P&gt;
I opted to create a shortcut on my desktop that launches mmc.exe C:\console.msc and I titled it "AD Console."  When I run it, I have to remember to launch it with my domain admin account using the trick above. Now, taking care of the day to day tasks on the enterprise is simple.
&lt;P&gt;&lt;/P&gt;
&lt;a href="http://farm9.staticflickr.com/8152/7592716900_fda7e3ab09_o.png" imageanchor="1" style=""&gt;&lt;img border="0" height="229" width="296" src="http://farm9.staticflickr.com/8152/7592716900_fda7e3ab09_o.png" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=VK8GklY1Oyg:lKRudzDrRO8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=VK8GklY1Oyg:lKRudzDrRO8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=VK8GklY1Oyg:lKRudzDrRO8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=VK8GklY1Oyg:lKRudzDrRO8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=VK8GklY1Oyg:lKRudzDrRO8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/VK8GklY1Oyg" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/VK8GklY1Oyg/windows-sysadmin-trick-all-your-mmc.html</link><author>noreply@blogger.com (Ax0n)</author><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2012/07/windows-sysadmin-trick-all-your-mmc.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-3582153355201458839</guid><pubDate>Mon, 16 Jul 2012 14:47:00 +0000</pubDate><atom:updated>2012-12-22T11:04:17.233-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">openbsd</category><title>OpenBSD and Windows 7: Multi-boot</title><description>&lt;a href="http://4.bp.blogspot.com/-0tNUHxDNhcI/UAQjOSHMBfI/AAAAAAAAAaw/ojqepwB7dvc/s1600/12%2B-%2B1%2B%25281%2529.jpg" imageanchor="1" style=""&gt;&lt;img border="0" height="179" width="320" src="http://4.bp.blogspot.com/-0tNUHxDNhcI/UAQjOSHMBfI/AAAAAAAAAaw/ojqepwB7dvc/s320/12%2B-%2B1%2B%25281%2529.jpg" /&gt;&lt;/a&gt;
&lt;P&gt;A little more than a year ago, &lt;a href="http://www.h-i-r.net/2011/05/why-im-coming-home-to-openbsd.html"&gt;I switched my netbook over to OpenBSD 4.9&lt;/a&gt;.  From the start, the netbook had been set up to dual-boot with Ubuntu or XUbuntu, so those 6 months running only OpenBSD really exposed how much I've come to rely on Windows, even if it's only occasionally. That's fine. I'm not an anti-Windows zealot and I use it every single day at work. 
&lt;/P&gt;&lt;P&gt;
I decided to start from scratch one more time when OpenBSD 5.0 came out, and to attempt to dual-boot Windows 7 and OpenBSD. As it turns out, setting up Windows 7 and OpenBSD to coexist was covered in surprisingly fine detail in the &lt;a href="http://www.openbsd.org/faq/faq4.html#Multibooting"&gt;OpenBSD FAQ&lt;/a&gt;. I've been running Windows 7 and OpenBSD side by side now for more than half a year. This setup has proven to be more stable than Ubuntu and Windows 7 dual booting, and I'm very pleased with this setup. I urge anyone interested in this to read the FAQ, but this post should give you a taste of what you're in for.
&lt;/P&gt;&lt;P&gt;
Before I nuked the whole system, I rsynced all of my data to a file server at home, then re-installed Windows from the recovery media. From Windows, I set aside a FAT32 partition for sharing files between the two operating systems, since OpenBSD can only read NTFS, and I left 10GB blank for OpenBSD. From there, the rest of the instructions worked great. Once you have Windows installed and your partitions set up, the short version goes something like this:
&lt;/P&gt;&lt;P&gt;
Install OpenBSD. DO NOT tell it to use the whole disk. I opted to use only one root partition and a swap partition. For a netbook, this makes quite a bit of sense. You'd rarely want to set up a server that way.  
&lt;/P&gt;&lt;P&gt;
After the installer finishes and before you reboot, copy the partition boot record (first block of the openbsd partition) to a file called openbsd.pbr using dd as in the example below. Be certain to use the raw device and get the partition right. The example command below was taken from the FAQ and is probably going to differ for you. 
&lt;/P&gt;&lt;P&gt;
# dd if=/dev/rsd0a of=openbsd.pbr bs=512 count=1 
&lt;/P&gt;&lt;P&gt;
Copy openbsd.pbr to somewhere useful. I copied it to the Fat32 partition I created earlier on. You could copy it to a usb stick or upload it to another location. You'll need this on the Windows machine. When you reboot into Windows, move this file to the root of c:
&lt;/P&gt;&lt;P&gt;
Start a cmd.exe window as administrator (Start -&gt; use text box to search for cmd.exe -&gt; right-click it -&gt; Run as Administrator), then set up the boot loader. Ripped directly from the OpenBSD FAQ again:
&lt;/P&gt;&lt;P&gt;
&lt;blockquote&gt;&lt;pre&gt;    C:\Windows\system32&gt; bcdedit /create /d "OpenBSD/i386" /application bootsector
    The entry {0154a872-3d41-11de-bd67-a7060316bbb1} was successfully created.

    C:\Windows\system32&gt;

As admonished before, the {0154a872-3d41-11de-bd67-a7060316bbb1} 
GUID is system-dependent. Note the value you receive when executing, 
and copy it into the following commands:

    C:\Windows\system32&gt; bcdedit /set {0154a872-3d41-11de-bd67-a7060316bbb1} device boot
    The operation completed successfully.

    C:\Windows\system32&gt; bcdedit /set {0154a872-3d41-11de-bd67-a7060316bbb1} path \openbsd.pbr
    The operation completed successfully.

    C:\Windows\system32&gt; bcdedit /set {0154a872-3d41-11de-bd67-a7060316bbb1} device partition=c:
    The operation completed successfully.

    C:\Windows\system32&gt; bcdedit /displayorder {0154a872-3d41-11de-bd67-7060316bbb1} /addlast
    The operation completed successfully.

    C:\Windows\system32&gt;
&lt;/pre&gt;&lt;/blockquote&gt;
&lt;/P&gt;&lt;P&gt;
Additionally, since OpenBSD is going to be my primary OS, I used the &lt;a href="http://technet.microsoft.com/en-us/library/cc709667%28ws.10%29.aspx"&gt;bcdedit command line options&lt;/a&gt; to further modify the Windows Boot Loader so that OpenBSD is displayed first and loaded by default after a brief prompt.
&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;

Upgrading OpenBSD is usually pretty easy. There's only one pitfall when you're upgrading OpenBSD in a multi-boot environment: Make sure you copy the PBR to C:\openbsd.pbr as you did in the initial multi-boot setup before you reboot after the upgrade installer exits. Failure to do this might render your openbsd install difficult to boot. You should still be able to boot your system from the install media if all else fails.  
&lt;/P&gt;&lt;P&gt;
If you've installed packages, you'll need to upgrade them separately. Set the pkg_path variable to a repository for the version of OpenBSD you're installing (5.1 as of this writing) or if you're using my preferred method of using /etc/pkg.conf, edit that file since it'll still be pointing to the older package repository from before the upgrade. Then simply run "pkg_add -ui" through sudo or as root. This will find the new packages and upgrade all that are available. the "i" in the above command tells pkg_add to prompt the user for any questions (resolving dependencies, etc).
&lt;/p&gt;
Edited to embed a highly relevant xkcd:
&lt;P&gt;
&lt;IMG SRC="http://imgs.xkcd.com/comics/success.png"&gt;&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=nyPvmDQGZAM:d7Thh7s6wuM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=nyPvmDQGZAM:d7Thh7s6wuM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=nyPvmDQGZAM:d7Thh7s6wuM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=nyPvmDQGZAM:d7Thh7s6wuM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=nyPvmDQGZAM:d7Thh7s6wuM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/nyPvmDQGZAM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/nyPvmDQGZAM/openbsd-and-windows-7-multi-boot.html</link><author>noreply@blogger.com (Ax0n)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-0tNUHxDNhcI/UAQjOSHMBfI/AAAAAAAAAaw/ojqepwB7dvc/s72-c/12%2B-%2B1%2B%25281%2529.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2012/07/openbsd-and-windows-7-multi-boot.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-7751636314122711087</guid><pubDate>Thu, 07 Jun 2012 23:21:00 +0000</pubDate><atom:updated>2012-06-07T18:31:27.335-05:00</atom:updated><title>Guts of the password hash checker</title><description>&lt;div&gt;A few folks asked how I put together the password hash checker yesterday. Understand that I was sick and in bed most of the day, and did most of this from my Motorola Droid 4. It was really ugly.

A local KC2600'er found a link to the hash dump on a shady Russian website. If you really want the dump of hashes and haven't found it yet, look for combo_not.zip and/or combo_not.txt.  I downloaded the file via wget on one of my OpenBSD web servers.

The text file was likely made from a Windows environment because it has telltale CR/LF line breaks. The first thing I did was fix the line breaks with sed. This cute little one-liner replaces all CR/LF line breaks with traditional UNIX line breaks so that command-line wizardry will work on it.

&lt;blockquote&gt;sed -i "" 's/.$//' combo_not.txt&lt;/blockquote&gt;

Then, I figured I should cram it all into MySQL to make queries against the data less of a pain in the ass. I created a database and user named lihash, then created the DB with only an auto-incrementing ID and a hash column:

&lt;blockquote&gt;create table lihash (id int primary key auto_increment, hash varchar(40));&lt;/blockquote&gt;

And then I used some more sed stuff to turn each hash into an "insert" line for MySQL. Here's what the output looks like (limited to the first 10 lines with head):

&lt;blockquote&gt;&lt;pre&gt;$ sed 's/^/insert into lihash values (NULL,"/;s/$/");/' combo_not.txt | head
insert into lihash values (NULL,"000000a94d47b9ca82c58a3b092a50263b40f66e");
insert into lihash values (NULL,"000000a9876203148923f97c6f1a0635472e1e38");
insert into lihash values (NULL,"000000a9bf60e7f17fcac444a54791af780743a3");
insert into lihash values (NULL,"000000a97e734e7ed9766d1ce08ebc68d3e93ab2");
insert into lihash values (NULL,"000000a9b4b1b3497aac51e212ac9efdb00e7f4e");
insert into lihash values (NULL,"000000a9affc26ed1b0ef2956825e85f9a2567ff");
insert into lihash values (NULL,"000000a93c829bab8c40f805bd3adec3302edf06");
insert into lihash values (NULL,"000000a9e3686034e4f7a1f5b8d6de92679dba5c");
insert into lihash values (NULL,"000000a966dd229cbdd0c4ccc524f0aff6c0fc31");
insert into lihash values (NULL,"000000a9317a995cb16dec71edf0d3aa4b918de6");&lt;/pre&gt;
&lt;/blockquote&gt;

With that looking all fine and proper, I piped all that straight into MySQL. 

&lt;blockquote&gt;$ sed 's/^/insert into lihash values (NULL,"/;s/$/");/' combo_not.txt | mysql lihash&lt;/blockquote&gt;

It took several minutes to munch through the data and created many megabytes of MySQL binary logs. While that was processing, I scoured the web looking for a decent javascript SHA-1 hashing method so that I didn't have to worry about handling peoples' passwords via my site. You can simply view the source of &lt;a href="http://things.h-i-r.net/lipass.html "&gt;this page&lt;/a&gt; to see how that works. It was mostly copypasta.

Finally, there's the PHP that drives it on the back-end. You can see the PHP Source &lt;a href="http://things.h-i-r.net/lipass.src.php"&gt;HERE&lt;/a&gt;. When I was testing, I had it displaying the hash that was passed. I got rid of that part to keep XSS shenanigans at bay. I'm probably doing all sorts of things wrong with the SQL queries, but I copied some of that database code from another project on that server (I was using a phone for this, remember?)&lt;br/&gt;&lt;img src='http://lh6.ggpht.com/-E-LVp3ot0A8/T9E2WEeEj7I/AAAAAAAAAaY/9gV0XJqSM58/2012-06-07_18-10-35_955.png' /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=OdMAJ2jXklk:k5CQq1yCFGE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=OdMAJ2jXklk:k5CQq1yCFGE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=OdMAJ2jXklk:k5CQq1yCFGE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=OdMAJ2jXklk:k5CQq1yCFGE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=OdMAJ2jXklk:k5CQq1yCFGE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/OdMAJ2jXklk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/OdMAJ2jXklk/guts-of-password-hash-checker.html</link><author>noreply@blogger.com (Ax0n)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/-E-LVp3ot0A8/T9E2WEeEj7I/AAAAAAAAAaY/9gV0XJqSM58/s72-c/2012-06-07_18-10-35_955.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2012/06/guts-of-password-hash-checker.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-261953503041036569</guid><pubDate>Wed, 06 Jun 2012 18:32:00 +0000</pubDate><atom:updated>2012-06-06T13:37:22.046-05:00</atom:updated><title>LinkedIn: Was your password leaked?</title><description>By now, you may have heard that a list of 6.5 million hashes have been posted to the Internet, and that they appear to be password hashes from LinkedIn. &lt;a href="http://news.cnet.com/8301-1009_3-57448079-83/millions-of-linkedin-passwords-reportedly-leaked-online/"&gt;CNet has some of the deets&lt;/a&gt;, but there's a &lt;a href="http://news.ycombinator.com/item?id=4073309"&gt;great thread on YCombinator Hacker News&lt;/a&gt; where some observations are made. Namely, SHA1 hashes for easily-guessed passwords (such as "linkedin" or "password") do not show up in the list, but if you replace the first five characters of the hash with "00000", then hashes do match for simple passwords. This leads to speculation that the attackers have already cracked some of the easy ones and truncated them in the list.&amp;nbsp;
&lt;br /&gt;
&lt;br /&gt;
I've made a really quick and dirty &lt;a href="http://things.h-i-r.net/lipass.html"&gt;web page&lt;/a&gt; that will help you check if your password is on the list. It features a nifty javascript SHA-1 digest hash generator so that the password you check never gets sent over cleartext. It will check hash and truncated hash against the dump. If it detects the entire hash, then your LinkedIn password hash is now in the wild, and it's likely only a matter of time until it's cracked. If the truncated version is in the password dump, it's almost certain your password is compromised.&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=cUW9J0UXhFI:tcmMOEmidu4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=cUW9J0UXhFI:tcmMOEmidu4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=cUW9J0UXhFI:tcmMOEmidu4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=cUW9J0UXhFI:tcmMOEmidu4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=cUW9J0UXhFI:tcmMOEmidu4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/cUW9J0UXhFI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/cUW9J0UXhFI/linkedin-was-your-password-leaked.html</link><author>noreply@blogger.com (Ax0n)</author><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2012/06/linkedin-was-your-password-leaked.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-4241225768315315224</guid><pubDate>Tue, 08 May 2012 04:02:00 +0000</pubDate><atom:updated>2012-12-22T11:05:17.149-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">mysql</category><category domain="http://www.blogger.com/atom/ns#">openbsd</category><category domain="http://www.blogger.com/atom/ns#">apache</category><category domain="http://www.blogger.com/atom/ns#">oamp</category><title>OpenBSD 5.1 Released: OAMP Updated</title><description>&lt;a href="http://openbsd.org/51.html"&gt;OpenBSD 5.1&lt;/a&gt; was released last week, so the update is a bit overdue. &lt;a href="http://www.h-i-r.net/p/hirs-secure-openbsd-apache-mysql-and.html"&gt;HiR's Secure OpenBSD + AMP&lt;/a&gt; guide has been updated. OpenBSD 4.x is officially unsupported now, so we've dropped the 4.x parts from the guide and refined the rest.

Since we've started covering the setup of an AMP stack on OpenBSD, the process has gotten considerably easier. OpenBSD is a completely viable and stable environment for running almost any PHP/MySQL web app, with a little extra consideration given to the chroot environment and Suhosin hardening patches while you're setting up your applications or programming new ones.&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=2udaSDvu_4U:JiObERpTN_g:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=2udaSDvu_4U:JiObERpTN_g:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=2udaSDvu_4U:JiObERpTN_g:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=2udaSDvu_4U:JiObERpTN_g:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=2udaSDvu_4U:JiObERpTN_g:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/2udaSDvu_4U" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/2udaSDvu_4U/openbsd-51-released-oamp-updated.html</link><author>noreply@blogger.com (Ax0n)</author><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2012/05/openbsd-51-released-oamp-updated.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-8330559213628270947</guid><pubDate>Sun, 04 Mar 2012 04:53:00 +0000</pubDate><atom:updated>2012-03-03T23:15:04.699-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">mobile</category><category domain="http://www.blogger.com/atom/ns#">tether</category><category domain="http://www.blogger.com/atom/ns#">motorola</category><category domain="http://www.blogger.com/atom/ns#">droid2global</category><category domain="http://www.blogger.com/atom/ns#">links</category><title>Links: Root, Patch and Tether a Droid 2 Global</title><description>My wife and I have identical phones. She actually got hers before I got mine. Occasionally, I have to tether for troubleshooting, and I set hers up tonight to do the same.&lt;br /&gt;&lt;br /&gt;I encountered a number of stumbling blocks the first time around. Fortunately, other people did all the hard work.  Here are links I found helpful. &lt;br /&gt;&lt;br /&gt;Download the latest SuperOneClick package. You'll have to root your phone. There's no easier way than this: &lt;a href="http://shortfuse.org/"&gt;SuperOneClick - Shortfuse&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;Get the &lt;a href="http://code.google.com/p/android-wifi-tether/"&gt;Android WiFi Tether&lt;/a&gt; APK from Google Code.&lt;br /&gt;&lt;br /&gt;At this point, if you try to tether, you'll run into a similar issue as I've described in previous tethering posts: the authentication string will cause tethered traffic to bounce up against Verizon's wrath warning page.&lt;br /&gt;&lt;br /&gt;You'll need to download RadioComm, and the best way to find that is Google. You'll probably find fresh links to recent versions on XDA Devs or MotorolaFans. Caveat Emptor and all that. Shady download links galore, so be on your guard with good backups and malware protection.  &lt;a href="http://rootzwiki.com/topic/3136-wireless-tether-issues-with-d2g-gingerbread-tether-fix-instructions-updated-102/"&gt;Here are the instructions&lt;/a&gt; to patch your phone's baseband configuration for tethery goodness.&lt;br /&gt;&lt;br /&gt;After that, all should work well.&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=MwktCdN0PIs:rMPF0HBYk6c:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=MwktCdN0PIs:rMPF0HBYk6c:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=MwktCdN0PIs:rMPF0HBYk6c:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=MwktCdN0PIs:rMPF0HBYk6c:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=MwktCdN0PIs:rMPF0HBYk6c:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/MwktCdN0PIs" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/MwktCdN0PIs/links-root-patch-and-tether-droid-2.html</link><author>noreply@blogger.com (Ax0n)</author><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2012/03/links-root-patch-and-tether-droid-2.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-1093779537859216347</guid><pubDate>Wed, 08 Feb 2012 02:38:00 +0000</pubDate><atom:updated>2012-02-07T22:23:30.333-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Electronics</category><category domain="http://www.blogger.com/atom/ns#">hardware</category><category domain="http://www.blogger.com/atom/ns#">ham</category><title>Alinco DJ-C1 Hack: Internal Speaker</title><description>&lt;a title="Tiny ham radio transceiver by KC-Bike, on Flickr" href="http://www.flickr.com/photos/kc-bike/6834040193/"&gt;&lt;img src="http://farm8.staticflickr.com/7003/6834040193_85645cdd84_z.jpg" width="359" height="640" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The Alinco DJ-C1 was made in the 1990s and was a groundbreaking ham radio micro-transceiver about the thickness of an iPhone 4 and with a smaller footprint nearly identical to that of a credit card. It was designed to work on the 2m FM Voice band at 300mW. It featured an integrated microphone, but had no internal speaker from the factory; One had to rely on an earphone or an external speaker/microphone unit such as the one shown above.&lt;br /&gt;&lt;br /&gt;Over time, these micro radios evolved. The DJ-C4 came out at the same time as the C1, and was made for 440 MHz (70cm FM Voice). The DJ-C5 was a bit thicker and was the first to have an integrated speaker and work on both of the above bands. The latest one, the DJ-C7, lacks resemblance to these tiny relics of the late 90s aside from being smallish.&lt;br /&gt;&lt;br /&gt;You can still find these micro-handheld transcievers at hamfests, swap meets and online auctions. I got mine from a friend that's happened upon two C1s and a C4 in the past year. I was immediately somewhat frustrated by the lack of a built-in speaker. I opened it up and found plenty of room in the back for a piezoelectric element, similar to what you find as the alarm speaker in digital wrist watches.&lt;br /&gt;&lt;br /&gt;I couldn't find anything to salvage a piezo speaker out of, so I coughed up a couple of bucks at Radio Shack for one. I used a tiny screwdriver to pry the back cover off and to pry the element out of the case.&lt;br /&gt;&lt;a title="2012-02-07_18-18-27_381.jpg by KC-Bike, on Flickr" href="http://www.flickr.com/photos/kc-bike/6838679299/"&gt;&lt;img src="http://farm8.staticflickr.com/7025/6838679299_2805eac553_z.jpg" width="359" height="640" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Disassembly of the DJ-C1 initially looks pretty straight-forward. There are three small philips screws on the back which give you access to the battery and the back of the circuit board. You'll have to open the back up and you'll want to disconnect the battery before proceeding. Unfortunately, most of the stuff we need access to is on the other side of the circuit board. You can't get the board out from the back, so leave the screws through the circuitboard attached. To remove the front plate, carefully peel the sticker and membrane buttons off, then remove the three screws found underneath.&lt;br /&gt;&lt;a title="Untitled by KC-Bike, on Flickr" href="http://www.flickr.com/photos/kc-bike/6838713127/"&gt;&lt;img alt="" src="http://farm8.staticflickr.com/7007/6838713127_27d31564ac_z.jpg" width="359" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;There aren't many places to pass wires from the back of the radio where the speaker will be to the front of the radio where they can attach to the solder pads for the audio jack, so I ran them between the legs of the transmit LED. With the front and back removed, you can slide the circuit board out of the rectangular plastic frame enough to get access to the solder pads with almost any kind of soldering iron. You can see the red and black wires here:&lt;br /&gt;&lt;a title="2012-02-07_18-51-44_500.jpg by KC-Bike, on Flickr" href="http://www.flickr.com/photos/kc-bike/6838680075/"&gt;&lt;img src="http://farm8.staticflickr.com/7146/6838680075_0d045482ea_z.jpg" width="500" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I taped the piezo element to the back case toward the bottom. The copper shield in the middle of the circuit board seen below will sit flush against the back case, so keep the speaker and wires clear of it. The piezo speaker is actually louder when it's taped to the back case than it is when it's hooked up to the audio jack by itself.&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/kc-bike/6838680449/" title="2012-02-07_19-03-37_258.jpg by KC-Bike, on Flickr"&gt;&lt;img src="http://farm8.staticflickr.com/7164/6838680449_c5d3c4100f_z.jpg" width="640" height="359"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Gently re-assemble everything, making sure everything fits neatly inside. Re-position the speaker and wires as needed. I ended up placing a bit of tape inside to keep the speaker wires from getting in the way. Re-connect the battery, screw the front plate back on, re-attach the membrane buttons to the front, and test it before you button the thing back up.&lt;br /&gt;&lt;br /&gt;The resulting speaker works, but isn't terribly loud. It's loud enough to get your attention from the office desk, and if you hold it up next to your ear, you can make out what's being said. This is all I expected from this hack. You'll want to hold on to that earphone or external speaker, though.&lt;br /&gt;&lt;br /&gt;Here's some crappy cell phone video of it in action. &lt;br /&gt;&lt;iframe width="420" height="315" src="http://www.youtube.com/embed/tf_lIx3uXl0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=jPRjIjaAl68:dqIni1J5KU0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=jPRjIjaAl68:dqIni1J5KU0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=jPRjIjaAl68:dqIni1J5KU0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=jPRjIjaAl68:dqIni1J5KU0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=jPRjIjaAl68:dqIni1J5KU0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/jPRjIjaAl68" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/jPRjIjaAl68/alinco-dj-c1-hack-internal-speaker.html</link><author>noreply@blogger.com (Ax0n)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://img.youtube.com/vi/tf_lIx3uXl0/default.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2012/02/alinco-dj-c1-hack-internal-speaker.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-8350958351784049879</guid><pubDate>Fri, 03 Feb 2012 21:19:00 +0000</pubDate><atom:updated>2012-02-03T15:23:48.776-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">2600</category><category domain="http://www.blogger.com/atom/ns#">meetings</category><category domain="http://www.blogger.com/atom/ns#">lockpicking</category><title>February 2012 KC2600 Meeting</title><description>It's that time again! Bring your questions, projects, interesting topics of discussion, war stories and conspiracy theories. As a reminder, the official 2600 meeting start time is 5:00 PM local time, but the Greater Kansas City folks tend to start trickling in at 5:30 or so.&lt;br /&gt;&lt;br /&gt;If people are interested, I'll go over some of the common complaints of &lt;a href="http://www.h-i-r.net/2010/01/review-master-1500id-speed-dial-lock.html"&gt;this lock&lt;/a&gt; and how so many people manage to lock themselves out of it forever. I might live stream it on uStream. I might actually lock myself out of this lock forever, too, but hopefully not.&lt;br /&gt;&lt;br /&gt;(Crossposted from &lt;a href="http://www.kc2600.com/"&gt;KC2600&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=9PhX3r3W9Vk:eHmGm76hQ2w:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=9PhX3r3W9Vk:eHmGm76hQ2w:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=9PhX3r3W9Vk:eHmGm76hQ2w:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=9PhX3r3W9Vk:eHmGm76hQ2w:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=9PhX3r3W9Vk:eHmGm76hQ2w:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/9PhX3r3W9Vk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/9PhX3r3W9Vk/february-2012-meeting.html</link><author>noreply@blogger.com (Ax0n)</author><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2012/02/february-2012-meeting.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-2185891290094122701</guid><pubDate>Sat, 14 Jan 2012 20:08:00 +0000</pubDate><atom:updated>2012-01-14T14:10:41.067-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">locks</category><category domain="http://www.blogger.com/atom/ns#">fail</category><category domain="http://www.blogger.com/atom/ns#">lockpicking</category><title>Lock Fail 2.0</title><description>&lt;a href="http://4.bp.blogspot.com/-rOiMwvr7fpE/TxHhD3A1sVI/AAAAAAAAAZk/PsO221U4EXU/s1600/396617_748709708405_82400770_35567758_1319200265_n.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 179px;" src="http://4.bp.blogspot.com/-rOiMwvr7fpE/TxHhD3A1sVI/AAAAAAAAAZk/PsO221U4EXU/s320/396617_748709708405_82400770_35567758_1319200265_n.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5697582460023714130" /&gt;&lt;/a&gt;&lt;br /&gt;I wonder what the combination is.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.h-i-r.net/2011/07/lock-fail.html"&gt;Previously&lt;/a&gt;.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=s9vcYpT9KyA:zyBlogfbKFc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=s9vcYpT9KyA:zyBlogfbKFc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=s9vcYpT9KyA:zyBlogfbKFc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=s9vcYpT9KyA:zyBlogfbKFc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=s9vcYpT9KyA:zyBlogfbKFc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/s9vcYpT9KyA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/s9vcYpT9KyA/lock-fail-20.html</link><author>noreply@blogger.com (Ax0n)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-rOiMwvr7fpE/TxHhD3A1sVI/AAAAAAAAAZk/PsO221U4EXU/s72-c/396617_748709708405_82400770_35567758_1319200265_n.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2012/01/lock-fail-20.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-486104283110339932</guid><pubDate>Sun, 08 Jan 2012 15:28:00 +0000</pubDate><atom:updated>2012-01-08T11:05:27.150-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">seo</category><category domain="http://www.blogger.com/atom/ns#">mysql</category><category domain="http://www.blogger.com/atom/ns#">programming</category><category domain="http://www.blogger.com/atom/ns#">php</category><title>PHP Programming: Clean URLs</title><description>I've spent the past two weekends re-writing old, horrible, ugly code that I wrote as a kid. I still have a lot of work ahead of me, and there's still no guarantee that the code I'm writing now will be great, but it'll be better than the stuff I wrote before. I'm not a web developer by any means, but it won't keep me from having some nerdy fun on the weekend. I've learned some tricks, and figured I'd share them here in a few short entries. Today, it's so-called "Clean" URLs.&lt;br /&gt;&lt;br /&gt;In most dynamic web scripting languages such as PHP, dynamic pages can be accessed by passing parameters through a query string. As an example: http://foo.somesite.com/article.php?p=42&lt;br /&gt;&lt;br /&gt;You've undoubtedly seen dynamic websites that don't pass query strings, but instead generate nice, friendly URLs that look more like this: http://foo.somesite.com/article/Hello_World&lt;br /&gt;&lt;br /&gt;Clean URLs are easier to link to, they're better for search engine optimization, and with proper implementation provide a few security features as well. The project I'm working on is a custom CMS that was my very first Apache/PHP/MySQL project. It ended up getting kind of popular among a niche crowd, so I left it online in all its ugly glory. I have an article list script that can filter articles by category, and another script to display the articles. I'll just call them list.php and article.php here for the sake of discussion.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;b&gt;Removing .php from the URL&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;The first part of the problem is the fact that I'd rather not have ".php" show up in the URL, so that "article" and "list" would appear to be sub-directories of my site. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After playing around with a bunch of promising hacks that tended to work fine, including mod_rewrite, I decided that the most elegant way to tackle this was to rely on Apache's "FilesMatch" directive. I created symbolic links from list.php and article.php to strip the .php extension. You could just as easily rename them, though.  Then I added the FilesMatch directive to .htaccess for "article" and "list" as shown below.  Make sure "AllowOverride All" is set in your Apache configuration, too.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://farm8.staticflickr.com/7013/6660143755_8185fae0dd_o.png" /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;At this point, pulling up http://foo.somesite.com/list will try to run "list" as a PHP script. In my case, it shows a list of articles.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;b&gt;Parsing URI parameters with PHP&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;The next part is mostly easy. As far as I know, any PHP script will let you add a bunch of parameters to it with slashes like this: http://foo.somesite.com/index.php/testing/1/2/3/4/5. It may not render well, but it doesn't keep it from executing. Above, we got list to show a list of articles, so now it's time to set up filtering. As you can see below, the last element of the URL (split by /) is considered to be the category. The following URL would show a category of "Widgets": http://foo.somesite.com/list/Widgets&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To avoid the problem of getting a category of "list" or "list.php" (remember, I chose to symlink my .php files), I included logic to check to see if the category matches the script name. If so, it assumes that it should instead display the Table Of Contents. You'll also see I am setting the title based on what happens here. As the category types are stored in the database and displayed with spaces, I am using str_replace to replace underscores in the URI with spaces. This means that I have to ensure spaces are turned into underscores elsewhere in the code and in all links to my site. That's beyond the scope of this article, though.  What matters is that a URL of http://foo.somesite.com/list/Arts_and_Crafts would pull up a category of "Arts and Crafts". &lt;/div&gt;&lt;blockquote&gt;&lt;code&gt;&lt;span&gt;&lt;span style="color: rgb(0, 0, 187); "&gt;$category&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;=(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187); "&gt;end&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187); "&gt;explode&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0); "&gt;'/'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187); "&gt;urldecode&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187); "&gt;$_SERVER&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;[&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0); "&gt;'REQUEST_URI'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;]))));&lt;br /&gt;if((&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187); "&gt;$category&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;) &amp;amp;&amp;amp; (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187); "&gt;$category &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;!= &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0); "&gt;'list.php' &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;&amp;amp;&amp;amp; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187); "&gt;$type &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;!= &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0); "&gt;'list'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;))&lt;br /&gt;{&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187); "&gt;$rawcat&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187); "&gt;str_replace&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0); "&gt;'_'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0); "&gt;' '&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187); "&gt;$category&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;    &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187); "&gt;$list&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187); "&gt;getlist&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187); "&gt;$rawcat&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;);&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187); "&gt;$title&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187); "&gt;$rawcat&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;.&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0); "&gt;" Articles"&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187); "&gt;$toc&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187); "&gt;TRUE&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187); "&gt;$list&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187); "&gt;getlist&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;();&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187); "&gt;$title&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0); "&gt;=&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0); "&gt;"Table of Contents"&lt;/span&gt;&lt;span&gt;&lt;span&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;div&gt;From here, the rest of my PHP code can query the database for articles.  getlist() is a function that I wrote. If its parameter is null, it gets all of them, otherwise it (safely!) queries the database for a category. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I used similar code in the article php script, which queries the database for the title of an article, so I get nice-looking URLs for individual articles as well, such as:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;http://foo.somesite.com/article/How_to_narfle_the_Garthok&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=zyJ_WVzfK00:bOcNTFWZLeM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=zyJ_WVzfK00:bOcNTFWZLeM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=zyJ_WVzfK00:bOcNTFWZLeM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=zyJ_WVzfK00:bOcNTFWZLeM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=zyJ_WVzfK00:bOcNTFWZLeM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/zyJ_WVzfK00" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/zyJ_WVzfK00/php-programming-clean-urls.html</link><author>noreply@blogger.com (Ax0n)</author><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2012/01/php-programming-clean-urls.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-3759155264889735850</guid><pubDate>Tue, 03 Jan 2012 16:26:00 +0000</pubDate><atom:updated>2012-01-03T21:32:46.188-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">radio</category><category domain="http://www.blogger.com/atom/ns#">ham</category><title>Why Ham?</title><description>Amateur radio is called "ham radio" by many. Ham isn't an acronym, but the origin of the sobriquet is a topic of debate. The most plausible explanation I heard is that professional telegraph operators considered amateur radio operators to be inferior, ham-fisted tinkerers. In this case, "ham" is actually a derogatory remark. Despite the fact, it's been adopted by the community now and is synonymous with "amateur radio." Amateur doesn't mean neophyte, however. It is the antonym of "professional radio," in that amateur stations are not commercial, and hams cannot recieve compensation for operating their equipment.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/n0ssc/6589188555/" title="W0EEE Shack in Contest Mode by N0SSC, on Flickr"&gt;&lt;img src="http://farm8.staticflickr.com/7015/6589188555_23af1a1719.jpg" width="400" alt="W0EEE Shack in Contest Mode"&gt;&lt;/a&gt;&lt;br /&gt;(The ham shack at &lt;a href="http://mst.edu/"&gt;MST's&lt;/a&gt; Amateur Radio Club, &lt;a href="http://w0eee.mst.edu/new/HOME.html"&gt;W0EEE&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;Several co-workers and friends flaunted their amateur radio gear and goaded me into joining their ranks last year. Many hackers carry a ham license, or are getting interested in the hobby. Still, some people occasionally ask me "what's the point? We have smartphones and the Internet now." It's true. The telephone as we know it has indeed enjoyed evolution at a breakneck pace. My co-worker's Nexus LTE sucked 20 megabits per second out of thin air the day he got it. I don't even get that kind of pipe to my home. Still, to me, there's always been something about amateur radio that can't quite be compared with the Internet or mobile phones. I'll explain just a few of those things, from my own novice perspective.&lt;br /&gt;&lt;br /&gt;In 1987, I saw an amateur radio demonstration that was given to my scout troop in the middle of Nebraska. With a brick-like walkie-talkie weighing more than a pound and about the size of two Wiimotes side by side (not counting the big rubber antenna on top of it), the presenter was able to communicate with others several counties away, and even place telephone calls. He said that with a bigger antenna and more powerful radio at home, he could talk to people all over the world, all without relying on telephones or even the power grid, because much his radio equipment could be powered by car batteries.&lt;br /&gt;&lt;br /&gt;This blew my 8-year-old mind. It was nothing like my little walkie talkies at home. I wanted to be a ham, and even put in some work toward it, but I simply wasn't ready. The urge hit me in waves on occasion. In high school, I experimented with CB. In college, I took some interest in those FRS walkie-talkies that are now ubiquitous in every department store. A few classmates were amateur radio operators, and I got the itch again, but never really got the motivation to get licensed. It would go on like this for many years. For me, it took a friend in California selling me some of his used radios for cheap. At that point, I had the equipment in my hot little hands, but I didn't have a license to use them for anything other than listening. That lit a fire under me.&lt;br /&gt;&lt;br /&gt;Aside from their size (owing to advances in surface-mount electronics and battery performance), the most basic hand-held ham radios haven't changed a whole lot in the last 20 years. For reference, &lt;a href="http://www.flickr.com/photos/kc-bike/6629268651/in/photostream"&gt;my smallest radio&lt;/a&gt; is about the size of a closed &lt;a href="http://en.wikipedia.org/wiki/Motorola_StarTAC"&gt;Motorola StarTAC&lt;/a&gt;, but packs nearly as powerful a transmitter as &lt;a href="http://www.eham.net/articles/11750"&gt;the giant brick radio&lt;/a&gt; that had me awestruck more than 20 years ago. Most hand-helds work on the FM Voice part of the VHF band (~144 MHz) or the UHF band (~440 MHz), or both. Some operate on other bands as well. Transmit power from 300mW to 5W is common. Although these smaller radios are most often used to contact a high-power repeater, they can also be used directly between licensed amateurs over shorter distances with some rules and restrictions noted. They have more power and better antennae than FRS radios, and can be connected to an externally-mounted antenna if desired. They're great for highway convoys and outdoor activities. Many hand-held transceivers are capable of tuning in a very wide range of frequencies, so they can be used somewhat like analog non-trunking scanners and frequency counters for finding and listening to public safety, railroad, airport or rent-a-cop chatter. More on that in a separate article.&lt;br /&gt;&lt;br /&gt;Repeaters are usually mounted on radio towers, tall buildings or up in mountains. They recieve on one frequency (an input frequency), then transmit what's received in real-time on the output frequency, allowing one-to-many conversations over a relatively large region within a 20-50 mile radius. Radios designed to be used with repeaters are able to automatically switch to a repeater's input frequency when transmitting. Repeaters are often linked together via high-power point-to-point radio links, telephone lines or digitally over the Internet. Some repeaters are actually built into satellites in space, covering extremely wide areas, but those can be a challenge to use as they traverse the sky. Many repeaters have redundant power, via battery and generator backup. And yes, a lot of this stuff is very similar to what existed 30 or more years ago, save for the Internet-connected repeaters.&lt;br /&gt;&lt;br /&gt;Hams are often called upon to help where efficient communications are desired. You're likely to find amateur radio operators volunteering behind the scenes helping marathon or charity bicycle ride officials locate event participants in need of assistance, providing the National Weather Service with critical storm data from the ground, or establishing point-to-point radio links with nearby hospitals and participating in relief efforts in communities whose infrastructure has been crippled by floods, tornadoes, hurricanes or earthquakes. All of this is made possible because hams know how to communicate efficiently in groups, and their equipment isn't completely disabled by disruptions of complex infrastructure (although, as noted, infrastructure such as the power grid and telecom is often used when available.)&lt;br /&gt;&lt;br /&gt;Many people think of morse code when they think of ham radio. Morse code is still in use, but you no longer need to know it to get licensed by the FCC. Morse code is essentially a human-comprehensible binary mode of communication. There are several other digital modes available, allowing you to blend technologies, and some common modes rely on AX.25 packet data. You can run a packet radio BBS over the air if you like, or transmit your GPS coordinates while hiking through the woods or helping disaster relief efforts. Some of these digital modes are extremely efficient, use very little bandwidth, and can be easily received from long distances, even if they aren't transmitted with much power. Conversely, hams can also enjoy many parts of the amateur bands, including parts of the 2.4 GHz spectrum (with some overlap on WiFi channels) with up to 1500 watts.&lt;br /&gt;&lt;br /&gt;Although some hams might seem like retro-grouches with their morse code conversations, technology doesn't stand still with amateur radio! There's a very hearty "do it yourself" spirit here. Many participants might very well be considered radio hackers. They build their own transmitters, recievers and repeaters, and most of them are -- by nature -- gifted problem solvers.&lt;br /&gt;&lt;br /&gt;Check out this video from ARRL for some more info.&lt;br /&gt;&lt;br /&gt;&lt;iframe height="254" src="http://www.youtube.com/embed/vlDwVhx7miQ" frameborder="0" width="500"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;What's it take to get licensed? There are three classes of amateur radio licenses in the US. In order from lowest to highest, they are Technician, General and Extra class. The exams are multiple-choice quizzes, each coming from a pool of several hundred possible questions. The Technician and General exams have 35 questions each, while the Extra exam is 50 more challenging questions covering material that's ostensibly arcane. The test to get each license requires progressively more depth of knowledge in safety (RF exposure, antenna towers, grounding), electronics, FCC rules, transciever and antenna designs and other information that proves the licensee understands the craft well enough to safely operate their own station. Each higher license class grants access to transmit on more frequencies, usually in the lower frequency bands that are more useful for reliable long-distance communication.&lt;br /&gt;&lt;br /&gt;Since the &lt;a href="http://www.arrl.org/question-pools"&gt;question pools&lt;/a&gt; and study materials for licensing are publicly available, I studied the Technician material on my own for a few weeks before acing the technician exam. Most major metro areas have groups that give frequent classes, and all metro areas have volunteer examiners who will administer the test to those who have studied on their own.&lt;br /&gt;&lt;br /&gt;I may upgrade to the General class license this year, but I'm honestly a lot more interested in the merge of digital technology with amateur radio. The Technician class license allows me to operate digital and "sideband" voice on the 10 meter band, but there's a lot of digital stuff in the higher frequencies that Technicians are allowed to use.&lt;br /&gt;&lt;br /&gt;If you are interested in learning more about amateur radio but can't seem to find anything in your area, post away in the comments and I'll see if I can help you out.&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/Xsmy_2q-lmA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/Xsmy_2q-lmA/amateur-radio-is-called-ham-radio-by.html</link><author>noreply@blogger.com (Ax0n)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://img.youtube.com/vi/vlDwVhx7miQ/default.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2012/01/amateur-radio-is-called-ham-radio-by.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-8900299368906307408</guid><pubDate>Sat, 17 Dec 2011 00:54:00 +0000</pubDate><atom:updated>2011-12-19T18:16:16.177-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">malware</category><title>Intro to javascript malware analysis</title><description>I am by no means an expert on this stuff. A few weeks ago, I ran across some suspicious links in spam and decided to see where they led. Some of them claimed to be from financial institutions that I have absolutely no connection to, and claimed that some transaction had failed to occur. Others were variants of shipping confirmation scams, pharmacy junk, etc. I wish I could say that I have no idea how people fall for these, but the fact is that some people will literally click on anything that shows up in their inbox, open any attachment and follow any link, no matter how blatantly fake we professionals think these scams are.&lt;br /&gt;&lt;br /&gt;What lay at the tail end of all the script="http://some-site/whatever.js" includes and document.location redirects? A webpage that'd been owned, filled with a huge pile of nonsensical jibberish that could barely pass as javascript, which happened to be part of the &lt;a href="http://threatpost.com/en_us/blogs/carberp-and-black-hole-exploit-kit-wreaking-havoc-120511"&gt;Blackhole Exploit Kit&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I've done my share of picking apart obfuscated javascript before, but it had been a while. I gave a presentation of this same thing at &lt;a href="http://www.kc2600.com/2011/12/great-turn-out.html"&gt;KC2600&lt;/a&gt; a few weeks ago. Then, this week, &lt;a href="http://blog.l-lacker.com/"&gt;a colleague of mine&lt;/a&gt; who missed the meeting ran into the same thing in the wild. I passed on what I'd learned, and decided it might be time to write it up with a little more detail than I did a few weeks back. He made this quick video that covers how he was able to de-obfuscate this particular sample:&lt;br /&gt;&lt;br /&gt;&lt;iframe height="350" src="http://www.youtube.com/embed/HPnEF3TVlu8" frameborder="0" width="400"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;By now, I've seen several different obfuscation schemes for BlackHole, but once it's decoded, it all looks about the same.&lt;br /&gt;&lt;br /&gt;The introductory basics are simple. Minimize the potential of infection by using a non-privileged account (and perhaps an OS other than Windows) and/or minimize the impact of a successful infection by running a virtual machine that you can blow away or revert to a snapshot of a known clean state. For the malware I'm using in this example, either (or both) of the above criteria will be ample to keep things from getting out of control. Other malware may be more insidious or may target non-Windows platforms. I have a few friends that have unwittingly infected their own workstations while trying to analyze things. Play safe.&lt;br /&gt;&lt;br /&gt;Once you have a safe lab environment, your goal is to examine a suspicious link and dissect it.&lt;br /&gt;&lt;br /&gt;In my case, I was able to find a few links to malware in my personal mail's spam folder. For the demo at KC2600, I used Malware Domain List to find some &lt;a href="http://www.malwaredomainlist.com/mdl.php?search=blackhole&amp;amp;colsearch=All&amp;amp;quantity=50"&gt;Blackhole samples&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In the wild, there may be any number of redirects ahead of the malware. You may see a shortened URL (through goo.gl, tinyurl, etc) which goes to a sparse HTML page with several calls to javascripts hosted on various sites, and those javascripts may simply be a document.location pointing to the malware. I usually stick with curl or wget to pull down suspicious links, and then I keep looking at the content and following the redirects until I strike gold.&lt;br /&gt;&lt;br /&gt;&lt;a title="Screenshot-2011-12-17_01.00.06 by KC-Bike, on Flickr" href="http://www.flickr.com/photos/kc-bike/6526725271/"&gt;&lt;img alt="Screenshot-2011-12-17_01.00.06" src="http://farm8.staticflickr.com/7004/6526725271_5b2ca72eff.jpg" width="400" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The javascript itself is ugly once you get to it. Sometimes, the byte array is only a few (really long) lines. Other times, like this sample, each byte of the obfuscated data is on a new line, like this:&lt;br /&gt;&lt;a title="Screenshot-2011-12-17_12.21.10 by KC-Bike, on Flickr" href="http://www.flickr.com/photos/kc-bike/6526761769/"&gt;&lt;img alt="Screenshot-2011-12-17_12.21.10" src="http://farm8.staticflickr.com/7149/6526761769_d0fefdd0d3.jpg" width="400" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You'll see a few interesting things. There's an "e=eval;" line near the bottom, and then "e(c);" after that. It doesn't take a coding genius to realize that this is a way to call eval(c) without triggering some IDS signatures that look for "eval(". Many samples I saw weren't quite this obvious. In fact, the script in the video has the eval alias in a different part of the script and varies in several other ways if you look closely.&lt;br /&gt;&lt;br /&gt;To turn this cryptic payload into something that resembles actual javascript, there's &lt;a href="http://isc.sans.edu/diary.html?storyid=2268"&gt;a post on SANS ISC&lt;/a&gt; from several years ago covering a few methods. I went with the so-called &lt;a href="http://pre-isc.sans.edu//diary.html?storyid=1917"&gt;Tom Liston Method&lt;/a&gt;, essentially trying to wrangle the decoded stuff that was destined for the eval function into a document.write within a textarea box instead. Note: I ran into one sample of BlackHole that has a /textarea tag near the beginning, which would keep someone from using this trick to easily view the code with this trick, but I don't think it will eval the stuff behind it since it's been changed to a document.write.&lt;br /&gt;&lt;br /&gt;In the above example (and in the video), the content that is destined for eval is stored in variable "c", so you simply replace "e(c);" with:&lt;br /&gt;&lt;br /&gt;document.write("&amp;lt;textarea cols="150" rows="100"&amp;gt;" + c + "&amp;lt;/textarea&amp;gt;");&lt;br /&gt;&lt;br /&gt;But obviously, you need to use some brain power here to figure out what trickery they're using to call eval, and what the variable is that needs to be wrapped up in the above document.write command. You may also wish to mess with the rows and columns on the textarea. I know on my netbook, that textarea size is far too unweildy. On my desktop, it's almost perfect.&lt;br /&gt;&lt;br /&gt;Make sure the file is renamed as a .html, then load it up in your safe lab environment's browser, just in case something goes wrong.&lt;br /&gt;&lt;br /&gt;&lt;a title="Screenshot-2011-12-17_12.49.34 by KC-Bike, on Flickr" href="http://www.flickr.com/photos/kc-bike/6526893785/"&gt;&lt;img alt="Screenshot-2011-12-17_12.49.34" src="http://farm8.staticflickr.com/7011/6526893785_8111be90e6.jpg" width="400" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Voila. If you scroll through recent versions of BlackHole Exploit Kit, you'll see that it tries to load an embedded java applet and a PDF, both of which are designed to exploit recent vulnerabilities in JRE and Adobe Reader. Since I don't have Windows running in a VM environment (and I'm not keen on actually infecting any of my Windows boxes) I'm not entirely sure what gets loaded from there. I'm guessing the carberp trojan, given most of what I've read lately. If that's the case, a successful infection would likely block access to anti-malware sites, try to sabotage existing security software, and start gathering sensitive data such as card numbers and online banking credentials.&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=u8c552Q33J8:IHVRbdUTtTY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=u8c552Q33J8:IHVRbdUTtTY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=u8c552Q33J8:IHVRbdUTtTY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=u8c552Q33J8:IHVRbdUTtTY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=u8c552Q33J8:IHVRbdUTtTY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/u8c552Q33J8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/u8c552Q33J8/intro-to-javascript-malware-analysis.html</link><author>noreply@blogger.com (Ax0n)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://img.youtube.com/vi/HPnEF3TVlu8/default.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2011/12/intro-to-javascript-malware-analysis.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-4461401039525764536</guid><pubDate>Mon, 05 Dec 2011 03:48:00 +0000</pubDate><atom:updated>2011-12-04T21:56:56.136-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">hacks</category><category domain="http://www.blogger.com/atom/ns#">hardware</category><title>UPS Battery Hackery: Not highly recommended</title><description>Step 1: Disassemble UPS (not shown). That includes unplugging it and removing the battery, and taking the outer shell off. This was a dumpster rescue that was missing the battery entirely. Be careful. Lots of capacitors and transformers inside. See the disclaimer in the title. Not highly recommended.&lt;br /&gt;&lt;br /&gt;Step 2: Drill a hole in the case, near where the battery wiring harness enters the battery chamber. I used a 1/2" drill bit for this. &lt;br /&gt;&lt;br /&gt;Step 3: Make a grommet. I used some silicone air hose for my aquarium, cut a length of it, then split it. I used a few separate pieces.&lt;br /&gt;&lt;div&gt;&lt;a href="https://lh3.googleusercontent.com/-bYCo64beG1Q/Ttw-DX_cAxI/AAAAAAAABlw/V33T_oVDyds/s288/11%2B-%2B1"&gt;&lt;img style="WIDTH: 288px; HEIGHT: 162px; CURSOR: hand" border="0" alt="" src="https://lh3.googleusercontent.com/-bYCo64beG1Q/Ttw-DX_cAxI/AAAAAAAABlw/V33T_oVDyds/s288/11%2B-%2B1" /&gt;&lt;/a&gt; &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Step 4: Re-assemble, Hook up a much bigger battery than what's supposed to be inside.&lt;br /&gt;&lt;a href="https://lh5.googleusercontent.com/-R4Pl4FqO4Bw/Ttw9hYXKJTI/AAAAAAAABlc/gUgEYcRckVA/s320/11%2B-%2B1"&gt;&lt;img style="WIDTH: 180px; HEIGHT: 320px; CURSOR: hand" border="0" alt="" src="https://lh5.googleusercontent.com/-R4Pl4FqO4Bw/Ttw9hYXKJTI/AAAAAAAABlc/gUgEYcRckVA/s320/11%2B-%2B1" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I accept no blame for any of the many things that could possibly go wrong with this.&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=gkamR62d5d0:JasZoq-GOVM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=gkamR62d5d0:JasZoq-GOVM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=gkamR62d5d0:JasZoq-GOVM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=gkamR62d5d0:JasZoq-GOVM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=gkamR62d5d0:JasZoq-GOVM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/gkamR62d5d0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/gkamR62d5d0/ups-battery-hackery-not-highly.html</link><author>noreply@blogger.com (Ax0n)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh3.googleusercontent.com/-bYCo64beG1Q/Ttw-DX_cAxI/AAAAAAAABlw/V33T_oVDyds/s72-c/11%2B-%2B1" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2011/12/ups-battery-hackery-not-highly.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-5197184207053141652</guid><pubDate>Fri, 18 Nov 2011 17:47:00 +0000</pubDate><atom:updated>2011-11-18T11:47:52.532-06:00</atom:updated><title>Shell Script: Parse Juniper firewall logs</title><description>Juniper firewalls (at least the ScreenOS-based one I have in the lab) have an interesting format for their syslog entries. It&amp;#39;s a whole line full of variable=parameter type stuff. Usually, these are in a pretty predictable order, but you can&amp;#39;t rely on the nth parameter to be the same in every log entry just due to the fact that different types of traffic have different parameters. You don&amp;#39;t see a source or destination port on ICMP traffic, for example.  This script reads a log file (I&amp;#39;m using Syslog-NG in the lab), splits the entry up into one parameter per line, grabs only parameters matching the list you provide on the command line, then stitches it back together into one line. I saw no benefit in trying to make the output order match the order provided on the command-line, since some columns are prone to be blank in certain situations anyway. This is quick and dirty, but it does the job for what I need, and I thought I&amp;#39;d share.&lt;br&gt; &lt;br&gt;axon@moo:~$ ./juniper-parse.sh &lt;br&gt;&lt;br&gt;Parse columns from Juniper firewall logs&lt;br&gt;  Syntax:&lt;br&gt;  ./juniper-parse.sh logfile column [column ...]&lt;br&gt;&lt;br&gt;Common columns:&lt;br&gt;  action, device_id, dst, dst_port, duration, ip, &lt;br&gt;   policy_id, port, proto, rcvd, reason, sent, service, &lt;br&gt;  session_id, src, src_port, start_time, zone&lt;br&gt;&lt;br&gt;&lt;br&gt;Here, you can see some of my lab machines trying to fetch updates from an Ubuntu mirror, getting denied because I only allow requests through my proxy server:&lt;br&gt; &lt;br&gt;axon@moo:~$ sudo ./juniper-parse.sh /var/log/firewall.log action policy_id proto src dst dst_port&lt;br&gt;&lt;br&gt;2011-11-13T08:35:09-06:00 policy_id=12 proto=6 action=Deny src=192.168.42.75 dst=91.189.92.169 dst_port=80&lt;br&gt;2011-11-13T08:35:09-06:00 policy_id=12 proto=6 action=Deny src=192.168.42.112 dst=91.189.92.169 dst_port=80&lt;br&gt; 2011-11-13T08:35:10-06:00 policy_id=12 proto=6 action=Deny src=192.168.42.171 dst=91.189.92.169 dst_port=80&lt;br&gt;2011-11-13T08:35:13-06:00 policy_id=12 proto=6 action=Deny src=192.168.42.171 dst=91.189.92.169 dst_port=80&lt;br&gt; 2011-11-13T08:35:15-06:00 policy_id=12 proto=6 action=Deny src=192.168.42.77 dst=91.189.92.169 dst_port=80&lt;br&gt;2011-11-13T08:35:18-06:00 policy_id=12 proto=6 action=Deny src=192.168.42.75 dst=91.189.92.169 dst_port=80&lt;br&gt;2011-11-13T08:35:18-06:00 policy_id=12 proto=6 action=Deny src=192.168.42.77 dst=91.189.92.169 dst_port=80&lt;br&gt; ...&lt;br&gt;&lt;br&gt;Script below:&lt;br&gt;&lt;br&gt;#!/bin/sh&lt;br&gt;#juniper-parse.sh&lt;br&gt;if [ $# -lt &amp;quot;2&amp;quot; ]&lt;br&gt;then&lt;br&gt;echo &amp;quot;&lt;br&gt;Parse columns from Juniper firewall logs&lt;br&gt;  Syntax:&lt;br&gt;  $0 logfile column [column ...]&lt;br&gt;&lt;br&gt;Common columns:&lt;br&gt;   action, device_id, dst, dst_port, duration, ip, &lt;br&gt;  policy_id, port, proto, rcvd, reason, sent, service, &lt;br&gt;  session_id, src, src_port, start_time, zone&lt;br&gt;&lt;br&gt;&amp;quot;&lt;br&gt;exit 1&lt;br&gt;fi&lt;br&gt;&lt;br&gt;filename=$1; shift&lt;br&gt;until [ $# = &amp;quot;0&amp;quot; ]&lt;br&gt; do &lt;br&gt;  pattern=&amp;quot;$pattern -e ^$1=&amp;quot;&lt;br&gt;  shift&lt;br&gt;done &lt;br&gt;while read line&lt;br&gt;do&lt;br&gt;  timestamp=`echo $line | cut -f1 -d&amp;quot; &amp;quot;`&lt;br&gt;  echo &amp;quot;$timestamp `echo $line | tr &amp;#39; &amp;#39; &amp;#39;\n&amp;#39; | grep $pattern | tr &amp;#39;\n&amp;#39; &amp;#39; &amp;#39;`&amp;quot;&lt;br&gt; done &amp;lt; $filename&lt;br&gt;&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=SU-LgwHhylo:M9Ff-yMJZyU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=SU-LgwHhylo:M9Ff-yMJZyU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=SU-LgwHhylo:M9Ff-yMJZyU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=SU-LgwHhylo:M9Ff-yMJZyU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=SU-LgwHhylo:M9Ff-yMJZyU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/SU-LgwHhylo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/SU-LgwHhylo/shell-script-parse-juniper-firewall.html</link><author>noreply@blogger.com (Ax0n)</author><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2011/11/shell-script-parse-juniper-firewall.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5554915078212081470.post-3336649699395323090</guid><pubDate>Sat, 12 Nov 2011 07:52:00 +0000</pubDate><atom:updated>2011-11-12T22:04:59.734-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">mysql</category><category domain="http://www.blogger.com/atom/ns#">php</category><category domain="http://www.blogger.com/atom/ns#">openbsd</category><category domain="http://www.blogger.com/atom/ns#">apache</category><category domain="http://www.blogger.com/atom/ns#">opensource</category><category domain="http://www.blogger.com/atom/ns#">oamp</category><title>OpenBSD 5.0: Apache, PHP and MySQL</title><description>The basic steps for taking a bare-bones install of OpenBSD and adding an AMP stack for web applications hadn't changed much in the past 2 years. Although 5.0 is not seen as a "major update", but simply a continuation of the normal development cycle, the OpenBSD team did a few things that make the installation a bit different this go around. I'll cover some of the recent changes to OpenBSD and its packages in this post, then you can dive right into the updated &lt;a href="http://www.h-i-r.net/p/hirs-secure-openbsd-apache-mysql-and.html"&gt;OpenBSD Chroot Apache, PHP, MySQL setup guide&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Initialization scripts: Starting with OpenBSD 4.9, the RC scripts became modular. This is similar to how NetBSD and FreeBSD have worked for many years. Individual daemons have startup scripts in /etc/rc.d, but rc.conf, rc.local and rc.conf.local still work the same, so it wouldn't surprise me if many OpenBSD users didn't even notice the change. It seems like OpenBSD 5.0 packages for most of the popular services (samba, cups, postgres, etc) are actually creating these startup scripts now. If a third-party application from packages installs a startup script in /etc/rc.d, you can add it to the pkg_scripts variable in /etc/rc.conf.local like so, and it'll magically start.&lt;br /&gt;&lt;br /&gt;pkg_scripts="mysqld cups samba"&lt;br /&gt;&lt;br /&gt;See the &lt;a href="http://www.openbsd.org/cgi-bin/man.cgi?query=rc.d&amp;amp;sektion=8"&gt;OpenBSD man page for rc.d&lt;/a&gt; for more details.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;MySQL and chroot:&lt;/strong&gt; I'm not sure why it didn't dawn on me before, but one really simple way around hard-linking MySQL's socket file into the chroot environment is to simply have your web applications connect to MySQL's TCP port on 127.0.0.1 (not localhost, because that means "use the socket file" in MySQL-ese) I think I'll be doing it this way in the future.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;PHP:&lt;/strong&gt; PHP 5.3 added a lot of features, such that PHP 5.2.x and PHP 5.3 might as well be different major version numbers when complex web applications are considered. OpenBSD 5.0 adds packages for PHP 5.3 for the first time, but PHP 5.2 is still available in the repository. For this reason, the PHP core and module packages are no longer prefixed by php5-, they're just php, php-mysql, etc. Since PHP 5.2 is still supported, the version numbers are used to distinguish them, like this:&lt;br /&gt;&lt;br /&gt;$ sudo pkg_add php-mysql&lt;br /&gt;Ambiguous: php-mysql could be php-mysql-5.2.17p3 php-mysql-5.3.6&lt;br /&gt;&lt;br /&gt;Further, some configuration file locations have been changed. If you pay attention to the text after installing packages, this shouldn't make much difference. Hint: you can always re-read the post-install notes afterward by using pkg_info -M.&lt;br /&gt;&lt;br /&gt;All in all, the recent changes to OpenBSD are welcome. Some of the things I outlined here are areas where OpenBSD had some catching up to do. They've managed to do a lot of proactive stuff in the realm of hardware support and (of course) security and encryption. This is still one of my favorite platforms to tinker with.&lt;div class="blogger-post-footer"&gt;&lt;P&gt;We are proud members of the &lt;A HREF="http://securitybloggers.net/"&gt;Security Bloggers Network&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;This content originally posted on &lt;A HREF="http://www.h-i-r.net/"&gt;HiR Information Report&lt;/A&gt;. Copyright © 1997-2010, HiR&lt;/P&gt;&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/HiR?a=Q_K8rLYkycE:lHEUG_irlF8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=Q_K8rLYkycE:lHEUG_irlF8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=Q_K8rLYkycE:lHEUG_irlF8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/HiR?a=Q_K8rLYkycE:lHEUG_irlF8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/HiR?i=Q_K8rLYkycE:lHEUG_irlF8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/HiR/~4/Q_K8rLYkycE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/HiR/~3/Q_K8rLYkycE/openbsd-50-apache-php-and-mysql.html</link><author>noreply@blogger.com (Ax0n)</author><thr:total>0</thr:total><feedburner:origLink>http://www.h-i-r.net/2011/11/openbsd-50-apache-php-and-mysql.html</feedburner:origLink></item></channel></rss>
