<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" 
   xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" 
   xmlns:html="http://www.w3.org/1999/html" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
<channel>
   <title>Mast Kalandar</title>
   <link>http://www.imsc.res.in/~kapil/blog</link>
   <description>bandar's colander of random jamun aur aam</description>
   <language>en</language>
   <copyright>Copyright 2008 Kapil Hari Paranjape</copyright>
   <ttl>60</ttl>
   <pubDate>Thu, 10 Jul 2008 11:37 GMT</pubDate>
   <managingEditor>kapil@imsc.res.in</managingEditor>
   <generator>PyBlosxom http://pyblosxom.sourceforge.net/ 1.3.2 2/13/2006</generator>
<item>
   <title>DNS cache poisoning quickfix</title>
   <guid isPermaLink="false">lg/dns_quickfix-2008-07-10-17-07</guid>
   <link>http://www.imsc.res.in/~kapil/blog/lg/dns_quickfix-2008-07-10-17-07.html</link>
   <description><![CDATA[

  <p>A number of security sites have announced a DNS protocol problem which
  was discovered by Dan Kaminsky. For example the advisories for
  Debian are at:</p>

  <ul>
    <li><a href=
    "http://www.debian.org/security/2008/dsa-1605">DSA-1605
    glibc</a> - DNS cache poisoning</li>

    <li><a href=
    "http://www.debian.org/security/2008/dsa-1604">DSA-1604
    bind</a> - DNS cache poisoning</li>

    <li><a href=
    "http://www.debian.org/security/2008/dsa-1603">DSA-1603
    bind9</a> - DNS cache poisoning</li>
  </ul>

  <p>The attack works if the victim machine uses a predictable
  source port when it makes DNS queries. Thus the current solution
  to the problem is to try to randomize the source port of the
  query.</p>

  <p>Now, the default resolving library that is part of glibc and
  the resolver that comes with BIND 8 do <em>not</em> randomise
  source ports and are thus subject to attack. This means that
  until glibc is patched <em>every</em> machine that uses glibc is
  vulnerable unless one installs a source port randomising DNS
  caching resolver on each such machine.</p>

  <p>Here is what <em>appears</em> to be a simpler alternative:</p>
  <pre>
<code>
iptables -t nat -A POSTROUTING -o ! lo -p udp --dport 53 \
    -j MASQUERADE --to-ports 1024-65535 --random

iptables -t nat -A POSTROUTING -o ! lo -p tcp --dport 53 \
    -j MASQUERADE --to-ports 1024-65535 --random
</code>
</pre>

  <p><em>WARNING</em>: The above suggestion may or may not work and
  may break your machine in all kinds of awful ways!</p>

  <p>Will someone more knowledgable than me about the various RFC's
  confirm whether this would indeed be a "quickfix"?</p>

  <p>Ideally, we should expect a suitably patched glibc soon and that
  would be a better solution</p>

  <p><em>Update</em>: The <code>--random</code> switch only works in
  Linux kernels with version at least 2.6.22</p>

  <p><em>Update 2</em>: (Thanks to
  <a href="http://linuxmafia.com/~rick/">Rick Moen</a>).</p>
  
  <ul>
  	<li>The <code>--random</code> switch
  	<a
  	href="http://cipherdyne.org/blog/2008/07/mitigating-dns-cache-poisoning-attacks-with-iptables.html">only
	works</a> with Linux kernels with version at least
	<em>2.6.24</em></li>

  	<li>There is a <a
  	href="http://addxorrol.blogspot.com/2008/07/on-dans-request-for-no-speculation.html">good
  	analysis</a> of the vulnerability which points to additional
  	fake records added to fake responses to queries for domains that
  	do not exist.
   </ul>

   <p>What this means is that the above quickfix will not work well
   enough if you run a caching DNS server. You must patch the
   source for such a caching DNS server.</p>

   <p>Secondly, you cannot really use the above quickfix on a machine
   that provides UDP-based services for remote clients. Those clients
   may just happen send your service a query from the source port 53
   and will get a response from a randomised port in return! For example,
   you cannot use the above fix on an authority record providing DNS
   server. Specifically, if you are still running BIND 8 then follow
   the advice in <a href="#1215722740.52">Simon's comment</a> and
   upgrade to BIND 9.</p>


]]></description>
   <category domain="http://www.imsc.res.in/~kapil/blog"></category>
   <pubDate>Thu, 10 Jul 2008 11:37 GMT</pubDate>
