Projects STRLCPY hiphp Commits 8387111d
🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■ ■
    README.md
    skipped 13 lines
    14 14  <h2>Installation:</h2>
    15 15  
    16 16  ```
    17  -pip install hiphp==0.1.7
     17 +pip install hiphp==0.1.9
    18 18  ```
    19 19  
    20 20  <h2>Usage:</h2>
    skipped 3 lines
    24 24  #s
    25 25  from hiphp import hiphp
    26 26  
    27  -p1=hiphp("<PASSWORD>","<http://THE/LINK/TO/THE/PHP/FILE/THAT/CONTAINS/THE/HIPHP/ID>")
    28  -print(p1.get_code())//Get HIPHP ID for first use.
    29  -p1.run("<YOUR_CODE>")//Run a code or line in your website.
    30  -p1.run_file("<PHP_CODE_FILE_PATH>")//Run a code or line in your website from a file.
    31  -p1.run_file("<PHP_CODE_FILE_PATH>","<__VALUE_NAME__>==<VALUE_CONTENT>")//Run a code or line in your website from a file With the entry of variables.
    32  -p1.cli()//open command panel
    33  -p1.upload("<THE_PATH_OF_THE_FILE_TO_BE_UPLOADED>")//Upload a file to the server hosting the site.
     27 +p1=hiphp("<PASSWORD>","<http://THE/LINK/TO/THE/PHP/FILE/THAT/CONTAINS/THE/HIPHP/ID>",False) #In order to print the result directly.
     28 +#p1=hiphp("<PASSWORD>","<http://THE/LINK/TO/THE/PHP/FILE/THAT/CONTAINS/THE/HIPHP/ID>") #In order to make the result as a variable.
     29 +print(p1.get_code()) #Get HIPHP ID for first use.
     30 +p1.run("<YOUR_CODE>") #Run a code or line in your website.
     31 +p1.run_file("<PHP_CODE_FILE_PATH>") #Run a code or line in your website from a file.
     32 +p1.run_file("<PHP_CODE_FILE_PATH>","<__VALUE_NAME__>==<VALUE_CONTENT>") #Run a code or line in your website from a file With the entry of variables.
     33 +p1.cli() #open command panel
     34 +p1.upload("<THE_PATH_OF_THE_FILE_TO_BE_UPLOADED>") #Upload a file to the server hosting the site.
    34 35  p1.upload("<THE_PATH_OF_THE_FILE_TO_BE_UPLOADED>","./<THE_PATH_YOU_WANT_TO_UPLOAD_THE_FILE_TO>")
    35 36  #e
    36 37  
    skipped 6 lines
    43 44  #s
    44 45  from hiphp import hiphp
    45 46  
    46  -p1=hiphp("123","http://localhost/index.php")
     47 +p1=hiphp("123","http://localhost/index.php",False)
    47 48  
    48 49  # Example:1
    49 50  # GET ID:
    skipped 74 lines
    124 125  <h2>Changelog:</h2>
    125 126  
    126 127  ```
     128 +## 0.1.9
     129 + - fix bugs.
     130 +
    127 131  ## 0.1.7
    128 132   - fix bugs.
    129 133  
    skipped 68 lines
  • ■ ■ ■ ■ ■ ■
    Scripts/hiphp_ftp/ftp.py
     1 +# EXAMPLES :
     2 +#s
     3 +import re
     4 +from hiphp import hiphp
     5 +from tkinter import *
     6 +from tkinter import filedialog
     7 +import os
     8 +from chardet import detect
     9 +
     10 +url="http://localhost/hiphp.php"
     11 +password="123"
     12 +
     13 +p1=hiphp(password,url).run("""
     14 +function iterateDirectory($i){
     15 + foreach($i as $path){
     16 + if($path->isDir()){
     17 + iterateDirectory($path);
     18 + }else{
     19 + echo $path.",";
     20 + }
     21 + }
     22 +}
     23 +$dir='.';
     24 +$iterator=new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir));
     25 +iterateDirectory($iterator);""")
     26 +
     27 +files_list=p1.split(",")
     28 +del files_list[-1]
     29 +for i in range(len(files_list)):
     30 + files_list[i]=files_list[i].replace("\\","/")
     31 +
     32 +# get file encoding type
     33 +def get_encoding_type(file):
     34 + with open(file,'rb') as f:
     35 + rawdata = f.read()
     36 + return detect(rawdata)['encoding']
     37 +
     38 +
     39 +def selectmode():
     40 + if var1.get()==1:
     41 + mylist['selectmode']="multiple"
     42 + else:
     43 + mylist['selectmode']="SINGLE"
     44 +
     45 +def deleteSelected():
     46 + #selected=[]
     47 + cname=mylist.curselection()
     48 + for i in cname[::-1]:
     49 + op=mylist.get(i)
     50 + #selected.append(op)
     51 + mylist.delete(i)
     52 + del_file='$file_pointer="'+op+'";if(!unlink($file_pointer)){echo("$file_pointer cannot be deleted due to an error");}else{echo("$file_pointer has been deleted");}'
     53 + p1=hiphp(password,url).run(f"{del_file}")
     54 + print(p1)
     55 + unselect_all()
     56 +
     57 +def select_all():
     58 + mylist.select_set(0,END)
     59 +
     60 +def unselect_all():
     61 + mylist.selection_clear(0,END)
     62 +
     63 +def openSelected():
     64 + if var1.get()==0:
     65 + cname=mylist.curselection()
     66 + for i in cname[::-1]:
     67 + op=mylist.get(i)
     68 + p1=hiphp(password,url).run(f"echo file_get_contents('{op}');")
     69 + print(p1)
     70 +
     71 +def upSelected():
     72 + file=filedialog.askopenfile(parent=root,mode='rb',title='Choose a file')
     73 + if file!=None:
     74 + file_name=file.name.split("/")
     75 + file_name=file_name[len(file_name)-1]
     76 + p1=hiphp(password,url).upload(file.name)
     77 +
     78 +def upSelected_to():
     79 + if var1.get()==0:
     80 + cname=mylist.curselection()
     81 +
     82 + for i in cname[::-1]:
     83 + op=mylist.get(i)
     84 + op=op.split("/")
     85 + path=""
     86 + for i in range(len(op)-1):
     87 + if path=="":
     88 + ss=""
     89 + else:
     90 + ss="/"
     91 + path=path+ss+op[i]
     92 +
     93 + file=filedialog.askopenfile(parent=root,mode='rb',title='Choose a file')
     94 + if file!=None:
     95 + file_name=file.name.split("/")
     96 + file_name=file_name[len(file_name)-1]
     97 +
     98 + p1=hiphp(password,url).upload(file.name,path+"/")
     99 +
     100 +root=Tk()
     101 +root.title('Hiphp FTP')
     102 +#root.iconbitmap(r'favicon.ico')
     103 +root.geometry('700x500')
     104 +scrollbar=Scrollbar(root)
     105 +
     106 +mylist=Listbox(root,bd=0,yscrollcommand=scrollbar.set)#,selectmode="multiple"
     107 +
     108 +x=files_list
     109 +for item in range(len(x)):
     110 + mylist.insert(END,x[item])
     111 + mylist.itemconfig(item,bg="#f6f6f6")
     112 +
     113 +mylist.pack(side=LEFT,padx=0,pady=0,expand=YES,fill="both")
     114 +scrollbar.pack(side=LEFT,fill=BOTH)
     115 +scrollbar.config(command=mylist.yview)
     116 +
     117 +select_all_btn=Button(root,text="Select all",command=select_all)
     118 +select_all_btn.pack()
     119 +select_all_btn.config(width=15)#,height=2
     120 +
     121 +unselect_all_btn=Button(root,text="Unselect all",command=unselect_all)
     122 +unselect_all_btn.pack()
     123 +unselect_all_btn.config(width=15)
     124 +
     125 +openSelected_btn=Button(root,text="Open",command=openSelected)
     126 +openSelected_btn.pack()
     127 +openSelected_btn.config(width=15)
     128 +
     129 +upSelected_btn=Button(root,text="Upload",command=upSelected)
     130 +upSelected_btn.pack()
     131 +upSelected_btn.config(width=15)
     132 +
     133 +upSelected_to_btn=Button(root,text="Upload to",command=upSelected_to)
     134 +upSelected_to_btn.pack()
     135 +upSelected_to_btn.config(width=15)
     136 +
     137 +deleteSelected_btn=Button(root,text="Delete",command=deleteSelected)
     138 +deleteSelected_btn.pack()
     139 +deleteSelected_btn.config(width=15)
     140 +
     141 +var1=IntVar()
     142 +c1=Checkbutton(root,text='multiple selection',variable=var1,onvalue=1,offvalue=0,command=selectmode)
     143 +c1.pack(side="bottom")
     144 +
     145 +mainloop()
     146 +#e
  • ■ ■ ■ ■ ■ ■
    changelog.txt
     1 +## 0.1.9
     2 + - fix bugs.
     3 +
    1 4  ## 0.1.7
    2 5   - fix bugs.
    3 6  
    skipped 32 lines
  • ■ ■ ■ ■
    examples.py
    skipped 1 lines
    2 2  #s
    3 3  from hiphp import hiphp
    4 4  
    5  -p1=hiphp("123","http://localhost/index.php")
     5 +p1=hiphp("123","http://localhost/index.php",False)
    6 6  
    7 7  # Example:1
    8 8  # GET ID:
    skipped 72 lines
  • ■ ■ ■ ■ ■ ■
    hiphp/__init__.py
    skipped 6 lines
    7 7  #s
    8 8  from hiphp import hiphp
    9 9  
    10  -p1=hiphp("<PASSWORD>","<http://THE/LINK/TO/THE/PHP/FILE/THAT/CONTAINS/THE/HIPHP/ID>")
    11  -print(p1.get_code())//Get HIPHP ID for first use.
    12  -p1.run("<YOUR_CODE>")//Run a code or line in your website.
    13  -p1.run_file("<PHP_CODE_FILE_PATH>")//Run a code or line in your website from a file.
    14  -p1.run_file("<PHP_CODE_FILE_PATH>","<__VALUE_NAME__>==<VALUE_CONTENT>")//Run a code or line in your website from a file With the entry of variables.
    15  -p1.cli()//open command panel
    16  -p1.upload("<THE_PATH_OF_THE_FILE_TO_BE_UPLOADED>")//Upload a file to the server hosting the site.
     10 +p1=hiphp("<PASSWORD>","<http://THE/LINK/TO/THE/PHP/FILE/THAT/CONTAINS/THE/HIPHP/ID>",False) #In order to print the result directly.
     11 +#p1=hiphp("<PASSWORD>","<http://THE/LINK/TO/THE/PHP/FILE/THAT/CONTAINS/THE/HIPHP/ID>") #In order to make the result as a variable.
     12 +print(p1.get_code()) #Get HIPHP ID for first use.
     13 +p1.run("<YOUR_CODE>") #Run a code or line in your website.
     14 +p1.run_file("<PHP_CODE_FILE_PATH>") #Run a code or line in your website from a file.
     15 +p1.run_file("<PHP_CODE_FILE_PATH>","<__VALUE_NAME__>==<VALUE_CONTENT>") #Run a code or line in your website from a file With the entry of variables.
     16 +p1.cli() #open command panel
     17 +p1.upload("<THE_PATH_OF_THE_FILE_TO_BE_UPLOADED>") #Upload a file to the server hosting the site.
    17 18  p1.upload("<THE_PATH_OF_THE_FILE_TO_BE_UPLOADED>","./<THE_PATH_YOU_WANT_TO_UPLOAD_THE_FILE_TO>")
    18 19  #e
    19 20  ##################################################################
    skipped 1 lines
    21 22  #s
    22 23  from hiphp import hiphp
    23 24  
    24  -p1=hiphp("123","http://localhost/index.php")
     25 +p1=hiphp("123","http://localhost/index.php",False)
    25 26  
    26 27  # Example:1
    27 28  # GET ID:
    skipped 72 lines
    100 101  """
    101 102  # VALUES :
    102 103  #s
    103  -__version__="0.1.7"
     104 +__version__="0.1.9"
    104 105  __name__="hiphp"
    105 106  __author__="Yasser BDJ (Ro0t96)"
    106 107  __author_email__="[email protected]"
    skipped 20 lines
    127 128  limitations under the License.'''
    128 129  __copyright__='Copyright 2008 -> Present, '+__author__
    129 130  
    130  -__changelog__=("## 0.1.7\n - fix bugs.\n\n")
     131 +__changelog__=("## 0.1.9\n - fix bugs.\n\n")
     132 +__changelog__=__changelog__+("## 0.1.7\n - fix bugs.\n\n")
    131 133  __changelog__=__changelog__+("## 0.1.6\n - fix bugs.\n - add upload to upload any file.\n - Simplify the use of the program.\n\n")
    132 134  __changelog__=__changelog__+("## 0.1.5\n - fix bugs.\n\n")
    133 135  __changelog__=__changelog__+("## 0.1.4\n - fix bugs.\n - new build. \n\n")
    skipped 17 lines
    151 153  #start hiphp class:
    152 154  class hiphp:
    153 155   #__init__:
    154  - def __init__(self,key,url):
     156 + def __init__(self,key,url,returns=True):
    155 157   self.key=ashar(key,key).encode()
    156 158   self.url=url
    157 159   self.headers={'User-Agent':self.key}
    158 160   self.print=hexor()
    159 161   self.print2=hexor(True)
     162 + self.returns=returns
    160 163  
    161 164   #run:
    162 165   def run(self,command):
    163  - hiphp.do(self.url,self.headers,command)
     166 + if self.returns==True:
     167 + return hiphp.do(self.url,self.headers,command,self.returns)
     168 + else:
     169 + hiphp.do(self.url,self.headers,command,self.returns)
    164 170  
    165 171   #cli:
    166 172   def cli(self):
    167 173   command=input('hiphp>>>')
    168 174   if command:
    169  - hiphp.do(self.url,self.headers,command)
     175 + hiphp.do(self.url,self.headers,command,self.returns)
    170 176   else:
    171 177   print(p1.c("Command not found!","#ff5b3c"))
    172 178   hiphp.cli(self)
    skipped 10 lines
    183 189   value,string=opts[i].split("==")
    184 190   open_file=open_file.replace(f"__{value}__",string)
    185 191  
    186  - hiphp.do(self.url,self.headers,open_file)
     192 + if self.returns==True:
     193 + return hiphp.do(self.url,self.headers,open_file,self.returns)
     194 + else:
     195 + hiphp.do(self.url,self.headers,open_file,self.returns)
    187 196   except:
    188 197   self.print.c("The file you entered does not exist.","#ff5b3c")
    189 198  
    skipped 8 lines
    198 207   except:
    199 208   self.print.c(f"We could not read the file {path_to_upluad}","#ff5b3c")
    200 209   #do:
    201  - def do(url,headers,command):
     210 + def do(url,headers,command,returns):
    202 211   response=requests.post(url,headers=headers)
    203 212   if response.status_code==200:
    204 213   if response.text[0:7]=="#python":
    205 214   ploads={'command':command}#open('php.php').read()
    206 215   response=requests.post(url,headers=headers,data=ploads)
    207  - hiphp.check_errors(response.text[7:])
     216 + if returns==True:
     217 + return hiphp.check_errors(response.text[7:],returns)
     218 + else:
     219 + hiphp.check_errors(response.text[7:],returns)
    208 220   else:
    209 221   hexor().c("We were unable to recognize the hiphp identifier.","#ff5b3c")
    210 222   else:
    211 223   hexor().c("We were unable to connect '"+url+"'.","#ff5b3c")
    212 224  
    213 225   #check_errors:
    214  - def check_errors(response):
     226 + def check_errors(response,returns):
    215 227   if response[:6]!="<br />":
    216  - print(response)
     228 + if returns==True:
     229 + return response
     230 + else:
     231 + print(response)
    217 232   else:
    218 233   result=re.search('on line <b>(.*)</b><br />',response)
    219 234   hexor().c(f"ERROR in line {result.group(1)}.","#ff5b3c")
    skipped 18 lines
  • ■ ■ ■ ■
    setup.py
    1 1  from setuptools import setup,find_packages
    2 2  setup(
    3 3   name="hiphp",
    4  - version="0.1.7",
     4 + version="0.1.9",
    5 5   author="Yasser BDJ (Ro0t96)",
    6 6   author_email="[email protected]",
    7 7   description='''A package for controlling a php-based website.''',
    skipped 23 lines
  • ■ ■ ■ ■ ■ ■
    usage.py
    skipped 1 lines
    2 2  #s
    3 3  from hiphp import hiphp
    4 4  
    5  -p1=hiphp("<PASSWORD>","<http://THE/LINK/TO/THE/PHP/FILE/THAT/CONTAINS/THE/HIPHP/ID>")
    6  -print(p1.get_code())//Get HIPHP ID for first use.
    7  -p1.run("<YOUR_CODE>")//Run a code or line in your website.
    8  -p1.run_file("<PHP_CODE_FILE_PATH>")//Run a code or line in your website from a file.
    9  -p1.run_file("<PHP_CODE_FILE_PATH>","<__VALUE_NAME__>==<VALUE_CONTENT>")//Run a code or line in your website from a file With the entry of variables.
    10  -p1.cli()//open command panel
    11  -p1.upload("<THE_PATH_OF_THE_FILE_TO_BE_UPLOADED>")//Upload a file to the server hosting the site.
     5 +p1=hiphp("<PASSWORD>","<http://THE/LINK/TO/THE/PHP/FILE/THAT/CONTAINS/THE/HIPHP/ID>",False) #In order to print the result directly.
     6 +#p1=hiphp("<PASSWORD>","<http://THE/LINK/TO/THE/PHP/FILE/THAT/CONTAINS/THE/HIPHP/ID>") #In order to make the result as a variable.
     7 +print(p1.get_code()) #Get HIPHP ID for first use.
     8 +p1.run("<YOUR_CODE>") #Run a code or line in your website.
     9 +p1.run_file("<PHP_CODE_FILE_PATH>") #Run a code or line in your website from a file.
     10 +p1.run_file("<PHP_CODE_FILE_PATH>","<__VALUE_NAME__>==<VALUE_CONTENT>") #Run a code or line in your website from a file With the entry of variables.
     11 +p1.cli() #open command panel
     12 +p1.upload("<THE_PATH_OF_THE_FILE_TO_BE_UPLOADED>") #Upload a file to the server hosting the site.
    12 13  p1.upload("<THE_PATH_OF_THE_FILE_TO_BE_UPLOADED>","./<THE_PATH_YOU_WANT_TO_UPLOAD_THE_FILE_TO>")
    13 14  #e
    14 15   
  • ■ ■ ■ ■
    version.txt
    1  -0.1.7
     1 +0.1.9
Please wait...
Page is in error, reload to recover