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
| def stripslashes(s): | |
| import re | |
| r = re.sub(r"\\(n|r)", "\n", s) | |
| r = re.sub(r"\\", "", r) | |
| return r |
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
| def ip2addr(ip): | |
| import urllib | |
| import httplib | |
| import chardet #字符集检测Module,返回dict | |
| config = { | |
| 'api_host':'www.sogou.com', | |
| 'api_script':'/websearch/features/ipsearch.jsp' | |
| } | |
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
| try: | |
| import dl | |
| libc = dl.open('/lib/libc.so.6') | |
| libc.call('prctl', 15, 'myproc', 0, 0, 0) #执行后ps -A,显示为myproc的进程 | |
| #参数2:15 /linux/prctl.h定义 #define PR_SET_NAME 15 | |
| except: | |
| pass |
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
| config = { | |
| 'api_host':'github.com', | |
| 'api_script':'test.php' | |
| } | |
| params = { | |
| 'code':1, | |
| 'file_id':123454, | |
| 'file_name':"v/test.mp4", | |
| 'file_size':3653.32 | |
| } |
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
| function encodeURI(str) | |
| if (str) then | |
| str = string.gsub (str, "\n", "\r\n") | |
| str = string.gsub (str, "([^%w ])", | |
| function (c) return string.format ("%%%02X", string.byte(c)) end) | |
| str = string.gsub (str, " ", "+") | |
| end | |
| return str | |
| end | |