Skip to content

Commit

Permalink
0.3.5
Browse files Browse the repository at this point in the history
 - Fix the '--edit' option for editing Script Files.
 - Fix the '--zip' option.
 - Added color to certain messages.
 - Bug fixes & performance improvements.

Signed-off-by: Boudjada Yasser <by.root96@gmail.com>
  • Loading branch information
yasserbdj96 committed Jun 12, 2023
1 parent d19067a commit 239f69e
Show file tree
Hide file tree
Showing 18 changed files with 163 additions and 98 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## 0.3.4 [011-06-2023][Latest Release]:
## 0.3.5 [12-06-2023][Latest Release]:
- Fix the '--edit' option for editing Script Files.
- Fix the '--zip' option.
- Added color to certain messages.
- Bug fixes & performance improvements.

## 0.3.4 [11-06-2023]:
- Now you can easily build a .deb file for Debian installations.
- Bug fixes & performance improvements.

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Security is a top priority for HIPHP, with regular updates ensuring compatibilit
<!--a href="https://raw.githubusercontent.com/yasserbdj96/hiphp/main/screenshot/hiphp_cli.gif">
<img src="https://raw.githubusercontent.com/yasserbdj96/hiphp/main/screenshot/hiphp_cli.gif" alt="hiphp by yasserbdj96">
</a-->
<a href="https://asciinema.org/a/523450" target="_blank"><img src="https://raw.githubusercontent.com/yasserbdj96/hiphp/main/screenshot/demo.png" /></a>
<a href="https://asciinema.org/a/591018" target="_blank"><img src="https://raw.githubusercontent.com/yasserbdj96/hiphp/main/screenshot/demo.png" /></a>
</div>

<br>
Expand Down Expand Up @@ -152,11 +152,11 @@ Security is a top priority for HIPHP, with regular updates ensuring compatibilit

| Distribution | Version Check | Python Version | Installation | hiphp-cli | hiphp-desktop | hiphp-tk |
| :------------: | :-----------: | :------------: | :----------: | :--------: | :-----------: | :------: |
| Ubuntu | Last version | 3.7 --> 3.11 ||| ||
| Windwos | Last version | 3.7 --> 3.11 ||| ||
| MacOS | Last version | 3.7 --> 3.10 ||| ||
| Android-termux | Last version | 3.7 --> 3.9 ||| ||
| Nethunter | Last version | 3.7 --> 3.9 ||| ||
| Ubuntu | Last version | 3.7 --> 3.11 |||||
| Windwos | Last version | 3.7 --> 3.11 |||||
| MacOS | Last version | 3.7 --> 3.10 |||||
| Android-termux | Last version | 3.7 --> 3.9 |||||
| Nethunter | Last version | 3.7 --> 3.9 |||||

<br>
<h2>Hiphp with Docker:</h2>
Expand Down
3 changes: 3 additions & 0 deletions build_deb.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/sh

find . -type d -name __pycache__ -prune -exec rm -rf {} \;
find . -type d -name venv -prune -exec rm -rf {} \;

appname="hiphp" # Replace with your app name
file_path="version.txt"
version=$(head -n 1 "$file_path")
Expand Down
103 changes: 83 additions & 20 deletions hiphp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ def check_hiphp_in(url):
ppth=command.split(" ")[1:]
try:
command=simulate_mv(ppth[0],ppth[1])
print(hiphp.do(self,self.key,self.url,self.headers,True,command))
mv_msg=hiphp.do(self,self.key,self.url,self.headers,True,command)
print(print_msg_with_c(mv_msg))
except:
help(__version__,"--mv")
#download
Expand All @@ -272,7 +273,8 @@ def check_hiphp_in(url):
out_path=down[2]
except:
out_path=""
print(smsg_1+hiphp.download(self,down[1],out_path))
print(print_msg_with_c(smsg_1+hiphp.download(self,down[1],out_path)))
#print(smsg_1+hiphp.download(self,down[1],out_path))
elif down[0].lower()=="-d":
try:
zip_file_name=hiphp.compress(self,down[1])
Expand All @@ -284,14 +286,14 @@ def check_hiphp_in(url):
out_path=down[2]
except:
out_path=""
print(smsg_1+hiphp.download(self,zip_file_name,out_path))
print(print_msg_with_c(smsg_1a+hiphp.download(self,zip_file_name,out_path)))
elif down[0].lower()=="-all":
try:
out_path=down[1]
except:
out_path=""
zip_file_name=hiphp.compress(self)
print(smsg_1+hiphp.download(self,zip_file_name,out_path))
print(print_msg_with_c(smsg_1+hiphp.download(self,zip_file_name,out_path)))
else:
help(__version__,"--down")

