-
Yasser BDJ (Ro0t-96) committed with GitHub 3 years ago1 parent 1c2bf06f
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
-
-
-
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 -
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 -