Skip to content

Commit

Permalink
Merge pull request #4 from noraj/patch-1
Browse files Browse the repository at this point in the history
fix  Wrong relative path behavior #3
  • Loading branch information
TarlogicSecurity authored May 20, 2019
2 parents b560921 + a8d92a7 commit 9c76b63
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions chankro.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
######## Chankro v0.3 #######
######## Chankro v0.4 #######

# [+] Bypass disable_functions
# [+] Bypass open_basedir
Expand All @@ -10,6 +10,7 @@

import argparse
import base64
import os

parser = argparse.ArgumentParser(description='Generate PHP backdoor')
parser.add_argument('--arch', dest='arch',help='Architecture (32 or 64)')
Expand All @@ -18,8 +19,8 @@
parser.add_argument('--path', dest='pati', help='Absolute path')
args = parser.parse_args()



# path where the tool is installed
script_path = os.path.dirname(os.path.realpath(__file__))

print "\n\n -=[ Chankro ]=-\n -={ @TheXC3LL }=-\n\n"

Expand All @@ -37,7 +38,10 @@
print "[!] Error: please select a valid file as output"
exit()
try:
outfile = open(args.out, "w")
if (os.path.isabs(args.out)):
outfile = open(args.out, "w") # absolute path provided
else:
outfile = open(os.getcwd() + '/' + args.out, "w") # relative path provided
except:
print "[!] Error: file could not be created"
exit()
Expand All @@ -50,7 +54,7 @@
print "[!] Error: unknow architecture"
exit()
else:
archi = "hook" + args.arch + ".so"
archi = script_path + "/hook" + args.arch + ".so"
if not args.pati:
print "[!] Error: remote path"
exit()
Expand Down

0 comments on commit 9c76b63

Please sign in to comment.