PDA

View Full Version : How To send a command automatically through the Kaliboot terminal HELP



mancavemodder
2015-03-18, 10:36
Hi guys,

Firstly I would like to say congratulations on the Nethunter suite for the Nexus 7 it works perfect. I have a question if I may that has stumped me for quite a while;

I have written a script that I would like to excite from a app icon, I have managed to do this fine but as I need root permissions to I call the command "su -c bootkali" this enables me to change to the root@kali from my app but now I need want to run a script .sh file but I can't seem to pass any commands through to the root@kali.
If I type the command in it works perfect but I would like to automate it on the app launch.

I thought something like this would work;

su- c bootkali /r ./test.sh

But it does not! so to summarise all I want to do it click a icon and have it load the kali root permission and run my test.sh script.

Any ideas?

Kind Regards

Keith

binkybear
2015-03-20, 22:28
Hi Keith,

You need to modify the bootkali file to take in test.sh as an argument like this "update" section I highlighted:
https://github.com/offensive-security/kali-nethunter/blob/master/flash/system/bin/bootkali#L249

Right now bootkali doesn't take "any" argument and run it so you can't just pass a script to it. To modify the bootkali file to take a script as an argument you will need to mount rw the /system folder on your device. From terminal on device run:

mount -o remount,rw /system /system

You can then edit /system/bin/bootkali.

If you need any help I'm also available on freenode in #nethunter.