S
S
synapse_people2019-04-20 22:03:27
linux
synapse_people, 2019-04-20 22:03:27

How to upload a file to android (there is only nc, NO wget / curl, etc.)?

I came up with something like this:

tmp=/tmp;
echo "GET /30.apk HTTP/1.0\r">$tmp/req;
echo "Host: s3..su\r">>$tmp/req;
echo "Connection: close\r">>$tmp/req;
echo "\r\n\r\n">>$tmp/req;
cat $tmp/req|nc s3..su 80>$tmp/app.apk;
pm install $tmp/app.apk;
rm -rf $tmp/req $tmp/app.apk;

The code works, but I didn’t take into account that headers also come in response: (
sed / head, etc. there’s nothing, you won’t be able to cut them ..
I wouldn’t want to change the image, I need a solution via nc does not determine hostname)
How to download a file in Linux (see android)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2019-04-21
@synapse_people

android-sdk, adb and all that. No extra bikes.
Z.Y. - I read your dialogue in the comments and did not understand why keep 500 connections in adb at the same time, if you can upload a file and disconnect.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question