[DEV] BACKTRACK 5 on SGS2 (chroot) [UPDATED: 12/July/2011]

Search This thread

anantshri

Senior Member
Feb 22, 2011
687
320
Bangalore
anantshri.info
Any advice on setting screen resolution in such way so it doesn't scroll a bit to the left or right?

Swyped from my Galaxy S II using Tapatalk

inside bt.img there is a file named as ui

in terminal emulator if you follow steps till you type bt and get a root@localhost prompt

at this point you cna go to

cd /root/bin

and here you will see there is a file named ui

inside ui file you can see the text somthing like

vncserver -- geometry abcXdef
here abc=854 and def=480 for X10i simmilarly what ever is your screen resolution you just need to place that in correct place all done

@Doom please provide update script with correct resolution, as i am not sure about exact size of screen.
directly updating ui file once bt command has been fired and img is mounted should do the trick
 
Last edited:

bentez2003

Senior Member
Nov 26, 2009
351
36
bracing myself for the backlash but could someone clue me in on why this awesome thing is awesome?
 

jastonas

Senior Member
Jul 1, 2010
1,172
191
Patra
Redmi Note 10 Pro
inside bt.img there is a file named as ui

in terminal emulator if you follow steps till you type bt and get a root@localhost prompt

at this point you cna go to

cd /root/bin

and here you will see there is a file named ui

inside ui file you can see the text somthing like

vncserver -- geometry abcXdef
here abc=854 and def=480 for X10i simmilarly what ever is your screen resolution you just need to place that in correct place all done

@Doom please provide update script with correct resolution, as i am not sure about exact size of screen.
directly updating ui file once bt command has been fired and img is mounted should do the trick

Is there any editor to change this file easily?

I tried vi but it doesn't seem to work properly. Backspace (as well as other stuff) won't work.
 

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
@Doom please provide update script with correct resolution, as i am not sure about exact size of screen.
directly updating ui file once bt command has been fired and img is mounted should do the trick

Ok will do! Sgs2 resolution is 800x480... so in the ui file (startvnc too???) we just need to change the number 854 with 800... A sed command should do the trick...

Is there any editor to change this file easily?

I tried vi but it doesn't seem to work properly. Backspace (as well as other stuff) won't work.

Please wait I will post a small updated file (or command for this)

Sent from my GT-I9100 using XDA App
 

Omegavirus

Senior Member
Aug 15, 2010
152
9
Vienna
Doesn't seem to work for me.. Everything is fine until i connect with android-vnc-app.. only grey screen with black cross which i can move around with my fingers.. :/ no gui loading..
 

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
@jastonas, others

after the startbt command and before executing bt command,
just execute the following command:
(u should be at this shell> # )
Code:
busybox sed -i 's/850/800/g' /data/local/bt/root/bin/ui
(the above needs to be done only once)


Doesn't seem to work for me.. Everything is fine until i connect with android-vnc-app.. only grey screen with black cross which i can move around with my fingers.. :/ no gui loading..

thats odd.. did u get any errors on screen while executing the commands?

if possible can u post screenshots of output after executing each command?
 

memo855

Senior Member
Dec 2, 2009
86
9
Brussel
Not workin thanks anyway

export PATH=/data/local/bin:$PATH
$ export PATH=/data/local/bin:$PATH
$su
# cd /sdcard/bt
# sh installbt.sh
[ STEP 1 ]
BackTrack CHroot v0.2 for SGS2
This process does NOT damage Android OS!

based on Xperia X10 Customization by Anant http://anantshri.info
modded for SGS2 by DooMLoRD
Usage: mount [-r] [-w] [-o options] [-t type] device directory
Cleaning up old Chunks . . .
Creating necessary directories
Setting up files
[ STEP 1 COMPLETE ]
BackTrack is now configure!

to Start BackTrack type 'startbt' (without the quotes)
Usage: mount [-r] [-w] [-o options] [-t type] device directory
# startbt
[ STEP 2 ]
mknod: /dev/block/loop254: File exists
losetup: applet not found
mount: mounting /dev/block/loop254 on /data/local/bt failed: Invalid argument
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
net.ipv4.ip_forward = 1
Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4
startbt: cannot create /data/local/bt/etc/resolv.conf: directory nonexistent
startbt: cannot create /data/local/bt/etc/resolv.conf: directory nonexistent
startbt: cannot create /data/local/bt/etc/hosts: directory nonexistent
BackTrack Loader by Anant based on ubuntu loader
[ STEP 2 COMPLETE ]

BackTrack is ready just type 'bt' (without the quotes)
# busybox sed -i 's/850/800/g' /data/local/bt/root/bin/ui
sed: /data/local/bt/root/bin/ui: No such file or directory
#

Sent from my GT-I9100 using XDA Premium App
 

Omegavirus

Senior Member
Aug 15, 2010
152
9
Vienna
thats odd.. did u get any errors on screen while executing the commands?

if possible can u post screenshots of output after executing each command?

screenshots are attached.. thanks for your help! :)
btw i used better terminal, but terminal emulator leaves me with the same problem..
 

