<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Linux-Tricks on OiePoie!</title>
    <link>https://www.oiepoie.nl/categories/linux-tricks/</link>
    <description>Recent content in Linux-Tricks on OiePoie!</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 02 May 2008 00:18:44 +0200</lastBuildDate><atom:link href="https://www.oiepoie.nl/categories/linux-tricks/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Free strong (two factor) authentication using One Time Passwords on your mobile phone</title>
      <link>https://www.oiepoie.nl/2008/05/02/free-strong-two-factor-authentication-using-one-time-passwords-on-your-mobile-phone/</link>
      <pubDate>Fri, 02 May 2008 00:18:44 +0200</pubDate>
      
      <guid>https://www.oiepoie.nl/2008/05/02/free-strong-two-factor-authentication-using-one-time-passwords-on-your-mobile-phone/</guid>
      <description>&lt;p&gt;Authentication is the process by which you verify that someone is who they claim they are. In computerland this mostly involves a secret. By using the secret (for instance a password) in the authentication process Alice (there she is again) proves to Bob that she really is Alice since the secret is coupled to her (digital) identity. This process is as old as the road to Rome.&lt;br/&gt;
But not all secrets are as secret as we would like them to be. If i choose the name of my girlfriend as the secret, it might be easily guessed, even by someone who doesn’t know me, but is willing to go through the effort of making a few phone calls. Also secrets can be captured in transit, through shouldersurfing when you log in to the system, etcetera.&lt;/p&gt;
&lt;p&gt;The next step in this game is &lt;b&gt;strong authentication&lt;/b&gt; a.k.a. &lt;b&gt;two factor authentication&lt;/b&gt;, this is where you combine two out of the next three options to prove your identity:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;something you know (e.g. password, pin)&lt;/li&gt;
&lt;li&gt;something you have (e.g. token, smartcard, cellphone)&lt;/li&gt;
&lt;li&gt;something you are (e.g. fingerprint, iris pattern, DNA, voice)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So apart from capturing someones secret, Eve also has to steal the token/smartcard/cellphone or in case of biometrics duplicate your fingerprint/iris in a way the scanner is convinced that it’s still attached to a human being. This doesn’t make it impossible to authenticate as somebody else, it just makes it harder.&lt;/p&gt;
&lt;p&gt;One of the problems with strong authentication is that it is expensive. You can get (for instance) an RSA token on a trade fair for free, but when you actually want to use one you have to buy the token and also buy the license for the authentication server that is needed to make it work, this may set you back between $50 – $100 per user.&lt;/p&gt;
&lt;p&gt;Another disadvantage is the the cryptographic algorithm used to produce to codes is know only to the company, so you can’t use the RSA token and verify the authentication process to a authentication server of a different vendor. Also nobody can check if the cryptographic principles on with the product is build are sound. Good cryptography is build on open source so anyone can verify the correctness of it’s operation.&lt;br/&gt;
Luckily for us there is the Open Authentication Framework (&lt;b&gt;OATH&lt;/b&gt;) which led to the definition of the “Hashed Message Authentication Code One Time Password” or &lt;b&gt;HMAC OTP&lt;/b&gt; or even more concise &lt;b&gt;HOTP&lt;/b&gt;. If you are interested you can read &lt;a class=&#34;extlink&#34; href=&#34;http://tools.ietf.org/html/rfc4226&#34; target=&#34;_blank&#34;&gt;rfc4226&lt;/a&gt; on it’s inner working’s and even build your own implementation.&lt;/p&gt;
&lt;p&gt;The next step is to build our own strong authentication system using &lt;b&gt;HOTP&lt;/b&gt;. &lt;a class=&#34;extlink&#34; href=&#34;http://www.tri-dsystems.com&#34; target=&#34;_blank&#34;&gt;Tri-D systems&lt;/a&gt; has an open source One Time Password authentication server available for download. They also sell the tokens to use for authentication, but since we are talking open source HOTP we can look for a company which sells the authentication server and has a (soft) token for free: &lt;a class=&#34;extlink&#34; href=&#34;http://www.dsssasia.com/&#34; target=&#34;_blank&#34;&gt;Data Security Systems Solutions&lt;/a&gt;. They provide a free &lt;i&gt;Java Phone Token&lt;/i&gt; which can generate the One Time Passwords.&lt;/p&gt;
&lt;center&gt;&lt;/center&gt;
&lt;p&gt;&lt;b&gt;Build Process&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;goto: &lt;a class=&#34;extlink&#34; href=&#34;http://www.tri-dsystems.com/software/downloads.html&#34; target=&#34;_blank&#34;&gt;http://www.tri-dsystems.com/software/downloads.html&lt;/a&gt;&lt;br/&gt;
accept license and download otpd-3.1.0.tar.gz &amp;amp; pam_otp_auth-3.2.2.tar.gz&lt;/p&gt;
&lt;pre&gt;
gtar zxvf otpd-3.1.0.tar.gz
cd otpd-3.1.0/
./configure
make
make install
&lt;p&gt;mkdir /etc/otpstate
touch /etc/otppasswd
chmod 600 /etc/otppasswd
chmod 700 /etc/otpstate
mkdir /var/run/otpd
touch /var/run/otpd/socket
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;install oathdsss on your Nokia or Windows Mobile phone&lt;br/&gt;
from: &lt;a class=&#34;extlink&#34; href=&#34;http://www.dsssasia.com/token.html&#34; target=&#34;_blank&#34;&gt;http://www.dsssasia.com/token.html&lt;/a&gt;&lt;br/&gt;
and start the program&lt;/p&gt;
&lt;p&gt;First time initialization asks for a label, e.g. SEC&lt;br/&gt;
a seed length between 16 … 20 (choose 20)&lt;br/&gt;
OTP Length between 6 … 8 (choose 6)&lt;/p&gt;
&lt;p&gt;Select Options -&amp;gt; Init&lt;br/&gt;
and register the seed displayed:&lt;br/&gt;
e.g. 44D060008BF440A2F9FF588AAD537F78B820F200&lt;br/&gt;
Now copy the seed to your computer, don’t make any mistakes or it won’t work.&lt;br/&gt;
The seed is case insensitive since it’s a hexadecimal number. If you are using a Windows Mobile device, you might have to switch it to landscape to see all the characters, you should see a left and right square bracket.&lt;/p&gt;
&lt;p&gt;Do you want to set a PIN to protect the OTP?&lt;br/&gt;
Yes (otherwise it wouldn’t be two factor authentication)&lt;br/&gt;
Pin: ****&lt;br/&gt;
Pin Again: ****&lt;/p&gt;
&lt;p&gt;If all goes well oathdsss finishes and when you start it&lt;br/&gt;
up again, you will be asked for a PIN and after that the&lt;br/&gt;
6 number OTP is displayed together with a countdown timer&lt;br/&gt;
running from 60 seconds.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Setting up the OTP server&lt;/b&gt;&lt;br/&gt;
Enter the generated seed from your cellphone into &lt;b&gt;/etc/otppasswd&lt;/b&gt;&lt;/p&gt;
&lt;pre&gt;
cat &amp;gt;&amp;gt; /etc/otppasswd
foo:hotp-d6:44D060008BF440A2F9FF588AAD537F78B820F200
&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;foo&lt;/b&gt; is the username, alter it at your convenience&lt;br/&gt;
&lt;b&gt;hotp-d6&lt;/b&gt; is the token algorithm, so HOTP with a 6 digit OTP.&lt;/p&gt;
&lt;p&gt;Generate two OTP’s from your cellphone and use them with resynctool (this is installed together with the OTP server) to save the state information which the OTP server will need in the authentication process:&lt;/p&gt;
&lt;pre&gt;
resynctool -1 816857 -2 433761 -u foo -k 44D060008BF440A2F9FF588AAD537F78B820F200 &amp;gt; /etc/otpstate/foo
&lt;/pre&gt;
&lt;p&gt;If you look at the contents of &lt;b&gt;/etc/otpstate/foo&lt;/b&gt; you should see something like:&lt;/p&gt;
&lt;pre&gt;
5:foo:0000000000000003:::0:0:0:
&lt;/pre&gt;
&lt;p&gt;Due to a bug (i assume) resynctool is not able to work with 7 or 8 figure OTP’s (it will present you with the error message: &lt;b&gt;resynctool: passcode 1 wrong length&lt;/b&gt;). There is also a second bug (maybe we should call it an discrepancy). While resynctool writes: 0000000000000003 meaning the first two OTP’s have been used and the next to be presented is number 3, the otp server reads that 0000000000000003 as: the first three OTP’s have been used and the next to be presented is number 4. So change the number back to 0000000000000002 or generate an OTP from you cellphone and don’t use it.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Testing authentication&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;start up otpd as root in debug mode:&lt;/p&gt;
&lt;pre&gt;
# otpd -D
otpd: otpd 3.1.0 starting
otpd: accept_thread: tid=3086179248
&lt;/pre&gt;
&lt;p&gt;Now generate an OTP from your phone and test it with:&lt;/p&gt;
&lt;pre&gt;
# otpauth -u foo -p 549855 -s /var/run/otpd/socket
0 (ok)
&lt;/pre&gt;
&lt;p&gt;On the otp server you will see:&lt;/p&gt;
&lt;pre&gt;
otpd: accept_thread: plugin accept fd=5
otpd: work_thread: tid=3076053936, fd=5
otpd: work_thread(3076053936,5): handling plugin request for [foo]
otpd: verify: [foo], sync challenge t:0 e:0 0000000000000004, expecting response 549855
otpd: verify: user [foo] authentication succeeded
otpd: work_thread(3076053936,5): plugin disconnect
&lt;/pre&gt;
&lt;p&gt;If you don’t see a &lt;b&gt;0 (ok)&lt;/b&gt; from otpauth, you might get a &lt;b&gt;3 (authentication error)&lt;/b&gt; which means you didn’t present the expected OTP to the server. In the server debug window you will see 5 OTP’s (configurable through /etc/otpd.conf) which the server expects from that user account. Generate another one from you phone an you will immediately see if that one is in the list and will work.&lt;br/&gt;
If you get a &lt;b&gt;5 (service error)&lt;/b&gt; there is something wrong with your configuration and you have to fix that first before authentication will work.&lt;/p&gt;
&lt;p&gt;You might want to play around a little bit more with the HOTP software to get a grip on how it’s working. An easier way to generate the OTP’s is through a small perl program on your computer. For this you have to install the &lt;b&gt;Authen::HOTP&lt;/b&gt; module:&lt;/p&gt;
&lt;pre&gt;
perl -MCPAN -e &#39;install Authen::HOTP&#39;
&lt;/pre&gt;
&lt;p&gt;And then create this program:&lt;br/&gt;
[perl]&lt;br/&gt;
#!/usr/bin/perl&lt;br/&gt;
use Authen::HOTP qw(hotp);&lt;br/&gt;
use strict;&lt;/p&gt;
&lt;p&gt;my $secret=”44D060008BF440A2F9FF588AAD537F78B820F200″;&lt;br/&gt;
my $counter=$ARGV[1];&lt;br/&gt;
my $digits=$ARGV[0];&lt;/p&gt;
&lt;p&gt;my $pass = hotp($secret, $counter, $digits);&lt;br/&gt;
print “$pass\n”;&lt;br/&gt;
[/perl]&lt;/p&gt;
&lt;p&gt;Now it’s a easy as:&lt;/p&gt;
&lt;pre&gt;
# ./hotp.pl 6 5
853481
&lt;/pre&gt;
&lt;p&gt;If you got a successful authentication we can proceed to doing something useful with HOTP. Tri-D delivers a pam-otp module which you can use on a local system to replace your standard username/password authentication dialog. But they really recommend using the OTP daemon through RADIUS.&lt;br/&gt;
So download freeradius and compile &amp;amp; install:&lt;/p&gt;
&lt;pre&gt;
cd /tmp
wget ftp://ftp.freeradius.org/pub/radius/freeradius-1.1.7.tar.bz2
gtar jxvf freeradius-1.1.7.tar.bz2
cd freeradius-1.1.7
./configure
make
make install
&lt;p&gt;cd redhat/
cat rc.radiusd-redhat &amp;gt; /etc/init.d/radiusd
chkconfig &amp;ndash;add radiusd
chkconfig &amp;ndash;list radiusd
radiusd         0:off   1:off   2:off   3:off   4:off   5:off   6:off
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;On my redhat system i had to modify &lt;b&gt;/etc/init.d/radiusd&lt;/b&gt; to read:&lt;br/&gt;
&lt;b&gt;RADIUSD=/usr/local/sbin/radiusd&lt;/b&gt;&lt;br/&gt;
and i had to run &lt;b&gt;ldconfig&lt;/b&gt; again or otherwise radiusd would complain about&lt;br/&gt;
a missing &lt;b&gt;libradius-1.1.7.so&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Modify the radius configuration &lt;b&gt;/usr/local/etc/raddb/radiusd.conf&lt;/b&gt; to allow for One Time Passwords:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;remove the comment (#) before: &lt;b&gt;$INCLUDE ${confdir}/otp.conf&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;add &lt;b&gt;otp&lt;/b&gt; directly below &lt;b&gt;authorize {&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;add &lt;b&gt;otp&lt;/b&gt; directly below &lt;b&gt;authenticate {&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And start otpd and the radius service up:&lt;/p&gt;
&lt;pre&gt;
# otpd
# service radiusd start
Starten van RADIUS server:                                 [  OK  ]
&lt;/pre&gt;
&lt;p&gt;Now we can test OTP authentication through RADIUS with the radtest program:&lt;/p&gt;
&lt;pre&gt;
# ./hotp.pl 6 11
885417
&lt;h1 id=&#34;radtest-foo-885417-localhost-10-testing123&#34;&gt;radtest foo 885417 localhost 10 testing123&lt;/h1&gt;
&lt;p&gt;Sending Access-Request of id 197 to 127.0.0.1 port 1812
User-Name = &amp;ldquo;foo&amp;rdquo;
User-Password = &amp;ldquo;885417&amp;rdquo;
NAS-IP-Address = 255.255.255.255
NAS-Port = 10
rad_recv: Access-Accept packet from host 127.0.0.1:1812, id=197, length=20&lt;/p&gt;
&lt;h1 id=&#34;tail--1-varlogmessages&#34;&gt;tail -1 /var/log/messages&lt;/h1&gt;
&lt;p&gt;May  1 23:25:10 vortex otpd[11395]: verify: user [foo] authentication succeeded
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;testing123&lt;/b&gt; is the default RADIUS secret for localhost, you MUST change that in:&lt;br/&gt;
&lt;b&gt;/usr/local/etc/raddb/clients.conf&lt;/b&gt;, the NAS port number (10) is not used.&lt;/p&gt;
&lt;p&gt;On my testbox there was no pam_radius_auth module, so:&lt;/p&gt;
&lt;pre&gt;
cd /tmp
wget ftp://ftp.freeradius.org/pub/radius/pam_radius-1.3.17.tar.gz
gtar zxvf pam_radius-1.3.17.tar.gz
cd pam_radius-1.3.17
make
cp pam_radius_auth.so /lib/security/
cat  pam_radius_auth.conf &amp;gt; /etc/raddb/server
chmod go-rwx /etc/raddb/server
&lt;/pre&gt;
&lt;p&gt;Edit &lt;b&gt;/etc/raddb/server&lt;/b&gt; to match te secret for localhost in &lt;b&gt;/usr/local/etc/raddb/clients.conf&lt;/b&gt;, next add a line in &lt;b&gt;/etc/pam.d/system-auth&lt;/b&gt; like this:&lt;/p&gt;
&lt;pre&gt;
auth        required      /lib/security/$ISA/pam_env.so
auth        sufficient    /lib/security/$ISA/pam_unix.so likeauth nullok
auth        sufficient    /lib/security/pam_radius_auth.so try_first_pass
auth        required      /lib/security/$ISA/pam_deny.so
&lt;/pre&gt;
&lt;p&gt;This will allow normal password authentication, but if you are providing an OTP the unix password authentication will fail and the OTP is passed on to the pam_radius_auth module for validation.&lt;/p&gt;
&lt;p&gt;You can also use OTP authentication on you Apache webserver by using the &lt;a class=&#34;extlink&#34; href=&#34;http://www.freeradius.org/mod_auth_radius/&#34; target=&#34;_blank&#34;&gt;mod_auth_radius&lt;/a&gt; module.&lt;/p&gt;
&lt;p&gt;Have fun!&lt;/p&gt;
&lt;p&gt;&lt;i&gt;sources:&lt;/i&gt;&lt;br/&gt;
&lt;a class=&#34;extlink&#34; href=&#34;http://fbq.hamal.nl/index.php/archives/8#more-8&#34; target=&#34;_blank&#34;&gt;Foo Bar Quux&lt;/a&gt;&lt;br/&gt;
&lt;a class=&#34;extlink&#34; href=&#34;http://www.tri-dsystems.com/documentation/quickstart.html&#34; target=&#34;_blank&#34;&gt;Tri-D QuickStart Guide&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Update 20080529&lt;/b&gt;&lt;br/&gt;
Since it looks like the Tri-D site is offline, i will make my copies of otpd and pam_otp_auth available for download:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://www.oiepoie.nl/sw/otpd-3.1.0.tar.gz&#34;&gt;otpd-3.1.0.tar.gz&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.oiepoie.nl/sw/pam_otp_auth-3.2.2.tar.gz&#34;&gt;pam_otp_auth-3.2.2.tar.gz&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
    <item>
      <title>Oneliner to remove duplicates while maintaining the original order</title>
      <link>https://www.oiepoie.nl/2008/01/12/oneliner-to-remove-duplicates-while-maintaining-the-original-order/</link>
      <pubDate>Sat, 12 Jan 2008 16:58:01 +0100</pubDate>
      
      <guid>https://www.oiepoie.nl/2008/01/12/oneliner-to-remove-duplicates-while-maintaining-the-original-order/</guid>
      <description>&lt;p&gt;If you have got a list like this:&lt;/p&gt;
&lt;pre&gt;
one
two
one
three
one
two
four
&lt;/pre&gt;
&lt;p&gt;and you want to remove the duplicates from the list, chances are that you will end up with this result:&lt;/p&gt;
&lt;pre&gt;
four
one
three
two
&lt;/pre&gt;
&lt;p&gt;Because you are using a command like:&lt;/p&gt;
&lt;pre&gt;
sort -u &amp;lt; list.txt
&lt;/pre&gt;
&lt;p&gt;or the longer form:&lt;/p&gt;
&lt;pre&gt;
cat list.txt | sort | uniq
&lt;/pre&gt;
&lt;p&gt;There is an easy way to keep the original order of the list and remove the duplicates in an oneliner.&lt;br/&gt;
For this you need to number the entries in the list with this command:&lt;/p&gt;
&lt;pre&gt;
nl list.txt
&lt;/pre&gt;
&lt;p&gt;If you don&#39;t have &lt;strong&gt;nl&lt;/strong&gt; on your system, you can use &lt;strong&gt;cat -n&lt;/strong&gt; or whatever tickles your fancy.&lt;br/&gt;
This will give you the list:&lt;/p&gt;
&lt;pre&gt;
     1  one
     2  two
     3  one
     4  three
     5  one
     6  two
     7  four
&lt;/pre&gt;
&lt;p&gt;We will use the numbering to restore the original order when we are done removing the duplicates.&lt;br/&gt;
Next thing is to sort the list on the second field:&lt;/p&gt;
&lt;pre&gt;
nl list.txt | sort -k2
&lt;/pre&gt;
&lt;pre&gt;
     7  four
     1  one
     3  one
     5  one
     4  three
     2  two
     6  two
&lt;/pre&gt;
&lt;p&gt;and tell sort to remove the lines with duplicate fields:&lt;/p&gt;
&lt;pre&gt;
nl list.txt | sort -k2 -u
&lt;/pre&gt;
&lt;pre&gt;
     7  four
     1  one
     4  three
     2  two
&lt;/pre&gt;
&lt;p&gt;All that is left is to restore the original order:&lt;/p&gt;
&lt;pre&gt;
nl list.txt | sort -k2 -u | sort -n
&lt;/pre&gt;
&lt;pre&gt;
     1  one
     2  two
     4  three
     7  four
&lt;/pre&gt;
&lt;p&gt;and get rid of our inserted numbering:&lt;/p&gt;
&lt;pre&gt;
nl list.txt | sort -k2 -u | sort -n | cut -f2-
&lt;/pre&gt;
&lt;pre&gt;
one
two
three
four
&lt;/pre&gt;
&lt;p&gt;Imagine trying to do this on a Windows box, I wouldn&#39;t know where to start 😉&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Oneliner to remove duplicates while maintaining the original order</title>
      <link>https://www.oiepoie.nl/2008/01/12/oneliner-to-remove-duplicates-while-maintaining-the-original-order/</link>
      <pubDate>Sat, 12 Jan 2008 16:58:01 +0100</pubDate>
      
      <guid>https://www.oiepoie.nl/2008/01/12/oneliner-to-remove-duplicates-while-maintaining-the-original-order/</guid>
      <description>&lt;p&gt;If you have got a list like this:&lt;/p&gt;
&lt;pre&gt;
one
two
one
three
one
two
four
&lt;/pre&gt;
&lt;p&gt;and you want to remove the duplicates from the list, chances are that you will end up with this result:&lt;/p&gt;
&lt;pre&gt;
four
one
three
two
&lt;/pre&gt;
&lt;p&gt;Because you are using a command like:&lt;/p&gt;
&lt;pre&gt;
sort -u &amp;lt; list.txt
&lt;/pre&gt;
&lt;p&gt;or the longer form:&lt;/p&gt;
&lt;pre&gt;
cat list.txt | sort | uniq
&lt;/pre&gt;
&lt;p&gt;There is an easy way to keep the original order of the list and remove the duplicates in an oneliner.&lt;br/&gt;
For this you need to number the entries in the list with this command:&lt;/p&gt;
&lt;pre&gt;
nl list.txt
&lt;/pre&gt;
&lt;p&gt;If you don&#39;t have &lt;strong&gt;nl&lt;/strong&gt; on your system, you can use &lt;strong&gt;cat -n&lt;/strong&gt; or whatever tickles your fancy.&lt;br/&gt;
This will give you the list:&lt;/p&gt;
&lt;pre&gt;
     1  one
     2  two
     3  one
     4  three
     5  one
     6  two
     7  four
&lt;/pre&gt;
&lt;p&gt;We will use the numbering to restore the original order when we are done removing the duplicates.&lt;br/&gt;
Next thing is to sort the list on the second field:&lt;/p&gt;
&lt;pre&gt;
nl list.txt | sort -k2
&lt;/pre&gt;
&lt;pre&gt;
     7  four
     1  one
     3  one
     5  one
     4  three
     2  two
     6  two
&lt;/pre&gt;
&lt;p&gt;and tell sort to remove the lines with duplicate fields:&lt;/p&gt;
&lt;pre&gt;
nl list.txt | sort -k2 -u
&lt;/pre&gt;
&lt;pre&gt;
     7  four
     1  one
     4  three
     2  two
&lt;/pre&gt;
&lt;p&gt;All that is left is to restore the original order:&lt;/p&gt;
&lt;pre&gt;
nl list.txt | sort -k2 -u | sort -n
&lt;/pre&gt;
&lt;pre&gt;
     1  one
     2  two
     4  three
     7  four
&lt;/pre&gt;
&lt;p&gt;and get rid of our inserted numbering:&lt;/p&gt;
&lt;pre&gt;
nl list.txt | sort -k2 -u | sort -n | cut -f2-
&lt;/pre&gt;
&lt;pre&gt;
one
two
three
four
&lt;/pre&gt;
&lt;p&gt;Imagine trying to do this on a Windows box, I wouldn&#39;t know where to start 😉&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Gratis online boeken over Linux, Programmeren, Security</title>
      <link>https://www.oiepoie.nl/2008/01/11/gratis-online-boeken-over-linux-programmeren-security/</link>
      <pubDate>Fri, 11 Jan 2008 22:56:25 +0100</pubDate>
      
      <guid>https://www.oiepoie.nl/2008/01/11/gratis-online-boeken-over-linux-programmeren-security/</guid>
      <description>&lt;p&gt;Eigenlijk is december &lt;strong&gt;de&lt;/strong&gt; maand van de lijstjes, maar ik kwam ergens een lijstje van online Linux boeken tegen, ging op zoek naar andere lijstjes en gratis online boeken en kon het toen toch niet nalaten om een &lt;a href=&#34;https://www.oiepoie.nl/gratis_boeken&#34;&gt;superlijst van gratis boeken&lt;/a&gt; te maken. &lt;/p&gt;
&lt;p&gt;Nu nog een &lt;a class=&#34;extlink&#34; href=&#34;http://www.irextechnologies.com/products/iliad&#34; target=&#34;_new&#34;&gt;iLiad&lt;/a&gt; of een &lt;a class=&#34;extlink&#34; href=&#34;http://www.amazon.com/Kindle-Amazons-Wireless-Reading-Device/dp/B000FI73MA&#34; target=&#34;_new&#34;&gt;kindle&lt;/a&gt; om al dat online spul eens fatsoenlijk te kunnen lezen.&lt;br/&gt;
&lt;strong&gt;Tip:&lt;/strong&gt;Er is ook een nieuwsgroep: &lt;a class=&#34;extlink&#34; href=&#34;news://alt.binaries.e-book.technical&#34;&gt;alt.binaries.e-book.technical&lt;/a&gt; waar veel leuke boeken in worden gepost om te downloaden, maar daar nemen ze het met Copyright niet zo nauw.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Working with Nikon RAW (.nef) photo’s on Linux</title>
      <link>https://www.oiepoie.nl/2007/12/05/working-with-nikon-raw-nef-photos-on-linux/</link>
      <pubDate>Wed, 05 Dec 2007 13:38:18 +0100</pubDate>
      
      <guid>https://www.oiepoie.nl/2007/12/05/working-with-nikon-raw-nef-photos-on-linux/</guid>
      <description>&lt;p&gt;If you own a digital SLR (Single Lens Reflex) camera, there comes a time when you want to move to &lt;strong&gt;RAW&lt;/strong&gt; format because it gives you so much more options of processing the photo afterwards. Also the price of memory cards has decreased tremendously, so the extra storage space needed is no reason anymore to keep shooting in &lt;strong&gt;JPEG&lt;/strong&gt;. On my last holiday to Canada i took 3 compact flash cards of 4GB each with me, so i had room for around 2000 photo’s with my Nikon D70S.&lt;/p&gt;
&lt;p&gt;When i returned from this fantastic holiday and mounted the memory cards on my Linux box to look at the results, i had a bit of a disappointment because the &lt;strong&gt;.nef&lt;/strong&gt; files were not recognized by gqview, my favorite photo viewing program. Also i couldn’t put them straight away on the website, because nobody would see the picture when clicking on the nef images.&lt;/p&gt;
&lt;p&gt;After a little bit of searching on Google i discovered that a Nikon NEF image contains four JPG images, so you don’t need to convert the NEF to JPG, but you can just extract the desired jpg image from the NEF file. &lt;i&gt;Phil Harvey&lt;/i&gt; has written the excellent &lt;a class=&#34;extlink&#34; href=&#34;http://www.sno.phy.queensu.ca/~phil/exiftool/&#34; target=&#34;_blank&#34;&gt;exiftool&lt;/a&gt; to do that (and a lot more) on Linux. The syntax to do this is:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
exiftool -b -JpgFromRaw orignal.NEF &amp;gt; output.jpg&lt;br/&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you want to do this for a lot of files, you can use the command like this:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
exiftool -b -JpgFromRaw -w _C2007.JPG -ext nef -r .&lt;br/&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The command specifies to operate recursively on all files in the current directory &lt;strong&gt;(-r .)&lt;/strong&gt; and use the original filename with &lt;strong&gt;_C2007.JPG&lt;/strong&gt; appended as output filename.&lt;br/&gt;
But it turned out that the &lt;strong&gt;EXIF&lt;/strong&gt; information which is present in the original NEF image is not copied to the resulting JPG image. Luckily you can do that with exiftool in a second step:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;br/&gt;
exiftool -b -JpgFromRaw original.NEF &amp;gt; output.jpg&lt;br/&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Before putting these images on my website i wanted to scale them down to a viewable dimension and also rename the image to a more sensible name. By choosing a name based on the date i took the photograph, the images would automatically be listed (and viewed) in chronological order. Also because i took two camera’s with me on holiday, this would allow me to merge both photo sets into one directory and still have them in chronological order.&lt;/p&gt;
&lt;p&gt;To automate all the steps, i wrote a small perl program which i named neftojpg.pl&lt;/p&gt;
&lt;p&gt;[perl]&lt;br/&gt;
#!/usr/bin/perl -w&lt;br/&gt;
#&lt;br/&gt;
# wil create a set of JPEG images from NIKON NEF files&lt;br/&gt;
# resize those to $pix pixels&lt;br/&gt;
# copy the EXIF data over from NEF to JPEG&lt;br/&gt;
# and rename the JPEG files to a filename based on the&lt;br/&gt;
# creation date&lt;/p&gt;
&lt;p&gt;# 20071205 (c) Ewald&lt;/p&gt;
&lt;p&gt;use strict;&lt;/p&gt;
&lt;p&gt;my @files;&lt;br/&gt;
my $file;&lt;br/&gt;
my $name;&lt;br/&gt;
my $pix=”800×600″;          # desired geometry&lt;br/&gt;
my $dir=”.”;&lt;br/&gt;
my $dirname=”small”;          # output subdirectory&lt;br/&gt;
my $ext=”nef”;          # nef for NIKON, crw for Canon&lt;/p&gt;
&lt;p&gt;@files = &amp;lt;$dir/*.$ext&amp;gt;;          # set of files to work on&lt;/p&gt;
&lt;p&gt;foreach $file (@files) {&lt;br/&gt;
  print “processing $file\n”;&lt;/p&gt;
&lt;p&gt;  ($name) = ($file =~ /.*\/(.+?)\.$ext/);     # separate name from file extension&lt;/p&gt;
&lt;p&gt;  if (!-d $dirname) {&lt;br/&gt;
        mkdir $dirname or die “$!”;&lt;br/&gt;
        }&lt;/p&gt;
&lt;p&gt;# extract jpg image from raw and convert to $pix pixels&lt;br/&gt;
  qx{exiftool -b -JpgFromRaw $file | convert – -geometry $pix $dirname/$name.jpg};&lt;/p&gt;
&lt;p&gt;# copy exif tags from the raw image into the jpg file&lt;br/&gt;
  qx{exiftool -TagsFromFile $file $dirname/$name.jpg};&lt;/p&gt;
&lt;p&gt;# rotate image if nessessary based on EXIF information (NB your camera might not support this)&lt;br/&gt;
  qx{exiftran -ai $dirname/$name.jpg};&lt;/p&gt;
&lt;p&gt;# rename jpg file to a date based name&lt;br/&gt;
  qx{exiftool ‘-FileName&lt;createdate _original=&#34;&#34; by=&#34;&#34; changing=&#34;&#34; copy=&#34;&#34; created=&#34;&#34; exiftool=&#34;&#34; get=&#34;&#34; of=&#34;&#34; rid=&#34;&#34; safety=&#34;&#34; unlink=&#34;&#34;&gt;$ext to CRW the script should just as easy work for Canon RAW image files.&lt;/createdate&gt;&lt;/p&gt;
&lt;p&gt;Both exiftool and ImageMagick (where the convert command comes from) have their own perl modules, so the next step would be to get rid of the &lt;strong&gt;qx{}&lt;/strong&gt; to execute shell commands and rewrite all operations in perl, but i am in no hurry yet to do so 😉&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>completely removing information from an USB stick</title>
      <link>https://www.oiepoie.nl/2007/11/28/completely-removing-information-from-an-usb-stick/</link>
      <pubDate>Wed, 28 Nov 2007 18:15:46 +0100</pubDate>
      
      <guid>https://www.oiepoie.nl/2007/11/28/completely-removing-information-from-an-usb-stick/</guid>
      <description>&lt;p&gt;Perhaps you have seen those movies where a person is questioned about things from the past. Of course he doesn’t remember all those embarrassing things the interrogator wants to know. Then a hypnotherapist is called in and puts the man under hypnosis and all details come pouring out.&lt;br/&gt;
A USB stick acts the same. If you look at it from Windows explorer or you do a mount + ls under Linux you see only the information which is on the surface. But beneath it a lot of other information is often lingering, information which maybe could be embarrassing if it falls into the wrong hands.&lt;br/&gt;
The reason for this is that when files are deleted from the USB stick, or from a harddisk for that matter, they not actually wiped. The only thing that happens is that the space is marked free in the File Allocation Table. But as long as this space is not overwritten by new files, the information still remains on the device.&lt;br/&gt;
That is why undelete tools can recover files for you.&lt;/p&gt;
&lt;p&gt;A potential risk is that when you hand over your thumbdrive to someone for copying info on or of the stick, they might just copy a complete image of the stick to their laptop. There is even a handy program: &lt;strong&gt;USBdumper&lt;/strong&gt; which provides this functionality. Afterwards they can do a forensic analysis of the data, for instance using &lt;a class=&#34;extlink&#34; href=&#34;http://foremost.sourceforge.net/&#34; target=&#34;_blank&#34;&gt;foremost&lt;/a&gt; and see what kind of residual data they can retrieve. On linux you could even do a &lt;strong&gt;strings &amp;lt; USBimage.dd&lt;/strong&gt; to get a quick view.&lt;/p&gt;
&lt;p&gt;So how to avoid this risk? If you are on a Windows system, there is a free tool called &lt;a class=&#34;extlink&#34; href=&#34;http://www.heidi.ie/eraser/&#34; target=&#34;_blank&#34;&gt;eraser&lt;/a&gt; which securely wipes all residual data of a device. For Linux there are a number of tools, for instance &lt;a class=&#34;extlink&#34; href=&#34;http://wipe.sourceforge.net/&#34; target=&#34;_blank&#34;&gt;wipe&lt;/a&gt;, but it is more fun to do it by hand and know what you are doing.&lt;/p&gt;
&lt;p&gt;Let’s say i plug in my USB stick and mount it under: &lt;strong&gt;/media/disk&lt;/strong&gt;&lt;br/&gt;
When i execute a &lt;strong&gt;df -k&lt;/strong&gt; it displays how much space is free and therefore the number of bytes of hidden information there possibly are on the stick:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
# df -k /media/disk/
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sdb1               249336     60736    188600  25% /media/disk
&lt;/pre&gt;
&lt;p&gt;To completely obliterate all data, we need to overwrite all information with something else. If this were a harddrive, the specialists say you need to overwrite the data a fair number of times with random bytes, otherwise it’s possible that the NSA can still reconstruct the original bits from looking at the magnetic patterns on the disk. But since we are talking microchips here, anything will do. The fastest way would be to read zero’s from /dev/null, but we will use /dev/urandom just for the fun of it 😉&lt;/p&gt;
&lt;p&gt;Since there are 188600 blocks of 1 kbyte free, we need to write exactly that amount of data to the USB drive:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
# cd /media/disk/
# dd if=/dev/urandom of=rnd.bin bs=1k count=188600
188600+0 records in
188600+0 records out
193126400 bytes (193 MB) copied, 52.3836 s, 3.7 MB/s
&lt;h1 id=&#34;df--h-&#34;&gt;df -h .&lt;/h1&gt;
&lt;p&gt;Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb1             244M  244M     0 100% /media/disk&lt;/p&gt;
&lt;h1 id=&#34;sync&#34;&gt;sync&lt;/h1&gt;
&lt;h1 id=&#34;ls--l&#34;&gt;ls -l&lt;/h1&gt;
&lt;p&gt;total 188640
drwxr-xr-x 2 root root      4096   2007-11-22 15:39 porn_collection
drwxr-xr-x 2 root root      4096   2007-11-21 14:11 passwords
-rwxr-xr-x 1 root root 193126400 2007-11-28 15:43 rnd.bin&lt;/p&gt;
&lt;h1&gt;&lt;/h1&gt;
&lt;h1 id=&#34;hexdump--c-rndbin--head--6&#34;&gt;hexdump -C rnd.bin | head -6&lt;/h1&gt;
&lt;p&gt;00000000  6b 9d 85 95 6c 41 00 56  30 c5 f4 49 0a 90 ed 5a  |k&amp;hellip;lA.V0..I&amp;hellip;Z|
00000010  54 eb df 6d 4e 53 7a 39  33 a8 21 44 f7 a7 df 61  |T..mNSz93.!D&amp;hellip;a|
00000020  6a 33 f6 77 c1 cb d4 46  6e ab 57 0d 28 8e eb 13  |j3.w&amp;hellip;Fn.W.(&amp;hellip;|
00000030  f3 0d bd 28 eb 96 54 6c  21 ec d9 91 b8 4e ea 50  |&amp;hellip;(..Tl!&amp;hellip;.N.P|
00000040  fa 98 8e 78 0c d0 6c 49  7d 4a c6 b9 37 87 84 21  |&amp;hellip;x..lI}J..7..!|
00000050  ad 25 a5 fa 6a 52 62 ff  54 ae 77 ba 9d 45 4d a3  |.%..jRb.T.w..EM.|
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;That looks alright, since &lt;strong&gt;188600 * 1024 = 193126400&lt;/strong&gt; and sync is needed to flush the data from the write cache to the USB disk.&lt;br/&gt;
The only thing left to do is remove the random blob again (but now you know that what happens is that the space is marked free in the File Allocation Table and our random bytes remain in place), sync and unmount:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
# rm -f rnd.bin
# sync
# cd
# df -k /media/disk/
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sdb1               249336     60736    188600  25% /media/disk
# umount /media/disk
&lt;/pre&gt;
&lt;p&gt;And as you can see we are spacewise exactly where we started from.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Caveat lector!&lt;/strong&gt; This trick only protects you from somebody recovering deleted information. If you got private files on the stick, use cryptography to protect those. &lt;a class=&#34;extlink&#34; href=&#34;http://www.truecrypt.org/&#34; target=&#34;_blank&#34;&gt;TrueCrypt&lt;/a&gt; is a very nice program you can use. If you choose a simple password to access the encrypted files, you might as well use no crypto at all.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Sniffing Google’s blacklist for firefox</title>
      <link>https://www.oiepoie.nl/2007/11/25/sniffing-googles-blacklist-for-firefox/</link>
      <pubDate>Sun, 25 Nov 2007 16:40:05 +0100</pubDate>
      
      <guid>https://www.oiepoie.nl/2007/11/25/sniffing-googles-blacklist-for-firefox/</guid>
      <description>&lt;p&gt;Firefox 2 has a new security feature which protects you from entering private data on &lt;a class=&#34;extlink&#34; href=&#34;http://en.wikipedia.org/wiki/Phishing&#34; target=&#34;_blank&#34;&gt;phishing&lt;/a&gt; websites or getting infected with malware on a website which promises you heaven and earth.&lt;br/&gt;
Protection is done by comparing the website address (&lt;a class=&#34;extlink&#34; href=&#34;http://en.wikipedia.org/wiki/Url&#34; target=&#34;_blank&#34;&gt;URL&lt;/a&gt;against a so called &lt;a extlink=&#34;&#34; href=&#34;http://en.wikipedia.org/wiki/Blacklist#Computing&#34; target=&#34;_blank class=&#34;&gt;blacklist&lt;/a&gt;. The blacklist is maintained by the good folks at Google, they take care of updating the blacklist regulary and firefox automagically downloads new versions.&lt;br/&gt;
Curious by nature, i wanted to know which websites were in the blacklist, so i took a peek in my .mozilla/firefox/… directory where all the users stuff is stored. The blacklist itself is easy identified by it’s name: &lt;strong&gt;urlclassifier2.sqlite&lt;/strong&gt; and the extension betrays what kind of system is used to store the bad sites: &lt;strong&gt;sqlite&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;br/&gt;
&lt;a class=&#34;extlink&#34; href=&#34;http://en.wikipedia.org/wiki/Sqlite&#34; target=&#34;_blank&#34;&gt;SQLite&lt;/a&gt; is actually a database program, but in it’s simplest form. You don’t need to run a database engine and setup permissions, etc. But the complete database is stored into a file. So this is the &lt;strong&gt;KIS&lt;/strong&gt; principle to the max, and it works great as long as the database doesn’t grow to large or to complex.&lt;/p&gt;
&lt;p&gt;Next thing to do is fire up sqlite and have a look at the structure of the database:&lt;/p&gt;
&lt;pre&gt;
$ sqlite3  urlclassifier2.sqlite
SQLite version 3.4.2
Enter &#34;.help&#34; for instructions
sqlite&amp;gt; .tables
goog_black_enchash goog_black_url goog_white_domain goog_white_url
sqlite&amp;gt; .schema
CREATE TABLE &#39;goog_black_enchash&#39; (key TEXT PRIMARY KEY, value TEXT);
CREATE TABLE &#39;goog_black_url&#39; (key TEXT PRIMARY KEY, value TEXT);
CREATE TABLE &#39;goog_white_domain&#39; (key TEXT PRIMARY KEY, value TEXT);
CREATE TABLE &#39;goog_white_url&#39; (key TEXT PRIMARY KEY, value TEXT);
&lt;/pre&gt;
&lt;p&gt;Looks simple enough, the bad sites are probably in: goog_blac_url&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
qlite&amp;gt; select * from goog_black_url LIMIT 3;
uggc://ybtva.zlfcnpr.psz.shfrnpgvba.hfre.fcynfu.ubzr.zlgbxra.76701n2644n8605.pn0qpor.pbz/vaqrk.cuc|c
uggc://ealfcnprv.pbz/vaqrk.pszshfrnpgvba=ybtva.cebprff&amp;amp;ZlGbxra-wrrqk4r1ssn-s3kg3k2ns0-4r3-sfs3n421-s7goskks3ks231.ugz|c
uggc://eeaelfcnpr.pbz/vaqrk.psz-shfrnpgvba657Qybtva.cebprff8526ZlGbxraf79843964886883084155.ugz|c
sqlite&amp;gt; .quit
&lt;/pre&gt;
&lt;p&gt;Hmm, it &lt;a class=&#34;extlink&#34; href=&#34;http://wiki.mozilla.org/Safe_Browsing:_Design_Documentation&#34; target=&#34;_blank&#34;&gt;turns out&lt;/a&gt; that the content is encoded through the famous &lt;a class=&#34;extlink&#34; href=&#34;http://en.wikipedia.org/wiki/Rot13&#34; target=&#34;_blank&#34;&gt;ROT13&lt;/a&gt; methode. The reason being that the file otherwise might be flagged as harmfull by locally running antivirus software.&lt;/p&gt;
&lt;p&gt;So we need a ROT13 decoder, this is easilly done with the unix utility &lt;strong&gt;tr&lt;/strong&gt; and the complete construct snugly fits into a oneliner:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
echo &#34;SELECT * FROM goog_black_url LIMIT 3;&#34; | sqlite3 \
urlclassifier2.sqlite | tr N-ZA-Mn-za-m A-Za-z
&lt;/pre&gt;
&lt;p&gt;Which will output something like:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
http://login.myspace.cfm.fuseaction.user.splash.home.mytoken.76701a2644a8605.ca0dcbe.com/index.php|p
http://rnyspacei.com/index.cfmfuseaction=login.process&amp;amp;ZyGoken-jeedx4e1ffa-f3xt3x2af0-4e3-fsf3a421-f7tbfxxf3xf231.htm|p
http://rrnryspace.com/index.cfm-fuseaction657Qlogin.process8526ZyGokens79843964886883084155.htm|p
&lt;/pre&gt;
&lt;p&gt;If you’re brave, you might cut ‘n paste one of the URL’s in your firefox browser and see what happens 😉&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Sniffing Google’s blacklist for firefox</title>
      <link>https://www.oiepoie.nl/2007/11/25/sniffing-googles-blacklist-for-firefox/</link>
      <pubDate>Sun, 25 Nov 2007 16:40:05 +0100</pubDate>
      
      <guid>https://www.oiepoie.nl/2007/11/25/sniffing-googles-blacklist-for-firefox/</guid>
      <description>&lt;p&gt;Firefox 2 has a new security feature which protects you from entering private data on &lt;a class=&#34;extlink&#34; href=&#34;http://en.wikipedia.org/wiki/Phishing&#34; target=&#34;_blank&#34;&gt;phishing&lt;/a&gt; websites or getting infected with malware on a website which promises you heaven and earth.&lt;br/&gt;
Protection is done by comparing the website address (&lt;a class=&#34;extlink&#34; href=&#34;http://en.wikipedia.org/wiki/Url&#34; target=&#34;_blank&#34;&gt;URL&lt;/a&gt;against a so called &lt;a extlink=&#34;&#34; href=&#34;http://en.wikipedia.org/wiki/Blacklist#Computing&#34; target=&#34;_blank class=&#34;&gt;blacklist&lt;/a&gt;. The blacklist is maintained by the good folks at Google, they take care of updating the blacklist regulary and firefox automagically downloads new versions.&lt;br/&gt;
Curious by nature, i wanted to know which websites were in the blacklist, so i took a peek in my .mozilla/firefox/… directory where all the users stuff is stored. The blacklist itself is easy identified by it’s name: &lt;strong&gt;urlclassifier2.sqlite&lt;/strong&gt; and the extension betrays what kind of system is used to store the bad sites: &lt;strong&gt;sqlite&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;br/&gt;
&lt;a class=&#34;extlink&#34; href=&#34;http://en.wikipedia.org/wiki/Sqlite&#34; target=&#34;_blank&#34;&gt;SQLite&lt;/a&gt; is actually a database program, but in it’s simplest form. You don’t need to run a database engine and setup permissions, etc. But the complete database is stored into a file. So this is the &lt;strong&gt;KIS&lt;/strong&gt; principle to the max, and it works great as long as the database doesn’t grow to large or to complex.&lt;/p&gt;
&lt;p&gt;Next thing to do is fire up sqlite and have a look at the structure of the database:&lt;/p&gt;
&lt;pre&gt;
$ sqlite3  urlclassifier2.sqlite
SQLite version 3.4.2
Enter &#34;.help&#34; for instructions
sqlite&amp;gt; .tables
goog_black_enchash goog_black_url goog_white_domain goog_white_url
sqlite&amp;gt; .schema
CREATE TABLE &#39;goog_black_enchash&#39; (key TEXT PRIMARY KEY, value TEXT);
CREATE TABLE &#39;goog_black_url&#39; (key TEXT PRIMARY KEY, value TEXT);
CREATE TABLE &#39;goog_white_domain&#39; (key TEXT PRIMARY KEY, value TEXT);
CREATE TABLE &#39;goog_white_url&#39; (key TEXT PRIMARY KEY, value TEXT);
&lt;/pre&gt;
&lt;p&gt;Looks simple enough, the bad sites are probably in: goog_blac_url&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
qlite&amp;gt; select * from goog_black_url LIMIT 3;
uggc://ybtva.zlfcnpr.psz.shfrnpgvba.hfre.fcynfu.ubzr.zlgbxra.76701n2644n8605.pn0qpor.pbz/vaqrk.cuc|c
uggc://ealfcnprv.pbz/vaqrk.pszshfrnpgvba=ybtva.cebprff&amp;amp;ZlGbxra-wrrqk4r1ssn-s3kg3k2ns0-4r3-sfs3n421-s7goskks3ks231.ugz|c
uggc://eeaelfcnpr.pbz/vaqrk.psz-shfrnpgvba657Qybtva.cebprff8526ZlGbxraf79843964886883084155.ugz|c
sqlite&amp;gt; .quit
&lt;/pre&gt;
&lt;p&gt;Hmm, it &lt;a class=&#34;extlink&#34; href=&#34;http://wiki.mozilla.org/Safe_Browsing:_Design_Documentation&#34; target=&#34;_blank&#34;&gt;turns out&lt;/a&gt; that the content is encoded through the famous &lt;a class=&#34;extlink&#34; href=&#34;http://en.wikipedia.org/wiki/Rot13&#34; target=&#34;_blank&#34;&gt;ROT13&lt;/a&gt; methode. The reason being that the file otherwise might be flagged as harmfull by locally running antivirus software.&lt;/p&gt;
&lt;p&gt;So we need a ROT13 decoder, this is easilly done with the unix utility &lt;strong&gt;tr&lt;/strong&gt; and the complete construct snugly fits into a oneliner:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
echo &#34;SELECT * FROM goog_black_url LIMIT 3;&#34; | sqlite3 \
urlclassifier2.sqlite | tr N-ZA-Mn-za-m A-Za-z
&lt;/pre&gt;
&lt;p&gt;Which will output something like:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
http://login.myspace.cfm.fuseaction.user.splash.home.mytoken.76701a2644a8605.ca0dcbe.com/index.php|p
http://rnyspacei.com/index.cfmfuseaction=login.process&amp;amp;ZyGoken-jeedx4e1ffa-f3xt3x2af0-4e3-fsf3a421-f7tbfxxf3xf231.htm|p
http://rrnryspace.com/index.cfm-fuseaction657Qlogin.process8526ZyGokens79843964886883084155.htm|p
&lt;/pre&gt;
&lt;p&gt;If you’re brave, you might cut ‘n paste one of the URL’s in your firefox browser and see what happens 😉&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Caught a virus? Trinity to the rescue!</title>
      <link>https://www.oiepoie.nl/2007/08/04/caught-a-virus-trinity-to-the-rescue/</link>
      <pubDate>Sat, 04 Aug 2007 12:45:35 +0200</pubDate>
      
      <guid>https://www.oiepoie.nl/2007/08/04/caught-a-virus-trinity-to-the-rescue/</guid>
      <description>&lt;p&gt;Last week we detected some PC’s in the network behaving badly. The were sending a massive amount of ping packets to one host on the Internet, so some sort of &lt;b&gt;DoS&lt;/b&gt; (Denial of Service) attack. When we investigated the problem there was nog sign of the culprit at first, also McAfee which was installed and running had not detected anything abnormal going on.&lt;br/&gt;
What most people do next is load lots of tools on the PC and try to discover the hidden programs responsible for all this havoc. But actually there is a much simpler approach.&lt;/p&gt;
&lt;p&gt;Today there is a lot of money to be earned by sending SPAM. But since sending SPAM is illegal in a lot of countries, the challange is to keep sending out these giant amounts of SPAM e-mail without being caught. The way to do this is by “owning” a lot of computers of unaware home users and send the e-mails through these systems. So if a recipient traces back the SPAM e-mail, he only sees the home computer as the source.&lt;/p&gt;
&lt;p&gt;To be able to control these computers, the hacker needs to infect them with something that installs a &lt;a class=&#34;extlink&#34; href=&#34;http://en.wikipedia.org/wiki/Backdoor_%28computing%29&#34; target=&#34;_blank&#34;&gt;&lt;b&gt;backdoor&lt;/b&gt;&lt;/a&gt;. The backdoor is the way in for the hacker to control the computer and the program which installs the backdoor is often a &lt;a class=&#34;extlink&#34; href=&#34;http://en.wikipedia.org/wiki/Trojan_horse_%28computing%29&#34; target=&#34;_blank&#34;&gt;&lt;b&gt;trojan&lt;/b&gt;&lt;/a&gt; named after the trojan horse strategy of the greek.&lt;br/&gt;
Such an trojan might be an e-mail with the message that you received a postcard from a friend, neighbor or worshipper. To see the postcard you need to click on a link, and that link contains &lt;i&gt;postcard.exe&lt;/i&gt;. Since you are curious by nature, you of course click on the link and execute the postcard program.&lt;br/&gt;
You might even see a postcard, but meanwhile a program is covertly installed on your computer and your system becomes a marionette to the hacker.&lt;/p&gt;
&lt;p&gt;It is important for the hacker to keep his program hidden, because the longer it stays on your computer, the longer he can make money out of it. A way to hide programs from other programs (like you antivirus) is by using &lt;a class=&#34;extlink&#34; href=&#34;http://en.wikipedia.org/wiki/Rootkit&#34; target=&#34;_blank&#34;&gt;rootkit&lt;/a&gt; technology. A rootkit installs itself inside or just above the operating system. If you start the taskmanager to look at all the programs that are running, the taskmanager requests this information from the operating system. But instead of communicating with the OS, it really communicates through the rootkit, and the rootkit filters out it’s own existence when sending back the response from the OS to the taskmanager. So effectively the rootkit is a cloaking device which makes it own existence and the existence of the backdoor invisible.&lt;/p&gt;
&lt;p&gt;The simple approach i mentioned to finding this kind of software is by eliminating the Operating System when you look for this kind of hidden software. The way we do that is by booting a different Operating System (known to be clean of rootkits) and from there start our search for the culprits. We even assure that the booted OS can not be infected with malware by running it from a read-only medium (i.e. a cdrom).&lt;/p&gt;
&lt;p&gt;&lt;a class=&#34;extlink&#34; href=&#34;http://trinityhome.org/Home/index.php?wpid=1&amp;amp;front_id=12&#34; target=&#34;_blank&#34;&gt;&lt;strong&gt;Trinity Rescue Kit&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;There are some other bootable cdrom’s out there with antivirus products on it, but &lt;strong&gt;TRK&lt;/strong&gt; is different in that it supports 4 (&lt;strong&gt;four!&lt;/strong&gt;) different antivirus products and they are all legal versions for you to use. Apart from the antivirus bit, TRK also has these (and more) features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;easily reset windows passwords&lt;/li&gt;
&lt;li&gt;4 different virusscan products integrated in a single uniform commandline with online update capability&lt;/li&gt;
&lt;li&gt;full ntfs write support thanks to ntfs-3g (all other drivers included as well)&lt;/li&gt;
&lt;li&gt;clone NTFS filesystems over the network&lt;/li&gt;
&lt;li&gt;wide range of hardware support (kernel 2.6.19.2 and recent kudzu hwdata)&lt;/li&gt;
&lt;li&gt;easy script to find all local filesystems&lt;/li&gt;
&lt;li&gt;self update capability to include and update all virusscanners&lt;/li&gt;
&lt;li&gt;full proxyserver support.&lt;/li&gt;
&lt;li&gt;run a samba fileserver (windows like filesharing)&lt;/li&gt;
&lt;li&gt;run a ssh server&lt;/li&gt;
&lt;li&gt;recovery and undeletion of files with utilities and procedures&lt;/li&gt;
&lt;li&gt;recovery of lost partitions&lt;/li&gt;
&lt;li&gt;evacuation of dying disks&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Start with downloading the TRK iso from: &lt;a class=&#34;extlink&#34; href=&#34;http://trinityhome.org/Home/index.php?wpid=5&amp;amp;front_id=12&#34; target=&#34;_blank&#34;&gt;here&lt;/a&gt; and burn it on a cdrom, for instance with Nero (here is a &lt;a class=&#34;extlink&#34; href=&#34;http://www.wizardskeep.org/mainhall/tutor/neroiso.html&#34; target=&#34;_blank&#34;&gt;good tutorial&lt;/a&gt; on how to burn iso’s with Nero).&lt;br/&gt;
Put the cdrom in your computer and reboot, when the BIOS kicks in you might need to press a key to get a boot menu and select the cdrom to boot from (on Dell computer, press F12). When you see the TRK boot screen (click on the image for a larger version):&lt;br/&gt;
&lt;a href=&#34;https://www.oiepoie.nl/pics/trk.gif&#34; target=&#34;_blank&#34;&gt;&lt;img align=&#34;right&#34; src=&#34;https://www.oiepoie.nl/pics/trk.png&#34;/&gt;&lt;/a&gt;&lt;br/&gt;
press enter to continue booting the default option. After a lot of text scrolling over your screen you will end up with a prompt, indicating that trinity as ready to obey your commands. To start scanning your computer for viruses, all you have to do is type in:&lt;br/&gt;
&lt;code&gt;virusscan -a avg&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This will mount all the Windows disks, update the virusscanner to the latest signatures and start scanning. Apart from selecting the &lt;b&gt;AVG&lt;/b&gt; virusscanner, you can also choose to use: ClamAV by specifying “clam”, Bitdefender (bde) and F-Prot (fprot). But we had very good results with AVG. Of course if you are really paranoid, you can run them all four sequentially.&lt;/p&gt;
&lt;p&gt;For the update to be successfull you will need an Internet connection  on the computer. If the computer is detached from the network, you can first boot TRK on a different computer with Internet and then give the command:&lt;br/&gt;
&lt;a class=&#34;extlink&#34; href=&#34;http://trinityhome.org/Home/index.php?wpid=46&amp;amp;front_id=12&#34; target=&#34;_blank&#34;&gt;updatetrk&lt;/a&gt;, this will update all four virusscanners and generate a new iso image from which you can burn a new updated cdrom.&lt;/p&gt;
&lt;p&gt;When one of the virusscanners has found something fishy and has deleted of renamed the file, you can reboot Windows and be sure that the rootkit is not operational anymore. It is wise (now you know the name of the malware) to run a targeted removal tool for the malware, because they will clean up the registry as well.&lt;/p&gt;
&lt;p&gt;Some other neat thing TRK can do is copy itself to an USB stick so you can boot it from there with &lt;b&gt;trk2usb&lt;/b&gt; or start a fileserver so you can access all the disks from an other computer on the same network with: &lt;b&gt;fileserver&lt;/b&gt;.&lt;br/&gt;
For a complete overview of it’s capabilities, type &lt;b&gt;trkhelp&lt;/b&gt; or have a look: &lt;a class=&#34;extlink&#34; href=&#34;http://trinityhome.org/trk/prtdocs/&#34; target=&#34;_blank&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;Have fun &amp;amp; stay clean…&lt;/i&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Leadtek Speeding Master GPS on Linux</title>
      <link>https://www.oiepoie.nl/2007/07/15/leadtek-speeding-master-gps-on-linux/</link>
      <pubDate>Sun, 15 Jul 2007 14:42:43 +0200</pubDate>
      
      <guid>https://www.oiepoie.nl/2007/07/15/leadtek-speeding-master-gps-on-linux/</guid>
      <description>&lt;p&gt;&lt;img align=&#34;right&#34; alt=&#34;LeadTek Speeding Master&#34; border=&#34;0&#34; src=&#34;https://www.oiepoie.nl/pics/leadtek_sm.jpg&#34;/&gt;&lt;br/&gt;
I can’t resist buying gadgets, even when they are of no practical use (and that’s the characteristic of most gadgets) i am drawn to buying it, firing it up, see how it works, peek in it’s insides and after that it mostly ends in a box in my overcrowded hobby room. So when i saw this GPS device for only 35 € i had to buy it, even when the device has an outdated Sirf II receiver and only works when attached to a power source. 35 € is just no money for such an ingenious device.&lt;/p&gt;
&lt;p&gt;The next thing is of course connect it to my Linux system and see how much trouble it will be to get things working. The Leadtek GPS is a RS232 serial device but comes with a serial to USB convertor. So when i plugged it in, the convertor registers on the system:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
# dmesg | tail
usb 4-1: new full speed USB device using uhci_hcd and address 2
usb 4-1: configuration #1 chosen from 1 choice
usbcore: registered new interface driver usbserial
drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
drivers/usb/serial/usb-serial.c: USB Serial Driver core
drivers/usb/serial/usb-serial.c: USB Serial support registered for pl2303
pl2303 4-1:1.0: pl2303 converter detected
usb 4-1: pl2303 converter now attached to ttyUSB0
usbcore: registered new interface driver pl2303
drivers/usb/serial/pl2303.c: Prolific PL2303 USB to serial adaptor driver
&lt;/pre&gt;
&lt;p&gt;And it shows up on a lsusb output:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
# lsusb
Bus 001 Device 001: ID 0000:0000
Bus 001 Device 004: ID 413c:a005 Dell Computer Corp.
Bus 001 Device 006: ID 0b97:7762 O2 Micro, Inc. Oz776 SmartCard Reader
Bus 001 Device 005: ID 0b97:7761 O2 Micro, Inc.
Bus 003 Device 001: ID 0000:0000
Bus 003 Device 002: ID 046d:c016 Logitech, Inc. M-UV69a Optical Wheel Mouse
Bus 004 Device 002: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 004 Device 001: ID 0000:0000
Bus 005 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
&lt;/pre&gt;
&lt;p&gt;To communicate with the GPS the documentation says the baudrate should be 38400 bits per second, so we will configure that for the first USB serial port and see what happens.&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
# /bin/stty -F /dev/ttyUSB0 speed 38400 raw cs8
38400
&lt;/pre&gt;
&lt;p&gt;&lt;i&gt;(i had to repeat the command twice on my system because the first time it reported back 9600 bps)&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;And Lo and Behold, there is the NMEA data spilling out:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
# cat &amp;lt; /dev/ttyUSB0
$GPGGA,120523.932,5210.0992,N,00430.9070,E,1,08,1.2,57.4,M,,,,0000*30
$GPRMC,120523.932,A,5210.0992,N,00430.9070,E,0.00,,080707,,,A*7A
$GPVTG,,T,,M,0.00,N,0.0,K,A*13
&lt;/pre&gt;
&lt;p&gt;Since humans are not optimally equipped for interpreting these sequences of data, we need a program to convert the messages into sensible information, for instance coordinates. I will use &lt;a class=&#34;extlink&#34; href=&#34;http://gpsd.berlios.de/&#34; target=&#34;_blank&#34;&gt;gpsd&lt;/a&gt; for this purpose. It&#39;s a daemon which can provide the information gathered from a GPS device to one or more clients even if they are not running locally. On my Fedora Core 6 system the program was available through yum:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
#yum -y install gpsd gpsd-clients
&lt;/pre&gt;
&lt;p&gt;First we will start it up in debug mode to see whether it understands our GPS:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
# gpsd -N -n -D 5 /dev/ttyUSB0
&lt;p&gt;gpsd: CLK 0x07
gpsd: Raw SiRF packet type 0x29 length 91: 2900000204059b02a5f30607d707080c143ed61f0000801f18412002b0f4cb000016f20000048f1500000000000000000000000000da0000018f00000000000002a35
c1100000000001c2453000000000000000000000000060800
gpsd: Raw SiRF packet type 0x02 length 41: 02003ba1d70004b582004c8357000000000000040802019b0043cb8006081d1a1c1b19000000000000
gpsd: MND 0x02: Navtype = 0x4, Status = 1, mode = 3
gpsd: &amp;lt;= GPS: $GPGGA,122016,5210.0993,N,00430.9087,E,1,06,1.60,12.3,M,46.766,M,,*44\x0d\x0a$GPRMC,122016,A,5210.0993,N,00430.9087,E,0.0000,0.000,080707,,&lt;em&gt;27\x0d\x0a$GPGSA,A,3,0
8,29,26,28,27,25,,,,,,,2.7,1.6,1.2&lt;/em&gt;3C
gpsd: Raw SiRF packet type 0x09 length 9: 09004300040028007c
gpsd: THR 0x09: SegStatMax=0.360, SegStatLat=  0, AveTrkTime=0.215, Last MS= -0
gpsd: Raw SiRF packet type 0x07 length 20: 07059b0043cb800600017a970016870f02a5f306
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;That&#39;s looking good, so now we can run it as intended:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
# gpsd -n /dev/ttyUSB0
&lt;/pre&gt;
&lt;p&gt;And have a client connect to finally show us our position:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
$ xgps -speedunits kph -altunits meters
&lt;/pre&gt;
&lt;p&gt;&lt;a href=&#34;https://www.oiepoie.nl/pics/xgps.png&#34; target=&#34;_blank&#34;&gt;&lt;img align=&#34;left&#34; alt=&#34;xgps display&#34; border=&#34;0&#34; src=&#34;https://www.oiepoie.nl/pics/xgps-small.png&#34; valign=&#34;bottom&#34;/&gt;&lt;/a&gt;&lt;br/&gt;
&lt;i&gt;&lt;font size=&#34;-1&#34;&gt;click on the image to see it in a seperate window&lt;/font&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;Now you could program a tomahawk missile with these coordinates and wipe me of the face of the earth (better ring first to see if i am at home, otherwise it would be a total waste of such an expensive missile). But before spending a million dollar on a rocket it might be interesting to know how accurate these coordinates are, otherwise you might wipe out my neigbhors, and they are perfectly amicable people.&lt;br/&gt;
One way of getting an impression is to build a so called scatter graph of the GPS data. The GPS outputs coordinate data approximately once every second, so we could collect one hour of coordinates and put them into a graph. The way to do this is actually very simple with gpsd:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
$ gpsprof -n 3600 | gnuplot -persist
gpsprof: looking for fix...first fix in 0.73sec, gathering samples...
&lt;/pre&gt;
&lt;p&gt;Here is the resulting graph:&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.oiepoie.nl/pics/gps_scatter_graph.png&#34; target=&#34;_blank&#34;&gt;&lt;img align=&#34;left&#34; alt=&#34;gps scatter graph&#34; border=&#34;0&#34; src=&#34;https://www.oiepoie.nl/pics/gps_scatter_graph-small.png&#34; valign=&#34;bottom&#34;/&gt;&lt;/a&gt;&lt;br/&gt;
&lt;i&gt;&lt;font size=&#34;-1&#34;&gt;click on the image to see it in a seperate window&lt;/font&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;This is all the help you will get from me, both in connecting the GPS device and in programming the missile with my home coordinates.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;&lt;b&gt;Have fun!&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>secure ssh access to your server</title>
      <link>https://www.oiepoie.nl/2007/06/03/secure-ssh-access-to-your-server/</link>
      <pubDate>Sun, 03 Jun 2007 13:30:26 +0200</pubDate>
      
      <guid>https://www.oiepoie.nl/2007/06/03/secure-ssh-access-to-your-server/</guid>
      <description>&lt;p&gt;&lt;b&gt;Every access to your system is a security threat.&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Let’s focus on &lt;a class=&#34;extlink&#34; href=&#34;http://en.wikipedia.org/wiki/Ssh&#34; target=&#34;_blank&#34;&gt;ssh (Secure Shell)&lt;/a&gt;.&lt;br/&gt;
Even when there is no know security bug for ssh, hackers might have found a way in which they share (or sell) between them and which hasn’t surfaced yet. Even if there is no security bug at all for ssh, access mostly depends on username/password combinations and we all know what a weak system that is, especially when used from untrusted systems.&lt;/p&gt;
&lt;p&gt;We can make life a little bit more secure by using a trick.&lt;br/&gt;
ssh access is blocked by default using iptables, but by visiting a secret URL on your website ssh access from that ip-address is turned on. You will still need username and password to access the box, but this way portscanners won’t detect an ssh server running.&lt;/p&gt;
&lt;p&gt;We will need a little script which extracts the ip-address from the computer which accessed the webpage. The script will generate a 404 Error page (and HTTP 404 Error headers to fool the clever hacker):&lt;/p&gt;
&lt;p&gt;[php]&lt;br/&gt;
&lt;?php #set some variables
$TMPFILE=&#34;/tmp/allow_sshd.tmp&#34;;
$IP=$_SERVER[&#34;REMOTE_ADDR&#34;];
&lt;p&gt;#open the file for writing, suppress errors (remove @ to see errors)
if(@$F = fopen(&amp;quot;$TMPFILE&amp;quot;,&amp;ldquo;w&amp;rdquo;)) {
#write the ip to the file
fputs($F,$IP);
#close the file
fclose($F);
}
header(&amp;ldquo;HTTP/1.1 404 Not Found&amp;rdquo;);
?&amp;gt;&lt;br/&gt;
&lt;br/&gt;&lt;/p&gt;
&lt;/p&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;title&gt;404 Not Found&lt;/title&gt;&lt;br/&gt;
&lt;h1&gt;Not Found&lt;/h1&gt;
&lt;p&gt;The requested URL /secret-url.php was not found on this server.&lt;/p&gt;
&lt;hr/&gt;
&lt;address&gt;Apache Server at &lt;a href=&#34;mailto:webmaster@yourserver.com&#34;&gt;www.yourserver.com&lt;/a&gt; Port 80&lt;/address&gt;
&lt;p&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
[/php]&lt;/p&gt;
&lt;p&gt;The ip-address is written to a file in /tmp. As you might have noticed, there is no variable passing in the URL (e.g. http://www.yourserver.com/secret-url.php?ip=192.168.10.1 ) because these are potential security loopholes. Also the script itself uses a simple message passing algorithm to get the relevant data (the ip-address) to iptables, this way there is no direct coupling between an global accessable webpage and iptables.&lt;/p&gt;
&lt;p&gt;We will use a bash script to read the ip-address and configure iptables:&lt;/p&gt;
&lt;p&gt;[code]&lt;br/&gt;
#!/bin/bash&lt;br/&gt;
TMPFILE=”/tmp/allow_sshd.tmp”&lt;br/&gt;
LOGFILE=”/var/log/allow_sshd.log”&lt;br/&gt;
IP=`&amp;lt; ${TMPFILE}`
DATE=`date`
# timeframe for communications to start:
SECONDS=&#34;300&#34;
LOCKFILE=&#34;/tmp/allow_sshd.lck&#34;
&lt;p&gt;if [ -s &amp;ldquo;${TMPFILE}&amp;rdquo; ] ; then
#check for a lock file
if [ ! -e &amp;ldquo;${LOCKFILE}&amp;rdquo; ] ; then
#create the lock file to prevent more than one of these running
/bin/touch ${LOCKFILE}
#write to the log
echo &amp;ldquo;${DATE}: SSHD started from ${IP}&amp;rdquo; &amp;gt;&amp;gt; ${LOGFILE}&lt;br/&gt;
#remove the temp file&lt;br/&gt;
/bin/rm -f ${TMPFILE} &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;/p&gt;&lt;/p&gt;
&lt;p&gt;        iptables -I INPUT -p tcp –dport 22 -s ${IP} -j ACCEPT&lt;br/&gt;
        #wait SECONDS&lt;br/&gt;
        sleep ${SECONDS}&lt;/p&gt;
&lt;p&gt;        iptables -D INPUT -p tcp –dport 22 -s ${IP} -j ACCEPT&lt;br/&gt;
        #remove the lock file to allow another copy to run&lt;br/&gt;
        /bin/rm -f ${LOCKFILE}&lt;br/&gt;
    else&lt;br/&gt;
        #log multiple copy attempts&lt;br/&gt;
        echo “${DATE}: SSHD multiple copy attempt!” &amp;gt;&amp;gt; ${LOGFILE}&lt;br/&gt;
        #remove temp file&lt;br/&gt;
        /bin/rm -f ${TMPFILE} &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br/&gt;
    fi&lt;br/&gt;
fi&lt;br/&gt;
[/code]&lt;/p&gt;
&lt;p&gt;The script needs to run every minute to check for new ip-addresses written to the tmp file, which is accomplished by using a crontab entry:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
* * * * * /usr/local/bin/allow-ssh.sh &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;br/&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;original version:&lt;/i&gt;&lt;br/&gt;
&lt;a class=&#34;extlink&#34; href=&#34;http://gentoo-wiki.com/TIP_turn_sshd_on_from_php&#34; target=&#34;_blank&#34;&gt;http://gentoo-wiki.com/TIP_turn_sshd_on_from_php&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>de ultieme hacker toolkit aan je sleutelhanger</title>
      <link>https://www.oiepoie.nl/2007/03/07/de-ultieme-hacker-toolkit-aan-je-sleutelhanger/</link>
      <pubDate>Wed, 07 Mar 2007 15:29:34 +0100</pubDate>
      
      <guid>https://www.oiepoie.nl/2007/03/07/de-ultieme-hacker-toolkit-aan-je-sleutelhanger/</guid>
      <description>&lt;p&gt;&lt;b&gt;20080309 update: Deze post gaat over BackTrack 2, ondertussen is BackTrack 3 beta beschikbaar, deze kan veel eenvoudiger op een USB stick geinstalleerd worden, je krijgt bovendien meer tools en de laatste versies:&lt;br/&gt;
&lt;a href=&#34;https://www.oiepoie.nl/2008/03/09/backtrack-3-on-a-usb-stick-ultimate-hacker-tool-on-your-keychain/&#34;&gt;Installing BackTrack 3 on a USB stick&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In Linux land kennen we al lang de zogenaamde “bootable distributions”, dat is een compleet Linux operating systeem plus alle applicaties op een cdrom of dvd die je in de computer kan stoppen om er vervolgens van te booten. Vervolgens heb je na een paar minuten een Linux desktop tot je beschikking zonder dat er ook maar een byte op je harde schijf wordt veranderd.&lt;/p&gt;
&lt;p&gt;Een afgeleide hiervan zijn de “bootable security distributions”, dit is hetzelfde verhaal, alleen is de cdrom volgepakt met security tools om b.v. het netwerk mee te scannen, wachtwoorden te testen op hun sterkte enz. Extra handig zijn de forensische tools waarmee je op de harde schijf van de geboote pc kan gaan zoeken naar informatie over het gebruik, b.v. browser gegevens maar ook gewiste bestanden zijn weer boven water te halen. Als je de harde schijf van de PC in read-only mode mount (mount -o r /dev/sda /media/disk) dan wordt er nog steeds geen byte op de disk veranderd.&lt;/p&gt;
&lt;p&gt;Belangrijk van security distro’s is vooral dat ze recente programmatuur bevatten. Enerzijds is dit vaak nodig om van de PC in kwestie te kunnen booten en goede ondersteuning te hebben voor de hardware in de PC, bv. (wireless) netwerkkaart, videodriver, enz. en anderzijds zijn de nieuwere tools doorontwikkeld en kunnen ze meer of werken ze sneller.&lt;/p&gt;
&lt;p&gt;Na Whoppix, Whax, Auditor, STD, Phlak en wat al niet meer, is de ster aan het firnament op dit moment &lt;a class=&#34;extlink&#34; href=&#34;http://www.remote-exploit.org/backtrack.html&#34; target=&#34;_blank&#34;&gt;BackTrack&lt;/a&gt;, te vinden op &lt;a class=&#34;extlink&#34; href=&#34;http://www.remote-exploit.org&#34; target=&#34;_blank&#34;&gt;www.remote-exploit.org&lt;/a&gt;.&lt;br/&gt;
Backtrack Final 2.0 is net uit en staat volgepakt met allerlei interessante software, het is ideaal om er mee te experimenteren op je eigen computer en te zien hoeveel informatie er achter blijft waarvan je het bestaan niet wist. Ook kan je goed testen of je eigen (wireless) netwerk veilig is voor hackers en of je wachtwoorden wel voldoende onkraakbaar zijn.&lt;/p&gt;
&lt;p&gt;Nog leuker wordt het als je backtrack om een 1GB USB stick zet en hem meeneemt om bij computers van kennisen de guru uit te hangen door in een minuutje hun brave windows PC om te toveren in een volwaardig hacker workstation. Terwijl je in een desktop het station “Secret Agent” van &lt;a class=&#34;extlink&#34; href=&#34;http://somafm.com/listen/&#34; target=&#34;_blank&#34;&gt;SomaFM&lt;/a&gt; draait, mount je hun harde schijf en vertel je welke websites ze de laatste tijd hebben bezocht, zo heb je je eigen “Shock and Awe” campagne.&lt;/p&gt;
&lt;p&gt;Behalve voor de security tools, is zo’n bootable usb omgeving ook bijzonder geschikt om zelf veilig van te werken, b.v. als je dingen op Internet wilt nakijken zonder het risico om spyware of virussen op te lopen, of om je e-mail te lezen zonder dat er (software)keyloggers of trojans zijn die “meekijken”, ook laat je geen history achter op de computer die je gebruikt hebt.&lt;/p&gt;
&lt;center&gt;&lt;b&gt;Hoe installeer je backtrack 2.0 op een USB stick?&lt;/b&gt;&lt;/center&gt;&lt;br/&gt;
&lt;br/&gt; &lt;br/&gt;
Download de iso, b.v. &lt;a class=&#34;extlink&#34; href=&#34;http://ftp.belnet.be/packages/backtrack/bt2final.iso&#34; target=&#34;_blank&#34;&gt;hier&lt;/a&gt; vandaan.&lt;br/&gt;
&lt;br/&gt; &lt;br/&gt;
Stop de USB stick in je PC, als die automatisch gemount wordt (meestal te zien aan pop-up windows met de inhoud v/d thumbdrive), sluit de windows en unmount de stick (kijkt met het command &lt;b&gt;mount&lt;/b&gt; en dan: &lt;b&gt;umount /dev/sd..&lt;/b&gt;).&lt;br/&gt;
Als er niets te zien is na het insteken v/d USB stick kan je met &lt;b&gt;dmesg | tail &lt;/b&gt; meestal wel zien als welk device het herkent wordt. In het verhaal hieronder gaan we uit van &lt;b&gt;/dev/sdb&lt;/b&gt; en ook moeten (bijna) alle commando’s als root worden uitgevoerd.
&lt;p&gt;Herpartitioneer de USB stick met:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
# fdisk /dev/sdb
&lt;/pre&gt;
&lt;p&gt;Maak twee partities:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
# fdisk /dev/sdb
&lt;p&gt;The number of cylinders for this disk is set to 2575.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;software that runs at boot time (e.g., old versions of LILO)&lt;/li&gt;
&lt;li&gt;booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Command (m for help): p&lt;/p&gt;
&lt;p&gt;Disk /dev/sdb: 1020 MB, 1020788224 bytes
129 heads, 6 sectors/track, 2575 cylinders
Units = cylinders of 774 * 512 = 396288 bytes&lt;/p&gt;
&lt;p&gt;Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            1              2575     996522  c  W95 FAT32 (LBA)&lt;/p&gt;
&lt;p&gt;Command (m for help): d
Selected partition 1&lt;/p&gt;
&lt;p&gt;Command (m for help): n
Command action
e   extended
p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2575, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-2575, default 2575): +760M&lt;/p&gt;
&lt;p&gt;Command (m for help): n
Command action
e   extended
p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (1895-2575, default 1895):
Using default value 1895
Last cylinder or +size or +sizeM or +sizeK (1895-2575, default 2575):
Using default value 2575&lt;/p&gt;
&lt;p&gt;Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): c
Changed system type of partition 1 to c (W95 FAT32 (LBA))&lt;/p&gt;
&lt;p&gt;Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): c
Changed system type of partition 2 to c (W95 FAT32 (LBA))&lt;/p&gt;
&lt;p&gt;Command (m for help): a
Partition number (1-4): 1&lt;/p&gt;
&lt;p&gt;Command (m for help): p&lt;/p&gt;
&lt;p&gt;Disk /dev/sdb: 1020 MB, 1020788224 bytes
129 heads, 6 sectors/track, 2575 cylinders
Units = cylinders of 774 * 512 = 396288 bytes&lt;/p&gt;
&lt;p&gt;Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1        1919      742650    c  W95 FAT32 (LBA)
/dev/sdb2            1920        2575      253872    c  W95 FAT32 (LBA)&lt;/p&gt;
&lt;p&gt;Command (m for help): w
The partition table has been altered!&lt;/p&gt;
&lt;p&gt;Calling ioctl() to re-read partition table.&lt;/p&gt;
&lt;p&gt;WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;en zet er de juiste filesystems op met:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
# mkfs.vfat -v /dev/sdb1
# mkfs.vfat -v /dev/sdb2
&lt;/pre&gt;
&lt;p&gt;De tweede partitie is alleen maar een handigheidje, je hebt nu de mogelijkheid om bij gebruik met backtrack om hier tijdelijke bestanden naar toe te kopieeren, maar je kan de stick ook nog steeds als gewone datadrager gebruiken onder b.v. Windows.&lt;/p&gt;
&lt;p&gt;Mount de backtrack iso via het loopback device en mount de eerste partitie v/d USB stick&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
# mkdir /FF
# mount -o loop bt2final.iso /FF
# mkdir /FF1
# mount -o rw /dev/sdb1 /FF1
&lt;/pre&gt;
&lt;p&gt;Kopieer de bestanden:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
# cd /FF1
# cp -r /FF/* .
&lt;/pre&gt;
&lt;p&gt;De partitie is net voldoende voor alles:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
# df -h /FF1
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb1             724M  4.0K  724M   1% /FF1
&lt;/pre&gt;
&lt;p&gt;Nu nog ervoor zorgen dat de USB stick bootable is, hiervoor heb je het pakket syslinux nodig. Als het niet op je computer staat kan je het met yum, apt-get, emerge, enz. installeren afhankelijk van je gebruikte distributie.&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
# umount /FF1
# syslinux /dev/sdb1
# cat /usr/lib/syslinux/mbr.bin &amp;gt; /dev/sdb
&lt;/pre&gt;
&lt;p&gt;Er is nog wat finetuning nodig voor syslinux om echt te kunnen booten:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
# mount -o rw /dev/sdb1 /FF1
# cd /FF1/boot/isolinux
#  perl -pe &#39;s#/boot/##&#39;  isolinux.cfg&amp;gt; /FF1/syslinux.cfg
# mv boot/vmlinuz .
# mv boot/initrd.gz .
# cd
# umount /FF1
&lt;/pre&gt;
&lt;p&gt;That’s all folks. Reboot, zorg dat de PC probeert op te starten van USB en backtrack start op en dan zie je:&lt;br/&gt;
&lt;/p&gt;&lt;center&gt;&lt;img src=&#34;https://www.oiepoie.nl/pics/bt2final.png&#34;/&gt;&lt;/center&gt;
&lt;p&gt;Mocht je geen linux systeem hebben, maar toch die bootable USB stick willen hebben, brand dan de backtrack iso die je hebt gedownload op cdrom en start daar van op, vervolgens heb je een linux systeem draaien en kan je het bovenstaande verhaal volgen.&lt;/p&gt;
&lt;p&gt;Tip: installeer &lt;a class=&#34;extlink&#34; href=&#34;http://www.vmware.com/products/server/&#34; target=&#34;_blank&#34;&gt;vmware server&lt;/a&gt;, maak een vrij kaal linux systeem aan&lt;br/&gt;
en laat vervolgens de cdrom drive verwijzen naar de backtrack iso. Nu zal in vmware backtrack worden geboot en kan je daar zonder restricties in&lt;br/&gt;
“spelen” en b.v. je host systeem via het vmware netwerk laten scannen.&lt;/p&gt;
&lt;p&gt;have fun!&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Caveat Lector!&lt;/b&gt;&lt;br/&gt;
Volgens de nieuwe wet Computercriminaliteit is het  voorradig hebben van hulpmiddelen die bedoeld zijn om niet alleen in te breken, maar ook gegevens op te slaan (onze 2e partitie?) of een systeem wederrechtelijk te gebruiken, strafbaar met maximaal vier jaar cel!&lt;/p&gt;
&lt;p&gt;Zie: &lt;a class=&#34;extlink&#34; href=&#34;http://www.iusmentis.com/beveiliging/hacken/computercriminaliteit/computervredebreuk/&#34; target=&#34;_blank&#34;&gt;De Wet Computercriminaliteit: Computervredebreuk&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Mijn intentie is om de USB stick prive te gebruiken om te controleren dat mijn eigen systemen veilig zijn en voor voorlichting van vrienden en kennissen, en dat is volkomen legaal (anders zou nl. iedere computergebruiker strafbaar zijn, want op ieder systeem staan wel programma’s die je kan gebruiken om te scannen of in te breken, b.v. ping tracert, telnet, enz. Het komt alleen op de kennis en de intentie van de gebruiker aan om ze ook als zodanig te gebruiken).&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Upgrading from fedora core 5 to core 6 on a dell d620 laptop without any hassle</title>
      <link>https://www.oiepoie.nl/2007/03/04/upgrading-from-fedora-core-5-to-core-6-on-a-dell-d620-laptop-without-any-hassle/</link>
      <pubDate>Sun, 04 Mar 2007 14:55:21 +0100</pubDate>
      
      <guid>https://www.oiepoie.nl/2007/03/04/upgrading-from-fedora-core-5-to-core-6-on-a-dell-d620-laptop-without-any-hassle/</guid>
      <description>&lt;p&gt;The main reason to upgrade to the (not so) new fedora release, was that i wanted the desktop eye candy that comes with compiz and beryl. On fedora core 5 i was forced to use the vesa display driver, but fedora core 6 had a much newer i810 display driver which should detect the i945GM graphics chipset on my D620.&lt;br/&gt;
After some googling around i decided to do the whole upgrade process through yum via the network and that proved to be surprisingly easy.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.oiepoie.nl/linux_on_d620/#upgrading_to_fc6&#34;&gt;Read on to see the steps involved…&lt;/a&gt;.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>High speed password cracking with John the Ripper</title>
      <link>https://www.oiepoie.nl/2007/02/11/high-speed-password-cracking-with-john-the-ripper/</link>
      <pubDate>Sun, 11 Feb 2007 20:08:06 +0100</pubDate>
      
      <guid>https://www.oiepoie.nl/2007/02/11/high-speed-password-cracking-with-john-the-ripper/</guid>
      <description>&lt;p&gt;&lt;a extlink=&#34;&#34; href=&#34;http://en.wikipedia.org/wiki/John_the_Ripper&#34; target=&#34;_blank class=&#34;&gt;John the Ripper&lt;/a&gt; has been out there for a long time, it’s a great tool for auditing passwords. How does it work, well simple: you take a password file with encrypted (or better hashed) passwords in it and give it to John. The program will first determine what kind of hash algorithm is used and will then start by taking normal words from an extensive wordlist and feed them one by one through the same hash algorithm. If the outcome matches with what is in the file that word is obviously the password.&lt;/p&gt;
&lt;p&gt;After John has exhausted the wordlist it will try variations on the words. It will start every word with a capital and do the whole list again, than it could try every word backwards, substitute all letter “o” with zero’s, “i” with ones, “s” with “$”, and so on. Since computers have become mindboggling fast it can try a massive amount of combinations in a relative short time.&lt;/p&gt;
&lt;p&gt;Since John the Ripper is around for a couple of years, it is written to be run on a single CPU. This is kind of a waste since we all got these dual core machines on our desks and even quad core’s or more in the servers in the racks. So how to make use of all this processing power?&lt;/p&gt;
&lt;p&gt;Luckily there is a patch for John which allows it to use the &lt;a class=&#34;extlink&#34; href=&#34;http://www.mpi-forum.org/&#34; target=&#34;_blank&#34;&gt;Message Passing Interface&lt;/a&gt; to run multiple instances simultaneously, you can download this version: &lt;a class=&#34;extlink&#34; href=&#34;http://www.bindshell.net/tools/johntheripper/john-1.7.2-bp17-mpi2.tar.gz&#34; target=&#34;_blank&#34;&gt;john-1.7.2-bp17-mpi2.tar.gz&lt;/a&gt;&lt;br/&gt;
and build it on your dual core box. Before the code will compile you need to install the MPI software, with yum on fedora this can be done with:&lt;/p&gt;
&lt;pre&gt;yum -y install openmpi*&lt;/pre&gt;
&lt;p&gt;next get the software (if not already done so), extract and move in there:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
wget http://www.bindshell.net/tools/johntheripper/john-1.7.2-bp17-mpi2.tar.gz
gtar zxvf john-1.7.2-bp17-mpi2.tar.gz
cd john-1.7.2-bp17-mpi2/src
&lt;/pre&gt;
&lt;p&gt;Make a small adaptation to the Makefile so it will work with openmpi:&lt;/p&gt;
&lt;pre&gt;
vim Makefile&lt;br/&gt;
:%s/mpicc/om-mpicc/g&lt;br/&gt;
:wq&lt;br/&gt;
&lt;/pre&gt;
&lt;p&gt;Now build the beast:&lt;/p&gt;
&lt;pre&gt;
make linux-x86-mmx
&lt;/pre&gt;
&lt;p&gt;If all goes well, you will see some warnings about pointers, but no errors and end up with a executable in &lt;b&gt;../run/john&lt;/b&gt;. Now change directory to&lt;br/&gt;
../run&lt;br/&gt;
and get hold of a shadow file, a .htaccess, a ldif with userpasswords, or anything  with hashed passwords you would like to reverse back to the original form. If you don’t have anything yourself use Google with the right query to find something on the Net.&lt;br/&gt;
Give John his first assignment with the commandline:&lt;/p&gt;
&lt;pre&gt;
om-mpirun -np 2 ./john -incremental my-hash-file.txt
&lt;/pre&gt;
&lt;p&gt;The “-np 2” means that the “Number of Processors” is 2.&lt;br/&gt;
This is also the value to use if you have a single CPU machine with hyperthreading enabled.&lt;/p&gt;
&lt;p&gt;Now if you want to get serious with decrypting hashed passwords, get the right wordlist for your language since people love to choose simple words they can easily remember. This is a good source:&lt;br/&gt;
&lt;a class=&#34;extlink&#34; href=&#34;ftp://ftp.mirrorgeek.com/openwall/wordlists/&#34; target=&#34;_blank&#34;&gt;ftp://ftp.mirrorgeek.com/openwall/wordlists&lt;/a&gt;&lt;br/&gt;
You can use the specific wordlist with John this way:&lt;/p&gt;
&lt;pre class=&#34;noscroll&#34;&gt;
om-mpirun -np 2 ./john --wordlist=dutch_lower.txt my-hash-file.txt
&lt;/pre&gt;
&lt;p&gt;So, when all is said and done, the main question remains. How fast is it?&lt;br/&gt;
Well John the Ripper has a build in benchmark function which you can&lt;br/&gt;
activate by using &lt;b&gt;john -test&lt;/b&gt;, you then get lots of data for&lt;br/&gt;
all different ciphers which John supports.&lt;/p&gt;
&lt;p&gt;I will take “FreeBSD MD5 [32/64 X2]” as a comparison metric.&lt;/p&gt;
&lt;p&gt;On my Pentium D920 desktop running at 3.4GHz with linux /proc/cpuinfo:&lt;/p&gt;
&lt;pre&gt;
&lt;/pre&gt;&lt;table&gt;&lt;tr&gt;
&lt;td&gt;cpu family&lt;/td&gt;&lt;td&gt;: 15&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt;model&lt;/td&gt;&lt;td&gt;: 6&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt;model name&lt;/td&gt;&lt;td&gt;: Intel(R) Pentium(R) D CPU 3.40GHz&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt;stepping&lt;/td&gt;&lt;td&gt;: 2&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;table border=&#34;1&#34;&gt;
&lt;tr&gt;
&lt;td&gt;dual cpu: &lt;/td&gt;
&lt;td&gt;Raw: 23511.00 c/s real&lt;/td&gt;
&lt;td&gt;23488.00 c/s virtual&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;single cpu: &lt;/td&gt;
&lt;td&gt;Raw: 11786.00 c/s real&lt;/td&gt;
&lt;td&gt;11786.00 c/s virtual&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;On my laptop: Core Duo CPU T2500 at 2.0GHz with linux /proc/cpuinfo:&lt;/p&gt;
&lt;pre&gt;
&lt;/pre&gt;&lt;table&gt;&lt;tr&gt;
&lt;td&gt;cpu family&lt;/td&gt;&lt;td&gt;: 6&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt;model&lt;/td&gt;&lt;td&gt;: 14&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt;model name&lt;/td&gt;&lt;td&gt;: Intel(R) CPU T2500  @ 2.00GHz&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;
&lt;td&gt;stepping&lt;/td&gt;&lt;td&gt;: 8&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;table border=&#34;1&#34;&gt;
&lt;tr&gt;
&lt;td&gt;dual cpu: &lt;/td&gt;
&lt;td&gt;Raw: 9622.00 c/s real&lt;/td&gt;
&lt;td&gt;10106.00 c/s virtual&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;single cpu: &lt;/td&gt;
&lt;td&gt;Raw: 5061.00 c/s real&lt;/td&gt;
&lt;td&gt;5061.00 c/s virtual&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;So what if this is not fast enough? There are two a number of roads you can take. There is &lt;b&gt;Distributed Network Attack&lt;/b&gt;, this is  like Seti at Home, where one master chops up the task at hand and delivers small chunks to thousands of computers which all complete the computations in spare processor time and then feed back the result to the master. The &lt;a class=&#34;extlink&#34; href=&#34;http://www.washingtonpost.com/wp-dyn/articles/A6098-2005Mar28.html&#34; target=&#34;_blank&#34;&gt;Secret Service&lt;/a&gt; has linked 4000 computers this way to try and decrypt passwords which it can’t break with “normal” supercomputer power.&lt;br/&gt;
You can build your own DNA password cracking universum by using &lt;a class=&#34;extlink&#34; href=&#34;http://freshmeat.net/projects/djohn/&#34; target=&#34;_blank&#34;&gt;Distributed John&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;An other way would be using &lt;a class=&#34;extlink&#34; href=&#34;http://en.wikipedia.org/wiki/Rainbow_tables&#34; target=&#34;_blank&#34;&gt;Rainbow Tables&lt;/a&gt; where every possible password is already translated to it’s hash value. So if you have a hash from a password file and you want to know to which password it belongs, you can just do a lookup in the giant rainbow table and find the password.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Caveat Lector!&lt;/b&gt;&lt;br/&gt;
Usage of tools like “John the Ripper” might be unlawfull or illegal in your country, if you want to test strenght of passwords on systems which are not your own, get written permission of the owner first.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>bootable security distro on your USB stick</title>
      <link>https://www.oiepoie.nl/2006/12/20/bootable-security-distro-on-your-usb-stick/</link>
      <pubDate>Wed, 20 Dec 2006 23:26:25 +0100</pubDate>
      
      <guid>https://www.oiepoie.nl/2006/12/20/bootable-security-distro-on-your-usb-stick/</guid>
      <description>&lt;p&gt;&lt;b&gt;20080309 update: This article covers BackTrack 2, you might want to consider reading the information on how to install BackTrack 3 beta on a USB stick. This is a much easier process, you will get more tools and the latest versions:&lt;br/&gt;
&lt;a href=&#34;https://www.oiepoie.nl/2008/03/09/backtrack-3-on-a-usb-stick-ultimate-hacker-tool-on-your-keychain/&#34;&gt;Installing BackTrack 3 on a USB stick&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Bootable linux security distributions come and go, first there was Whoppix, than it became Whax and parallel there also was Auditor. But now we have got &lt;a class=&#34;extlink&#34; href=&#34;http://www.remote-exploit.org/index.php/BackTrack&#34; target=&#34;_blank&#34;&gt;BackTrack&lt;/a&gt;. If Whoppix was the swiss army knife of a security auditor, than backtrack is his lightsword.&lt;/p&gt;
&lt;p&gt;So what can we do with &lt;b&gt;BackTrack&lt;/b&gt;? You can use it for security auditing, penetration testing, reconnaissance, wardriving, (wireless) network problem solving, actually a better question would be, what can’t you do with backtrack? &lt;/p&gt;
&lt;p&gt;So what’s the ultimate geeky thing to do with backtrack? Install it on a USB stick and turn any computer into a stealth auditor toolkit. Today’s 1 gigabyte USB sticks cost less than 20 euro and are all USB-2.0 compliant, so they are fast to boot from. It’s important to stay current with these security distro’s, because if you try a penetration test with old tools, you might as well not do it at all. So we will use the latest beta which is available at the time of writing (bt20061013) and show you how to install that on a bootable thumbdrive.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;step 1&lt;/b&gt;&lt;br/&gt;
Take the USB stick and plug it into a linux computer. If it mounts automagically, become root, type &lt;b&gt;mount&lt;/b&gt; and remember the device which belongs to the USB stick (mostly something like /dev/sdc) and &lt;b&gt;umount&lt;/b&gt; the device.&lt;br/&gt;
If it doesn’t mount automagically, type &lt;b&gt; dmesg | tail&lt;/b&gt; and you will see the device that was recognized by the kernel.&lt;br/&gt;
Now run fdisk on the device (e.g. &lt;b&gt;fdisk /dev/sdc&lt;/b&gt;) destroy all existing partitions and start a new (primary) one which starts at cylinder 1 and ends at &lt;b&gt;+650M&lt;/b&gt; which will suffice for the complete backtrack toolkit. Next you can create a second partition (also primary) which fills up the rest of the USB stick and will allow you to use it the way it was intended (for instance transporting files), but is can also come in very handy to put discovered forensic data on that partition. Change both types of the partition to &lt;b&gt;c&lt;/b&gt; which is W95 fat32 (lba). Don’t forget to make the first partition bootable.&lt;br/&gt;
Write the partition table to disk (USB drive) and exit fdisk. Now &lt;b&gt;fdisk -l /dev/sdc&lt;/b&gt; should give you something like:&lt;/p&gt;
&lt;pre&gt;
Disk /dev/sdc: 1020 MB, 1020788224 bytes
129 heads, 6 sectors/track, 2575 cylinders
Units = cylinders of 774 * 512 = 396288 bytes
&lt;p&gt;Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1        1641      635064    c  W95 FAT32 (LBA)
/dev/sdc2            1642        2575      361458    c  W95 FAT32 (LBA)
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Next, put a filesystem on both partitions with:&lt;br/&gt;
&lt;b&gt;mkfs.vfat -v /dev/sdc1&lt;/b&gt;&lt;br/&gt;
and repeat that for &lt;b&gt;/dev/sdc2&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;step 2&lt;/b&gt;&lt;br/&gt;
If you haven’t downloaded bt20061013.iso do so now and mount the iso image via the loopback device:&lt;br/&gt;
&lt;b&gt;mount -r -o loop /data/iso/bt20061013.iso /FF4/&lt;/b&gt;&lt;br/&gt;
also mount the first partition of our USB drive:&lt;br/&gt;
&lt;b&gt;mount -o rw /dev/sdc1 /FF&lt;/b&gt;&lt;br/&gt;
and start copying:&lt;br/&gt;
&lt;b&gt; cd /FF4/&lt;br/&gt;
cp -r * /FF/&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;step 3&lt;/b&gt;&lt;br/&gt;
To make the device bootable we will use the syslinux package, if it’s not on your linux system install it with &lt;b&gt;yum install syslinux&lt;/b&gt; (or use emerge, apt-get, or whatever). Now do the magic:&lt;/p&gt;
&lt;pre&gt;
# umount /FF
# syslinux /dev/sdc1
# cat /usr/lib/syslinux/mbr.bin &amp;gt; /dev/sdc
&lt;/pre&gt;
&lt;p&gt;and there are a few more steps to make it really work:&lt;/p&gt;
&lt;pre&gt;
# mount -o rw /dev/sdc1 /FF
# cd /FF
# perl -pe &#39;s/boot\///&#39; isolinux.cfg &amp;gt; syslinux.cfg
# mv boot/vmlinuz .
# mv boot/initrd.gz .
# cd
# umount /FF
&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;step 4&lt;/b&gt;&lt;br/&gt;
put the USB drive in your computer and reboot and see if it boot’s from the USB stick. You might need to alter your BIOS settings for this to happen, or hit some kind of magic key during startup (my DELL laptop requires F12). If all goes well you will end up with:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://www.oiepoie.nl/pics/backtrack.jpg&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Have fun! and don’t forget to read the &lt;a extlink=&#34;&#34; href=&#34;http://www.remote-exploit.org/index.php/Tutorials&#34; target=&#34;_blank class=&#34;&gt;tutorials&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Windows&lt;/b&gt;&lt;br/&gt;
If you are on a Windows system and don’t have Linux installed, you can still follow the same procedure by downloading and booting &lt;a extlink=&#34;&#34; href=&#34;http://www.knopper.net/knoppix/index-en.html&#34; target=&#34;_blank class=&#34;&gt;knoppix&lt;/a&gt;. When the backtrack iso is on your C: or D: drive, knoppix will automatically mount and show these drives, and you can still mount the iso via the loopback device (-o loop) as described above.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Other ways of playing around with backtrack&lt;/b&gt;&lt;br/&gt;
Apart from booting backtrack from USB stick (or from cdrom) there is another very conveniant way of using this distro, and thats by running it inside &lt;a class=&#34;extlink&#34; href=&#34;http://www.vmware.com/download/server/&#34; target=&#34;_blank&#34;&gt;VMware Server&lt;/a&gt;. You can use vmware server for free, but you have to &lt;a class=&#34;extlink&#34; href=&#34;http://register.vmware.com/content/registration.html&#34; target=&#34;_blank&#34;&gt;register&lt;/a&gt;.&lt;br/&gt;
&lt;a class=&#34;extlink&#34; href=&#34;http://www.markwilson.co.uk/blog/2006/08/installing-vmware-server-on-fedora.htm&#34; target=&#34;_blank&#34;&gt;Here&lt;/a&gt; is a nice installation guide how to install vmware server on Fedora Core 5. After that you can just fire up vmware console and click together a new Linux machine.  In “virtual mchine settings” the cdrom device should point towards your backtrack iso and after that power on the machine. Click the button to switch to full-screen, login as root (password toor) and type startx. You can still switch back forth to your host window manager by using &lt;b&gt;CRTL-ALT-F7&lt;/b&gt; and &lt;b&gt;CTRL-ALT-F8&lt;/b&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a class=&#34;extlink&#34; href=&#34;http://digg.com/submit?phase=2&amp;amp;url=https://www.oiepoie.nl/2006/12/20/bootable-security-distro-on-your-usb-stick/&amp;amp;title=bootable%20backtrack%20security%20distro%20on%20a%20USB%20stick&amp;amp;bodytext=Transform%20your%20laptop%20in%20a%20security%20auditor%20toolkit%20in%20a%20few%20seconds%20by%20booting%20a%20backtrack%20distribution%20from%20a%201GB%20USB%20stick&amp;amp;topic=security&#34; target=&#34;_blank&#34;&gt;Digg This!&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;N.B.&lt;br/&gt;
In most countries it’s only legal to use the auditing, scanning, and forensic tools on your own computer. Use at your own risk!&lt;/b&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>terughalen van verloren gewaande bestanden met Linux en foremost</title>
      <link>https://www.oiepoie.nl/2006/11/12/terughalen-van-verloren-gewaande-bestanden-met-linux-en-foremost/</link>
      <pubDate>Sun, 12 Nov 2006 14:53:20 +0100</pubDate>
      
      <guid>https://www.oiepoie.nl/2006/11/12/terughalen-van-verloren-gewaande-bestanden-met-linux-en-foremost/</guid>
      <description>&lt;p&gt;Voor iedereen die wat met computers doet is het bijna een bekend probleem, een kennis heeft een digitale camera en om een of andere reden zijn alle foto’s van zijn geheugenkaartje verdwenen, of je ze even terug wilt halen.&lt;br/&gt;
Met de juiste tools is dit vaak vrij gemakkelijk. Het kaartje is bijvoorbeeld geformatteerd en dan lijkt het leeg, maar gelukkig staan alle bestanden er nog gewoon op.&lt;br/&gt;
Soms komen ook de standaard tools er niet uit en dan zijn er voor Linux altijd nog een aantal speciale forensische programma’s die je kan proberen. Een daarvan is &lt;a class=&#34;extlink&#34; href=&#34;http://foremost.sourceforge.net&#34; target=&#34;_blank&#34;&gt;foremost&lt;/a&gt; een programma dat het medium in kwestie afscant op bekende headers, footers en data structuren en vervolgens de bijbehorende bestanden weer terughaalt. Foremost is ontwikkeld door &lt;a class=&#34;extlink&#34; href=&#34;http://www.dtic.mil/afosi/&#34; target=&#34;_blank&#34;&gt;Air Force Office of Special Investigations&lt;/a&gt; en &lt;a class=&#34;extlink&#34; href=&#34;http://cisr.nps.edu/&#34; target=&#34;blank&#34;&gt;The Center for Information Systems Security Studies and Research&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Normaliter staat op een opslagmedium zoals harddisk of smartcard een zogenaamde “File Allocation Table”, in deze FAT is te vinden welke bestanden er op het medium staan en waar ze te vinden zijn (vergelijk het met een kaartenbak). Als de FAT afwezig of corrupt is, kan het besturingssysteem geen bestanden meer vinden en biedt het meestal aan om het medium te formatteren zodat het weer bruikbaar wordt.&lt;br/&gt;
Foremost kijkt niet naar de FAT maar begint het medium byte voor byte te lezen en vergelijkt de informatie met bekende headers. Zo begint een jpg bestand bijvoorbeeld met:&lt;br/&gt;
&lt;b&gt;FF D8 FF&lt;/b&gt;&lt;br/&gt;
en eindigt het met:&lt;br/&gt;
&lt;b&gt;FF D9&lt;/b&gt;&lt;br/&gt;
Ook (bijna) alle andere bestanden hebben dit soort unieke headers. In Linux gebruikt b.v. het &lt;b&gt;file&lt;/b&gt; commando deze informatie om terug te geven wat voor soort bestand het is, dus zonder te kijken naar de extensie.&lt;/p&gt;
&lt;p&gt;Om het xD kaartje te kunnen uitlezen op mijn fedora core 5 laptop sloot ik een Medion USB2 16-card reader aan van de aldi. Helaas ging dat niet onmiddelijk goed, de blauwe leesled bleef maar knipperen en &lt;b&gt;dmesg | tail&lt;/b&gt; gaf foutmeldingen als:&lt;/p&gt;
&lt;pre&gt;
usb 1-7: new high speed USB device using ehci_hcd and address 11
usb 1-7: device descriptor read/all, error -71
&lt;/pre&gt;
&lt;p&gt;Dit lijkt een of andere bug te zijn is het USB2 subsysteem van linux. Onder Windows zou dit meteen einde oefening zijn, maar met Linux kan je b.v. het USB2 gedeelte uit de kernel verwijderen met:&lt;br/&gt;
&lt;b&gt;rmmod ehci_hcd&lt;/b&gt;&lt;br/&gt;
en dan komt het kaartje alsnog netjes via USB1 beschikbaar:&lt;/p&gt;
&lt;pre&gt;
[super@zorax ~]# fdisk -l /dev/sdd
&lt;p&gt;Disk /dev/sdd: 65 MB, 65536000 bytes
8 heads, 32 sectors/track, 500 cylinders
Units = cylinders of 256 * 512 = 131072 bytes&lt;/p&gt;
&lt;p&gt;Device Boot      Start         End      Blocks   Id  System
/dev/sdd1   *           1         500       63972+   1  FAT12
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;mounten wilde niet lukken (bekende melding:&lt;br/&gt;
&lt;i&gt;mount: wrong fs type, bad option, bad superblock on /dev/sdd1,&lt;/i&gt; )&lt;br/&gt;
dus heb ik eerst maar eens een kopie gemaakt op harddisk om alle info&lt;br/&gt;
veilig te stellen:&lt;/p&gt;
&lt;pre&gt;dd if=/dev/sdd1 of=m-xd-card.iso&lt;/pre&gt;
&lt;p&gt;Met: &lt;/p&gt;
&lt;pre&gt;hexview -C m-xd-card.iso | less&lt;/pre&gt;
&lt;p&gt;kan je een indruk krijgen of er nog wat te redden valt. Als je allemaal &lt;b&gt;00&lt;/b&gt; ziet dan is er niets meer van te maken. Of:&lt;/p&gt;
&lt;pre&gt;strings m-xd-card.iso | grep -i jpg&lt;/pre&gt;
&lt;p&gt;Foremost stond nog niet op mijn systeem, dus ik heb het eerst geinstalleerd met:&lt;/p&gt;
&lt;pre&gt;yum install foremost&lt;/pre&gt;
&lt;p&gt;en daarna was het een kwestie van:&lt;/p&gt;
&lt;pre&gt;foremost -t jpg m-xd-card.iso&lt;/pre&gt;
&lt;p&gt;en alle jpg plaatjes kwamen boven water in de directory output/jpg&lt;/p&gt;
&lt;pre&gt;
[super@zorax ~]# ls output/jpg/
00000105.jpg  00006729.jpg  00013225.jpg  00018665.jpg  00024073.jpg  00029737.jpg  00035113.jpg
00001449.jpg  00008041.jpg  00014601.jpg  00019881.jpg  00025417.jpg  00031081.jpg  00036457.jpg
00002857.jpg  00010665.jpg  00016009.jpg  00021321.jpg  00026857.jpg  00032425.jpg  00037737.jpg
00005609.jpg  00012041.jpg  00017449.jpg  00022729.jpg  00028297.jpg  00033833.jpg
&lt;/pre&gt;
</description>
    </item>
    
    <item>
      <title>Hoe laat is het in …</title>
      <link>https://www.oiepoie.nl/2006/09/17/hoe-laat-is-het-in/</link>
      <pubDate>Sun, 17 Sep 2006 22:49:13 +0200</pubDate>
      
      <guid>https://www.oiepoie.nl/2006/09/17/hoe-laat-is-het-in/</guid>
      <description>&lt;p&gt;Ik schreef laatst een stukje over tijdzone’s in linux en daarna viel het me op dat ik via Google af en toe zoekopdrachten binnen kreeg die op zoek waren naar de tijd in een bepaald land. Nu heb ik in PHP een script geschreven waarmee je kan zien hoe laat het is in diverse landen en plaatsen is die in allerlei verschillende tijdzones zitten. Dat klinkt iets makkelijker dan het is omdat we nu eenmaal zitten opgescheept met die zomertijd en sommige landen doen ook aan zomertijd en andere niet. Bovendien begint de zomertijd per land ook nog al eens verschillend, zo is de zomertijd in Australië precies tegenovergesteld aan die van ons. Anyway kijk maar eens op &lt;a href=&#34;https://www.oiepoie.nl/tijd&#34;&gt;Hoe laat is het in…&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Installing Fedora Core 5 on a Dell D620 laptop</title>
      <link>https://www.oiepoie.nl/2006/08/27/installing-fedora-core-5-on-a-dell-d620-laptop/</link>
      <pubDate>Sun, 27 Aug 2006 22:56:03 +0200</pubDate>
      
      <guid>https://www.oiepoie.nl/2006/08/27/installing-fedora-core-5-on-a-dell-d620-laptop/</guid>
      <description>&lt;p&gt;Here is a article dedicated to how i went with installing &lt;a href=&#34;https://www.oiepoie.nl/linux_on_d620/&#34;&gt;Fedora Core 5 on a Latitude D620&lt;/a&gt;, most things work right out of the box and some (wirelss for instance) need a little tweaking. The challenge this time is to see whether i can keep SELinux in enforcing mode. In the past i have always switched back to permissive mode, because that’s the fastest way to get things working, but this time i will try and keep the beast activated.&lt;/p&gt;
&lt;p&gt;If you want a Linux distro on your D620 that works in one go, it seems that &lt;a extlink=&#34;&#34; href=&#34;http://www.ubuntu.com/&#34; target=&#34;_blank class=&#34;&gt;Ubuntu&lt;/a&gt; is your best bet.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>video filmpjes op een iAudio U3 via Linux</title>
      <link>https://www.oiepoie.nl/2006/08/01/video-filmpjes-op-een-iaudio-u3-via-linux/</link>
      <pubDate>Tue, 01 Aug 2006 12:06:03 +0200</pubDate>
      
      <guid>https://www.oiepoie.nl/2006/08/01/video-filmpjes-op-een-iaudio-u3-via-linux/</guid>
      <description>&lt;p&gt;&lt;img align=&#34;right&#34; alt=&#34;iAudio U3&#34; border=&#34;0&#34; src=&#34;https://www.oiepoie.nl/pics/iaudio-u3.jpg&#34; valign=&#34;top&#34;/&gt;Af en toe is het weer tijd voor een nieuwe MP3 speler. De oude heeft te weinig capaciteit, meestal is de accu binnen een uur uitgeput en als gadget-junkie moet de drang naar nieuwe gadgets nu eenmaal bevredigd worden.&lt;/p&gt;
&lt;p&gt;Een iPod is natuurlijk helemaal hip om te hebben, maar zo’n iPod nano kan bijvoorbeeld geen &lt;a class=&#34;extlink&#34; href=&#34;http://nl.wikipedia.org/wiki/Ogg_Vorbis&#34; target=&#34;_new&#34;&gt;Ogg Vorbis&lt;/a&gt; aan en heeft zelfs niet eens de mogelijkheid om videofilmpjes af te spelen. Een iPod video vond ik te groot en te duur, dus het is een &lt;b&gt;Cowon iAudio U3&lt;/b&gt; geworden. Subliem geluid, ondersteund alle standaarden: MP3, WMA, OGG Vorbis, JPEG, XviD, WAV, TXT, FLAC, MPEG4 en heeft een 260K TFT-LCD Display met 160×128 pixels (formaatje postzegel, maar wel vlijmscherp beeld). Je kan er dus ook je foto’s op bekijken, radio mee luisteren of geluid opnemen met de bijzonder gevoelige microfoon.&lt;br/&gt;
Officieel wordt Linux niet genoemd als ondersteund platform, maar je kan het apparaat mounten (USB stekker aansluiten, met &lt;b&gt;dmesg | tail&lt;/b&gt; kijken welk device eraan is toegekend, b.v. &lt;b&gt;/dev/sda&lt;/b&gt; en dat dan mounten met: &lt;b&gt;mkdir /iAudio ; mount /dev/sdb /iAudio&lt;/b&gt;) en bestanden heen en weer kopieeren.&lt;/p&gt;
&lt;p&gt;Als je fimpjes wilt omzetten zodat ze op de U3 te bekijken zijn kan dat heel goed met mencoder (meegeleverd in het mplayer package). Output formaat moet 160×128 pixels zijn met 15 frames per seconde. Dat gaat als volgt:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
mencoder orgineel.ext -quiet -oac pcm -ovc xvid -ofps 15 -vf scale=160:-2 -xvidencopts bitrate=256:vhq=4:me_quality=4:max_bframes=0 -o film.avi&lt;br/&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Uiteraard vervang je &lt;i&gt; orgineel.ext&lt;/i&gt; door de naam van het video bestand dat je wilt converteren. Hierna moet er nog een slag plaatsvinden om het geluid te converteren van &lt;a class=&#34;extlink&#34; href=&#34;http://en.wikipedia.org/wiki/Pulse-code_modulation&#34; target=&#34;_new&#34;&gt;PCM&lt;/a&gt; naar MP3:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
transcode -i film.avi -P1 -b 0,1 -o U3-film.avi&lt;br/&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;En nu kan het bestand U3-film in de movie folder op je U3 geplaatst worden.&lt;/p&gt;
&lt;p&gt;Wat een erg hoge “coolness” factor heeft is om het journaal op die manier te kijken. Met mplayer kan je zo de laatste versie van het journaal streaming bekijken:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
mplayer &#39;rtsp://streams3.omroep.nl/tv/nos/journaal/bb.laatste.rm&#39;&lt;br/&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Dus voor het opslaan naar disk en slechts een kleine wijziging nodig:&lt;br/&gt;
&lt;code&gt;&lt;br/&gt;
mplayer -dumpstream -dumpfile journaal.rm &#39;rtsp://streams3.omroep.nl/tv/nos/journaal/bb.laatste.rm&#39;&lt;br/&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Vervolgens journaal.rm met mencode omzetten, door transcode halen en voila. De ondertitels zijn nog net (maar dan ook net) leesbaar. &lt;/p&gt;
&lt;p&gt;Ik heb een klein programma in Perl gescheven wat alle video files in een directory in een keer kan converteren naar het juiste formaat&lt;/p&gt;
&lt;p&gt;[perl]&lt;br/&gt;
#!/usr/bin/perl&lt;br/&gt;
# (c) 20060801 by Ewald&lt;/p&gt;
&lt;p&gt;use strict;&lt;/p&gt;
&lt;p&gt;my $DEBUG = 0;&lt;br/&gt;
my @files = glob( “*.mp4” );    # get files to work on&lt;br/&gt;
my $out1;&lt;br/&gt;
my $out2;&lt;br/&gt;
my $org;&lt;/p&gt;
&lt;p&gt;foreach my $file ( @files ) {&lt;br/&gt;
        next if -d $file;       # directory?&lt;br/&gt;
        next if -z $file;       # zero byte ?&lt;br/&gt;
        $DEBUG &amp;amp;&amp;amp; print “$file\n”;&lt;br/&gt;
        $org = $file;&lt;br/&gt;
        $file =~ tr/A-Z/a-z/;                   # lowercase&lt;br/&gt;
        $file =~ tr/\ /_/;                      # get rid of spaces&lt;br/&gt;
        $file =~ s/[\’\”\[\]\(\)\$\&amp;amp;]//g;       # get rid of special char’s&lt;br/&gt;
        $file =~ s/\.mp4$//;                    # strip extension&lt;br/&gt;
        $DEBUG &amp;amp;&amp;amp; print “$file\n”;&lt;br/&gt;
        $org =~ s/(.)/\\$1/g;           # escape everything for the shell&lt;br/&gt;
        $out1 = $file . “.avi”;&lt;br/&gt;
        print “transcoding $file\n”;&lt;br/&gt;
        $DEBUG &amp;amp;&amp;amp; print “mencoder $org -quiet -oac pcm -ovc xvid -ofps 15 -vf scale=160:-2 -xvidencopts bitrate=256:vhq=4:me_quality=4:max_bframes=0 -o $out1\n”;&lt;br/&gt;
        qx(mencoder $org -quiet -oac pcm -ovc xvid -ofps 15 -vf scale=160:-2 -xvidencopts bitrate=256:vhq=4:me_quality=4:max_bframes=0 -o $out1);&lt;br/&gt;
        $out2 = “U3_” . $out1;&lt;br/&gt;
        $DEBUG &amp;amp;&amp;amp; print “transcode -i $out1 -P1 -b 0,1 -o $out2\n”;&lt;br/&gt;
        qx(transcode -i $out1 -P1 -b 0,1 -o $out2);&lt;br/&gt;
        unlink $out1;                           # remove intermediate file&lt;br/&gt;
        $DEBUG &amp;amp;&amp;amp; exit 0;                       # in debug we run only once&lt;br/&gt;
        }&lt;br/&gt;
[/perl]&lt;br/&gt;
Het programma is ook te downloaden: &lt;a href=&#34;https://www.oiepoie.nl/cvt2u3.pl&#34;&gt;cvt2u3.pl&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;have fun!&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Radio 1 nieuws luisteren met Linux</title>
      <link>https://www.oiepoie.nl/2006/07/26/radio-1-nieuws-luisteren-met-linux/</link>
      <pubDate>Wed, 26 Jul 2006 14:23:15 +0200</pubDate>
      
      <guid>https://www.oiepoie.nl/2006/07/26/radio-1-nieuws-luisteren-met-linux/</guid>
      <description>&lt;p&gt;Ik wil zelf graag op de hoogte blijven van het nieuws maar als ik op de klok kijk of het tijd is voor het journaal is het altijd te vroeg of te laat. Zelfs als de radio aan is ben ik vaak druk met andere dingen bezig zodat ik het journaal niet bewust hoor.&lt;br/&gt;
De oplossing is natuurlijk het journaal laten afspelen op het moment dat je de tijd wilt nemen om te luisteren. Met een beetje debuggen op de website vindt je de eigenlijke URL waar de stream met het journaal is verstopt. Vervolgens kan je die makkelijk vanaf de commandline afspelen met:&lt;/p&gt;
&lt;pre&gt;
mms://cachemedia.omroep.nl/rambo01/0/nos/radio1nieuws/NOS_Nieuws.wma
&lt;/pre&gt;
&lt;p&gt;Het bufferen van mplayer duurt even, maar daarna kan je tijdens het afspelen met alle vier de pijltjes toetsen voor- of achteruit “spoelen” in de stream.&lt;/p&gt;
&lt;p&gt;Als je zo’n stream zou willen opslaan op disk onder Linux moet je eens kijken naar het pakket &lt;a class=&#34;extlink&#34; href=&#34;http://savannah.nongnu.org/projects/mimms/&#34; target=&#34;_new&#34;&gt;mimms&lt;/a&gt;. &lt;/p&gt;
&lt;pre&gt;
mimms -o journaal.wma mplayer mms://streams.omroep.nl/nos/radio1nieuws/NOS_Nieuws.wma
&lt;/pre&gt;
&lt;p&gt;Uiteraard moet je het copyright van het aangebodene in de gaten houden, niet alles mag opgeslagen worden.&lt;br/&gt;
Het is met mimms ook mogelijk om video streams op te nemen.&lt;/p&gt;
&lt;p&gt;Om zelf makkelijk stream URL’s te vinden terwijl je met je browser aan het klikken bent is&lt;br/&gt;
&lt;a class=&#34;extlink&#34; href=&#34;http://freshmeat.net/projects/streamsniff/&#34; target=&#34;_new&#34;&gt;streamsniff&lt;/a&gt; bijzonder handig.&lt;br/&gt;
streamsniff kan je als root gewoon opstarten en vervolgens met &lt;a href=&#34;https://www.oiepoie.nl/firefox&#34;&gt;firefox&lt;/a&gt; (of desnoods IE) op websites klikken waar multimedia content staat.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Truuk&lt;/b&gt;&lt;br/&gt;
Om te zoeken welke shoutcast streams er zijn om via Internet radio te luisteren kan je op de volgende&lt;br/&gt;
&lt;a class=&#34;extlink&#34; href=&#34;http://www.google.nl/search?hl=nl&amp;amp;q=site%3Ashoutcast.omroep.nl+Title&#34; target=&#34;_blank&#34;&gt;Google Query&lt;/a&gt; klikken.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Tip&lt;/b&gt;&lt;br/&gt;
Zelf luister ik graag naar &lt;a class=&#34;extlink&#34; href=&#34;http://www.radioparadise.com&#34; target=&#34;_blank&#34;&gt;Radio Paradise&lt;/a&gt;, lekkere muziek zonder reclames.&lt;br/&gt;
Ze hebben diverse streams om online te luisteren, een daarvan is een 64 kbps AAC stream die vergelijkbaar qua kwaliteit is met 128 kbps mp3. Om deze stream onder Linux te luisteren kan je VLC (VideoLan Client) gebruiken:&lt;/p&gt;
&lt;pre&gt;
vlc http://www.radioparadise.com/musiclinks/rp_64aac-2.m3u
&lt;/pre&gt;
</description>
    </item>
    
  </channel>
</rss>
