May062020
DVWA-2.4 Command Injection(命令注入)-Impossible-安全的白名单
Impossible Level
查看源码
<?php
if( isset( $_POST[ 'Submit' ] ) ) {
// Check Anti-CSRF token
checkToken( $_REQUEST[ 'user_token' ], $_SESSION[ 'session_token' ], 'index.php' );
// Get input
$target = $_REQUEST[ 'ip' ];
$target = stripslashes( $target ); //stripslashes()删除反斜杠
// Split the IP into 4 octects
$octet = e...阅读全文
抢沙发
May062020
DVWA-2.3 Command Injection(命令注入)-High-绕过强的黑名单
High Level
查看源码
<?php
if( isset( $_POST[ 'Submit' ] ) ) {
// Get input
$target = trim($_REQUEST[ 'ip' ]);
// Set blacklist
$substitutions = array(
'&' => '',
';' => '',
'| ' => '',
'-' => '',
'$' => '',
'(' => '',
')' => '',
'`' => '',...阅读全文
May062020
DVWA-2.2 Command Injection(命令注入)-Medium-绕过弱的黑名单
Medium Level
查看源码
<?php
if( isset( $_POST[ 'Submit' ] ) ) {
// Get input
$target = $_REQUEST[ 'ip' ];
// Set blacklist----黑名单:删掉&&和;
$substitutions = array(
'&&' => '',
';' => '',
);
// Remove any of the charactars in the array (blacklist).
$target = str_replace( array_keys(...阅读全文
May062020
DVWA-2.1 Command Injection(命令注入)-Low
Low Level
查看源码
<?php
if( isset( $_POST[ 'Submit' ] ) ) {
// Get input
$target = $_REQUEST[ 'ip' ];
// Determine OS and execute the ping command.
if( stristr( php_uname( 's' ), 'Windows NT' ) ) {
// Windows
$cmd = shell_exec( 'ping ' . $target );
}
else {
// *nix
$cmd = shell_exec( 'ping -c 4...阅读全文
Apr092020
Sqli-labs Background-6 服务器(两层)架构
首先介绍一下29,30,31这三关的基本情况:
服务器端有两个部分:第一部分为tomcat为引擎的jsp型服务器,第二部分为apache为引擎的php服务器,真正提供web服务的是php服务器。工作流程为:client访问服务器,能直接访问到tomcat服务器,然后tomcat服务器再向apache服务器请求数据。数据返回路径则相反。
此处简单介绍一下相关环境的搭建。环境为ubuntu14.04。此处以我搭建的环境为例,我们...阅读全文
Apr092020
Sqli-labs Less-26 绕过 or、and、注释符、空格、斜杠过滤 基于BIGINT溢出的报错注入
关键代码
function blacklist($id)
{
$id= preg_replace('/or/i',"", $id); //strip out OR (non case sensitive)
$id= preg_replace('/and/i',"", $id); //Strip out AND (non case sensitive)
$id= preg_replace('/[\/\*]/',"", $id); //strip out /*
$id= preg_replace('/[--]/',"", $id); //Strip out --
$id= preg_replace('/[#]/',"", $id); //Strip out #
$id= preg_...阅读全文
Apr092020
Sqli-labs Background-5 HTTP头部介绍
在利用抓包工具进行抓包的时候,我们能看到很多的项,下面详细讲解每一项。
HTTP头部详解
1、 Accept:告诉WEB服务器自己接受什么介质类型,*/* 表示任何类型,type/* 表示该类型下的所有子类型,type/sub-type。
2、 Accept-Charset: 浏览器申明自己接收的字符集
Accept-Encoding: 浏览器申明自己接收的编码方法,通常指定压缩方法,是否支持压缩,支持什么压缩方法(gzip,deflate)
...阅读全文
Apr092020
Sqli-labs Background-3 mysql导入导出的讲解
1、load_file()导出文件
Load_file(file_name):读取文件并返回该文件的内容作为一个字符串。
使用条件:
A、必须有权限读取并且文件必须完全可读
and (select count(*) from mysql.user)>0/* 如果结果返回正常,说明具有读写权限and (select count(*) from mysql.user)>0/* 返回错误,应该是管理员给数据库帐户降权
B、欲读取文件必须在服务器上
C、必须指定文件完整的路径
D、欲读...阅读全文
Apr042020
Apr022020
在centos使用softether搭建v*p*服务器
VP*概述:
V** : Virtual Private Network 虚拟专用网络。
虚拟专用网络的功能是:在公用网络上建立专用网络,进行加密通信。虚拟专用网络可以实现不同网络的组件和资源之间的相互连接。虚拟专用网络能够利用Internet或其它公共互联网络的基础设施为用户创建隧道,并提供与专用网络一样的安全和功能保障。在企业网络中有广泛应用。VPN网关通过对数据包的加密和数据包目标地址的转换实现...阅读全文