</item>
<item>
   <title>Point-less SPAM?</title>
   <guid isPermaLink="false">lg/pondering-spam-2007-02-01-17-58</guid>
   <link>http://www.imsc.res.in/~kapil/blog/lg/pondering-spam-2007-02-01-17-58.html</link>
   <description><![CDATA[

  <p>I was just wondering if someone has thought about what the
  intent is behind SPAM messages which only contain some mish-mash text.
  The qualifying criteria to identify such spam are:</p>

  <ol class="decimal">
    <li>Only text without attachments.</li>

    <li>Text that contains incoherent sentences or disconnected
    sentences.<a href="#fn1" class="footnoteRef" id="fnref1" name=
    "fnref1"><sup>1</sup></a></li>

    <li>Messages from addresses definitely not known to the
    recipient.<a href="#fn2" class="footnoteRef" id="fnref2" name=
    "fnref2"><sup>2</sup></a></li>
  </ol>

  <p>Here are some possiblities that occured to me.</p>

  <p>A. These are messages that are designed to test/mar the
  efficiency of the spam detection systems currently employed by
  servers.</p>

  <p>B. These messages contain coded messages that are flooded
  across the internet in an attempt to disguise their true
  origin/destination. The real message could be short one such as
  "the machine from which this has been sent has serious security
  holes".</p>

  <p>C. This is generated for someone's research project.</p>

  <p>D. This is the result of some spam generating software/virus
  which has bugs.</p>

  <p>I don't know if this is worth wondering about ... except ...
  why is someone going to some trouble to make (a program which is
  making) life difficult for everyone?</p>

  <div class="footnotes">
    <hr>

    <ol>
      <li id="fn1">
        <p>Clearly (2) is subjective which makes such spam hard to
        detect automatically. <a href="#fnref1" class=
        "footnoteBackLink" title=
        "Jump back to footnote 1">↩</a></p>
      </li>

      <li id="fn2">
        <p>This is to exclude e-mail messages written by friends
        who are not quite sober at the time of writing :-) <a href=
        "#fnref2" class="footnoteBackLink" title=
        "Jump back to footnote 2">↩</a></p>
      </li>
    </ol>
  </div>

]]></description>
   <category domain="http://www.imsc.res.in/~kapil/blog"></category>
   <pubDate>Thu, 01 Feb 2007 12:28 GMT</pubDate>
