webchacking.kr 第5题

打开题目发现了两个按钮,分别是Login和join

打开Login发现url是http://webhacking.kr/challenge/web/web-05/mem/login.php的 我们把login.php删掉发现了一个index of的目录,里面有一个join的php文件

打开发现黑的没有边际,右键源代码发现了猫腻,这里我把js代码翻译了下,后来发现其实直接f12编译下就ok了 2333333

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
documnent.cookie
if(eval(document.cookie)==-1)
{
bye;
}
else(eval(document.URL).indexOf(mode=1))==-1
{
alert('access_denied');history.go(-1);
}
else{
document.write('<font size=2 color=white>Join</font><p>');
document.write('.<p>.<p>.<p>.<p>.<p>');
document.write('<form method=post action='NaNoin.php>');
document.write('<table border=1><tr><td><font color=gray>id</font></td><td><input type=text name='id' maxlength=5></td></tr>');
document.write('<tr><td><font color=gray>pass</font></td><td><input type=text name='NaNw' maxlength=10></td></tr>');
document.write('<tr align=center><td colspan=2><input type=submit></td></tr></form></table>');
}

把第三个else中代码进行执行就得到一个登陆框

做到这里心里有点小激动,然后噫~~~~ 好像限制了字符长度,没想到真是

用burp进行抓包,加点空格突破他的5的长度限制

发现注册成功

返回开头的Login按钮那,登录 过关

webchacking.kr 第24题

打开题目发现是一个关于ip的题,照常右键查看源代码发现index.phps

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?

extract($_SERVER);
extract($_COOKIE); if(!$REMOTE_ADDR) $REMOTE_ADDR=$_SERVER[REMOTE_ADDR]; $ip=$REMOTE_ADDR;
$agent=$HTTP_USER_AGENT; if($_COOKIE[REMOTE_ADDR])
{
$ip=str_re 大专栏  waterplace("12","",$ip);
$ip=str_replace("7.","",$ip);
$ip=str_replace("0.","",$ip);
} echo("<table border=1><tr><td>client ip</td><td>$ip</td></tr><tr><td>agent</td><td>$agent</td></tr></table>"); if($ip=="127.0.0.1")
{
@solve();
} else
{
echo("<p><hr><center>Wrong IP!</center><hr>");
}
?>

看着有点长,其实很简单就是让ip等于127.0.0.1就可以了

直接。。。。 坑 试了很多127.0.0.1发现不行,原来有过滤233333

一条js代码搞定

1
document.cookie ="REMOTE_ADDR = 112277..00..00..1;";

webchacking.kr 第27题

打开题目右键发现index.phps

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?
if($_GET[no])
{ if(eregi("#|union|from|challenge|select|(|t|/|limit|=|0x",$_GET[no])) exit("no hack"); $q=@mysql_fetch_array(mysql_query("select id from challenge27_table where id='guest' and no=($_GET[no])")) or die("query error"); if($q[id]=="guest") echo("guest");
if($q[id]=="admin") @solve(); } ?>

从源码可以看出我们需要让id=admin才能过关,但是id这个没找到,但是有一个q变量,所以我们想办法把id给他变成admin就可以了

分析源码得到它过滤了一些常用的字段,比如说“ = ” 这个常用的东东 这里可以使用like进行替代

1
$q=@mysql_fetch_array(mysql_query("select id from challenge27_table where id='guest' and no=($_GET[no])")) or die("query error")id='guest' and no=($_GET[no])")) or die("query error");

这里我们必须select id from challenge27_table where id=’guest’ and no= 返回错误,否则就无法获得admin这个字段了,因为他id已经等于guest

尝试payload

-1) or no like 0 – 这个–后边有一个空格

它返回了查询错误,接着试

-1) or no like 1 –

发现返回了guest,说明构造的sql语句执行了,guest的id=1 那么admin的id可能为2嘛

继续试

-1) or no like 2 –

成功了(这个是我做过一遍,所以会是这样的)

