Skip to content

Instantly share code, notes, and snippets.

View wofeiwo's full-sized avatar
💭
蚂蚁集团长期招人,安全各方面

GaRY wofeiwo

💭
蚂蚁集团长期招人,安全各方面
View GitHub Profile
@wofeiwo
wofeiwo / gist:3582748
Created September 1, 2012 18:37
Signal handle in golang
package main
import (
"fmt"
"os"
"os/signal"
)
func main() {
// 处理一下Ctrl+c
@wofeiwo
wofeiwo / setup.py
Created September 13, 2012 13:16
Python System Execute Module
from distutils.core import setup, Extension
ext = Extension('system', sources=['system.c'])
setup(name='system', version='1.0', description='Test description', ext_modules=[ext])
@wofeiwo
wofeiwo / hex_str_transfer.py
Created December 13, 2012 05:38
hex,string,int_bits transfer
def hexstr(s):
"""
turns ABCD
into
41424344
"""
tmp=[]
for c in s:
tmp+=["%2.2x"%ord(c)]
return "".join(tmp)
@wofeiwo
wofeiwo / grace.go
Last active December 17, 2015 00:49 — forked from rcrowley/grace.go
package main
import (
"log"
"net"
"os"
"os/signal"
"sync"
"syscall"
"time"
local http = require "http"
local shortport = require "shortport"
local stdnse = require "stdnse"
local string = require "string"
local vulns = require "vulns"
description = [[
Detects Ruby on Rails installations that are vulnerable to CVE-2013-0156, This critical vulnerability allows unauthenticated attackers to execute code remotely.
This is the nmap/lua port of the metasploit scanner module from hd moore
@wofeiwo
wofeiwo / phpweblog2markdown.py
Created May 11, 2013 19:09
trans all blog entities from phpweblog.net to markdown format. each entity a file. include all files and images.
#!/usr/bin/env python
#coding=utf-8
from xml.dom import minidom as md
from datetime import datetime
import re
from urllib2 import urlopen
from os.path import basename
from socket import setdefaulttimeout
// Most browsers limit cookies to 4k characters, so we need multiple
function setCookies (good) {
// Construct string for cookie value
var str = "";
for (var i=0; i< 819; i++) {
str += "x";
}
// Set cookies
for (i = 0; i < 10; i++) {
// Expire evil cookie
@wofeiwo
wofeiwo / gist:6060134
Last active December 20, 2015 02:59 — forked from leemars/gist:6060036
Vim encoding script
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Encoding
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,gbk,euc-jp,euc-kr,big5,gb18030,latin1
function! s:CheckGBLocale(locale_var)
let locale_var=toupper(a:locale_var)
if (match(locale_var, '.GBK$') != -1 || match(locale_var, '.GB18030$') != -1 || match(locale_var, '.GB2312$') != -1)
return 1
def http_request(url,
data = {},
header = {
# 默认伪装成IE9
"User-Agent" : "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 5.1; Trident/4.0)",
"Connection" : "Close",
# 避免proxy cache页面
"Pragma" : "no-cache",
"Cache-Control": "no-cache, max-age=0, must-revalidate"
}):
@wofeiwo
wofeiwo / bk.c
Last active January 7, 2017 11:11
Connect back shells
/*
Connect back tools
compile under linux
2003-07-11 now support FreeBSD ..
now support user define echo value
[bkbll@mobile bkbll]$ uname -a
Linux mobile 2.4.18-3custom #1 Èý 11ÔÂ 20 19:46:20 CST 2002 i686 unknown
%uname -a
FreeBSD 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Mon Jan 28 14:31:56 GMT 2002 murray@builder.freebsdmall.com:/usr/src/sys/compile/GENERIC i386
[bkbll@mobile ownprog]$ ./cntoltty 192.168.8.110 5555