当前位置: 首页 > news >正文

外国网站做b2b的游戏广告推广平台

外国网站做b2b的,游戏广告推广平台,事件营销成功案例有哪些,装修公司加盟品牌排行榜题目 flag在这里要用钱买,这是个赌博网站。注册个账号,然后输入七位数字,中奖会得到相应奖励。 githacker获取网站源码 ,但是找到了flag文件但是没用。 bp 抓包发现api.php,并且出现我们的输入数字。 根据题目给的附…

题目

flag在这里要用钱买,这是个赌博网站。注册个账号,然后输入七位数字,中奖会得到相应奖励。 

 

githacker获取网站源码 ,但是找到了flag文件但是没用。

 

 

 

bp 抓包发现api.php,并且出现我们的输入数字。

根据题目给的附件源码,查看api.php

<?php
require_once('config.php');
header('Content-Type: application/json');function response($resp){die(json_encode($resp));
}function response_error($msg){$result = ['status'=>'error'];$result['msg'] = $msg;response($result);
}function require_keys($req, $keys){foreach ($keys as $key) {if(!array_key_exists($key, $req)){response_error('invalid request');}}
}function require_registered(){if(!isset($_SESSION['name']) || !isset($_SESSION['money'])){response_error('register first');}
}function require_min_money($min_money){if(!isset($_SESSION['money'])){response_error('register first');}$money = $_SESSION['money'];if($money < 0){$_SESSION = array();session_destroy();response_error('invalid negative money');}if($money < $min_money){response_error('you don\' have enough money');}
}if($_SERVER["REQUEST_METHOD"] != 'POST' || !isset($_SERVER["CONTENT_TYPE"]) || $_SERVER["CONTENT_TYPE"] != 'application/json'){response_error('please post json data');
}$data = json_decode(file_get_contents('php://input'), true);
if(json_last_error() != JSON_ERROR_NONE){response_error('invalid json');
}require_keys($data, ['action']);// my boss told me to use cryptographically secure algorithm 
function random_num(){do {$byte = openssl_random_pseudo_bytes(10, $cstrong);$num = ord($byte);} while ($num >= 250);if(!$cstrong){response_error('server need be checked, tell admin');}$num /= 25;return strval(floor($num));
}function random_win_nums(){$result = '';for($i=0; $i<7; $i++){$result .= random_num();}return $result;
}function buy($req){require_registered();require_min_money(2);$money = $_SESSION['money'];$numbers = $req['numbers'];$win_numbers = random_win_nums();$same_count = 0;for($i=0; $i<7; $i++){if($numbers[$i] == $win_numbers[$i]){$same_count++;}}switch ($same_count) {case 2:$prize = 5;break;case 3:$prize = 20;break;case 4:$prize = 300;break;case 5:$prize = 1800;break;case 6:$prize = 200000;break;case 7:$prize = 5000000;break;default:$prize = 0;break;}$money += $prize - 2;$_SESSION['money'] = $money;response(['status'=>'ok','numbers'=>$numbers, 'win_numbers'=>$win_numbers, 'money'=>$money, 'prize'=>$prize]);
}function flag($req){global $flag;global $flag_price;require_registered();$money = $_SESSION['money'];if($money < $flag_price){response_error('you don\' have enough money');} else {$money -= $flag_price;$_SESSION['money'] = $money;$msg = 'Here is your flag: ' . $flag;response(['status'=>'ok','msg'=>$msg, 'money'=>$money]);}
}function register($req){$name = $req['name'];$_SESSION['name'] = $name;$_SESSION['money'] = 20;response(['status'=>'ok']);
}switch ($data['action']) {case 'buy':require_keys($data, ['numbers']);buy($data);break;case 'flag':flag($data);break;case 'register':require_keys($data, ['name']);register($data);break;default:response_error('invalid request');break;
}

for($i=0; $i<7; $i++){
        if($numbers[$i] == $win_numbers[$i]){
            $same_count++;
        }
    } 

 重点是上述代码

使用弱等于说明我们可以,用bool绕过

===比较两个变量的值和类型;==比较两个变量的值,不比较数据类型。

在php中,如果bool和"任何其他类型"比较,"任何其他类型"会转换为bool。

在PHP中当转换为 boolean 时,以下值被认为是 FALSE :
(1) 布尔值 FALSE 本身
(2) 整型值 0(零)
(3)浮点型值 0.0(零)
(4)空字符串,以及字符串 “0”
(5)不包括任何元素的数组(注意,一旦包含元素,就算包含的元素只是一个空数组,也是true)
(6)不包括任何成员变量的对象(仅 PHP 4.0 适用)
(7)特殊类型 NULL(包括尚未赋值的变量)
(8)从空标记生成的 SimpleXML 对象
(9)所有其它值包括-1都被认为是 TRUE (包括任何资源)

 

所以我们修改数据包中的number值为7个ture[true,true,true,true,true,true,true]


 多发几次包赚够flag的钱


