- MITM: 中间人攻击 HTTPS
- XSS: 浏览器漏洞JS攻击 过滤
- CSRF: http header: TOKEN,# 无法完全避免,只能尽量,如果被xss+预制你的token key,一样被获取到token然后进行攻击
- Replay: 过期时间
JSON web Token,简称JWT,本质是一个token,是一种紧凑的URL安全方法,用于在网络通信的双方之间传递。一般放在HTTP的headers 参数里面的authorization里面,值的前面加Bearer关键字和空格。除此之外,也可以在url和request body中传递。
作者:space back
链接:https://www.zhihu.com/question/36135526/answer/136603826
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
- 单点登录
yum install perf
ps aux | grep filebeat
perf record -F 99 -p 20315 -g -- sleep 10s
perf record -F 99 -p 5559 -g -- sleep 10s
perf script > test_out.perf
~/FlameGraph-master/stackcollapse-perf.pl --kernel < ./test_out.perf | ~/FlameGraph-master/flamegraph.pl --hash > ./test_out.svg
~/FlameGraph-master/stackcollapse-perf.pl < ./test_out.perf | ~/FlameGraph-master/flamegraph.pl --hash > ./test_out.svg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $str = '<end><p><img src="nihao"><img src="nihao2"><img src="nihao3"><img src="nihao4"></p></end>'; | |
| // 后瞻断言使用 | |
| // ========== | |
| // 使用后瞻断言 (?<=) 匹配 nihao | |
| $str1 = preg_replace('/((?<=<end><p>)<img src=[^>]+>)/', '', $str); | |
| echo $str1, PHP_EOL; |
默认的nginx已经包含了很多通用的模块,详见:http://nginx.org/en/docs/ 但是如果需要增加一些第三方的模块的话(比如淘宝的HTTP请求合并模块:) 则需要下载nginx的源码并加入新的模块源代码一同重新编译。 下面为编译具体步骤
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ssh 代理 | |
| $connection = ssh2_connect(ip-address-of-ssh-server, 22); | |
| ssh2_auth_pubkey_file($connection, 'username', 'id_dsa.pub', 'id_dsa'); | |
| $tunnel = ssh2_tunnel($connection, 本地公网ID, 9999); | |
| curl_setopt($ch, CURLOPT_PROXY, '127.0.0.1:9999'); | |
| // perform curl operations | |
| // The connection and tunnel will die at the and of the session. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| additional_strace_args="$1" | |
| MASTER_PID=$(ps auwx | grep php-fpm | grep -v grep | grep 'master process' | cut -d ' ' -f 6) | |
| while read -r pid; | |
| do | |
| if [[ $pid != $MASTER_PID ]]; then | |
| nohup strace -r -p "$pid" $additional_strace_args >"$pid.trc" 2>&1 & |