Skip to content

Instantly share code, notes, and snippets.

View coconut49's full-sized avatar
🐰
Focusing

49 coconut49

🐰
Focusing
View GitHub Profile
@qnnnnez
qnnnnez / natcp.py
Last active April 15, 2017 07:29
TCP 劫持
import asyncio
import socket
import struct
SO_ORIGINAL_DST = 80
class NATCPServerProtocol(asyncio.Protocol):
def connection_made(self, transport):
@AdamIsrael
AdamIsrael / README.md
Last active May 20, 2019 02:44
Installing Juju 2.0 on Centos7

Juju 2.0 on Centos7

Configure epel repository

yum -y install epel-release
yum repolist

Install LXD

@Wack0
Wack0 / upwned247.php
Last active December 13, 2023 08:16
UCam247/Phylink/Titathink/YCam/Anbash/Trivision/Netvision/others IoT webcams : remote code exec: reverse shell PoC. (works only in qemu usermode)
<?php
/*
Updated version, 2016-12-02: fixed shellcode so it *actually* works on QEMU
usermode emulation (seems I pushed an old version), and removed debug output.
-------------------------
NB: THIS PoC ONLY WORKS IN QEMU USERMODE EMULATION!
If anyone wants to fix this, go ahead (no pun intended).
However, I don't have a vulnerable product and am unwilling to acquire one.
@jackyyf
jackyyf / netns-launch
Created October 19, 2016 11:10
Launch tox-bootstrapd inside network namespace.
#!/bin/bash
who am i 1>&2
NSNAME=tox-bootstrapd
## ${VETH_PREFIX}0 is outside, and ${VETH_PREFIX}1 is inside.
VETH_PREFIX=tox
OUT_ADDRS="
A.B.C.125/31
#!/bin/bash
function gen {
dd if=/dev/urandom 2>/dev/null | tr -dc a-f0-9 | fold -w $1 | head -n 1 | sed 's/^/0x/'
}
spi=`gen 8`
reqid=`gen 8`
auth_key=`gen 64`
enc_key=`gen 64`
#!/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
}
@dtaylor84
dtaylor84 / gpg-agent-forward.sh
Last active May 15, 2017 07:10
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
@stableShip
stableShip / 详细设计文档编写规范
Created July 1, 2016 01:23
详细设计文档编写规范
## 一.引言
### 1. 编写目的(阐明编写详细设计说明书的目的,指明读者对象。)
### 2. 项目背景(应包括项目的来源和主管部门等。)
### 3. 定义(列出文档中用到的专门术语定义和缩写词的原意。)
### 4. 参考资料(列出这些资料的作者、标题、编号、发表日期、出版单位或资料来源,可包括:(1)项目的计划任务书,合同或批文;(2)项目开发计划;(3)需求规格说明书;(3)概要设计说明书;(4)测试计划(初稿);(5)用户操作手册(初稿);(5)文档所引用的其他资料、软件开发标准或规范。)
## 二.总体设计
### 1.需求概述
@giovtorres
giovtorres / virt-install-centos
Last active March 15, 2023 09:57
Install CentOS cloud images on KVM using cloud-init
#!/bin/bash
## **Updates to this file are now at https://github.com/giovtorres/kvm-install-vm.**
## **This updated version has more options and less hardcoded variables.**
# Take one argument from the commandline: VM name
if ! [ $# -eq 1 ]; then
echo "Usage: $0 <node-name>"
exit 1
fi
[Proxy]
WIFI = direct, interface=en2
VPN = direct, interface=utun0
[Rule]
DOMAIN-SUFFIX,yach.me,WIFI
FINAL,VPN