intval函数绕过$num="3e3"; if(intval($num) < 2020 && intval($num + 1) > 2021) { echo "yes"; } else { echo "no"; }basename函数绕过1. 函数作用basename() 函数返回路径中的文件名部分。$path="/www/index.php"; echo basename($path)."<br />"; //output: index.php echo basename($path,".php")."<br />"; //output: index2. 函数漏洞在使用默认语言环境设置时,basename() 会删除文件名开头的非 ASCII 字符。例如:$path1="/www/%ffindex.php"; echo basename($path1).&q
Java反序列化Java序列化与反序列化依赖于两个函数writeObject()与readObject(),只要一个类实现了Serializable接口就可以使用这两个函数进行序列化与反序列化。Java反序列化漏洞原理类似PHP反序列化,PHP反序列化时会触发wakeup()函数,而Java中没有这种通用的函数,要实现类似wakeup()函数在反序列化时被触发的功能需要重写readObject()。Java反序列化漏洞需要触发一个被重写的readObject(),这个readObject()调用了一个其他类也有同名的函数,导致非预期的函数被执行。举个例子:原本的程序预期:从接口接到A类对象序列化的字节流调用A类的readObject()进行反序列化A类的readObject()中调用反序列化出来的A类对象中的一个B类对象的F方法完成反序列化传入恶意序列化字节流后:在A类对象中放置B类对象的位置嵌入一个恶意的C类对象,其中B与C有一个共同的F方法从接口接到A类对象序列化的字节流调用A类的readObject()进行反序列化A类的readObject()中调用反序列化出来的A类对象中的C类
SQL注入原理由于程序员对插入SQL语句的用户输入参数检查不严格,导致的恶意SQL命令被插入语句并执行。例如:原始查询语句为 select * from user where id=$value$value为用户输入变量,由于没有过滤,在用户输入 1 and 1=2时查询语句变为 select * from user where id=1 and 1=2,返回永假页面。SQL数据库重要信息MySQL端口3306默认数据库:information_schemamysql.innodb_table_stats:这个表不储存列,所以看列的时候要另行他路。三个表名:SCHEMATA:所有数据库库名TABLES:所有数据库库名与表名COLUMNS:库名、表名、字段名基础查询语句select * from {table_name}select * from {table_name} where {column_name}={data}select * from {table_name} where {column_name}={data} and {other_column}={data} ...
一、RCE简介RCE漏洞,全称远程命令/代码执行漏洞,可以让攻击者直接向后台服务器远程注入操作系统命令或者代码,从而控制后台系统。RCE分为:远程命令执行Remote Command Execute远程代码执行Remote Code Execute二、远程命令执行漏洞原理一般出现这种漏洞,是因为应用系统从设计上需要给用户提供指定的远程命令操作的接口。比如我们常见的路由器、防火墙、入侵检测等设备的web管理界面上。一般会给用户提供一个ping操作的web界面,用户从web界面输入目标IP,提交后,后台会对该IP地址进行一次ping测试,并返回测试结果。 如果,设计者在完成该功能时,没有做严格的安全控制,则可能会导致攻击者通过该接口提交“意想不到”的命令,从而让后台进行执行,从而控制整个后台服务器。这种漏洞形成的条件有两个:有执行系统命令的函数。函数中存在外部可操作的变量。相关函数system() :执行外部程序,并且显示输出exec()/shell_exec(): 通过 shell 环境执行命令,并且将完整的输出以字符串的方式返回pcntl_exec() :在当前进程空间执行指定程序pa
一、PHP伪协议种类与函数PHP支持的伪协议种类file:——访问本地文件系统http:——访问http(s)网站ftp:——访问FTPphp:——访问IO流zlib:——压缩流data:——数据(RFC 2397)glob:——查找匹配的文件路径模式phar:——PHP归档ssh2:——Secure Shell 2rar:——RARogg:——音频流expect:——处理交互流一般用于文件包含的函数:include()require()include_once()require_once()highlight_file()show_source()flie()readfile()file_get_contents()file_put_contents()fopen() (比较常见)二、php://条件:allow_url_fopen:off/on allow_url_include :仅php://input、php://stdin、php://memory、php://temp 需要onphp:// 访问各个输入/输出流(I/O streams),在CTF中经常使用的是php:/
Equinox
一个乐于分享的网安人