A Note on Updating Weaponized Nokia N900s

by on Dec.17, 2011, under Code, Posts

I wanted to make this post to save time and headaches for people who own ‘weaponized’ Nokia N900s.

If you regularly update your Nokia N900 by doing (as root):

apt-get update && apt-get upgrade -y

I have ran into some issues with some of the newer packages.

Firstly, the newest beta version of nmap (5.59BETA1_armel) appears to be buggy enough to the point where it’s almost unusable.

Running this:
nmap -sS -P0 -vv www.google.com -p 80

Yields:
Starting Nmap 5.59BETA1 (http://nmap.org) at 2011-12-17 21:14 EST
Warning Hostname www.google.com resolves to 6 IPs. Using 74.125.45.147
route_dst_netlink: can’t find interface “wlan0”

Secondly, subversion (svn) gets completely broken due to a library compatibility issue:

svn -h
Segmentation fault

There has been discussion on this: http://talk.maemo.org/showthread.php?p=970467

Having svn broken really stinks, because then I am not able to update Metasploit. Who in the hell wants to run an outdated version of Metasploit? (I imagine there are some people..)

To work around this for the time being I have crafted the following shell script:

#!/bin/bash

if [ ${#} -lt 1 ]
 then
   echo "Usage:	"
   echo "./update.sh normal #This just does a normal update";
   echo "./update.sh modded #This will do a normal update and then downgrade libaprutil1, libapr1 and nmap so that they work";
   exit 1;
fi

if echo ${1} | egrep "normal"  > /dev/null;
 then
   apt-get update;
   apt-get upgrade -y;
   exit 0;
elif echo ${1} | egrep "modded"  > /dev/null;
 then
   apt-get update;
   apt-get upgrade -y;
   apt-get install nmap=5.50-2 libaprutil1=1.3.9-2 libapr1=1.4.2-1 --force-yes -y;
   apt-get clean && apt-get autoclean;
   exit 0;
else
   echo "I don't know what you are trying to do.." #Thanks Arc
   exit 2;
fi

http://zitstif.no-ip.org/update.txt
SHA1 (update.txt) = d83306d18a146a54a38ea236e3a236b4955bb81b

For the time being if you’re in a similar case like me, you’ll have to use this shell script (wget http://zitstif.no-ip.org/update.sh &&ย  chmod +x update.sh && ./update.sh modded).

:, , , , , , , , , , , , , ,

15 Comments for this entry

  • Arc

    Thanks for this script.)
    But there’s one little mistake:

    echo ‘I don’t know what you are trying to do..’ wouldn’t work, must be:
    echo “I don’t know what you are trying to do..”

    P.S.: Sorry for my english.)

  • zitstif

    Thanks for pointing that out! ๐Ÿ™‚ I will correct it.

  • Vaughn

    Hello
    I have tried to install your script but I keep getting the error
    /bin/sh: ./update.sh: permission denied
    Any ideas
    Thanks

  • zitstif

    1.) Make sure you are root
    2.) chmod +x update.sh
    3.) ./update.sh normal #Or modded, which ever you need

  • Vaughn

    Thanks for your reply, I tried that and was still getting the error so went through the installation again and it seems to have got me past that now, I must have typed something wrong lol.
    I’m getting this message now any ideas??
    ./update.sh: line 24: unexpected EOF while looking for matching `”
    ./update.sh: line 27: syntax error: unexpected end of file

  • zitstif

    Try downloading the file again. There was a simple syntax error that Arc pointed out that I fixed in the .txt version but not the .sh version.

    If you’re curious, the issue was with this line: echo โ€˜I donโ€™t know what you are trying to do..โ€™ , it’s suppose to be (thanks Arc):

    echo “I donโ€™t know what you are trying to do..”

  • Vaughn

    Ok thanks a lot I will give that a try when I get home, I’ll post back and let you know how I get on

  • Vaughn

    Got the script working in the end, thanks.
    Ended up bricking my phone over the weekend lol managed to sort it all out though and I’m just about to re-install your update script
    Thanks a lot for your help

  • zitstif

    I’m glad to hear you got it working! ๐Ÿ™‚ I try to help people when I can.

  • Rijkaard

    Hi zitstif I follow your script but now i got this … Any clue?
    Nokia-N900:/home/opt# ruby1.8 msf3/msfupdate
    [*]
    [*] Attempting to update the Metasploit Framework…
    [*]

    svn: The path ‘.’ appears to be part of a Subversion 1.7 or greater
    working copy. Please upgrade your Subversion client to use this
    working copy.
    svn: The path ‘.’ appears to be part of a Subversion 1.7 or greater
    working copy. Please upgrade your Subversion client to use this
    working copy.

  • zitstif

    I’m not 100% sure, but you may be able to update metasploit using git. I will have to look into it.

  • zitstif

    What version of subversion are you using? I am currently not having any problems updating metasploit on my n900 with subversion 1.6.16 (r1073529). I will also note that the last last time I downloaded and extracted the metasploit framework on my n900 was in October of 2011.

    I’m not quite sure what happened, but you may have somehow updated the msf3 directory using a newer version of subversion. (Maybe through a chroot environment?) You may have to just try removing this install and downloading a new copy of Metasploit via:

    svn co https://www.metasploit.com/svn/framework3/trunk/

    If you’re still having issues and svn does not seem to be cooperating then have a look at:

    https://community.rapid7.com/community/metasploit/blog/2011/12/20/git-friendly
    https://github.com/rapid7/metasploit-framework/wiki/Using-Git

    Let me know what works! Good luck!

  • Rijkaard

    Zitstif I follow the post of Carlos Perez http://www.darkoperator.com/blog/2011/11/9/metasploit-changes-to-git.html and GIT do the trick.

    Thanks a lot for your useful help =)

  • zitstif

    I’m glad you were able to get your issue resolved! ๐Ÿ™‚

  • League of Legends Bot

    We’ve been a group of volunteers plus establishing a brand new scheme in your community. Your internet site presented all of us along with very helpful info to figure about. You’ve done a remarkable approach and our own total team are going to be happy for your requirements.

Leave a Reply

Please leave these two fields as-is:

Protected by Invisible Defender.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!