Gaining root on Samsung FemtoCells
Written 2011-07-17
Tags:SCS-2U01 Serial port Samsung SCS-26UC SCS-26UC4 serial root
To summarize the steps needed to take over a femtocell:
- Build a serial cable
- Find your baud rate: SCS-2U01 is 115200:8N1, the Sprint Airave and SCS-24UC4 are 57600:8N1
- Retrieve the bootloader key from their source code drop by diffing their u-boot with mainline u-boot (hint, it is "sys\r")
- log into u-boot by using above key - it is time-limited different amounts on different devices
- go read the u-boot manual so I don't have to read the nitty-gritty
- copy the u-boot settings by logging your console and running `printenv`
- quickly turn off the hardware watchdog with `setenv watchdog_off 1`. Otherwise this is a great bugger.
- root the device by adding `init=/bin/sh` to $ramboot
- boot the device with `onandboot`
- Almost there: "sh-3.00#" At this point you have root, but very little is mounted(/etc/shadow is present though)
- insmod the mdoc/tffs.ko and mdoc/tffsbd.ko from the /lib/modules/<yourkernelhere>/
- `mount /dev/tffsa1 /mnt/mdoc` - brings up the main disk
- `mount /proc` `mount /sys`
- `mkdir /mnt/mdoc`
- `mkdir /mnt/mdoc/RFS`
- `mdoc_cp RFAB /mnt/mdoc/RFS/append_rfs.tgz 900000`
- `cd /mnt/mdoc/RFS`
- `tar xzfm append_rfs.tgz`
- copy the created directories over / as needed.
- bring up GPS with `insmod /mnt/mdoc/RFS/PATH_MODE/lib/modules/
GpsCtrlDev.ko` - You can now fiddle around with the device. Keep in mind that many of the read/write areas will actually store results in RAM for now, but you may get a 'No space left on device' error if you write too much.
Interesting bits:
- The web interface (only available to verizon) is running thttpd, and stores a hash in /udata/htdocs/.htpasswd
- The cgi web interface is a set of ARM binaries in /udata/htdocs/cgi-bin/
- Shadow passwords are used, but you're root anyhow
- Component versions are in /udata/image.ver and /udata/oper.ver
- iked-v.conf contains some very interesting settings, like 'set local psk XXXXXX'
This is written as a summary of work on the SCS-24UC4, although it should apply directly to the SCS-2U01 and Airave.
This was a collaboration by RSAXVC and Doug.