water的更多相关文章

  1. [LeetCode] Pacific Atlantic Water Flow 太平洋大西洋水流

    Given an m x n matrix of non-negative integers representing the height of each unit cell in a contin ...

  2. [LeetCode] Trapping Rain Water II 收集雨水之二

    Given an m x n matrix of positive integers representing the height of each unit cell in a 2D elevati ...

  3. [LeetCode] Water and Jug Problem 水罐问题

    You are given two jugs with capacities x and y litres. There is an infinite amount of water supply a ...

  4. [LeetCode] Trapping Rain Water 收集雨水

    Given n non-negative integers representing an elevation map where the width of each bar is 1, comput ...

  5. [LeetCode] Container With Most Water 装最多水的容器

    Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). ...

  6. 如何装最多的水? — leetcode 11. Container With Most Water

    炎炎夏日,还是呆在空调房里切切题吧. Container With Most Water,题意其实有点噱头,简化下就是,给一个数组,恩,就叫 height 吧,从中任选两项 i 和 j(i <= ...

  7. 【leetcode】Container With Most Water

    题目描述: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ...

  8. [LintCode] Trapping Rain Water 收集雨水

    Given n non-negative integers representing an elevation map where the width of each bar is 1, comput ...

  9. [LintCode] Container With Most Water 装最多水的容器

    Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai).  ...

  10. LeetCode#11. Container With Most Water

    问题描述 Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ...

随机推荐

  1. Sublime Text 3 快捷键的汇总

    Sublime Text 3非常实用,但是想要用好,一些快捷键不可或缺,所以转了这个快捷键汇总. 选择类 Ctrl+D 选中光标所占的文本,继续操作则会选中下一个相同的文本. Alt+F3 选中文本按 ...

  2. JS中的0b00与0x00表示什么

    换成二进制表示:(0b表示二进制数,0x表示16进制数)

  3. Andorid Studio 3.1 引入第三方jar包的方法

    今天手痒,把android studio 从3.0升级到3.1.2 发现很多问题 1.发现编译会下载好多东西,等半天 2.之前的jar包导不进来了 针对jar包导入不成功,我查了一下说是不支撑comp ...

  4. Opencv笔记(三)——视频的获取及保存

    一.利用摄像头获取视频 我们经常需要使用摄像头捕获实时图像.OpenCV 为这中应用提供了一个非常简单的接口.让我们使用摄像头来捕获一段视频,并把它转换成灰度视频显示出来.了获取视频,你应该创建一个 ...

  5. MySQL报错解决:The MySQL server is running with the --read-only option so it cannot execute this statement

    MySQL报错:The MySQL server is running with the --skip-grant-tables option so it cannot execute this st ...

  6. vbox NAT 设置端口映射(NAT+8080端口转发)

    VirtualBox的提供了四种网络接入模式,它们分别是: 1.NAT 网络地址转换模式(NAT,Network Address Translation) 2.Bridged Adapter 桥接模式 ...

  7. servletHomeWork

    2. http全称是什么? 超文本传输协议(HTTP, HyperText Transfer Protocol)是互联网上应用为最广泛的一种网络协议. 3.http协议是无状态的协议是什么意思?请说明 ...

  8. 分享几个4412开发板新录制的视频,不是VIP也能看

    如果能点个赞就更好啦 iTOP4412开发板介绍https://www.bilibili.com/video/av74453392 iTOP4412开发板系统编程前言https://www.bilib ...

  9. dedecms_5.7 download.php SQL注入

    最近在看Web渗透与漏洞挖掘,这本书的编写目的感觉非常的不错,把渗透和代码审计结合在一起,但是代码审计部分感觉思路个人认为并不是很清晰,在学习dedecms v5.7 SQL注入的时候就只看懂了漏洞, ...

  10. 74cms_3.5.1 宽字节注入

    第一次进行CMS的代码审计,我选择了2014年发布的74CMS 3.5.1,历史比较久远的CMS往往存在更多的问题,虽然技术上难度不大,但是在思路方面给了我很大的启发.下面我根据我的思路给大家分享一下 ...