Forget your WebSphere password

April 27th, 2009

Call it hacking if you want but here is an example where it may be useful when it comes to WebSphere.  WebSphere uses a XOR-encrypted password system that isn’t really meant for rock hard security but more for not storing plain text passwords in configuration files.  In my average workday I could easily be using 5 different WebSphere servers for test/development in 4 different hosting environments.  So to decrypt the XOR-encrypted password use these commands.

WebSphere 5.x
> cd $WAS_INSTALL_DIR/lib
> ../java/bin/java -cp securityimpl.jar:iwsorb.jar com.ibm.ws.security.util.PasswordDecoder {xor}LDo8LTor
decoded password == “secret”, encoded password == “{xor}LDo8LTor”

WebSphere 6.0.x  (this also works with 6.1.x)

> cd $WAS_INSTALL_DIR/lib
> ../java/bin/java -cp securityimpl.jar:iwsorb.jar::ras.jar:wsexception.jar:bootstrap.jar:emf.jar:ffdc.jar com.ibm.ws.security.util.PasswordEncoder {xor}LDo8LTor
decoded password == “secret”, encoded password == “{xor}LDo8LTor”

Here are some other WebSphere 6.1.x commands I found but haven’t tested.

C:\IBM\WAS61\AppServer\bin\ProfileManagement\plugins\com.ibm.websphere.v61_6.1.200>C:\IBM\WAS61\AppServer\java\bin\java -cp ws_runtime.jar com.ibm.ws.security.util.PasswordDecoder {xor}LDo8LTor
encoded password == “{xor}LDo8LTor”, decoded password == “secret”

To encrypt

WebSphere 5.x

> cd $WAS_INSTALL_DIR/lib
> ../java/bin/java -cp securityimpl.jar:iwsorb.jar com.ibm.ws.security.util.PasswordEncoder secret
decoded password == “secret”, encoded password == “{xor}LDo8LTor”

WebSphere 6.0.x

> cd $WAS_INSTALL_DIR/lib
> ../java/bin/java -cp securityimpl.jar:iwsorb.jar::ras.jar:wsexception.jar:bootstrap.jar:emf.jar:ffdc.jar com.ibm.ws.security.util.PasswordEncoder secret
decoded password == “secret”, encoded password == “{xor}LDo8LTor”

npoore IBM, Web development , ,

Fixing your usb drive

April 2nd, 2009

I have updated my Apple TV by using the patchstick on my usb flash drive.  Now I need to use my usb drive to do a linux boot so I can do a network install of RedHat AS 4.  I plugged in my usb drive to a SUSE 9 box I have and checked to see if it could see the device connected.

mikey:~ # view /proc/bus/usb/devices

T:  Bus=04 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#=  2 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=14af ProdID=af01 Rev=11.00
S:  Manufacturer=SAMSUNG
S:  Product=SAMSUNG SUM-2G
S:  SerialNumber=0190107060001334
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=31875us

My machine sees the device but if I try and mount it.

mikey:~ # mkdir /mnt/usb
mikey:~ # mount -t vfat /dev/sda1 /mnt/usb/
mount: /dev/sda1 is not a valid block device

Now lets see what fdisk says.

mikey:~ # fdisk -l

Disk /dev/hda: 80.0 GB, 80032038912 bytes
255 heads, 63 sectors/track, 9730 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1         131     1052226   82  Linux swap
/dev/hda2             132        9729    77095935   83  Linux

Disk /dev/sda: 2030 MB, 2030043136 bytes
255 heads, 63 sectors/track, 246 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         247     1982463+  ee  EFI GPT
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(1023, 254, 63) logical=(0, 0, 2)
Partition 1 has different physical/logical endings:
phys=(1023, 254, 63) logical=(246, 205, 23)
The problem is the first (non-Linux?) physical partition.  To fix it I need to delete the partitions and recreate them.  Now I know my device isn’t mounted but just to make sure.

mikey:~ # umount /dev/sda1
umount: /dev/sda1: not mounted

mikey:~ # fdisk /dev/sda

Command (m for help): d
Selected partition 1

Command (m for help): n
Command action
e   extended
p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-246, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-246, default 246): +750M

Command (m for help): a
Partition number (1-4): 1

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 6
Changed system type of partition 1 to 6 (FAT16)

Command (m for help): n
Command action
e   extended
p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (93-246, default 93):
Using default value 93
Last cylinder or +size or +sizeM or +sizeK (93-246, default 246):
Using default value 246

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
mikey:~ # mkfs.vfat -F 16 -n rhboot /dev/sda1
mkfs.vfat 2.10 (22 Sep 2003)

mikey:~ # mkfs.ext2 -b 4096 -L casper -rw /dev/sdb2
mke2fs 1.38 (30-Jun-2005)
Filesystem label=casper
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
154880 inodes, 309251 blocks
15462 blocks (5.00%) reserved for the super user
First data block=0
10 block groups
32768 blocks per group, 32768 fragments per group
15488 inodes per group
Superblock backups stored on blocks:
32768, 65536, 98304, 131072, 163840, 196608, 229376, 262144, 294912

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 32 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

mikey:~ # mount /dev/sda1 /mnt/usb/

mikey:~ # dd if=/root/diskboot.img of=/dev/sda1
12288+0 records in
12288+0 records out

