I am trying to dump the partitions of Android devices with netcat. I have created 3 bash scripts for supporting the process. I have trouble on the second which to dumpt the specific partition through netcat. On the command line I used to type the following commands:
- adb shell
- su
- (on root) dd if=/dev/block/mmcblk0 | /sdcard/nc -l -p 8888
Based on the commands above, I have tried to make a bash script with detail below:
#!/bin/bash
adb shell "su
dd if=/dev/block/mmcblk0 | /dev/examiner/nc -l -p 8888"
But the result is text file with zero size. I have tried to change the quotation mark for identifying the variable, but the result was still the same.
Thanks in advance.
/dev/examiner
it'snc
's path in the Ubuntu filesystem? That would explain thatadb
shell, and not in the shell spawned bysu
, which leads to the execution of the pipe without root privileges. Tryadb shell "su -c 'dd if=/dev/block/mmcblk0 | /dev/examiner/nc -l -p 8888'''