icoa-cli 2.19.459 → 2.19.460
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/ai4ctf.js +1 -1
- package/dist/commands/ctf4ai-demo.js +1 -1
- package/dist/commands/ctf4vla.js +1 -1
- package/dist/commands/exam.js +1 -1
- package/dist/commands/learn.js +1 -1
- package/dist/commands/ref.js +1 -1
- package/dist/lib/lazy-assets.js +1 -0
- package/dist/lib/py-syntax.js +1 -1
- package/package.json +1 -2
- package/refs/ROPgadget.txt +0 -67
- package/refs/base64.txt +0 -63
- package/refs/bash.txt +0 -79
- package/refs/binwalk.txt +0 -43
- package/refs/bs4.txt +0 -61
- package/refs/checksec.txt +0 -57
- package/refs/curl.txt +0 -73
- package/refs/cyberchef.txt +0 -78
- package/refs/exiftool.txt +0 -50
- package/refs/ffuf.txt +0 -73
- package/refs/gcc.txt +0 -66
- package/refs/gdb.txt +0 -83
- package/refs/hashcat.txt +0 -64
- package/refs/hint.txt +0 -48
- package/refs/icoa.txt +0 -72
- package/refs/john.txt +0 -74
- package/refs/linux.txt +0 -58
- package/refs/nc.txt +0 -64
- package/refs/nmap.txt +0 -57
- package/refs/numpy.txt +0 -59
- package/refs/openssl.txt +0 -75
- package/refs/pillow.txt +0 -67
- package/refs/pwntools.txt +0 -79
- package/refs/pycrypto.txt +0 -77
- package/refs/python.txt +0 -103
- package/refs/r2.txt +0 -85
- package/refs/regex.txt +0 -73
- package/refs/requests.txt +0 -83
- package/refs/rules.txt +0 -28
- package/refs/scapy.txt +0 -80
- package/refs/sqlmap.txt +0 -69
- package/refs/steghide.txt +0 -71
- package/refs/struct.txt +0 -61
- package/refs/sympy.txt +0 -77
- package/refs/tshark.txt +0 -65
- package/refs/vim.txt +0 -74
- package/refs/volatility.txt +0 -41
- package/refs/z3.txt +0 -78
package/refs/openssl.txt
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
OpenSSL Quick Reference
|
|
2
|
-
=======================
|
|
3
|
-
|
|
4
|
-
HASHING
|
|
5
|
-
echo -n "text" | openssl md5
|
|
6
|
-
echo -n "text" | openssl sha1
|
|
7
|
-
echo -n "text" | openssl sha256
|
|
8
|
-
openssl dgst -sha256 file Hash a file
|
|
9
|
-
|
|
10
|
-
ENCODING / DECODING
|
|
11
|
-
echo -n "text" | openssl base64 Encode base64
|
|
12
|
-
echo "dGV4dA==" | openssl base64 -d Decode base64
|
|
13
|
-
echo -n "text" | openssl enc -base64 Same as above
|
|
14
|
-
xxd -p file Hex encode
|
|
15
|
-
|
|
16
|
-
SYMMETRIC ENCRYPTION
|
|
17
|
-
# AES-256-CBC encrypt
|
|
18
|
-
openssl enc -aes-256-cbc -salt -in plain.txt -out enc.bin -k password
|
|
19
|
-
|
|
20
|
-
# AES-256-CBC decrypt
|
|
21
|
-
openssl enc -aes-256-cbc -d -in enc.bin -out plain.txt -k password
|
|
22
|
-
|
|
23
|
-
# Specify IV and key directly
|
|
24
|
-
openssl enc -aes-128-cbc -d -in enc.bin \
|
|
25
|
-
-K 000102030405060708090a0b0c0d0e0f \
|
|
26
|
-
-iv 00112233445566778899aabbccddeeff
|
|
27
|
-
|
|
28
|
-
RSA KEY OPERATIONS
|
|
29
|
-
# Generate RSA key
|
|
30
|
-
openssl genrsa -out private.pem 2048
|
|
31
|
-
|
|
32
|
-
# Extract public key
|
|
33
|
-
openssl rsa -in private.pem -pubout -out public.pem
|
|
34
|
-
|
|
35
|
-
# View key details
|
|
36
|
-
openssl rsa -in private.pem -text -noout
|
|
37
|
-
|
|
38
|
-
# View public key details
|
|
39
|
-
openssl rsa -pubin -in public.pem -text -noout
|
|
40
|
-
|
|
41
|
-
# Encrypt with public key
|
|
42
|
-
openssl rsautl -encrypt -pubin -inkey pub.pem -in plain.txt -out enc.bin
|
|
43
|
-
|
|
44
|
-
# Decrypt with private key
|
|
45
|
-
openssl rsautl -decrypt -inkey priv.pem -in enc.bin -out plain.txt
|
|
46
|
-
|
|
47
|
-
CERTIFICATES
|
|
48
|
-
# View certificate
|
|
49
|
-
openssl x509 -in cert.pem -text -noout
|
|
50
|
-
|
|
51
|
-
# Extract public key from cert
|
|
52
|
-
openssl x509 -in cert.pem -pubkey -noout
|
|
53
|
-
|
|
54
|
-
# Generate self-signed cert
|
|
55
|
-
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365
|
|
56
|
-
|
|
57
|
-
# Check cert expiry
|
|
58
|
-
openssl x509 -in cert.pem -noout -dates
|
|
59
|
-
|
|
60
|
-
SSL / TLS
|
|
61
|
-
# Connect and show cert
|
|
62
|
-
openssl s_client -connect host:443
|
|
63
|
-
|
|
64
|
-
# Show cert chain
|
|
65
|
-
openssl s_client -showcerts -connect host:443
|
|
66
|
-
|
|
67
|
-
COMMON CTF PATTERNS
|
|
68
|
-
# Decode base64 encoded flag
|
|
69
|
-
echo "aWNvYXtmbGFnfQ==" | openssl base64 -d
|
|
70
|
-
|
|
71
|
-
# Extract RSA parameters for crypto challenge
|
|
72
|
-
openssl rsa -pubin -in pub.pem -text -noout | grep -E "Modulus|Exponent"
|
|
73
|
-
|
|
74
|
-
# Decrypt with known key
|
|
75
|
-
openssl enc -aes-128-ecb -d -in encrypted -K "$(echo -n key | xxd -p)" -nopad
|
package/refs/pillow.txt
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
Pillow (PIL) Quick Reference
|
|
2
|
-
============================
|
|
3
|
-
|
|
4
|
-
INSTALLATION
|
|
5
|
-
pip install pillow
|
|
6
|
-
|
|
7
|
-
BASIC USAGE
|
|
8
|
-
from PIL import Image
|
|
9
|
-
|
|
10
|
-
img = Image.open("image.png")
|
|
11
|
-
img.save("output.png")
|
|
12
|
-
img.show()
|
|
13
|
-
|
|
14
|
-
IMAGE INFO
|
|
15
|
-
img.size (width, height)
|
|
16
|
-
img.mode "RGB", "RGBA", "L", "1"
|
|
17
|
-
img.format "PNG", "JPEG", etc.
|
|
18
|
-
img.info Metadata dict
|
|
19
|
-
|
|
20
|
-
PIXEL ACCESS
|
|
21
|
-
px = img.load() Get pixel access
|
|
22
|
-
px[x, y] Get pixel value
|
|
23
|
-
px[x, y] = (R, G, B) Set pixel value
|
|
24
|
-
|
|
25
|
-
# Get all pixels
|
|
26
|
-
pixels = list(img.getdata())
|
|
27
|
-
|
|
28
|
-
CONVERSIONS
|
|
29
|
-
img.convert("L") Grayscale
|
|
30
|
-
img.convert("RGB") RGB
|
|
31
|
-
img.convert("RGBA") RGBA
|
|
32
|
-
img.convert("1") Black and white
|
|
33
|
-
|
|
34
|
-
OPERATIONS
|
|
35
|
-
img.resize((w, h)) Resize
|
|
36
|
-
img.crop((l, t, r, b)) Crop (left, top, right, bottom)
|
|
37
|
-
img.rotate(90) Rotate
|
|
38
|
-
img.transpose(Image.FLIP_LEFT_RIGHT) Flip horizontal
|
|
39
|
-
|
|
40
|
-
CREATE NEW IMAGE
|
|
41
|
-
img = Image.new("RGB", (width, height), (255, 255, 255))
|
|
42
|
-
|
|
43
|
-
COMMON CTF PATTERNS
|
|
44
|
-
# LSB steganography extraction
|
|
45
|
-
img = Image.open("steg.png")
|
|
46
|
-
px = img.load()
|
|
47
|
-
bits = ""
|
|
48
|
-
for y in range(img.height):
|
|
49
|
-
for x in range(img.width):
|
|
50
|
-
r, g, b = px[x, y][:3]
|
|
51
|
-
bits += str(r & 1) # Extract LSB
|
|
52
|
-
# Convert bits to bytes
|
|
53
|
-
message = bytes(int(bits[i:i+8], 2) for i in range(0, len(bits), 8))
|
|
54
|
-
|
|
55
|
-
# Hide data in pixels
|
|
56
|
-
for i, byte in enumerate(data):
|
|
57
|
-
x, y = i % img.width, i // img.width
|
|
58
|
-
r, g, b = px[x, y][:3]
|
|
59
|
-
px[x, y] = ((r & 0xFE) | (byte >> 7 & 1), g, b)
|
|
60
|
-
|
|
61
|
-
# Visual comparison
|
|
62
|
-
from PIL import ImageChops
|
|
63
|
-
diff = ImageChops.difference(img1, img2)
|
|
64
|
-
diff.save("diff.png")
|
|
65
|
-
|
|
66
|
-
# Extract text from image regions
|
|
67
|
-
region = img.crop((10, 10, 200, 50))
|
package/refs/pwntools.txt
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
Pwntools Quick Reference
|
|
2
|
-
========================
|
|
3
|
-
|
|
4
|
-
INSTALLATION
|
|
5
|
-
pip install pwntools
|
|
6
|
-
|
|
7
|
-
CONNECTION
|
|
8
|
-
from pwn import *
|
|
9
|
-
|
|
10
|
-
# Remote connection
|
|
11
|
-
r = remote("host", port)
|
|
12
|
-
|
|
13
|
-
# Local process
|
|
14
|
-
p = process("./binary")
|
|
15
|
-
|
|
16
|
-
# SSH
|
|
17
|
-
s = ssh("user", "host", password="pass")
|
|
18
|
-
|
|
19
|
-
SEND / RECEIVE
|
|
20
|
-
r.send(b"data") Send raw bytes
|
|
21
|
-
r.sendline(b"data") Send + newline
|
|
22
|
-
r.sendafter(b"prompt", data) Send after receiving
|
|
23
|
-
r.sendlineafter(b">", data) Sendline after prompt
|
|
24
|
-
|
|
25
|
-
r.recv(1024) Receive up to N bytes
|
|
26
|
-
r.recvline() Receive one line
|
|
27
|
-
r.recvuntil(b":") Receive until delimiter
|
|
28
|
-
r.recvall() Receive everything
|
|
29
|
-
r.interactive() Interactive mode
|
|
30
|
-
|
|
31
|
-
PACKING / UNPACKING
|
|
32
|
-
p32(0x41414141) Pack 32-bit (little-endian)
|
|
33
|
-
p64(0x41414141) Pack 64-bit
|
|
34
|
-
u32(b"\x41\x41\x41\x41") Unpack 32-bit
|
|
35
|
-
u64(data) Unpack 64-bit
|
|
36
|
-
p32(addr, endian='big') Big-endian pack
|
|
37
|
-
|
|
38
|
-
ELF ANALYSIS
|
|
39
|
-
e = ELF("./binary")
|
|
40
|
-
e.symbols["main"] Function address
|
|
41
|
-
e.got["puts"] GOT entry
|
|
42
|
-
e.plt["puts"] PLT entry
|
|
43
|
-
e.search(b"/bin/sh") Search for bytes
|
|
44
|
-
e.address Base address
|
|
45
|
-
|
|
46
|
-
ROP
|
|
47
|
-
rop = ROP(e)
|
|
48
|
-
rop.call("puts", [got_puts]) Call function
|
|
49
|
-
rop.raw(gadget_addr) Raw gadget
|
|
50
|
-
rop.chain() Build chain
|
|
51
|
-
rop.find_gadget(["pop rdi"]) Find gadget
|
|
52
|
-
|
|
53
|
-
SHELLCODE
|
|
54
|
-
shellcraft.sh() /bin/sh shellcode
|
|
55
|
-
shellcraft.cat("flag.txt") cat file
|
|
56
|
-
asm(shellcraft.sh()) Assemble shellcode
|
|
57
|
-
|
|
58
|
-
CRYPTO
|
|
59
|
-
xor(data, key) XOR data with key
|
|
60
|
-
xor_key(plain, cipher) Find XOR key
|
|
61
|
-
|
|
62
|
-
CONTEXT
|
|
63
|
-
context.arch = "amd64" Set architecture
|
|
64
|
-
context.os = "linux" Set OS
|
|
65
|
-
context.log_level = "debug" Debug output
|
|
66
|
-
context.terminal = ["tmux", "splitw", "-h"]
|
|
67
|
-
|
|
68
|
-
FORMAT STRING
|
|
69
|
-
fmtstr_payload(offset, {addr: value})
|
|
70
|
-
|
|
71
|
-
COMMON PATTERNS
|
|
72
|
-
# Buffer overflow
|
|
73
|
-
payload = b"A" * offset
|
|
74
|
-
payload += p64(ret_addr)
|
|
75
|
-
r.sendline(payload)
|
|
76
|
-
|
|
77
|
-
# Leak address
|
|
78
|
-
r.recvuntil(b"output: ")
|
|
79
|
-
leak = u64(r.recv(6).ljust(8, b"\x00"))
|
package/refs/pycrypto.txt
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
PyCryptodome Quick Reference
|
|
2
|
-
============================
|
|
3
|
-
|
|
4
|
-
INSTALLATION
|
|
5
|
-
pip install pycryptodome
|
|
6
|
-
|
|
7
|
-
AES
|
|
8
|
-
from Crypto.Cipher import AES
|
|
9
|
-
from Crypto.Util.Padding import pad, unpad
|
|
10
|
-
|
|
11
|
-
# AES-ECB
|
|
12
|
-
cipher = AES.new(key, AES.MODE_ECB)
|
|
13
|
-
ct = cipher.encrypt(pad(data, 16))
|
|
14
|
-
pt = unpad(cipher.decrypt(ct), 16)
|
|
15
|
-
|
|
16
|
-
# AES-CBC
|
|
17
|
-
cipher = AES.new(key, AES.MODE_CBC, iv=iv)
|
|
18
|
-
ct = cipher.encrypt(pad(data, 16))
|
|
19
|
-
cipher2 = AES.new(key, AES.MODE_CBC, iv=iv)
|
|
20
|
-
pt = unpad(cipher2.decrypt(ct), 16)
|
|
21
|
-
|
|
22
|
-
# AES-CTR
|
|
23
|
-
cipher = AES.new(key, AES.MODE_CTR, nonce=nonce)
|
|
24
|
-
ct = cipher.encrypt(data) # no padding needed
|
|
25
|
-
|
|
26
|
-
# AES-GCM
|
|
27
|
-
cipher = AES.new(key, AES.MODE_GCM, nonce=nonce)
|
|
28
|
-
ct, tag = cipher.encrypt_and_digest(data)
|
|
29
|
-
|
|
30
|
-
RSA
|
|
31
|
-
from Crypto.PublicKey import RSA
|
|
32
|
-
from Crypto.Cipher import PKCS1_OAEP
|
|
33
|
-
|
|
34
|
-
# Generate key
|
|
35
|
-
key = RSA.generate(2048)
|
|
36
|
-
pub = key.publickey()
|
|
37
|
-
|
|
38
|
-
# Encrypt / Decrypt
|
|
39
|
-
cipher = PKCS1_OAEP.new(pub)
|
|
40
|
-
ct = cipher.encrypt(data)
|
|
41
|
-
cipher = PKCS1_OAEP.new(key)
|
|
42
|
-
pt = cipher.decrypt(ct)
|
|
43
|
-
|
|
44
|
-
# RSA math
|
|
45
|
-
key = RSA.import_key(open("key.pem").read())
|
|
46
|
-
n = key.n # modulus
|
|
47
|
-
e = key.e # public exponent
|
|
48
|
-
d = key.d # private exponent
|
|
49
|
-
p = key.p # prime 1
|
|
50
|
-
q = key.q # prime 2
|
|
51
|
-
|
|
52
|
-
# Textbook RSA
|
|
53
|
-
ct = pow(m, e, n) # encrypt
|
|
54
|
-
pt = pow(ct, d, n) # decrypt
|
|
55
|
-
|
|
56
|
-
HASHING
|
|
57
|
-
from Crypto.Hash import SHA256, MD5, SHA1
|
|
58
|
-
|
|
59
|
-
h = SHA256.new(data)
|
|
60
|
-
print(h.hexdigest())
|
|
61
|
-
|
|
62
|
-
h = MD5.new(data)
|
|
63
|
-
print(h.hexdigest())
|
|
64
|
-
|
|
65
|
-
RANDOM
|
|
66
|
-
from Crypto.Random import get_random_bytes
|
|
67
|
-
key = get_random_bytes(16) # 16 random bytes
|
|
68
|
-
iv = get_random_bytes(16)
|
|
69
|
-
|
|
70
|
-
USEFUL MATH
|
|
71
|
-
from Crypto.Util.number import *
|
|
72
|
-
long_to_bytes(n) Number → bytes
|
|
73
|
-
bytes_to_long(b) Bytes → number
|
|
74
|
-
getPrime(1024) Random 1024-bit prime
|
|
75
|
-
isPrime(n) Primality test
|
|
76
|
-
inverse(e, phi) Modular inverse
|
|
77
|
-
GCD(a, b) Greatest common divisor
|
package/refs/python.txt
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
Python 3 Quick Reference
|
|
2
|
-
========================
|
|
3
|
-
|
|
4
|
-
DATA TYPES
|
|
5
|
-
x = 42 int
|
|
6
|
-
x = 3.14 float
|
|
7
|
-
s = "hello" str
|
|
8
|
-
b = b"\x41\x42" bytes
|
|
9
|
-
L = [1, 2, 3] list
|
|
10
|
-
T = (1, 2, 3) tuple
|
|
11
|
-
D = {"a": 1} dict
|
|
12
|
-
S = {1, 2, 3} set
|
|
13
|
-
|
|
14
|
-
STRINGS
|
|
15
|
-
s.upper() / s.lower() Case conversion
|
|
16
|
-
s.strip() Remove whitespace
|
|
17
|
-
s.split(",") Split to list
|
|
18
|
-
",".join(L) Join list to string
|
|
19
|
-
s.replace("a", "b") Replace
|
|
20
|
-
s.startswith("he") Check prefix
|
|
21
|
-
s.encode() str → bytes
|
|
22
|
-
b.decode() bytes → str
|
|
23
|
-
f"Value: {x}" F-string formatting
|
|
24
|
-
|
|
25
|
-
BYTES & ENCODING
|
|
26
|
-
bytes.fromhex("4142") Hex string → bytes
|
|
27
|
-
b.hex() Bytes → hex string
|
|
28
|
-
import base64
|
|
29
|
-
base64.b64encode(b) Base64 encode
|
|
30
|
-
base64.b64decode(s) Base64 decode
|
|
31
|
-
|
|
32
|
-
LIST OPERATIONS
|
|
33
|
-
L.append(x) Add to end
|
|
34
|
-
L.extend([4,5]) Extend list
|
|
35
|
-
L.pop() Remove last
|
|
36
|
-
L[1:3] Slice
|
|
37
|
-
L[::-1] Reverse
|
|
38
|
-
sorted(L) Sort (new list)
|
|
39
|
-
[x*2 for x in L] List comprehension
|
|
40
|
-
len(L) Length
|
|
41
|
-
|
|
42
|
-
DICT OPERATIONS
|
|
43
|
-
D["key"] Get value
|
|
44
|
-
D.get("key", default) Get with default
|
|
45
|
-
D.keys() All keys
|
|
46
|
-
D.values() All values
|
|
47
|
-
D.items() Key-value pairs
|
|
48
|
-
{**D1, **D2} Merge dicts
|
|
49
|
-
|
|
50
|
-
FILE I/O
|
|
51
|
-
with open("f.txt") as f:
|
|
52
|
-
content = f.read()
|
|
53
|
-
|
|
54
|
-
with open("f.txt", "w") as f:
|
|
55
|
-
f.write("data")
|
|
56
|
-
|
|
57
|
-
with open("f.bin", "rb") as f:
|
|
58
|
-
data = f.read()
|
|
59
|
-
|
|
60
|
-
USEFUL MODULES
|
|
61
|
-
import os OS operations
|
|
62
|
-
import sys System-specific
|
|
63
|
-
import re Regular expressions
|
|
64
|
-
import json JSON parsing
|
|
65
|
-
import hashlib Hash functions
|
|
66
|
-
import struct Binary packing
|
|
67
|
-
import socket Network sockets
|
|
68
|
-
import subprocess Run commands
|
|
69
|
-
import itertools Iteration tools
|
|
70
|
-
import collections Specialized containers
|
|
71
|
-
|
|
72
|
-
COMMON PATTERNS
|
|
73
|
-
# Read binary file
|
|
74
|
-
data = open("file", "rb").read()
|
|
75
|
-
|
|
76
|
-
# Decode an attached-data file (exam practicals save the blob to
|
|
77
|
-
# challenges/q<N>.txt inside the sandbox — base64, hex, or plain text)
|
|
78
|
-
import base64, re
|
|
79
|
-
blob = open("challenges/q36.txt").read().strip() # replace N
|
|
80
|
-
raw = base64.b64decode(blob) # if base64
|
|
81
|
-
# raw = bytes.fromhex(blob) # if hex
|
|
82
|
-
m = re.search(rb"ICOA\{[^}]+\}", raw)
|
|
83
|
-
print(m.group().decode() if m else "no flag in raw bytes")
|
|
84
|
-
|
|
85
|
-
# Hex dump
|
|
86
|
-
print(data.hex())
|
|
87
|
-
|
|
88
|
-
# XOR bytes
|
|
89
|
-
result = bytes(a ^ b for a, b in zip(d1, d2))
|
|
90
|
-
|
|
91
|
-
# HTTP request
|
|
92
|
-
import requests
|
|
93
|
-
r = requests.get(url)
|
|
94
|
-
r = requests.post(url, data={"key": "val"})
|
|
95
|
-
|
|
96
|
-
# Run command
|
|
97
|
-
import subprocess
|
|
98
|
-
out = subprocess.check_output(["cmd", "arg"])
|
|
99
|
-
|
|
100
|
-
# Regex
|
|
101
|
-
import re
|
|
102
|
-
m = re.search(r"pattern", text)
|
|
103
|
-
matches = re.findall(r"pattern", text)
|
package/refs/r2.txt
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
Radare2 Quick Reference
|
|
2
|
-
=======================
|
|
3
|
-
|
|
4
|
-
STARTING
|
|
5
|
-
r2 binary Open binary
|
|
6
|
-
r2 -d binary Debug mode
|
|
7
|
-
r2 -A binary Auto-analyze on open
|
|
8
|
-
r2 -w binary Write mode
|
|
9
|
-
|
|
10
|
-
ANALYSIS
|
|
11
|
-
aaa Full analysis
|
|
12
|
-
afl List functions
|
|
13
|
-
afl~main Find main function
|
|
14
|
-
afn name addr Rename function
|
|
15
|
-
axt addr Cross-references to
|
|
16
|
-
axf addr Cross-references from
|
|
17
|
-
|
|
18
|
-
NAVIGATION
|
|
19
|
-
s main Seek to function
|
|
20
|
-
s 0x401000 Seek to address
|
|
21
|
-
s+10 / s-10 Seek forward/back
|
|
22
|
-
|
|
23
|
-
DISASSEMBLY
|
|
24
|
-
pd 20 Disassemble 20 instructions
|
|
25
|
-
pdf Disassemble current function
|
|
26
|
-
pdf @ main Disassemble main
|
|
27
|
-
pD 100 Disassemble 100 bytes
|
|
28
|
-
|
|
29
|
-
PRINT DATA
|
|
30
|
-
px 64 Hex dump 64 bytes
|
|
31
|
-
ps @ addr Print string
|
|
32
|
-
pf d @ addr Print as integer
|
|
33
|
-
p8 16 Print 16 hex bytes
|
|
34
|
-
|
|
35
|
-
VISUAL MODE
|
|
36
|
-
V Enter visual mode
|
|
37
|
-
VV Graph mode
|
|
38
|
-
p/P Cycle views in visual
|
|
39
|
-
q Quit visual
|
|
40
|
-
|
|
41
|
-
SEARCHING
|
|
42
|
-
/ string Search for string
|
|
43
|
-
/x 90909090 Search hex pattern
|
|
44
|
-
/R pop rdi Search ROP gadget
|
|
45
|
-
iz List strings in data
|
|
46
|
-
izz List all strings
|
|
47
|
-
|
|
48
|
-
INFORMATION
|
|
49
|
-
i File info
|
|
50
|
-
ie Entry point
|
|
51
|
-
iS Sections
|
|
52
|
-
ii Imports
|
|
53
|
-
iE Exports
|
|
54
|
-
is Symbols
|
|
55
|
-
il Libraries
|
|
56
|
-
|
|
57
|
-
FLAGS / COMMENTS
|
|
58
|
-
f name @ addr Set flag (bookmark)
|
|
59
|
-
CC comment @ addr Add comment
|
|
60
|
-
CCu Remove comment
|
|
61
|
-
|
|
62
|
-
WRITE MODE (r2 -w)
|
|
63
|
-
wx 9090 @ addr Write hex bytes
|
|
64
|
-
wa "nop" @ addr Write assembly
|
|
65
|
-
|
|
66
|
-
DEBUG
|
|
67
|
-
db addr Breakpoint
|
|
68
|
-
dc Continue
|
|
69
|
-
ds Step
|
|
70
|
-
dr Show registers
|
|
71
|
-
dr rax=0 Set register
|
|
72
|
-
|
|
73
|
-
COMMON CTF PATTERNS
|
|
74
|
-
# Quick analysis
|
|
75
|
-
r2 -A binary
|
|
76
|
-
afl # list functions
|
|
77
|
-
s main # go to main
|
|
78
|
-
pdf # disassemble
|
|
79
|
-
|
|
80
|
-
# Find strings
|
|
81
|
-
iz~flag
|
|
82
|
-
iz~password
|
|
83
|
-
|
|
84
|
-
# Decompile (with r2ghidra)
|
|
85
|
-
pdg @ main # Ghidra decompiler output
|
package/refs/regex.txt
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
Regular Expressions Quick Reference
|
|
2
|
-
====================================
|
|
3
|
-
|
|
4
|
-
BASIC PATTERNS
|
|
5
|
-
. Any character (except newline)
|
|
6
|
-
\d Digit [0-9]
|
|
7
|
-
\D Non-digit
|
|
8
|
-
\w Word character [a-zA-Z0-9_]
|
|
9
|
-
\W Non-word character
|
|
10
|
-
\s Whitespace
|
|
11
|
-
\S Non-whitespace
|
|
12
|
-
\b Word boundary
|
|
13
|
-
|
|
14
|
-
ANCHORS
|
|
15
|
-
^ Start of string/line
|
|
16
|
-
$ End of string/line
|
|
17
|
-
\A Start of string only
|
|
18
|
-
\Z End of string only
|
|
19
|
-
|
|
20
|
-
QUANTIFIERS
|
|
21
|
-
* 0 or more
|
|
22
|
-
+ 1 or more
|
|
23
|
-
? 0 or 1
|
|
24
|
-
{n} Exactly n
|
|
25
|
-
{n,} n or more
|
|
26
|
-
{n,m} Between n and m
|
|
27
|
-
*? +? ?? Non-greedy versions
|
|
28
|
-
|
|
29
|
-
CHARACTER CLASSES
|
|
30
|
-
[abc] a, b, or c
|
|
31
|
-
[a-z] Lowercase letters
|
|
32
|
-
[A-Z] Uppercase letters
|
|
33
|
-
[0-9] Digits
|
|
34
|
-
[^abc] NOT a, b, or c
|
|
35
|
-
[a-zA-Z0-9] Alphanumeric
|
|
36
|
-
|
|
37
|
-
GROUPS & REFERENCES
|
|
38
|
-
(pattern) Capture group
|
|
39
|
-
(?:pattern) Non-capture group
|
|
40
|
-
(?P<name>pat) Named group (Python)
|
|
41
|
-
\1 Back-reference to group 1
|
|
42
|
-
(?=pattern) Lookahead
|
|
43
|
-
(?!pattern) Negative lookahead
|
|
44
|
-
(?<=pattern) Lookbehind
|
|
45
|
-
(?<!pattern) Negative lookbehind
|
|
46
|
-
|
|
47
|
-
ALTERNATION
|
|
48
|
-
a|b a or b
|
|
49
|
-
(cat|dog) cat or dog
|
|
50
|
-
|
|
51
|
-
COMMON CTF PATTERNS
|
|
52
|
-
# Flag format
|
|
53
|
-
icoa\{[^}]+\}
|
|
54
|
-
|
|
55
|
-
# IP address
|
|
56
|
-
\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}
|
|
57
|
-
|
|
58
|
-
# Hex string
|
|
59
|
-
[0-9a-fA-F]+
|
|
60
|
-
|
|
61
|
-
# Base64
|
|
62
|
-
[A-Za-z0-9+/]+=*
|
|
63
|
-
|
|
64
|
-
# Email
|
|
65
|
-
[\w.+-]+@[\w-]+\.[\w.]+
|
|
66
|
-
|
|
67
|
-
# URL
|
|
68
|
-
https?://[^\s]+
|
|
69
|
-
|
|
70
|
-
GREP EXAMPLES
|
|
71
|
-
grep -E "icoa\{.*\}" file Find flags
|
|
72
|
-
grep -oP "\d+\.\d+\.\d+\.\d+" f Extract IPs
|
|
73
|
-
grep -rn "password" . Search recursively
|
package/refs/requests.txt
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
Python Requests Quick Reference
|
|
2
|
-
===============================
|
|
3
|
-
|
|
4
|
-
INSTALLATION
|
|
5
|
-
pip install requests
|
|
6
|
-
|
|
7
|
-
BASIC REQUESTS
|
|
8
|
-
import requests
|
|
9
|
-
|
|
10
|
-
r = requests.get(url)
|
|
11
|
-
r = requests.post(url, data={"key": "val"})
|
|
12
|
-
r = requests.put(url, json={"key": "val"})
|
|
13
|
-
r = requests.delete(url)
|
|
14
|
-
r = requests.head(url)
|
|
15
|
-
r = requests.options(url)
|
|
16
|
-
|
|
17
|
-
RESPONSE
|
|
18
|
-
r.status_code HTTP status code
|
|
19
|
-
r.text Response body (str)
|
|
20
|
-
r.content Response body (bytes)
|
|
21
|
-
r.json() Parse JSON response
|
|
22
|
-
r.headers Response headers
|
|
23
|
-
r.cookies Response cookies
|
|
24
|
-
r.url Final URL (after redirects)
|
|
25
|
-
r.elapsed Time elapsed
|
|
26
|
-
r.history Redirect history
|
|
27
|
-
|
|
28
|
-
PARAMETERS
|
|
29
|
-
# URL parameters
|
|
30
|
-
r = requests.get(url, params={"q": "search"})
|
|
31
|
-
|
|
32
|
-
# Headers
|
|
33
|
-
r = requests.get(url, headers={"Authorization": "Bearer tok"})
|
|
34
|
-
|
|
35
|
-
# Cookies
|
|
36
|
-
r = requests.get(url, cookies={"session": "abc"})
|
|
37
|
-
|
|
38
|
-
# POST data (form-encoded)
|
|
39
|
-
r = requests.post(url, data={"user": "admin"})
|
|
40
|
-
|
|
41
|
-
# POST JSON
|
|
42
|
-
r = requests.post(url, json={"user": "admin"})
|
|
43
|
-
|
|
44
|
-
# File upload
|
|
45
|
-
r = requests.post(url, files={"file": open("f", "rb")})
|
|
46
|
-
|
|
47
|
-
# Timeout
|
|
48
|
-
r = requests.get(url, timeout=5)
|
|
49
|
-
|
|
50
|
-
# Disable SSL verification
|
|
51
|
-
r = requests.get(url, verify=False)
|
|
52
|
-
|
|
53
|
-
# Follow redirects
|
|
54
|
-
r = requests.get(url, allow_redirects=False)
|
|
55
|
-
|
|
56
|
-
# Proxy
|
|
57
|
-
r = requests.get(url, proxies={"http": "http://127.0.0.1:8080"})
|
|
58
|
-
|
|
59
|
-
SESSIONS (persist cookies, headers)
|
|
60
|
-
s = requests.Session()
|
|
61
|
-
s.headers.update({"Authorization": "Bearer tok"})
|
|
62
|
-
s.get(url) # cookies persist
|
|
63
|
-
s.post(url, data=data) # same session
|
|
64
|
-
|
|
65
|
-
AUTH
|
|
66
|
-
from requests.auth import HTTPBasicAuth
|
|
67
|
-
r = requests.get(url, auth=HTTPBasicAuth("user", "pass"))
|
|
68
|
-
# shorthand:
|
|
69
|
-
r = requests.get(url, auth=("user", "pass"))
|
|
70
|
-
|
|
71
|
-
CTF PATTERNS
|
|
72
|
-
# SQL injection test
|
|
73
|
-
r = requests.get(url, params={"id": "1' OR '1'='1"})
|
|
74
|
-
|
|
75
|
-
# Cookie manipulation
|
|
76
|
-
r = requests.get(url, cookies={"admin": "true"})
|
|
77
|
-
|
|
78
|
-
# Brute force
|
|
79
|
-
for word in open("wordlist.txt"):
|
|
80
|
-
r = requests.post(url, data={"pass": word.strip()})
|
|
81
|
-
if "Success" in r.text:
|
|
82
|
-
print(f"Found: {word}")
|
|
83
|
-
break
|
package/refs/rules.txt
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
ICOA 2026 Competition Rules
|
|
2
|
-
===========================
|
|
3
|
-
|
|
4
|
-
FORMAT
|
|
5
|
-
Jeopardy-style CTF
|
|
6
|
-
Categories: Crypto, Web, Pwn, Reverse, Forensics
|
|
7
|
-
Day 1: AI4CTF — Classic CTF with AI-assisted solving
|
|
8
|
-
Day 2: CTF4AI — Attacking AI models
|
|
9
|
-
|
|
10
|
-
HINT BUDGET
|
|
11
|
-
Level A (General Guidance): 50 uses
|
|
12
|
-
Level B (Deep Analysis): 10 uses
|
|
13
|
-
Level C (Critical Assist): 2 uses
|
|
14
|
-
Token Cap: 50,000 tokens
|
|
15
|
-
|
|
16
|
-
RULES
|
|
17
|
-
- All tools must run inside the Docker sandbox
|
|
18
|
-
- Flag format: icoa{...}
|
|
19
|
-
- No collaboration between teams during competition
|
|
20
|
-
- All AI prompts are logged and auditable
|
|
21
|
-
- Competition times are enforced server-side
|
|
22
|
-
- Submitting after competition ends is not allowed
|
|
23
|
-
|
|
24
|
-
SCORING
|
|
25
|
-
- Each challenge has fixed point value
|
|
26
|
-
- First-blood bonus may apply
|
|
27
|
-
- Final ranking by total score
|
|
28
|
-
- Ties broken by submission time
|