GET请求及传值

源代码

GET.php

<?php highlight_file("./resource/GETResource.php"); $vari = $_GET['variable']; if($vari == "flag"){ echo "
flag{GET_is_very_easy}"; }else{ die("
you will success"); } ?>

GETResource.php

<?php $vari = $_GET['variable']; if($vari == "flag"){ echo "flag{***************}"; }else{ die("you will success"); } ?>

我在phpstudy在本地搭建了一个环境
9000端口

效果如图所示:
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200306125917334.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQzNTM2ODMx,size_16,color_FFFFFF,t_70
查看源代码
发现当变量veri等于flag即输出flag

get请求方法传值是在该网页后加?然后赋值

exp: localhost:9000/GET.php?variable = flag

效果如图:
常用的请求和传值方法
POST请求及传值

源代码

POST.php

<?php highlight_file("./POSTResource.php"); $vari = $_POST['variable']; if($vari == "flag"){ echo "
flag{POST_is_very_easy}"; }else{ die("
you will success"); } ?>

POSTResource.php

<?php $vari = $_POST['variable']; if($vari == "flag"){ echo "flag{***************}"; }else{ die("you will success"); } ?>

访问POST.php效果如图:
常用的请求和传值方法

POST传值可以通过BurpSuite, curl, Python, hackbar等方法

为了方便,我是用Firefox中的组件hackbar进行传值

传值方法如图:
常用的请求和传值方法

常见的传值方法一般是GET和POST

其他方法还有exp: HEAD, PUT, DELETE, CONNECT, OPTIONS, TRACES

这里就不作解释啦, 大家可以到网上查询一下这些传值方法

相关文章:

  • 2022-12-23
  • 2021-08-03
  • 2021-11-25
  • 2022-12-23
  • 2022-01-06
  • 2021-10-16
  • 2021-09-01
  • 2021-07-19
猜你喜欢
  • 2022-12-23
  • 2021-07-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
相关资源
相似解决方案