Skip to content

Instantly share code, notes, and snippets.

View fffonion's full-sized avatar

Wangchong Zhou fffonion

View GitHub Profile
@takeshixx
takeshixx / hb-test.py
Last active March 9, 2024 13:37
OpenSSL heartbeat PoC with STARTTLS support.
#!/usr/bin/env python2
"""
Author: takeshix <takeshix@adversec.com>
PoC code for CVE-2014-0160. Original PoC by Jared Stafford (jspenguin@jspenguin.org).
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP.
"""
import sys,struct,socket
from argparse import ArgumentParser
@wintercn
wintercn / HTMLLexicalParser.js
Last active August 5, 2019 11:16
HTML语法分析器模型
function StartTagToken(){
}
function EndTagToken(){
}
function Attribute(){
}
@randphu
randphu / extract_buka.py
Last active November 13, 2018 12:32
extract buka manga archive (*.buka)
#!/usr/bin/env python3
'''
Layout of buka manga archives
Whole archive
| b"buka" | unknown (16 bytes) | manga title (c string) | entry table | file 1 | file 2 | ...
Entry table
| table size (uint32) | entry 1 | entry 2 | ... |
@delicb
delicb / ironpy_aes_crypt.py
Created January 18, 2013 10:36
IronPython AES encrypt and decrypt
# NOTE: Change this to random numbers in range (0, 255) inclusive
_key = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
_vector = [0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0]
from System import Array, Byte
from System.Text import UTF8Encoding
from System.IO import MemoryStream
@qtproduction
qtproduction / scrape.py
Created September 26, 2012 12:41
Retrive website from Google Cache without blocking IP
#Retrive old website from Google Cache. Optimized with sleep time, and avoid 504 error (Google block Ip send many request).
#Programmer: Kien Nguyen - QTPros http://qtpros.info/kiennguyen
#change search_site and search_term to match your requirement
#Original: http://www.guyrutenberg.com/2008/10/02/retrieving-googles-cache-for-a-whole-website/
#!/usr/bin/python
import urllib, urllib2
import re
import socket
import re, sys
from xml.dom import minidom, Node
import math
import argparse
class Matrix:
def m(self, i, j, value=None):
if i >= self.rows or j >= self.cols:
raise ValueError("Argument out of range")
@mrluanma
mrluanma / cryptography_3des_demo.py
Last active July 23, 2019 06:09
Python 用 PyCrypto, M2Crypto, ncrypt, cryptography 3DES ECB mode 加密解密 demo。
import os
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.primitives import padding
from cryptography.hazmat.backends import default_backend
backend = default_backend()
key = os.urandom(16)
text = b'Hello, there!'
padder = padding.PKCS7(algorithms.TripleDES.block_size).padder()