Skip to content

Commit

Permalink
Merge pull request #23 from noobpk/dev
Browse files Browse the repository at this point in the history
update and optimize repo
  • Loading branch information
noobpk authored Apr 18, 2022
2 parents 99e770a + fea46df commit ecdf1f8
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 31 deletions.
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"cSpell.words": [
"androidhook",
"Frida"
]
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Frida Android Hook ChangeLog

## [Unrelease] - 2022-04-18

### Add
- Add setup.py for build executable

### Changed
- Update Readme.md

## [Unrelease] - 2022-03-17

### Added
Expand Down
30 changes: 23 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
## Env OS Support
| OS | Supported | Noted |
| ------- | ------------------ | ------- |
| MacOS | :white_check_mark: | main |
| Darwin | :white_check_mark: | main |
| Linux | :white_check_mark: | sub |
| Windows | :white_check_mark: | sub |

Expand Down Expand Up @@ -62,16 +62,32 @@ Support both spawn & attach script to process.

[See Full ChangeLog](https://github.com/noobpk/frida-android-hook/blob/master/CHANGELOG.md)

## Install & Usage
## Install & Build

```
1. Git clone https://github.com/noobpk/frida-android-hook
1. git clone https://github.com/noobpk/frida-android-hook
2. cd frida-android-hook/
3. chmod +x androidhook
4. Start Frida-server: `./androidhook --fs-start`
5. ./androidhook --help(-h)
6. rebellion :))
3. pip3 install -r requirements.txt
4. python3 setup.py
4. cd frida-android-hook
```

### Usage For Windows:

```
5.1 python3 androidhook.py
5.2 Start Frida-server: `python3 androidhook.py --fs-start`
5.3 python3 androidhook.py --help(-h)
5.4 rebellion :))
```

### Usage For Darwin / Linux

```
6.1 chmod +x androidhook
6.2 Start Frida-server: `./androidhook --fs-start`
6.3 ./androidhook --help(-h)
6.4 rebellion :))
```

If you run the script but it doesn't work, you can try the following:
Expand Down
22 changes: 0 additions & 22 deletions frida-android-hook/androidhook

This file was deleted.

2 changes: 0 additions & 2 deletions frida-android-hook/core/hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ def main():
#Bypass SSL Pinning
elif options.package and options.method == "bypass-ssl":
method = APP_METHODS['Bypass SSL Pinning']
logger.warning('[!] The Method Is Updating!!')
if os.path.isfile(method):
logger.info('[*] Bypass SSL Pinning: ')
logger.info('[*] Spawning: ' + options.package)
Expand All @@ -272,7 +271,6 @@ def main():
#Intercept url request in app
elif options.name and options.method == "i-nw-req":
method = APP_METHODS['Intercept Network Request']
logger.warning('[!] The Method Is Updating!!')
if os.path.isfile(method):
logger.info('[*] Intercept NetWork Request: ')
logger.info('[*] Attaching: ' + options.name)
Expand Down
46 changes: 46 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/python3
import sys
import os
setup = """#!/usr/bin/python3
import os
import subprocess
import shlex
import sys
from shutil import which
try:
if(which('python3') is not None):
command = shlex.split("python3 " +"core/hook.py")
else:
command = shlex.split("python " +"core/hook.py")
command.extend(sys.argv[1:])
subprocess.call(command, cwd=os.path.dirname(__file__))
except Exception as e:
raise e
"""""

def _buildBinary():
try:
if sys.platform == 'darwin':
with open('frida-android-hook/androidhook','w+') as f:
f encoding='utf_8').write(setup)
os.system('chmod +x frida-android-hook/androidhook')
elif sys.platform == 'linux':
with open('frida-android-hook/androidhook','w+') as f:
f encoding='utf_8').write(setup)
os.system('chmod +x frida-android-hook/androidhook')
elif sys.platform == 'win32':
with open('frida-android-hook/androidhook.py','w+') as f:
f encoding='utf_8').write(setup)
except Exception as e:
raise e

if __name__ == '__main__':
if sys.version_info < (3, 0):
print("[x_x] iOS hook requires Python 3.x")
sys.exit(0)
else:
_buildBinary()

0 comments on commit ecdf1f8

Please sign in to comment.