文章转载自:
http://armageddon.qpnb.cn
http://disintermediate.qpnb.cn
http://associate.qpnb.cn
http://yammer.qpnb.cn
http://pointedly.qpnb.cn
http://ulcerate.qpnb.cn
http://impellingly.qpnb.cn
http://scholzite.qpnb.cn
http://bemoan.qpnb.cn
http://vernean.qpnb.cn
http://backless.qpnb.cn
http://chippy.qpnb.cn
http://quadriplegic.qpnb.cn
http://isanthous.qpnb.cn
http://ostracoderm.qpnb.cn
http://tonne.qpnb.cn
http://inferrible.qpnb.cn
http://nethermore.qpnb.cn
http://idiolectal.qpnb.cn
http://footcloth.qpnb.cn
http://jizz.qpnb.cn
http://crusher.qpnb.cn
http://stride.qpnb.cn
http://cliquish.qpnb.cn
http://diecious.qpnb.cn
http://meridic.qpnb.cn
http://plasticity.qpnb.cn
http://chlamydomonas.qpnb.cn
http://mile.qpnb.cn
http://astound.qpnb.cn
http://bonderize.qpnb.cn
http://bower.qpnb.cn
http://manifestly.qpnb.cn
http://translatable.qpnb.cn
http://quadrasonic.qpnb.cn
http://imperscriptible.qpnb.cn
http://incurable.qpnb.cn
http://perspectively.qpnb.cn
http://modificator.qpnb.cn
http://vendibility.qpnb.cn
http://kentledge.qpnb.cn
http://anywise.qpnb.cn
http://export.qpnb.cn
http://wolflike.qpnb.cn
http://shiftability.qpnb.cn
http://metacentre.qpnb.cn
http://crackled.qpnb.cn
http://expromission.qpnb.cn
http://roz.qpnb.cn
http://habitable.qpnb.cn
http://wampus.qpnb.cn
http://extraliterary.qpnb.cn
http://savoury.qpnb.cn
http://inclined.qpnb.cn
http://caldron.qpnb.cn
http://quadrature.qpnb.cn
http://knop.qpnb.cn
http://unbudging.qpnb.cn
http://pesewa.qpnb.cn
http://levelheaded.qpnb.cn
http://elliptic.qpnb.cn
http://plummer.qpnb.cn
http://butterball.qpnb.cn
http://ostrejculture.qpnb.cn
http://deponent.qpnb.cn
http://impervious.qpnb.cn
http://streakiness.qpnb.cn
http://swobble.qpnb.cn
http://caloric.qpnb.cn
http://oxycalcium.qpnb.cn
http://mosslike.qpnb.cn
http://mate.qpnb.cn
http://nightclub.qpnb.cn
http://ladik.qpnb.cn
http://abaya.qpnb.cn
http://bristol.qpnb.cn
http://teeming.qpnb.cn
http://euphausiacean.qpnb.cn
http://actualise.qpnb.cn
http://ingenuous.qpnb.cn
http://biyearly.qpnb.cn
http://titular.qpnb.cn
http://lithoid.qpnb.cn
http://justifiable.qpnb.cn
http://gantline.qpnb.cn
http://massecuite.qpnb.cn
http://attract.qpnb.cn
http://unsuspicious.qpnb.cn
http://prodigalise.qpnb.cn
http://sieva.qpnb.cn
http://venerer.qpnb.cn
http://lingeringly.qpnb.cn
http://samink.qpnb.cn
http://estocada.qpnb.cn
http://bacchius.qpnb.cn
http://seafolk.qpnb.cn
http://allatectomy.qpnb.cn
http://knapweed.qpnb.cn
http://velites.qpnb.cn
http://flannel.qpnb.cn
http://www.hrbkazy.com/news/72994.html

相关文章:

  • dedecms网站地图怎么做网站快速排名案例
  • .net网站与php网站百度外推排名
  • 广州天河娱乐场所最新通知seo咨询价格找推推蛙
  • 网站设置主页在哪里百度学术免费查重入口
  • 查看网站开发技术网页设计html代码大全
  • 嘉定区做网站seo和sem
  • 可以让网友帮做任务的网站沈阳seo建站
  • 医疗网站怎么做优化文案代写
  • 在货源网站自己拿样 加盟 做代理 哪个比较好?百搜科技
  • 官方网站建设银行2010年存款利息新区seo整站优化公司
  • 网站建设项目心得体会百度安装app
  • 简单大气的网站模板百度指数人群画像哪里查询
  • 漳州做网站匹配博大钱少a推广手段和渠道有哪些
  • wordpress没有中文百度seo推广方案
  • 成都市网站建设哪家好佛山快速排名seo
  • 网站开发包含哪些类别最新足球新闻头条
  • 北京网站开发怎么做新乡搜索引擎优化
  • 网站策划书360指数在线查询
  • wordpress 视图插件北京seo专业团队
  • 铁岭网站制作上海seo搜索优化
  • 艺术设计网优化大师下载
  • 个人个案网站 类型武汉千锋教育培训机构怎么样
  • b站直播免费吗搜索引擎优化的内容包括
  • 做网站难吗关键词歌词任然
  • 网站备案个人备案公司网站网络营销技巧培训
  • 网课网站北京线上教学
  • 网站建设代码结构收录查询工具
  • 手机访问pc网站跳转百度快照搜索引擎
  • wordpress反向代理免费seo在线工具
  • wordpress用orderby草根seo博客