</item>
<item>
   <title>Using a Moto Razr</title>
   <guid isPermaLink="false">lg/moto-razr-linux-2006-12-04-16-59</guid>
   <link>http://www.imsc.res.in/~kapil/blog/lg/moto-razr-linux-2006-12-04-16-59.html</link>
   <description><![CDATA[

  <p>I just got a Razr V3 recently and had a number of difficulties
  with setting it up using Linux. For what it is worth here are my
  experiences. (Note that the V3i is an entirely different
  beast!)</p>

  <ol class="decimal">
    <li>
      <p>The USB cable. This works with the recent(?) cdc-acm
      driver as a serial device (/dev/ttyACM0 for me). It cannot be
      used as a USB-storage device and mounted---worse luck.</p>

	<ol class="lower-alpha">
	<li>
	  <p>It doesn't work too well with "gammu". It seems that
	  Motorola changed the AT+Cxxx command sequence "a bit". What
	  you *can* do is download the phonebook with "--backup" but
	  this is only for local storage since re-upload fails.</p>
        </li>

	<li>
	  <p> "moto4lin" is a Qt-based program that works fine for
	  editing the filesystem (up/down loading photos/music etc but
	  not the phonebook!). It can also edit the "SEEM" which looks
	  dangerous so I haven't tried it yet. You can also upload Java
	  applications but I haven't done that either.
	</ol>
    </li>

    <li>
      <p>Bluetooth. This need a firmware upgrade (I was within the
      warranty period when I asked for one so it was free) to
      R374_G_0E.42.10R_A (at least; I noticed somewhere that _B,_C,
      etc are available). Even after this it was not entirely
      smooth sailing.</p>

      <ol class="lower-alpha">
        <li>
          <p>Bluetooth connects with bluez-utils. It was a bit
          tricky for me (=command-line-type!). This needed a file
          /var/lib/bluetooth/&lt;local_address&gt;/pincodes
          containing entries like</p>
          <code>
          <pre>
          	&lt;phone_address&gt; 12345678
	  </pre>
	  </code>

          <p>The 12345678 is the "initial shared secret" used between
          your phone and the computer. The file can be deleted after
          establishing a connection the first time.</p>
        </li>

        <li>
          <p>"obexftp" and "obexfs" can be used to access all the
          audio/pictures/video that you create (but not the others;
          you need "moto4lin" for that). However, this leads to
          corrupt {down,up}loads. The situation was worse with a
          Mac that Sudeshna uses.</p>
        </li>

        <li>
          <p>"obexpushd" and "ussp-push" are inherently less secure
          programs and are difficult to "batchify" but those are
          the ones that currently work for me to download and
          upload files without corruption.</p>
        </li>

        <li>
          <p>"gammu" with "bluerfat" (which is AT commands over
          RFCOMM) work fine for the phonebook. This is because the
          phone seems to use standard AT+Cxxx commands over this
          interface---wierd that it doesn't over the cable! I am
          able to edit the phone book and even use my computer
          keyboard as a remote keyboard instead of the phone
          keyboard. Can't access multimedia data over this
          interface though.</p>
        </li>
      </ol>
    </li>

    <li>
      <p>Still to try (but will not try soon since I've already
      wasted two weeks on this!).</p>

      <ol class="lower-alpha">
        <li>
          <p>Haven't yet tried to connect to the net using the
          phone. In principle, the difficulty here is not with the
          phone but with the service providers instructions---I
          still haven't managed to decode them---Indlish
          anyone?</p>
        </li>

        <li>
          <p>Haven't yet tried to unlock the pre-installed "Web
          sessions". This can be done by editing the SEEM according
          to various web sites. It doesn't have to be done yet
          since I am able to edit everything except the name of
          these sessions. That is enough to use the phone browser
          to "browse the web".</p>
        </li>

        <li>
          <p>Install Java applications and get them to work. I
          created some room by deleted all those keyboard damaging
          games that <em>were</em> installed but haven't got
          further than that.</p>
        </li>

        <li>
          <p>Re-write "moto4lin" as a command-line program. Why
          should one need to use Qt for a task like this?</p>
        </li>
      </ol>
    </li>
  </ol>

]]></description>
   <category domain="http://www.imsc.res.in/~kapil/blog"></category>
   <pubDate>Mon, 04 Dec 2006 11:29 GMT</pubDate>
</item>
<item>
   <title>Needed --- Illuminating Exercises</title>
   <guid isPermaLink="false">lg/debian-too-easy-q-2006-09-20-14-13</guid>
   <link>http://www.imsc.res.in/~kapil/blog/lg/debian-too-easy-q-2006-09-20-14-13.html</link>
   <description><![CDATA[

  <p>This is in response to <a href=
  "http://www.infodrom.org/~joey/log/?200609102259"><code>http://www.infodrom.org/~joey/log/?200609102259</code></a>.</p>

  <p>The question arises: How will people learn about GNU and Linux
  once everything starts working smoothly?</p>

  <p>I can certainly vouch for the fact that many of the things I
  learnt about computers, I learnt <em>because</em> the computer
  was not doing things the way I wanted it to.</p>

  <h5 id="from-personal-experience">From Personal Experience</h5>

  <p>There are two types of mathematics books.</p>

  <p>There are those where the author has taken great pains to
  construct the most illuminating exercises for the student to
  solve at the end of each chapter.</p>

  <p>And then there are the books where there are mistakes
  <em>in</em> the text. The exercise is to find the mistakes and
  correct them.</p>

  <blockquote>
    <p>I have learnt more from the latter than the former</p>
  </blockquote>

]]></description>
   <category domain="http://www.imsc.res.in/~kapil/blog"></category>
   <pubDate>Wed, 20 Sep 2006 08:43 GMT</pubDate>
