PND4

/dev/notes

Herp Derp.. 3 Std’s and a Null

Today 'patient' and I learned with some help from 'dizzie' about how exactly to use /dev/null and the other pseudodevices to control input and output in UNIX-like environments. This is something you'll see a lot in command-line scripting languages such as bash or Python.

A good way to check which 'devices' correspond with which number is by running this command.

1
ls -l /dev/null /dev/std*

In the output we can see that there are 3 file descriptors built into our UNIX environments. 0 is linked STDOUT. 1 is linked to STDIN, and finally 2 is linked to STDERR. /dev/null being called the 'bit-bucket' and certainly is a doorway to hell in which any data becomes a doomed soul.

Now, you're gonna want to know how to use these devices in a command line. Look no further:

1
ls -l / 2>/dev/null

This command will list your root partition with "long lists" and redirect any errors there may be to the bit-bucket. This can have uses for grepping or finds that may have some errors in the output you want to filter to still have something usable, or to plain make something be quiet which would normally complain on STDOUT.

A couple more resources: Novell: Cool Solutions: What does “> /dev/null 2>&1″ mean? Xaprb's Blog: /dev/null

Installing BT5 (Chroot) on the Sprint HTC Evo 4G (Non LTE)

Tonight ParkerR and I decided to get some pentesting tools into our devices. He has a Nexus 7 and I.. well I have my phone. Anyway, after a frustrating time working with p7zip which was used in the particular mirror we chose, we finally got it extracted. So grab your files HERE and follow along,

1
$ 7z e downloaded-file.7z.001

Next we had to copy over the files to the SD-card as per the instructions. Since my uSD (MicroSD) port on my phone is uber-janky I just turned off my phone and pulled out the uSD card instead of using ADB and opt'd for the slot in my trusty laptop. I was then able to mount the removable storage and [ever so slowly and unreliably] copy over the extracted contents into the SD's bt5 folder like so:

1
2
3
4
5
6
7
mount -t vfat /dev/mmcblk0p1 /mnt/sdcard -o rw
mkdir /mnt/sdcard/bt5
# because copy was not working too well for me.. we dd.
dd if=/home/user/bt5/bt5.img of=/mnt/sdcard/bt5/bt5.img
# answer no to the clobber
cp -i /home/user/bt5/* /mnt/sdcard/bt5/ 
# cd && umount /mnt/sdcard

Having unmounted the sdcard in this last line, we can now remove the card and toss that back into our phone and boot up our Android phone as usual.

Fire up the Terminal emulator and run the 'bt' script included as a super-user.. or if you have SSHDroid installed, we can SSH into our phone as root and run the script to start up the chroot'd environment.

1
2
$ ssh 192.168.1.<android> -l root
(android)# sh /sdcard/bt5/bt

Hopefully that starts up your Backtrack 5 chrooted environment. If you used Terminal Emulator you're good to walk down the street and still use the command line to your heart's desire. Unfortunately for SSH, soon as you lose your LAN connection, the session will drop out. So be sure to consider that before embarking out on your mission.

Defcon or Bust !!1!

I've decided that this summer I'd like to attend Def Con 20. After watching talks from previous Def Cons and other various events over the years on-line its finally time for me to get out and physically be there. I've been trying to head out to some 'talks' out here in the bay area too, but since Def Con is coming right up, and I still live on the right coast, why not. Its a great opportunity to see what's new in the world of technology first hand and meet the actual people developing it all in one place.

If you even consider knowing me, even just a little bit, you know that I'm a huge fan of this kind of stuff, and have been since primary school. I've always tried to make myself available to help solve problems and willing to guide friends and family that have also shown interest in the area with all I can offer. Its a learning experience, every time. Like they say, "Teach a man to fish and you feed him for a lifetime." Which is why I urge anyone reading this to come to with, simply because its pretty much impossible to walk out of one of these places and not be inspired.. not to mention its in Vegas :)

Unfortunately, at this point in my life there's a lot of free time to be spent, and life is short. Conversely, money is short-coming and school is annually getting more expensive. Education and opportunities we can all agree are valuable. Getting me to Def Con 20 isn't going to be easy, but all I have is time,`a willing mind, and a drive to be there. With a little help I'm sure I'll be hacking away with the best of them out in Las Vegas at the end of the month.

–pnd4