Expand All @@ -301,13 +303,14 @@ def check_hiphp_in(url):
elif command.lower().startswith("--zip") or command.lower().startswith("zip"):

try:
ziping=command.split(" ")[1]
try:
ziping=command.split(" ")[1]
zip_file_name=hiphp.compress(self,ziping)
except:
zip_file_name=hiphp.compress(self)
print(smsg_2+reee+self.DS+zip_file_name)
except:
print(print_msg_with_c(smsg_2+reee+self.DS+zip_file_name))
except NameError as e:
print(e)
help(__version__,"--zip")
#update
elif command.lower().startswith("--update") or command.lower().startswith("update"):
Expand All @@ -326,10 +329,10 @@ def check_hiphp_in(url):
else:
new=False
if new==True:
print(msg_2+version)
print(msg_3)
print(print_msg_with_c(msg_2+version))
print(print_msg_with_c(msg_3))
else:
print(msg_4)
print(print_msg_with_c(msg_4))
#ls
elif command.lower().startswith("--ls") or command.lower().startswith("ls"):
if len(command) == 4 or len(command) == 2:
Expand Down Expand Up @@ -426,26 +429,85 @@ def check_hiphp_in(url):
hiphp.do(self, self.key, self.url, self.headers, False, command)

#edt
elif command.lower().startswith("--edt") or command.lower().startswith("edt") or command.lower().startswith("edit"):
elif command.lower().startswith("--edt") or command.lower().startswith("edt") or command.lower().startswith("edit") or command.lower().startswith("--edit"):
dirx = command.split(" ")[1]


xxnn=hiphp.do(self,self.key,self.url,self.headers,True,"echo $_SERVER['SCRIPT_FILENAME'];")
xxnnb=hiphp.do(self,self.key,self.url,self.headers,True,"echo getcwd();")

ish=xxnn.replace(xxnnb,"")
if ish==dirx or ish==self.DS+dirx or ish=="."+self.DS+dirx:
ttx=self.color.c("[!] Edit ",self.c_red)+self.color.c(f"'{xxnn}'",self.c_yellow)+ self.color.c("? This may cause errors or login issues (Y/N): ",self.c_red)
doyou=input(ttx)
if doyou.lower()=="y":
old_url_w=self.url_w
old_url=self.url
out_path = hiphp.download(self, dirx, "")
if editor(out_path)!="q":

original_path = out_path
extension = os.path.splitext(original_path)[1]
new_filename = os.path.splitext(original_path)[0] + "_hiphphole" + extension

new_path = os.path.join(os.path.dirname(original_path), new_filename)

# Perform the file copy operation
with open(original_path, 'rb') as src_file, open(new_path, 'wb') as dest_file:
dest_file.write(src_file.read())

hiphp.upload(self, new_path)


basenamef=os.path.basename(dirx)
ccvvbb=os.path.splitext(basenamef)

self.url=self.url.replace(os.path.basename(xxnn),ccvvbb[0]+"_hiphphole"+ccvvbb[1])
url_w=re.compile(r"https?://(www\.)?")
self.url_w=url_w.sub('',str(self.url)).strip().strip('/')

hiphp.run(self, f"unlink('{dirx}');")

newcopy=dirx.replace(basenamef,ccvvbb[0]+"_hiphphole"+ccvvbb[1])

code=f"""$file_path = '{newcopy}';"""+"""
$new_file_path = str_replace('_hiphphole', '', $file_path);
if (rename($file_path, $new_file_path)) {echo "File edited successfully!";} else {echo "File edit failed.";}
"""
xx=hiphp.run(self, code)

print(xx)
os.remove(out_path)
os.remove(new_filename)
self.url=old_url
self.url_w=old_url_w

hiphp.cli(self)
exit()


else:
hiphp.cli(self)
pass
else:
hiphp.cli(self)
try:
from_path = os.path.dirname(dirx)
except:
from_path = "."

out_path = hiphp.download(self, dirx, "")

editor(out_path)

hiphp.run(self, f"unlink('{dirx}');")
if editor(out_path)!="q":
hiphp.run(self, f"unlink('{dirx}');")

if from_path == "":
hiphp.upload(self, out_path)
if from_path == "":
hiphp.upload(self, out_path)
else:
hiphp.upload(self, out_path, from_path + self.DS)
os.remove(out_path)
else:
hiphp.upload(self, out_path, from_path + self.DS)

os.remove(out_path)
hiphp.cli(self)

