wickywaka / internship_report

Latex report of my internship, this repo is made so that I can work on this report in office and in home
3 stars 0 forks source link

stuck here:(cannot get ready avd #8

Open cuckoo-linux opened 5 years ago

cuckoo-linux commented 5 years ago

I followed cuckoodroid documentation as well as your videos,and when i ran the script from /cuckoo/utils following errors occurs:

~/cuckoo$` ./utils/android_emulator_creator/create_guest_avd.sh
adb has been found.
Pushing /system/xbin/su binary
remount succeeded
adb: error: cannot stat 'binaries/su': No such file or directory
Installing application Superuser
adb: error: cannot stat 'apps/Superuser.apk': No such file or directory
rm failed for -f, No such file or directory
Installing Xposed Application
adb: error: cannot stat 'apps/de.robv.android.xposed.installer_v33_36570c.apk': No such file or directory
rm failed for -f, No such file or directory
Installing Droidmon Application
adb: error: cannot stat 'hooking/Droidmon.apk': No such file or directory
rm failed for -f, No such file or directory
Installing Anti Emulator Detection Application
adb: error: cannot stat 'hooking/EmulatorAntiDetect.apk': No such file or directory
rm failed for -f, No such file or directory
adb: error: cannot stat 'anti-vm/fake-build.prop': No such file or directory
adb: error: cannot stat 'anti-vm/fake-cpuinfo': No such file or directory
adb: error: cannot stat 'anti-vm/fake-drivers': No such file or directory
Installing Content Generator
adb: error: cannot stat 'apps/ImportContacts.apk': No such file or directory
rm failed for -f, No such file or directory
Installing Cuckoo Agent and Python for ARM
adb: error: cannot stat '../../agent/android/python_agent/*': No such file or directory
Unable to chmod /data/local/aapt: No such file or directory
Unable to chmod /data/local/agent.sh: No such file or directory
Unable to chmod /data/local/python/bin/python: No such file or directory
Device is ready!
cuckoo-linux commented 5 years ago

when i tried to run all commands one by one,following happens:

muqaddas@muqaddas-OptiPlex-9020:~$ cd cuckoo
muqaddas@muqaddas-OptiPlex-9020:~/cuckoo$ cd utils
muqaddas@muqaddas-OptiPlex-9020:~/cuckoo/utils$ cd android_emulator_creator
muqaddas@muqaddas-OptiPlex-9020:~/cuckoo/utils/android_emulator_creator$ ADB push binaries/su /system/xbin/su
ADB: command not found
muqaddas@muqaddas-OptiPlex-9020:~/cuckoo/utils/android_emulator_creator$ adb shell
root@android:/ # exit
muqaddas@muqaddas-OptiPlex-9020:~/cuckoo/utils/android_emulator_creator$ adb devices
List of devices attached
emulator-5554   device

muqaddas@muqaddas-OptiPlex-9020:~/cuckoo/utils/android_emulator_creator$ adb push binaries/su /system/xbin/su
binaries/su: 1 file pushed. 3.4 MB/s (380532 bytes in 0.106s)
muqaddas@muqaddas-OptiPlex-9020:~/cuckoo/utils/android_emulator_creator$ adb shell chmod 06755 /system/xbin/su
muqaddas@muqaddas-OptiPlex-9020:~/cuckoo/utils/android_emulator_creator$ adb install apps/Superuser.apk
apps/Superuser.apk: 1 file pushed. 4.3 MB/s (1468798 bytes in 0.328s)
    pkg: /data/local/tmp/Superuser.apk
Success
rm failed for -f, No such file or directory
muqaddas@muqaddas-OptiPlex-9020:~/cuckoo/utils/android_emulator_creator$ adb install apps/de.robv.android.xposed.installer_v33_36570c.apk
apps/de.robv.android.xposed.installer_v33_36570c.apk: 1 file pushed. 4.3 MB/s (788771 bytes in 0.175s)
    pkg: /data/local/tmp/de.robv.android.xposed.installer_v33_36570c.apk
Success
rm failed for -f, No such file or directory
muqaddas@muqaddas-OptiPlex-9020:~/cuckoo/utils/android_emulator_creator$ adb install hooking/Droidmon.apk
hooking/Droidmon.apk: 1 file pushed. 4.3 MB/s (513409 bytes in 0.115s)
    pkg: /data/local/tmp/Droidmon.apk
Success
rm failed for -f, No such file or directory
muqaddas@muqaddas-OptiPlex-9020:~/cuckoo/utils/android_emulator_creator$ adb install hooking/EmulatorAntiDetect.apk
hooking/EmulatorAntiDetect.apk: 1 file pushed. 4.0 MB/s (292007 bytes in 0.069s)
    pkg: /data/local/tmp/EmulatorAntiDetect.apk
Success
rm failed for -f, No such file or directory
muqaddas@muqaddas-OptiPlex-9020:~/cuckoo/utils/android_emulator_creator$ adb push anti-vm/fake-build.prop /data/local/tmp/
anti-vm/fake-build.prop: 1 file pushed. 0.3 MB/s (3706 bytes in 0.013s)
muqaddas@muqaddas-OptiPlex-9020:~/cuckoo/utils/android_emulator_creator$ adb push anti-vm/fake-cpuinfo /data/local/tmp/
anti-vm/fake-cpuinfo: 1 file pushed. 0.1 MB/s (316 bytes in 0.003s)
muqaddas@muqaddas-OptiPlex-9020:~/cuckoo/utils/android_emulator_creator$ adb push anti-vm/fake-drivers /data/local/tmp/
anti-vm/fake-drivers: 1 file pushed. 0.3 MB/s (670 bytes in 0.002s)
muqaddas@muqaddas-OptiPlex-9020:~/cuckoo/utils/android_emulator_creator$ adb install apps/ImportContacts.apk
apps/ImportContacts.apk: 1 file pushed. 3.1 MB/s (68598 bytes in 0.021s)
    pkg: /data/local/tmp/ImportContacts.apk
Success
rm failed for -f, No such file or directory
muqaddas@muqaddas-OptiPlex-9020:~/cuckoo/utils/android_emulator_creator$ adb push ../../agent/android/python_agent/ /data/local/
../../agent/android/python_agent/: 92 files pushed. 4.0 MB/s (14266340 bytes in 3.367s)
muqaddas@muqaddas-OptiPlex-9020:~/cuckoo/utils/android_emulator_creator$ adb shell chmod 06755 /data/local/aapt
Unable to chmod /data/local/aapt: No such file or directory
muqaddas@muqaddas-OptiPlex-9020:~/cuckoo/utils/android_emulator_creator$ which aapt
muqaddas@muqaddas-OptiPlex-9020:~/cuckoo/utils/android_emulator_creator$ adb shell chmod 06755 /data/local/agent.sh
Unable to chmod /data/local/agent.sh: No such file or directory
muqaddas@muqaddas-OptiPlex-9020:~/cuckoo/utils/android_emulator_creator$ adb shell chmod 06755 /data/local/python/bin/python
Unable to chmod /data/local/python/bin/python: No such file or directory
wickywaka commented 5 years ago

Can you cd to the directory and run the script from there. I remember having some problem when running the script from another directory.

PS. Write code or console output in code format to make it easy to read.

Waqar

cuckoo-linux commented 5 years ago

pb resolved by using cd to directory.I followed all your videos on you tube and your repositeries on github.AVD is rooted properly but app is still not launching in AVD. I made this change to adb.py: proc = subprocess.Popen("/system/bin/am start -n"+ package+"/"+activity, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, executable="/system/bin/sh")

Is there anyother change required???

wickywaka commented 5 years ago

That was it. Did you check if the app is even installed? Also make sure your app size is less than 10MB, otherwise it won't be able to upload it to the emulator.

cuckoo-linux commented 5 years ago

app is only 2.9 mb:(app didin't installed in emulator,emulator launches but nothing happen and then critical time hit.

2019-01-25 09:44:50,537 [lib.cuckoo.core.scheduler] INFO: Task #4: acquired machine aosx_1 (label=aosx_1)
2019-01-25 09:45:30,593 [lib.cuckoo.core.guest] INFO: Starting analysis on guest (id=aosx_1, ip=127.0.0.1)
2019-01-25 09:55:31,533 [lib.cuckoo.core.scheduler] ERROR: aosx_1: the guest initialization hit the critical timeout, analysis aborted.
2019-01-25 09:55:31,646 [modules.machinery.avd] INFO: Stopping AVD listening on port 5554
2019-01-25 09:55:33,925 [modules.processing.apkinfo] WARNING: Dex size bigger than: None
2019-01-25 09:55:33,927 [modules.processing.behavior] WARNING: Analysis results folder does not exist at path "/home/muqaddas/cuckoo/storage/analyses/4/logs".
2019-01-25 09:55:37,017 [lib.cuckoo.core.scheduler] INFO: Task #4: reports generation completed (path=/home/muqaddas/cuckoo/storage/analyses/4)
2019-01-25 09:55:37,091 [lib.cuckoo.core.scheduler] INFO: Task #4: analysis procedure completed
wickywaka commented 5 years ago

Then you need to fix the app installation first.

cuckoo-linux commented 5 years ago

how??

cuckoo-linux commented 5 years ago

are you getting static analysis in report???

wickywaka commented 5 years ago

Static analysis is related to androugard, I remember there were some problems with it but basic static analysis was working. Did you figure out the problem yet?

wickywaka commented 5 years ago

Are you using the cuckoodroid that I forked or the one from idanr?

wickywaka commented 5 years ago

Also add code tags to the scripts or code you are pasting here. It will make it easier to read.