-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathroot_bypass.py
executable file
·70 lines (56 loc) · 1.81 KB
/
root_bypass.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/python3
import argparse
import os
import docker
def calling_docker(input, output):
client = docker.from_env()
imageTag = "aymanrb/root_detection_bypass"
volumes = [input+':/home/input.apk', output+':/app/output/']
command = ""
try:
appContainer = client.containers.run(
image=imageTag,
remove=True,
stdout=False,
stderr=True,
network_mode="host",
volumes=volumes,
privileged=True,
command=command
)
output += "/generated.apk"
print(
f"if everything went well, the path of the APK without root detection is : {output}")
print("Happy Hacking !")
except docker.errors.ContainerError as c:
print(c)
except Exception as e:
print(e)
parser = argparse.ArgumentParser(
description="""
A simple tool for bypassing easy root detection mechanisms.
Examples usage :
$ bypasser -i /tmp/target.apk -o /tmp/output
$ bypasser -i /tmp/target.apk
$ bypasser --help
""",
formatter_class=argparse.RawDescriptionHelpFormatter
)
parser.add_argument("-i", "--input", type=str,
help="the full path of your apk", required=True)
parser.add_argument("-o", "--output", type=str,
help="the full path of the folder where the new apk will be generated. Otherwise, the folder 'output' will be created/used in the current directory.", required=False)
args = parser.parse_args()
folder = "output"
os.chdir(".")
pwd = os.getcwd()
input = args.input
output = args.output
if("/" not in input):
print("Please provide the full path of your apk")
sys.exit(0)
if(args.output is None):
output = pwd+"/output"
if not os.path.isdir(folder):
os.mkdir(folder)
calling_docker(input, output)