mikey:~ # fdisk /dev/sda

Command (m for help): p

Disk /dev/sda: 2030 MB, 2030043136 bytes
255 heads, 63 sectors/track, 246 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          92      738958+   6  FAT16
/dev/sda2              93         246     1237005   83  Linux

Now windows and Linux can read/write to my flash drive.

npoore Linux ,

Some frameworks to check out

March 16th, 2009

I have been playing around with a couple of different frameworks lately.  One is PHP based and one is Python based.  Zend Framework makes it easy to quickly develop PHP applications.  It supports many common needs for common applications, authentication, DB connection, URL management, access control lists, and many 3rd party apps.  Django  is a high-level Python framework that helps with rapid and clean web application development.  

Here is a good example of Django being used. 

I haven’t had much time to mess with Django yet but hope to get to soon.

npoore Web development , , ,

SDK for your car

March 13th, 2009

I want a SDK for my car.  My car has a dual screen display in the dash that splits between 2 functions I want to see. (GPS, radio, cellphone, and settings).   I typically keep it split on GPS and radio.  I want ways to interface to the cars computer with some other external device most likely through bluetooth.  Examples might be address book in my cellphone to the car addressbook for the GPS or down loading car data to be saved like the trip computer on my phone.  That way when I email the bmw service guy he knows what the problems are with my car or he knows when a scheduled maintenance is coming up.  Most important I would like my iPod to play video on one of the screens. 

Someone out there hacking the BMW iDrive systems?  I have seen some small things on forums like changing the boot logo.

http://www.x5world.com/navigation-system/11539-editing-splash-screen-v26-09a-beta-14.html

BMW Splash Screen

npoore bmw , ,

Boxee on my Apple TV

January 25th, 2009

I finally decided to try out Boxee on my Apple TV and I will have to say I am very pleased.  What is nice is how easy it was to get it installed.  I didn’t have to take apart my Apple TV to get the software on there I just had to load the software with the patchstick then restart.

First thing I did updated my Apple TV to the latest update which was 2.3.  Then I created the patchstick on my 2gb Samsung flash drive (I picked that up when I was in Korea last year).  I did find a forum of a list of flash drives to use or not use.  They say you should use better quality flash drives.  I am not really sure why I guess maybe because the Apple TV boots off of the flash drive and the i/o reads need to have fast response times?  Regardless many folks in the forum said that they were able to get the patchstick to work on the usb drives that were on the fail list so not sure what to really believe.  Regardless mine worked fine.

Here is a video that shows you how to create a patchstick.

I used atvusb-creator-1.0.b10 to create my patchstick.  After that was complete I followed the instructions from this video to get it on my Apple TV.

So after I let my Apple TV boot off of my patchstick then restarted I went and installed the latest code from Boxee.   The one thing that wasn’t mentioned in the last video was that if you are running on Apple TV 2.3 you need to install the Launcher 2.3 software.  You will see that on the same screen when you go and install Boxee.  After I did that it all worked just fine.  There are the usual bugs were if you try and quit Boxee my Apple TV might freeze or something so I just restarted it.  Usual problems you might see during an alpha software base.  Hulu streams seemed a little choppy but CBS stream was great.  I haven’t had a chance to try anything else yet.  ABC streams are on the Mac OSX version of Boxee and will be on the Apple TV version soon.

npoore Apple, Boxee , , ,

Problem with Rational Application Developer and ClearCase Plugin

January 18th, 2009

The Problem: Java project will not compile in Rational Application Developer due to a Internal error – the selected file is a system file that cannot be modified.  It will be hidden.

All software has bugs in it but some can drive you crazy and create extra frustration and lose more of your valuable time.  After moving all my source code into a new project in RAD I imported all my projects and added them to ClearCase.   Next I tried to compile them getting a 3 similar errors.  (Note:  First lesson read the error carefully.  Often while rushing through something to get it complete I don’t read the full error which would save me time.)  Anyway when trying to compile I kept on getting this error.

The project was not built due to “Internal error – the selected file is a system file that cannot be modified. It will be hidden.”. Fix the problem, then try refreshing this project and building it since it may be inconsistent.

After about 30 mins of frustration and almost ready to shutdown for the night I found a little file in the directory where the java class files were suppose to be named copyarea.db which was put there by ClearCase.  ClearCase makes this file ReadOnly thus not allowing RAD to delete it when it tries to compile my java code.

The Fix: Simple delete the file and refresh the project.

The Reason This Happened: I am not 100% certain but when I dumped all my code into the new project in RAD, ClearCase wanted to add all the code to the source repository so I let it the problem was it selected all the files which included the compiled class files.  Since I didn’t want or need those files in ClearCase I chose to remove them from the repository by deleting the classes directory but it left the copyarea.db file in the parent directory.  I am no expert on ClearCase but I couldn’t find a real easy way to remove the class files from the ClearCase server so I deleted the files through the ClearCase prospective view in RAD.  This unloaded the files from ClearCase but also deletes the files on the local filesystem.  If anyone knows a better way to remove them from ClearCase without deleting the files on the local system let me know.  Of course like always I made a copy of the files before deleting so I could restore them.

Suggestion: At least name the file that RAD is having problems deleting then I can go straight to the file the error never mentions the name of the file or the directory.

npoore IBM , , , ,