#os.system('cls' if os.name == 'nt' else 'clear')
#print(out_path)
Expand Down Expand Up @@ -592,6 +654,7 @@ def upload(self,path_to_upluad,to=""):
hiphp.run(self,"if(!file_exists('"+p+to+"')){mkdir('"+p+to+"',0777,true);}")
else:
pass
#print(f"{p+to+os.path.basename(path_to_upluad)}")
hiphp.run(self,f'file_put_contents("{p+to+os.path.basename(path_to_upluad)}", base64_decode("{encoded_string}"), FILE_APPEND | LOCK_EX);')
#hiphp.run(self,f'Fwrite(fopen("{p+to+os.path.basename(path_to_upluad)}","w+"),base64_decode("{encoded_string}"));')
except:
Expand Down
3 changes: 2 additions & 1 deletion hiphp/hiphpeditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@ def editor(stdscr):
elif ch == curses.KEY_DOWN and r < len(b)-1: r += 1
rw = b[r] if r < len(b) else None; rwlen = len(rw) if rw is not None else 0
if c > rwlen: c = rwlen
if ch == (ord('q') & 0x1f): xxvo=False
if ch == (ord('q') & 0x1f): xxvo=False;curses.endwin();return "q"
elif ch == (ord('s') & 0x1f):
cont = ''
for l in b: cont += ''.join([chr(c) for c in l]) + '\n'
with open(src, 'w') as f:
f.write(cont)
xxvo=False

curses.endwin()
#editor("vvvv.py")
#curses.wrapper(main)
Expand Down
15 changes: 15 additions & 0 deletions hiphp/hiphpfunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#START{
import os
import shutil
from hexor import *

def center(text):
try:
Expand Down Expand Up @@ -50,4 +51,18 @@ def lslist(lslist, separator='|'):

return lslist_final

def print_msg_with_c(text):

color=hexor(True)
if "[✗]" in text:
colorx="#ea4335"
elif "[!]" in text:
colorx="#fbbc05"
elif "[✓]" in text:
colorx="#34a853"
else:
colorx="#ffffff"

return color.c(text,colorx)

#}END.
1 change: 1 addition & 0 deletions hiphp/hiphpmsgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@

msgs="[✓]"
smsg_1=f"{msgs} File downloaded in: "
smsg_1a=f"{msgs} Folder downloaded in: "
smsg_2=f"{msgs} The path has been compressed into: "
#}END.
112 changes: 44 additions & 68 deletions hiphp/hiphpphpfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,73 +287,49 @@ def chmod(permissions,path):

