dsjpik057730 2019-05-07 11:18
浏览 160

尝试通过get方法注入php代码的方法

So I was doing(trying) some hacking work and got interested in xss

echo $_GET['cmd'];

Lets assume the above code is my vulnurable site page.single line php code

I tried page?cmd=<script>alert('hi');</script>

which executed an alert dialogue

Now i need to process php. I know the page is already loaded and even if i pass php functions it will be in the source code but it wont execute. Is there a way to get it execute?

UPDATE:

http://localhost/evaltest.php?data=%3Cscript%3Ealert(%27Hit%27);document.write(%27%3C?php%20echo%20%22HI%22;?%3E%27);%3C/script%3E

The code i am passing is

<script>alert('Hit');document.write('<?php echo "HI"');</script>

And the "Hi" alert is coming in and the php code is also written but like when you open the source code

<html><head></head>
 <body>
  <script>
   alert('Hit');
   document.write('<?php echo "HI"');
  </script>
  <!--?php echo "HI"; ?-->

 </body>
</html>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?