Skip to content

Instantly share code, notes, and snippets.

View Yubico.py
from Crypto.Cipher import AES
from binascii import hexlify, unhexlify
d = {'b': '1', 'c': '0', 'd': '2', 'e': '3', 'f': '4', 'g': '5', 'h': '6', 'i': '7', 'j': '8', 'k': '9', 'l': 'a', 'n': 'b', 'r': 'c', 't': 'd', 'u': 'e', 'v': 'f'}
rd = {'0': 'c', '1': 'b', '2': 'd', '3': 'e', '4': 'f', '5': 'g', '6': 'h', '7': 'i', '8': 'j', '9': 'k', 'a': 'l', 'b': 'n', 'c': 'r', 'd': 't', 'e': 'u', 'f': 'v'}
def modhex2hex(x):
return ''.join([d[i] for i in x])
View r.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import struct
import binascii
def p(a):
return struct.pack("<Q", a)
View checker.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import socket
import struct
import telnetlib
def sock(remoteip, remoteport):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((remoteip, remoteport))
View jmper.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import socket
import struct
import telnetlib
from time import sleep
def sock(remoteip, remoteport):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
View cheer_msg.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import socket
import struct
import telnetlib
def sock(remoteip, remoteport):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((remoteip, remoteport))
@otms61
otms61 / modhex.py
Created Nov 15, 2016
yubico modhex
View modhex.py
d = {
'b': '1',
'c': '0',
'd': '2',
'e': '3',
'f': '4',
'g': '5',
'h': '6',
'i': '7',
'j': '8',
@otms61
otms61 / hotp.py
Last active Sep 3, 2018
A command-line tool for google authenticator verify code.
View hotp.py
import hashlib
import hmac
import time
import struct
import base64
def compute_code(key):
t = int(time.time())
ts = t / 30
@otms61
otms61 / Dockerfile
Created Oct 30, 2016
centos6 google authenticator sshd
View Dockerfile
FROM centos:centos6
RUN yum update -y
RUN yum install -y epel-release
RUN sed -i 's/\#baseurl/baseurl/g' /etc/yum.repos.d/epel.repo
RUN sed -i 's/mirrorlist/\#mirrorlist/g' /etc/yum.repos.d/epel.repo
# setup sshd and pam
RUN yum install -y openssh-server google-authenticator
RUN sed -i 's/ChallengeResponseAuthentication no/ChallengeResponseAuthentication yes/g' /etc/ssh/sshd_config
@otms61
otms61 / flagen.py
Last active Mar 18, 2016
0ctf 2015 flagen pwn script
View flagen.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import socket
import struct
import telnetlib
def sock(remoteip, remoteport):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((remoteip, remoteport))
@otms61
otms61 / Makefile
Last active Mar 15, 2016
Inspect process_vm_readv behavior
View Makefile
ALL: sandbox permtest
sandbox:
gcc -m32 -o sandbox sandbox.c
permtest:
gcc -m32 -o permtest permtest.c
clean:
rm sandbox permtest
You can’t perform that action at this time.