</item>
<item>
   <title>Universities vs Polytechnics</title>
   <guid isPermaLink="false">lg/polytech-vs-univ-2006-09-13-15-11</guid>
   <link>http://www.imsc.res.in/~kapil/blog/lg/polytech-vs-univ-2006-09-13-15-11.html</link>
   <description><![CDATA[

  <p>Let me try to respond to Dave Russell as politely as I
  can.</p>

  <blockquote>
    <p>At the opposite end of the spectrum from elitism is dumbing
    down. I know nothing of the education systems outside England
    so, conversely, I expect some of LG's foreign readers may well
    be puzzled by my earlier references. For their possible
    interest, there used to be two distinct types of Further
    Education establishment in England (I simplify somewhat).</p>
  </blockquote>

  <p>Coming as I do from India, I fall somewhere in between "total
  foreigners" and the "UK locals". Just call me a "colonial" or
  "coolie" for short---I promise not to take offence.</p>

  <blockquote>
    <p>University - a place of academic excellence, awarding
    degrees. Polytechnic - providing practical training, leading to
    qualifications such as "City &amp; Guilds", HNC and HND.</p>
  </blockquote>

  <p>The following story is told about three students from the
  IIT's at Kanpur, Delhi, Madras who go for an interview. The
  ceiling fan in the interview room is not working. The candidate
  is asked for an opinion.</p>

  <p>IITK Candidate: Actually, what this building needs is a
  centralised air-conditioning plant that takes into account the
  weather conditions in this city which is in the tropics and is
  near the sea. I have a few research papers on the solution of the
  partial differential equations that arise when one takes all
  these factors into account. MIT has given me a doctoral
  fellowship to study these aspects of the Carnot cycle in greater
  detail. At the same time the mathematics department at Harvard
  feels that I should instead expand on the very unusual use of
  wavelets in my solutions.</p>

  <p>IITD Candidate: Here are my designs that improve upon certain
  air-conditioning units that are being developed at General
  Electric (in the USA) so that they will work well for the Indian
  consumer. I am looking for ways in which I can patent these or
  join up with GE to produce these for the mass market.</p>

  <p>IITM Candidate: Hold on. Takes out a screwdriver. Opens the
  switch board and mutters "Regulator is bust". Goes off to the
  neighbourhood hardware store and returns with some fine copper
  wire. Then re-wires the regulator and soon the fan is
  working.</p>

  <p>The amazing thing about this story is that each of the IIT's
  felt that the story was a way of complimenting them on the
  students they produced!</p>

  <p>IMNSHO, "academic excellence" or "awarding degrees"
  <em>alone</em> only leads to more tree felling (or toxic e-waste
  in the modern world) in the pointless pursuit of awards, while
  "partical training" <em>alone</em> will produce people who will
  resist change due their ineptness at adapting. A <em>true</em>
  university should impart training in using both halves of the
  brain.</p>

  <blockquote>
    <p>The entry requirements for a Poly would invariably be
    considerably lower than for University. Each had its own
    well-defined function, and there was little overlap.</p>
  </blockquote>

  <p>If I have learned anything in my N years of involvement with
  academic world it is this---input and output are not so closely
  correlated. The lack of overlap has probably harmed all of those
  who went in to these "systems".</p>

]]></description>
   <category domain="http://www.imsc.res.in/~kapil/blog"></category>
   <pubDate>Wed, 13 Sep 2006 09:41 GMT</pubDate>
</item>
</channel>
</rss>
