isset

【漏洞复现】WordPress插件Quizlord 2.0 XSS漏洞复现与分析

安稳与你 提交于 2019-12-16 00:11:04
年后趁着需要做安全测试系统不多的这个空档,学学python到处逛逛复现复现和分析一些简单的漏洞 --from Lyricbao 0x00 复现环境 phpstudy wordpress 4.4版本 Quizlord 2.0版本 貌似WordPress爆出漏洞的通常基本大多都是它的插件存在安全问题。 0x01步骤 使用phpstudy搭建环境,搭建wordpress,然后登陆进后台去下载Quizlord插件,版本为2.0 一切就绪后就开始看怎么触发的XSS了 3) At the title type: poc"><script>alert(1)</script> , then fill the remaining fields and click Save. --from exploit-db XSS注入点:title request包 POST /wp4.4/wordpress/wp-admin/admin.php HTTP/1.1 Host: localhost Content-Length: 184 Cache-Control: max-age=0 Origin: http://localhost Upgrade-Insecure-Requests: 1 Content-Type: application/x-www-form-urlencoded User-Agent:

php接口签名服务

社会主义新天地 提交于 2019-12-15 09:37:44
<?php /** * Created by PhpStorm. * User: zrj * Date: 18-10-11 * Time: 上午11:44 */ namespace App\Http\Services; trait SignatureService { public static $requestParamArr = []; /** * 初始化服务 * @param array $requestParamArr * @return mixed */ public static function init(array $requestParamArr) { self::$requestParamArr = $requestParamArr; } /** * 校验请求参数 * @param array $requestParamArr * @param bool $isInit * @return array */ public static function validateQueryParam(array $requestParamArr = [], bool $isInit = true): array { try { if (empty($requestParamArr)) { $requestParamArr = self::$requestParamArr;

Php if($var) used to work [closed]

荒凉一梦 提交于 2019-12-14 04:14:25
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I have som code for a website, that used to work fine with. I want to check if a variable or session is set. I used the following code: if ($_GET['something']){ //Do something } Now i try to install it on a local server, at i get a error code, saying that there is an undefined index. It requires me to do: if

Fatal error: Cannot use isset() on the result of an expression (you can use “null !== expression” instead)

白昼怎懂夜的黑 提交于 2019-12-13 09:24:49
问题 if(isset($_GET['a'] or $_GET['b'])){ echo "ok"; }else{ echo "no"; } i have two var for one condition when isset $_GET['a'] or $_GET['b'] always echo ok either echo no 回答1: isset takes only one input not two it should be if(isset($_GET['a']) OR isset($_GET['b'])) { echo 'ok'; } else { echo 'nope'; } 来源: https://stackoverflow.com/questions/32061024/fatal-error-cannot-use-isset-on-the-result-of-an-expression-you-can-use-nul

Check if form submitted and do something

给你一囗甜甜゛ 提交于 2019-12-13 03:33:27
问题 I have got my validation working but I wanted to only output it, when it has been submitted but isset nor empty seems to work for me for some reason? I am using php 5.5.3 I believe My code: <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" name="register"> <input type="text" placeholder="Username" maxlength="15" name="username"/><br> <input type="password" maxlength="15" name="password1"/><br> <input type="password" maxlength="15" name="password2" /><br> <input type="text"

PHP Make a simple if-isset-empty function

送分小仙女□ 提交于 2019-12-12 10:44:38
问题 I'm coding a worksheet app for a printer company. I'm getting flood of forms. For every single input field I have to check if the $_POST variables are set, and if, so echo back the value. (In case of some error, for example after a validation error, the user shouldn't retype the whole form) Sample code: if(isset($_POST['time'])&&!empty($_POST['time'])){echo $_POST['time'];} I had to implement this about a hundred times. So I tried to figure out some kind of function to make this simple and

Is there a shortcut for the “isset construct”?

谁说胖子不能爱 提交于 2019-12-12 09:34:30
问题 I'm writing quite often this line of code: $myParam = isset($params['myParam']) ? $params['myParam'] : 'defaultValue'; Typically, it makes the line very long for nested arrays. Can I make it shorter? 回答1: function getOr(&$var, $default) { if (isset($var)) { return $var; } else { return $default; } } $myParam = getOr($params['myParam'], 'defaultValue'); Be sure to pass the variable by reference though, otherwise the code will produce a E_NOTICE. Also the use of if/else instead of a ternary

PHP if multiple variables exist

筅森魡賤 提交于 2019-12-12 07:51:57
问题 So i'm having a bit of a problem with having my PHP run a command if multiple variables exist. I made a simple version for people to see what i'm trying to fix easier. Thanks in advance to anyone who can help :) <?php if ((isset($finalusername)) && if (isset($finalpassword)) && if (isset($finalemail))) echo "This will save."; ?> 回答1: if (isset($finalusername, $finalpassword, $finalemail)) Also see The Definitive Guide to PHP's isset and empty. 回答2: You don't need to place the multiple if in

Issue With Isset() Function

为君一笑 提交于 2019-12-12 01:06:44
问题 Trying to learn PHP with test and try method I am struggling with isset(). Here is the code I have: <form action="validate.php" method="POST"> <label title="User Input"> Custom Header Name</label> <input type="text" name="user_input"> <button type="submit" id="pageName">Submit</button> </form> and PHP file is as <?php if(isset($_POST['user_input'])) { echo "Input Is Set"; } else{ echo "Not Yet Set"; } ?> I both cases(empty or filled input) I am getting the first message "Input Is Set" as

isset() didn't work after login with $_SESSION set to valid

微笑、不失礼 提交于 2019-12-11 05:27:32
问题 I have this loginform.php with this part of code (this was called from index.php with a login form): include("config.php"); if(isset($_POST['submit'])) { $username = $_POST['username']; $password = $_POST['password']; if($username == "" || $password == "") { echo "Either username or password field is empty."; echo "<br/>"; echo "<a href='index.php'>Go back</a>"; } else { $result = mysql_query("select * from users where user_username='$username' and user_password='$password'",$conn) or die(