Attachments

  • snap20110711_164245.jpg
    snap20110711_164245.jpg
    45.5 KB · Views: 941
  • snap20110711_164256.jpg
    snap20110711_164256.jpg
    45 KB · Views: 812
  • snap20110711_164309.jpg
    snap20110711_164309.jpg
    42 KB · Views: 746
  • snap20110711_164315.jpg
    snap20110711_164315.jpg
    43.2 KB · Views: 757
  • snap20110711_164325.jpg
    snap20110711_164325.jpg
    8.5 KB · Views: 769

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
Not workin thanks anyway
Please restart ur phone and try again (run the commands only once) and please post output ba k here...

Also it seems u are using a diff version of busybox... can u please post output of the following:
(in the terminal emulator program)
Code:
busybox


screenshots are attached.. thanks for your help! :)
btw i used better terminal, but terminal emulator leaves me with the same problem..

On ur rom busybox symlinks aren't correctly configured... u see those "Toolbox!"... this means that the mount command is still symlinked to /system/bin/toolbox
U can verify this: (in terminal emulator program)
Code:
ls -l `which mount`

Can u check it and verify please?

Sent from my GT-I9100 using XDA App
 
Last edited:

Omegavirus

Senior Member
Aug 15, 2010
152
9
Vienna
On ur rom busybox symlinks aren't correctly configured... u see those "Toolbox!"... this means that the mount command is still symlinked to /system/bin/toolbox
U can verify this: (in terminal emulator program)
Code:
ls -l `which mount`

Can u check it and verify please?

Sent from my GT-I9100 using XDA App

i use infusion rom v1.4 and output of the command is one line: "lrwxrwxrwx 1 app_117 app_117"
 

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
output is attached.. used your terminal program ;)

seems u are using prerooted kernel (CF-Root)

and u messed up the commands... it should have been

Code:
ls -l /sbin/mount


anyways i am preparing an updated package (scripts + busybox only) will upload it soon... should sort out most busybox related issues
 

Omegavirus

Senior Member
Aug 15, 2010
152
9
Vienna
seems u are using prerooted kernel (CF-Root)

and u messed up the commands... it should have been

Code:
ls -l /sbin/mount


anyways i am preparing an updated package (scripts + busybox only) will upload it soon... should sort out most busybox related issues

that's true ;) i'm using the cf-root kernel..

the output of ls -l /sbin/mount is: "lrwxrwxrwx 1 root root 7 Jun 20 02:00 /sbin/mount -> busybox"

sounds great, thanks :)
 

NielDK

Inactive Recognized Developer
Jul 13, 2008
540
141
Farum
Sounds great with bt5 on the GS2. Tell mé, does anyone know if monitor mode and packet injection is working on the GS2 wifi drivers?
That is probably the main purpose, at least for me ;)
 
  • Like
Reactions: DOMin8or

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
Sounds great with bt5 on the GS2. Tell mé, does anyone know if monitor mode and packet injection is working on the GS2 wifi drivers?
That is probably the main purpose, at least for me ;)

@NielDK
dude u got the SGS2?

wht happened to the Play/Arc?


back on topic... yes i hope some devs can get wifi module compiled with monitor mode (if at all its possible)...
 

NielDK

