Skip to content

Instantly share code, notes, and snippets.

View badmonkey7's full-sized avatar
🐟
moyu

badmonkey badmonkey7

🐟
moyu
View GitHub Profile
@badmonkey7
badmonkey7 / fuck.js
Last active December 14, 2020 15:14
jlu uims 一键评教
// 参考文章 https://0x.mk/?p=166
function fuck() {
// 取消点击间隔
ntms.widget._AutoLabel.prototype._static.setInterval(0);
// 初始化时间
var lastTime = new Date().getTime() - 60000;
var newTime = lastTime + Math.floor((Math.random() * 1.5 + 1.5) * 1000);
// 构造时间数据
var clicks = {"_boot_": lastTime};
@badmonkey7
badmonkey7 / exp0.py
Last active August 27, 2020 14:30
dasctf 2020 8月赛
# Product =
Product = 213145517693473276472741453960288533380429305903664848348709095184411519973440
r_p,r_q = 2328957326808590967503,1461823189315446122067
n = 2063976825250272595388593010902135884890103500050668819831297298752625852801511751408065791793019547189652146900555099774958963484251389843293161492169372162099883268521841628059721206917183539122495978771222844176897602295938111287844515247614001317395469781055421827261855002882782439392377329027883959379213
# (x*y) == iroot(n,4)[0]
# (x^4+a)*(y^4+b) == n
var('x,y')
eq1 = x*y == Product
eq2 = (x^4+r_p)*(y^4+r_q) == n
solve([eq1,eq2],[x,y])
@badmonkey7
badmonkey7 / lfsr_recover.py
Created September 19, 2020 15:31
basic-lfsr-recover
#!/usr/bin/python3
# @Time : 2020-09-19 22:03:20
# @Author : badmonkey
# @FileName: Recover.py
# @Software: PyCharm
from sage.all import *
def lfsr_msb(R, mask, N):
'''
@badmonkey7
badmonkey7 / exp.py
Created September 19, 2020 15:35
2020第五空间题解
from Crypto.Util.number import *
from sage.all import *
def lcg(seed,a,b,m):
x = seed%m
while True:
x = (a*x+b)%m
yield x
def decrypt(key,leak_data):
a,b,m = key
@badmonkey7
badmonkey7 / exp1.py
Created September 22, 2020 11:54
金融密码部分题解
#!/usr/bin/python3
# @Author : badmonkey
# @FileName: exp.py
# @Software: PyCharm
# https://en.wikipedia.org/wiki/Slide_attack
f = open("ciphertext",'r').readlines()
cipher = []
@badmonkey7
badmonkey7 / change_screen.sh
Created October 2, 2020 13:46
manjaro 高分辨率问题
#! /bin/bash
# cvt 1920 1080 40 (height ,weight,fps)
xrandr --newmode "1920x1080_40" 110.50 1920 2016 2208 2496 1080 1083 1088 1108 -hsync +vsync
xrandr --addmode eDP1 "1920x1080_40"
xrandr --output eDP1 --mode "1920x1080_40"
@badmonkey7
badmonkey7 / dynamic_task.sh
Created October 25, 2020 15:44
根据task.py文件,动态生成flag及其需要的数据,并打包成附件到指定文件夹中
#! /usr/bin/bash
# 动态附件的数量
if [ $# -lt 2 ]; then
echo "请指定动态附件的数量,及题目名称!如:dynamic_task.sh 10 simple_math";
exit 0;
else
number=$1
save_path=$2
fi
@badmonkey7
badmonkey7 / extract.py
Created November 14, 2020 11:00
提取当前目录下所有的压缩文件到对应的文件夹下
#! /usr/bin/python
'''
@author: badmonkey
@software: PyCharm
@file: extract.py.py
@time: 2020/11/14 下午6:31
'''
import os
# 获取当前路径
pwd = os.getcwd()
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocksConfig version="1">
<editor>
<colour_sets>
<ACTIVE_COLOUR_SET>
<str>
<![CDATA[modnokai night shift v2]]>
</str>
</ACTIVE_COLOUR_SET>
<ACTIVE_LANG>
@badmonkey7
badmonkey7 / tea.py
Created August 22, 2021 13:50 — forked from twheys/tea.py
Python implementation of the Tiny Encryption Algorithm (TEA)
# coding: utf-8
"""
Implementation of the Tiny Encryption Algorithm (TEA) for Python
https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm
Example Usage:
import tea
# The key must be 16 characters