Skip to main content

青少年CTF训练平台提供的Python软件包

Project description

🤔QSNCTF

qsnctf是青少年CTF训练平台进行编写的一个Python包程序,意图在Python中为大家快速使用一些CTF常用功能开发的开源包。这里有很多CTF常用功能,如Base编码、hash加密,甚至少见的社会主义核心价值观编码都在其中。

使用

首先将GitHub上的项目下载下来后可以文件中有一个setup.py

打开终端然后输入

python setup.py install

或者也可以直接使用pip来进行安装(由于本Py包仍在开发,所以pip可能不是最新版)

pip install qsnctf

安装成功会显示

Successfully installed PyExecJS-1.5.1 qsnctf-0.0.4

如果你想知道具体怎么使用可以导入这个包,然后使用help(qsnctf)查看库的用法

>>> import qsnctf
>>> help(qsnctf)
Help on package qsnctf:

NAME
    qsnctf

PACKAGE CONTENTS
    base
    crypto
    hash
    main
    misc
    uuid

FILE
    c:\users\xiniyi\appdata\local\programs\python\python39\lib\site-packages\qsnctf-0.0.4-py3.9.egg\qsnctf\__init__.py

然后使用help(qsnctf.PACKAGE CONTENTS)来查看具体的使用方法

示例

查看base的使用方法

>>> help(qsnctf.base)              
Help on module qsnctf.base in qsnct
                                   
NAME                               
    qsnctf.base                    
                                   
DESCRIPTION                        
    # Base编码解码功能                   
    # 2023年1月1日                    
    # 末心                           
                                   
FUNCTIONS                          
    base16_decode(text)            
                                   
    base16_encode(text)            
                                   
    base32_decode(text)            
                                   
    base32_encode(text)            
                                   
    base64_decode(text)            
                                   
    base64_encode(text)            
                                   
    base85_decode(text)
>>>

功能列表

Base

base16 base32 base62 base64 base85
base91 base92 base100

crypto

凯撒密码 凯撒爆破 培根密码 ROT5 ROT13
ROT18

hash

md5 sha512 sha384 sha256 sha224
sha1 shake256 shake256 HMAC-SHA256 sha3-512
sha3-384 sha3-256 sha3-224

misc

核心价值观加密解密 文本逆向 url加密解密 位异或

uuid

获取uuid

具体使用

命令行使用

第一步导入qsnctf

import qsnctf

例如需要使用base64加密

qsnctf.base.base64_encode("需要加密的")

相同如果使用base64解密的话就是

qsnctf.base.base64_decode("需要解密的")

其他的加密加密类似


编译器使用

这里还是使用base64来演示,其他的加密解密类似。

import qsnctf

a=qsnctf.base.base64_encode("需要加密的")
print(a)
b=qsnctf.base.base64_decode("6ZyA6KaB5Yqg5a+G55qE")
print(b)

返回信息

6ZyA6KaB5Yqg5a+G55qE
需要加密的

提示:位异或传参是需要传入一个列表,下面是个例子

import qsnctf
l=[0x71,0x72,0x6c,0x60,0x70,0x63,0x7d,0x4a,0x38,0x71,0x3b,0x65,0x53,0x41,0x61,0x79,0x75,0x4e,0x6b,0x7c,0x61,0x34,0x6b]
a=qsnctf.misc.xor_decrypt(l)
print(a)

返回结果

qsnctf{M0X1n_Love_you!}

Base62的encode值应该是整数!

import qsnctf

a = qsnctf.base.base62_encode(34441886726)
print(a)
b = qsnctf.base.base62_decode("base62")
print(b)

环境

开发环境

Windows11 + Python3.10 + PyCharm 2022.2.3 (Professional Edition)

使用环境

支持 python 3.x 环境。

文档持续更新。

✨ Contributors

感谢下面的所有人:


Moxin


xinyi


yiye-yfs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qsnctf-0.0.6.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qsnctf-0.0.6-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file qsnctf-0.0.6.tar.gz.

File metadata

  • Download URL: qsnctf-0.0.6.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for qsnctf-0.0.6.tar.gz
Algorithm Hash digest
SHA256 4597d878b2893643ce5312876d3f06b41b9e7cb00142270c3cf6490cdad795f3
MD5 556da79acc7fa27b8b37fbdd482a001e
BLAKE2b-256 aed0e792dd99cfc9e7ddf6dc5ef0862c02e28fc0594fb54b5a547b6ad20184da

See more details on using hashes here.

File details

Details for the file qsnctf-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: qsnctf-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for qsnctf-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d52f20bc720ebe1ddb65e34807093ec63e22c7e9625811c6397b8dccf99f3847
MD5 46a925e50b85a3512a4b854f192f7771
BLAKE2b-256 bd75f3ff6ebf4da4f8bbf4501cffae45ecc4d8de363e804f9997449d312524b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page