Inactive Recognized Developer
Jul 13, 2008
540
141
Farum
@NielDK
dude u got the SGS2?

wht happened to the Play/Arc?


back on topic... yes i hope some devs can get wifi module compiled with monitor mode (if at all its possible)...

;) I have a few phones. GS. GS2. Play. X10 mini. N900 and some Chineese one.

Sent from my GT-I9100 using XDA Premium App
 

Top Liked Posts

  • There are no posts matching your filters.
  • 64
    \\----[ Announcement ]----//

    [12/July/2011] Updated with new package (bt5_sgs2_shell_scripts_v2.zip) containing shell scripts & busybox

    //----[ Announcement ]----\\



    hi guys DooMLoRD & anantshri present to u:

    BACKTRACK 5 on SGS2


    all the work was done by anantshri, i mostly assisted by testing it on my SGS2 and modding it slightly so that it will work properly for SGS2... dont forget to thank him!

    i will try n keep it short and simple...

    for more details u can read the original thread at X10 sub-forums...

    [DEV] BACKTRACK 5 on Xperia X10 chroot


    [ Screenshots ]


    on startup (shell):

    shell.png



    in GUI:

    gui.jpeg


    phone + BT5 GUI:

    phone.jpg




    [ Requirements ]



    [ How To : File Setup ]

    u need to do this only once
    1. download the files from the links provided in this thread
    2. extract the files using 7zip to a temporary folder (needs 3.3GB free on that drive)
    3. connect ur SGS2 to PC and mount USB storage
    4. create a folder named 'bt' (without quotes) in the root of ur sdcard and copy the bt.img in that folder
    5. also place the file bt5_sgs2_shell_scripts_v2.zip in root of sdcard, this file has to be flashed via recovery
    6. once u verify that the above is correct then un-mount usb storage
    7. reboot into recovery and flash the file bt5_sgs2_shell_scripts_v2.zip stored in root of sdcard (or if u are using CWM app then just select the file for flashing and the app will do the rest ;))
    8. once ur phone reboots into OS just check the /sdcard/bt folder
    9. final directory structure should look like this:
      • /sdcard/bt/bt
      • /sdcard/bt/bt.img
      • /sdcard/bt/installbt.sh
      • /sdcard/bt/startbt
      • /sdcard/bt/stopbt
    10. once u verify that the above is correct then u can proceed


    [ How To : Launch BT ]

    1. start Terminal Emulator app on ur SGS2 and enter the following commands step by step (accept/allow any SuperUser request/popup that u may receive)
      • su
      • cd /sdcard/bt
      • sh installbt.sh
      • startbt
      • bt
    2. now u are in BackTrack5 shell

    3. to launch GUI (vncserver) enter the following command
      • ui
      uilaunch.jpeg

      now note the number N shown localhost:N
      e.g. as u can see from the above image that "New 'X' desktop is localhost:1", so N=1
      the vncserver is running at (5900 + N, N=1 ; so server port is 5901)

    4. now launch androidVNC app on phone and fill in the detials as follows
      • Nick : bt
      • Address : 127.0.0.1
      • Port : 5901
      • Password : 12345678
      • Username : <leave it blank>
      • Color Format : 24-bit color (4 bpp)
      vnc.jpeg

      inside vnc window select input mode (i personally recommend the following)
      • TouchPad (here your screen works like a big touchpad use it to navigate mouse.)
    5. and then press connect... now u are in BackTrack GUI!

    6. if u want to exit/close BT5 then u need to follow these steps:
      • close the androidVNC app (Menu -> Disconnect)
      • go back into Terminal Emulator app and enter the following commands
        u should be at this shell root@localhost:~#
        • killui
        • exit
      • now u will get back to this shell> #
      • now enter the following commands to stop bt and exit
        • stopbt
        • exit
        • exit
      • u can now exit the Terminal Emulator app
      • i would also recommend that u reboot ur phone


    [ Important Info ]

    root password is 12345678



    [ Download Links ]

    1. update.zip package containing shell scripts, busybox (which gets installed to temporary location) [to be flashed via recovery]
      this will not disturb/conflict with busybox of ur ROM/CF-Root kernel

      bt5_sgs2_shell_scripts_v2.zip (~800KB)

    2. main bt.img
      these links are 7zip archives split into 50mb files, u will need to download the following:
      total size: 486MB

      also uploading to mediafire for mirroring...
      Mediafire Folder: http://www.mediafire.com/?f9gk3p3t9wip5

      md5 hashes:

      Code:
       bt.7z.001 f19e769bf42b44867c8bb1d9bb9c5d44
       bt.7z.002 a4dd26a98d2c6925d871fb108fb5fadb
       bt.7z.003 ecca5a5d72c449117b1d3dbc23aeb1a2
       bt.7z.004 8ad487a01e4d149f0247ad9288201f32
       bt.7z.005 adab9cb3778cd8ac89ccc0e21997c3d7
       bt.7z.006 ba6a28de70a1115dc316f45cea508215
       bt.7z.007 f59757e891631607e1a35abadb231b3b
       bt.7z.008 cdb8c28a1fbd03657bb42e8d69f0600b
       bt.7z.009 426d892f872679e3d53d0ebb0376e138
       bt.7z.010 c7d2957bc65340d967b9dd3646d7cb39

    icon8.gif



    ENJOY!
    8
    [ Tips n Tricks! ]

    1. if u have ur device (SGS2) connected over wifi u can connect to the BT5 vncserver running on ur phone!! u will just need to connect to
      <ip_address_of_phone>:<portno>

      pcbasedvnc.png


    2. most of the startup/launching commands can be executed even through adb shell
    5
    ==== Reserved ===

    few pointers as this has been asked many times

    1) Monitor Mode will not work till someone tried to compile a custom wifi drivers with monitor mode enables, in that case also firmware should allow it.

    2) Those using android-vnc-viewer and facing difficulty in navigation check various input modes.
    These 3 works the best for me.

    1. Touch Mouse; D-Pad Pan
    2. Mouse pointer control mode
    3. TouchPad (here your screen works like a big touchpad use it to navigate mouse.)
    3
    [MOD/FIX]scripts will now mount storage on boot and path is fixed

    First the [FIX] bit

    The attached scripts change the PATH environment variable settings to include /usr/local/bin as needed this is added into the 'bt' script

    not sure if this was in all versions of doom's scripts but it's fixed in these ones where it was missing.

    *I have not gone through all programs to identify if other directories should be in path or not


    Second the [MOD]
    I have modified the 'startbt' and 'stopbt' scripts to automatically mount and unmount the sdcard, external_sd and the usb flash drives (otg cable required)

    Once Back|track 5 is loaded these are mounted in the /root/storage directory creating three directories called 'sdcard', 'external_sd' and 'usbflash'

    Since I was only really doing this as a POC, for myself and the poster above, I have not done extensive testing but so far the sdcard and external_sd are working just fine.

    Using a USB flash via this methof the flash drive must be mounted via the OTG cable and fully enumerated prior to booting or files will not display.

    one word of caution my startbt script is configred to boot BT5 from the external sdcard (edit line 5 remove '/external_sd' for default configuration)

    Full scripts with mods highlighted and underlined (simple bold didn't seem to show up much):-

    startbt :-

    Code:
    echo "BackTrack Loader by Anant based on ubuntu loader"
    echo " "
    echo "[ STEP 2 ]"
    echo ">> Setting variables"
    export kit=/sdcard/[B][U]external_sd/[/U][/B]bt
    export bin=/system/bin
    export mnt=/data/local/bt
    [B][U]export stor=$mnt/root/storage
    export sdcard=$stor/sdcard
    export extsd=$stor/external_sd
    export usbflash=$stor/usbflash[/U][/B]
    export PATH=$bin:/usr/bin[B][U]:/usr/local/bin[/U][/B]:/usr/sbin:/bin:$PATH
    export TERM=linux
    export HOME=/root
    export bboxpath=/data/local/tmp/bt/busybox
    # Mounting Image to the farthest loop point
    # FIXME : check if mount sucessfull otherwise abort whole process.
    echo ">> Creating nodes"
    $bboxpath mknod /dev/block/loop254 b 7 254
    echo ">> Mounting image"
    $bboxpath losetup /dev/block/loop254 $kit/bt.img
    echo ">> Setting other mount points"
    $bboxpath mount -t ext2 /dev/block/loop254 $mnt
    $bboxpath mount -t devpts devpts $mnt/dev/pts
    $bboxpath mount -t proc proc $mnt/proc
    $bboxpath mount -t sysfs sysfs $mnt/sys
    [B][U]$bboxpath mkdir -p $sdcard
    $bboxpath mkdir -p $extsd
    $bboxpath mkdir -p $usbflash
    $bboxpath mount --bind /mnt/sdcard $sdcard
    $bboxpath mount --bind /mnt/sdcard/external_sd $extsd
    $bboxpath mount --bind /mnt/sdcard/usbStorage/sda $usbflash[/U][/B]
    echo ">> Seting environment"
    sysctl -w net.ipv4.ip_forward=1
    echo ">> Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4"
    echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
    echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
    echo "127.0.0.1 localhost" > $mnt/etc/hosts
    echo "[ STEP 2 COMPLETE ]"
    echo " "
    echo "BackTrack is ready just type 'bt' (without the quotes)"



    bt script with mods in bold:-

    Code:
    echo "[ STEP 3 ]"
    echo ">> Setting variables"
    export kit=/sdcard/bt
    export bin=/system/bin
    export mnt=/data/local/bt
    export PATH=$bin:/usr/bin:/usr/sbin[B][U]:/usr/local/bin[/U][/B]:/bin:$PATH
    export TERM=linux
    export HOME=/root
    export bboxpath=/data/local/tmp/bt/busybox
    echo ">> Correcting resolution issues"
    $bboxpath sed -i 's/850/800/g' /data/local/bt/root/bin/ui
    echo "[ STEP 3 COMPLETE ]"
    echo "Customized script for BackTrack by Anant shrivastava http://anantshri.info"
    echo "modded for SGS2 by DooMLoRD"
    echo "Enjoy BackTrack 5 }:)"
    echo " "
    echo "BackTrack shell will now be lauched"
    echo "to start GUI (vncserver) type 'ui' (without the quotes)"
    $bboxpath chroot $mnt /bin/bash

    stopbt script with mods in bold:-

    Code:
    echo "Cleaning the leftover and returning back the memory to Android."
    echo "by Anant Shrivastava http://anantshri.info "
    echo " "
    echo "[ Cleanup ]"
    #After exit command is executed clear it all up
    echo ">> Setting variables"
    export kit=/sdcard/bt
    export bin=/system/bin
    export mnt=/data/local/bt
    export PATH=$bin:/usr/bin:/usr/sbin[B][U]:/usr/local/bin[/U][/B]:/bin:$PATH
    export TERM=linux
    export HOME=/root
    export bboxpath=/data/local/tmp/bt/busybox
    sync
    echo ">> Unmounting temporary mount points"
    [B][U]$bboxpath umount -l /data/local/bt/root/storage/external_sd
    $bboxpath umount -l /data/local/bt/root/storage/usbflash
    $bboxpath umount -l /data/local/bt/root/storage/sdcard[/U][/B]
    $bboxpath umount -l $mnt/dev/pts
    $bboxpath umount -l $mnt/proc 
    $bboxpath umount -l $mnt/sys 
    $bboxpath umount -l $mnt
    echo ">> Unmounting image"
    $bboxpath losetup -d /dev/block/loop254
    echo ">> Remounting system as RO"
    $bboxpath mount -o remount,ro /system
    echo "[ Cleanup Completed ]"
    echo " "
    echo "Please reboot to properly unmount BackTrack"

    I've just noticed I have used full path's in unmounting in this last script, so if you modified the paths to mount things you need to modify these too.

    additionally I used root explorer to manually copy these to '/system/bin' there is no reason that I can think of that these should not work with the standard install.sh script but this has not been tested by me.

    Disclaimer: as mentioned above this was a simple quick and dirty POC for me this messes with files in sensitve areas of your phone, I take no responsibilty for any damage you might do to your own phone.
    3
    files uploaded to personal direct download server!

    links updated

    also uploading to mediafire for mirroring...
    http://www.mediafire.com/?f9gk3p3t9wip5

    will post these links in few hours!

    ENJOY BT5 on ur SGS2