#
def php_info():
code="""header('Content-type: text/plain');
echo "OS : ".php_uname();
echo "\n";
echo "your_ip: ".$_SERVER['REMOTE_ADDR'];
echo "\n";
echo "HTTP_HOST : ".$_SERVER['HTTP_HOST'];
echo "\n";
echo "REQUEST_METHOD : ".$_SERVER['REQUEST_METHOD'];
echo "\n";
echo "SERVER_ADMIN : ".$_SERVER['SERVER_ADMIN'];
echo "\n";
echo "SERVER_PORT : ".htmlentities($_SERVER['SERVER_PORT'], ENT_QUOTES, 'UTF-8');
echo "\n";
echo "server_ip : ".gethostbyname($_SERVER["HTTP_HOST"]);
echo "\n";
echo "PHP_SELF : ".$_SERVER['PHP_SELF'];
echo "\n";
echo "GATEWAY_INTERFACE : ".$_SERVER['GATEWAY_INTERFACE'];
echo "\n";
echo "SERVER_ADDR : ".$_SERVER['SERVER_ADDR'];
echo "\n";
echo "SERVER_NAME : ".$_SERVER['SERVER_NAME'];
echo "\n";
echo "SERVER_PROTOCOL : ".$_SERVER['SERVER_PROTOCOL'];
echo "\n";
echo "REQUEST_TIME : ".$_SERVER['REQUEST_TIME'];
echo "\n";
echo "QUERY_STRING : ".$_SERVER['QUERY_STRING'];
echo "\n";
echo "HTTP_ACCEPT : ".$_SERVER['HTTP_ACCEPT'];
echo "\n";
echo "HTTP_ACCEPT_CHARSET : ".$_SERVER['HTTP_ACCEPT_CHARSET'];
echo "\n";
echo "HTTP_REFERER : ".$_SERVER['HTTP_REFERER'];
echo "\n";
echo "HTTPS : ".$_SERVER['HTTPS'];
echo "\n";
echo "REMOTE_HOST : ".$_SERVER['REMOTE_HOST'];
echo "\n";
echo "REMOTE_PORT : ".$_SERVER['REMOTE_PORT'];
echo "\n";
echo "SCRIPT_FILENAME : ".$_SERVER['SCRIPT_FILENAME'];
echo "\n";
echo "SERVER_SIGNATURE : ".$_SERVER['SERVER_SIGNATURE'];
echo "\n";
echo "PATH_TRANSLATED : ".$_SERVER['PATH_TRANSLATED'];
echo "\n";
echo "SCRIPT_NAME : ".$_SERVER['SCRIPT_NAME'];
echo "\n";
echo "SCRIPT_URI : ".$_SERVER['SCRIPT_URI'];
echo "\n";
echo "server_software : ".getenv("SERVER_SOFTWARE");
echo "\n";
echo "Php Version : ".phpversion();
echo "\n";
echo "Zend : ".htmlentities(zend_version(), ENT_QUOTES, 'UTF-8');
echo "\n";
echo "Oracle : ".$Oracle2=function_exists('ocilogon')?("ON"):("OFF");
echo "\n";
echo "MySQL : ".$MySQL2=function_exists('mysql_connect')?("ON"):("OFF");
echo "\n";
echo "MSSQL : ".$MSSQL2=function_exists('mssql_connect')?("ON"):("OFF");
echo "\n";
echo "PostgreSQL : ".$pg_connect2=function_exists('pg_connect')?("ON"):("OFF");
echo "\n";
echo "disabled_functions : ".$r=ini_get('disable_functions') ? ini_get('disable_functions'):'none';
echo "\n";
echo "DIRECTORY_SEPARATOR : ".DIRECTORY_SEPARATOR;"""
code="""
$data = array(
'OS' => php_uname(),
'Your IP' => $_SERVER['REMOTE_ADDR'],
'HTTP_HOST' => $_SERVER['HTTP_HOST'],
'Request Method' => $_SERVER['REQUEST_METHOD'],
'Server Admin' => $_SERVER['SERVER_ADMIN'],
'Server Port' => htmlentities($_SERVER['SERVER_PORT'], ENT_QUOTES, 'UTF-8'),
'Server IP' => gethostbyname($_SERVER["HTTP_HOST"]),
'PHP Self' => $_SERVER['PHP_SELF'],
'Gateway Interface' => $_SERVER['GATEWAY_INTERFACE'],
'Server Address' => $_SERVER['SERVER_ADDR'],
'Server Name' => $_SERVER['SERVER_NAME'],
'Server Protocol' => $_SERVER['SERVER_PROTOCOL'],
'Request Time' => date('Y-m-d H:i:s', $_SERVER['REQUEST_TIME']),
'Query String' => $_SERVER['QUERY_STRING'],
'HTTP Accept' => $_SERVER['HTTP_ACCEPT'],
'HTTP Accept Charset' => $_SERVER['HTTP_ACCEPT_CHARSET'],
'HTTP Referer' => $_SERVER['HTTP_REFERER'],
'HTTPS' => isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'Enabled' : 'Disabled',
'Remote Host' => isset($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : 'Unknown',
'Remote Port' => $_SERVER['REMOTE_PORT'],
'Script Filename' => $_SERVER['SCRIPT_FILENAME'],
'Server Signature' => $_SERVER['SERVER_SIGNATURE'],
'Path Translated' => $_SERVER['PATH_TRANSLATED'],
'Script Name' => $_SERVER['SCRIPT_NAME'],
'Script URI' => $_SERVER['SCRIPT_URI'],
'Server Software' => getenv("SERVER_SOFTWARE"),
'PHP Version' => phpversion(),
'Zend Version' => htmlentities(zend_version(), ENT_QUOTES, 'UTF-8'),
'Oracle' => function_exists('ocilogon') ? 'ON' : 'OFF',
'MySQL' => function_exists('mysql_connect') ? 'ON' : 'OFF',
'MSSQL' => function_exists('mssql_connect') ? 'ON' : 'OFF',
'PostgreSQL' => function_exists('pg_connect') ? 'ON' : 'OFF',
'Disabled Functions' => $r = ini_get('disable_functions') ? $r : 'None',
'Directory Separator' => DIRECTORY_SEPARATOR,
'Current Date and Time' => date('Y-m-d H:i:s')
);
$maxKeyLength = max(array_map('strlen', array_keys($data)));
foreach ($data as $key => $value) {
printf("%-{$maxKeyLength}s : %s\n", $key, $value);
}"""
return code
#}END.
2 changes: 1 addition & 1 deletion hiphp/hiphpversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# | | #

#START{
__version__="0.3.4"
__version__="0.3.5"
#}END.
Binary file modified screenshot/HIPHP_HOLE_CODE.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshot/demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshot/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshot/screenshot0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshot/screenshot1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshot/screenshot14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshot/screenshot2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshot/screenshot3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 239f69e

Please sign in to comment.