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.
Files changed (47) hide show
  1. package/dist/commands/ai4ctf.js +1 -1
  2. package/dist/commands/ctf4ai-demo.js +1 -1
  3. package/dist/commands/ctf4vla.js +1 -1
  4. package/dist/commands/exam.js +1 -1
  5. package/dist/commands/learn.js +1 -1
  6. package/dist/commands/ref.js +1 -1
  7. package/dist/lib/lazy-assets.js +1 -0
  8. package/dist/lib/py-syntax.js +1 -1
  9. package/package.json +1 -2
  10. package/refs/ROPgadget.txt +0 -67
  11. package/refs/base64.txt +0 -63
  12. package/refs/bash.txt +0 -79
  13. package/refs/binwalk.txt +0 -43
  14. package/refs/bs4.txt +0 -61
  15. package/refs/checksec.txt +0 -57
  16. package/refs/curl.txt +0 -73
  17. package/refs/cyberchef.txt +0 -78
  18. package/refs/exiftool.txt +0 -50
  19. package/refs/ffuf.txt +0 -73
  20. package/refs/gcc.txt +0 -66
  21. package/refs/gdb.txt +0 -83
  22. package/refs/hashcat.txt +0 -64
  23. package/refs/hint.txt +0 -48
  24. package/refs/icoa.txt +0 -72
  25. package/refs/john.txt +0 -74
  26. package/refs/linux.txt +0 -58
  27. package/refs/nc.txt +0 -64
  28. package/refs/nmap.txt +0 -57
  29. package/refs/numpy.txt +0 -59
  30. package/refs/openssl.txt +0 -75
  31. package/refs/pillow.txt +0 -67
  32. package/refs/pwntools.txt +0 -79
  33. package/refs/pycrypto.txt +0 -77
  34. package/refs/python.txt +0 -103
  35. package/refs/r2.txt +0 -85
  36. package/refs/regex.txt +0 -73
  37. package/refs/requests.txt +0 -83
  38. package/refs/rules.txt +0 -28
  39. package/refs/scapy.txt +0 -80
  40. package/refs/sqlmap.txt +0 -69
  41. package/refs/steghide.txt +0 -71
  42. package/refs/struct.txt +0 -61
  43. package/refs/sympy.txt +0 -77
  44. package/refs/tshark.txt +0 -65
  45. package/refs/vim.txt +0 -74
  46. package/refs/volatility.txt +0 -41
  47. package/refs/z3.txt +0 -78
package/refs/gcc.txt DELETED
@@ -1,66 +0,0 @@
1
- GCC Compiler Quick Reference
2
- ============================
3
-
4
- BASIC COMPILATION
5
- gcc -o output source.c Compile C
6
- g++ -o output source.cpp Compile C++
7
- gcc -c source.c Compile only (no link)
8
- gcc -S source.c Generate assembly
9
- gcc -E source.c Preprocess only
10
-
11
- OPTIMIZATION
12
- gcc -O0 source.c No optimization (debug)
13
- gcc -O1 source.c Basic optimization
14
- gcc -O2 source.c Standard optimization
15
- gcc -O3 source.c Aggressive optimization
16
- gcc -Os source.c Optimize for size
17
-
18
- DEBUG
19
- gcc -g source.c Debug symbols (for GDB)
20
- gcc -ggdb source.c GDB-specific debug info
21
-
22
- WARNINGS
23
- gcc -Wall source.c All common warnings
24
- gcc -Wextra source.c Extra warnings
25
- gcc -Werror source.c Treat warnings as errors
26
- gcc -pedantic source.c Strict standard compliance
27
-
28
- SECURITY FLAGS
29
- # Disable protections (for exploit development)
30
- gcc -fno-stack-protector -z execstack -no-pie source.c -o vuln
31
-
32
- # Disable specific protections
33
- -fno-stack-protector Disable stack canary
34
- -z execstack Make stack executable (disable NX)
35
- -no-pie Disable PIE
36
- -Wl,-z,norelro Disable RELRO
37
-
38
- # Enable protections
39
- -fstack-protector-all Enable stack canary
40
- -pie -fPIE Enable PIE
41
- -Wl,-z,relro,-z,now Full RELRO
42
- -D_FORTIFY_SOURCE=2 Buffer overflow detection
43
-
44
- LINKING
45
- gcc source.c -lm Link math library
46
- gcc source.c -lpthread Link pthreads
47
- gcc source.c -lcrypto Link OpenSSL crypto
48
- gcc -static source.c Static linking
49
-
50
- ARCHITECTURE
51
- gcc -m32 source.c Compile 32-bit
52
- gcc -m64 source.c Compile 64-bit
53
- gcc -march=native source.c Native architecture
54
-
55
- COMMON CTF PATTERNS
56
- # Compile vulnerable binary for practice
57
- gcc -fno-stack-protector -z execstack -no-pie -o vuln vuln.c
58
-
59
- # Compile with debug symbols for reversing practice
60
- gcc -g -O0 -o binary source.c
61
-
62
- # Compile shellcode runner
63
- gcc -z execstack -o runner runner.c
64
-
65
- # Cross-compile
66
- gcc -m32 -o binary32 source.c
package/refs/gdb.txt DELETED
@@ -1,83 +0,0 @@
1
- GDB / pwndbg Quick Reference
2
- ============================
3
-
4
- STARTING
5
- gdb ./binary Start debugging
6
- gdb -q ./binary Quiet mode
7
- gdb -p PID Attach to process
8
- gdb -args ./binary arg1 arg2 With arguments
9
-
10
- RUNNING
11
- r / run Start program
12
- r < input.txt With stdin from file
13
- c / continue Continue execution
14
- n / next Step over
15
- s / step Step into
16
- ni / si Next/step instruction
17
- finish Run until return
18
- kill Kill program
19
-
20
- BREAKPOINTS
21
- b main Break at function
22
- b *0x401000 Break at address
23
- b file.c:42 Break at line
24
- b *main+50 Break at offset
25
- info b List breakpoints
26
- delete N Delete breakpoint N
27
- disable N Disable breakpoint
28
- enable N Enable breakpoint
29
- watch *0x601000 Watchpoint (break on write)
30
-
31
- EXAMINING
32
- x/10x $rsp 10 hex words from RSP
33
- x/20i $rip 20 instructions from RIP
34
- x/s addr String at address
35
- x/10gx addr 10 giant (64-bit) hex values
36
- x/10wx addr 10 word (32-bit) hex values
37
- x/10bx addr 10 bytes hex
38
-
39
- p $rax Print register
40
- p/x $rax Print in hex
41
- p (int)$rax Print as int
42
- info reg All registers
43
-
44
- MEMORY
45
- vmmap Memory map (pwndbg)
46
- search -s "flag" Search memory for string
47
- search -x 4141 Search for hex pattern
48
-
49
- STACK
50
- bt / backtrace Call stack
51
- frame N Switch frame
52
- info frame Frame details
53
-
54
- PWNDBG SPECIFIC
55
- checksec Security mitigations
56
- got GOT entries
57
- plt PLT entries
58
- heap Heap overview
59
- bins Heap bins
60
- telescope 20 Smart stack view
61
- cyclic 200 Generate pattern
62
- cyclic -l 0x41414141 Find pattern offset
63
- rop ROP gadgets
64
- canary Show stack canary
65
- libc Libc base address
66
-
67
- SET VALUES
68
- set $rax = 0 Set register
69
- set *(int*)0x601000 = 42 Set memory
70
- set args "AAAA" Set arguments
71
-
72
- COMMON CTF PATTERNS
73
- # Find buffer overflow offset
74
- cyclic 200 > pattern.txt
75
- r < pattern.txt
76
- # After crash:
77
- cyclic -l $rsp
78
-
79
- # Bypass check
80
- b *check_password
81
- r
82
- set $rax = 1
83
- c
package/refs/hashcat.txt DELETED
@@ -1,64 +0,0 @@
1
- Hashcat Quick Reference
2
- =======================
3
-
4
- BASIC USAGE
5
- hashcat -m MODE hash.txt wordlist.txt
6
- hashcat -m MODE hash.txt -a 3 ?a?a?a?a?a (brute force)
7
-
8
- COMMON HASH MODES (-m)
9
- 0 MD5
10
- 100 SHA1
11
- 1400 SHA256
12
- 1700 SHA512
13
- 1800 sha512crypt ($6$)
14
- 3200 bcrypt
15
- 1000 NTLM
16
- 5600 NetNTLMv2
17
- 13100 Kerberos TGS-REP (Kerberoast)
18
- 22000 WPA-PBKDF2-PMKID+EAPOL
19
- 500 MD5crypt ($1$)
20
- 7400 SHA256crypt ($5$)
21
- 11600 7-Zip
22
- 13400 KeePass
23
- 16800 WPA-PMKID-PBKDF2
24
-
25
- ATTACK MODES (-a)
26
- 0 Dictionary (wordlist)
27
- 1 Combination (word1+word2)
28
- 3 Brute-force / mask
29
- 6 Wordlist + mask
30
- 7 Mask + wordlist
31
-
32
- MASK CHARSETS
33
- ?l Lowercase [a-z]
34
- ?u Uppercase [A-Z]
35
- ?d Digits [0-9]
36
- ?s Special chars
37
- ?a All printable
38
- ?b All bytes (0x00-0xff)
39
-
40
- RULES
41
- hashcat -m 0 hash.txt wordlist.txt -r rules/best64.rule
42
- hashcat -m 0 hash.txt wordlist.txt -r rules/rockyou-30000.rule
43
-
44
- OPTIONS
45
- --show Show cracked passwords
46
- --force Ignore warnings
47
- -o output.txt Output file
48
- -w 3 Workload profile (1-4)
49
- --potfile-disable Don't use potfile
50
- --username Hash file has usernames
51
- -O Optimized kernels
52
-
53
- COMMON CTF PATTERNS
54
- # MD5 dictionary
55
- hashcat -m 0 hash.txt /usr/share/wordlists/rockyou.txt
56
-
57
- # SHA256 with rules
58
- hashcat -m 1400 hash.txt wordlist.txt -r rules/best64.rule
59
-
60
- # Brute force 6-char alphanumeric
61
- hashcat -m 0 hash.txt -a 3 ?a?a?a?a?a?a
62
-
63
- # Known format: flag{????}
64
- hashcat -m 0 hash.txt -a 3 "flag{?a?a?a?a}"
package/refs/hint.txt DELETED
@@ -1,48 +0,0 @@
1
- AI Hint System Reference
2
- ========================
3
-
4
- LEVELS
5
- Level A — General Guidance (50 uses)
6
- - Conceptual direction only
7
- - No specific vulnerability names
8
- - No code or commands
9
- - Guides you with questions
10
-
11
- Level B — Deep Analysis (10 uses)
12
- - May identify vulnerability types
13
- - May suggest tool categories
14
- - No complete commands
15
- - No exploit code
16
-
17
- Level C — Critical Assist (2 uses)
18
- - Key conceptual breakthrough
19
- - May name specific algorithms
20
- - No complete exploit code
21
- - No flags
22
- - Requires confirmation before use
23
-
24
- COMMANDS
25
- hint <question> Level A hint
26
- hint-b <question> Level B hint
27
- hint-c <question> Level C hint (requires confirmation)
28
- hint budget Check remaining budget
29
-
30
- USAGE TIPS
31
- 1. Open a challenge first: open <id>
32
- This sets context for better hints.
33
-
34
- 2. Be specific in your question:
35
- BAD: "how do I solve this?"
36
- GOOD: "what type of vulnerability might be in a login form
37
- that doesn't sanitize input?"
38
-
39
- 3. Start with Level A — it's cheap (50 uses).
40
- Only escalate to B/C when A isn't enough.
41
-
42
- 4. Check your budget: hint budget
43
-
44
- TOKEN CAP
45
- All AI usage shares a 50,000 token cap.
46
- Level A uses ~500 tokens per query.
47
- Level B uses ~1000 tokens per query.
48
- Level C uses ~1500 tokens per query.
package/refs/icoa.txt DELETED
@@ -1,72 +0,0 @@
1
- ICOA CLI v2.5 — Quick Reference
2
- ==============================
3
-
4
- MODES (selected on first run)
5
- National Selection Lightweight exam-only mode
6
- International Olympiad Full CTF competition mode
7
- Organizer Partner management mode
8
- setup → Switch Mode Change mode anytime
9
-
10
- GETTING STARTED
11
- join <url> Connect to server
12
- activate <token> Unlock (Olympiad mode only)
13
- env Check tool environment (Olympiad only)
14
- help Show all commands
15
-
16
- COMPETITION
17
- challenges (ch) List all challenges
18
- open <id> View challenge details
19
- submit <id> <flag> Submit a flag
20
- scoreboard (sb) View rankings
21
- status Hint budget, score, rank, time
22
- time Competition countdown
23
-
24
- EXAM (National Selection)
25
- exam list Available exams for your country
26
- exam start <id> Begin exam (starts timer)
27
- exam q [n] View question n (or all)
28
- exam answer <n> <A-D> Answer question n
29
- exam review Review all answers
30
- exam submit Submit for grading
31
- exam result View your score
32
-
33
- AI HINTS
34
- hint <question> Level A — General guidance (50 uses)
35
- hint-b <question> Level B — Deep analysis (10 uses)
36
- hint-c <question> Level C — Critical assist (2 uses)
37
- hint budget Show remaining budget
38
-
39
- TOOLS
40
- ref <topic> Quick reference (38 topics)
41
- files <id> Download challenge files
42
- connect <id> Connect to remote target
43
- note <text> Personal notepad
44
- log Session history
45
- log stats Session statistics
46
- log export Export audit trail (JSON)
47
-
48
- SYSTEM COMMANDS
49
- python solve.py Run Python (forced to 3.12.13)
50
- nano solve.py Edit files
51
- gcc -o pwn pwn.c Compile code
52
- Any Linux command Runs in ~/icoa-workspace/
53
-
54
- SETTINGS
55
- setup Configure API keys
56
- lang <code> Switch language (en/zh/ja/ko/es)
57
- clear Clear screen
58
- exit Save session & quit
59
-
60
- SHORTCUTS
61
- ch = challenges
62
- sb = scoreboard
63
- flag = submit
64
-
65
- TIPS
66
- - Use 'open <id>' before 'hint' to set challenge context
67
- - Level A hints are cheap — use freely for direction
68
- - Level C hints require confirmation — use wisely
69
- - All commands are logged for audit
70
- - python/python3 always uses Python 3.12.13
71
- - System commands run in ~/icoa-workspace/ (sandboxed)
72
- - Use 'ref <topic>' for zero-cost tool references
package/refs/john.txt DELETED
@@ -1,74 +0,0 @@
1
- John the Ripper Quick Reference
2
- ================================
3
-
4
- BASIC USAGE
5
- john hash.txt Auto-detect and crack
6
- john --wordlist=words.txt hash.txt Dictionary attack
7
- john --show hash.txt Show cracked passwords
8
-
9
- HASH FORMATS
10
- john --format=raw-md5 hash.txt
11
- john --format=raw-sha256 hash.txt
12
- john --format=raw-sha512 hash.txt
13
- john --format=bcrypt hash.txt
14
- john --format=NT hash.txt NTLM
15
- john --format=sha512crypt hash.txt Linux shadow
16
-
17
- # List all formats
18
- john --list=formats
19
-
20
- HASH EXTRACTION
21
- # Linux shadow file
22
- unshadow /etc/passwd /etc/shadow > hashes.txt
23
-
24
- # ZIP file
25
- zip2john file.zip > hash.txt
26
-
27
- # RAR file
28
- rar2john file.rar > hash.txt
29
-
30
- # PDF
31
- pdf2john file.pdf > hash.txt
32
-
33
- # SSH private key
34
- ssh2john id_rsa > hash.txt
35
-
36
- # KeePass
37
- keepass2john database.kdbx > hash.txt
38
-
39
- # Office documents
40
- office2john file.docx > hash.txt
41
-
42
- # 7z archive
43
- 7z2john file.7z > hash.txt
44
-
45
- ATTACK MODES
46
- # Wordlist
47
- john --wordlist=/path/to/wordlist hash.txt
48
-
49
- # Wordlist with rules
50
- john --wordlist=words.txt --rules hash.txt
51
- john --wordlist=words.txt --rules=jumbo hash.txt
52
-
53
- # Incremental (brute force)
54
- john --incremental hash.txt
55
- john --incremental=digits hash.txt
56
-
57
- # Mask
58
- john --mask="?a?a?a?a?a" hash.txt
59
-
60
- OPTIONS
61
- --fork=4 Use 4 CPU cores
62
- --session=name Save session
63
- --restore=name Restore session
64
- --pot=file Custom potfile
65
-
66
- COMMON CTF PATTERNS
67
- # Crack ZIP password
68
- zip2john secret.zip > zip_hash.txt
69
- john --wordlist=rockyou.txt zip_hash.txt
70
- john --show zip_hash.txt
71
-
72
- # Crack SSH key
73
- ssh2john id_rsa > ssh_hash.txt
74
- john --wordlist=rockyou.txt ssh_hash.txt
package/refs/linux.txt DELETED
@@ -1,58 +0,0 @@
1
- Linux Commands Quick Reference
2
- ==============================
3
-
4
- FILE OPERATIONS
5
- ls -la List files with details
6
- cat file Display file contents
7
- head -n 20 file First 20 lines
8
- tail -n 20 file Last 20 lines
9
- less file Page through file
10
- find . -name "*.txt" Find files by name
11
- grep -r "pattern" . Search file contents recursively
12
- cp src dest Copy file
13
- mv src dest Move/rename file
14
- rm file Delete file
15
- chmod +x file Make file executable
16
- file filename Determine file type
17
-
18
- TEXT PROCESSING
19
- grep "pattern" file Search for pattern
20
- grep -i "pat" file Case-insensitive search
21
- sed 's/old/new/g' f Replace text
22
- awk '{print $1}' f Print first column
23
- sort file Sort lines
24
- uniq file Remove duplicate lines
25
- wc -l file Count lines
26
- cut -d: -f1 file Cut fields by delimiter
27
- tr 'a-z' 'A-Z' Translate characters
28
- xxd file Hex dump
29
- xxd -r hex.txt bin Reverse hex dump
30
-
31
- SYSTEM
32
- ps aux List processes
33
- kill PID Kill process
34
- uname -a System info
35
- df -h Disk usage
36
- free -m Memory usage
37
- which command Find command location
38
- env Show environment variables
39
-
40
- NETWORKING
41
- curl URL HTTP request
42
- wget URL Download file
43
- ping host Test connectivity
44
- ss -tlnp Show listening ports
45
- ip addr Show IP addresses
46
- dig domain DNS lookup
47
-
48
- PERMISSIONS
49
- chmod 755 file rwxr-xr-x
50
- chmod 644 file rw-r--r--
51
- chown user:group file Change ownership
52
-
53
- REDIRECTION
54
- cmd > file Redirect stdout to file
55
- cmd >> file Append stdout to file
56
- cmd 2> file Redirect stderr
57
- cmd1 | cmd2 Pipe output
58
- cmd < file Redirect stdin from file
package/refs/nc.txt DELETED
@@ -1,64 +0,0 @@
1
- Netcat (nc) Quick Reference
2
- ===========================
3
-
4
- BASIC CONNECTION
5
- nc host port Connect to host:port
6
- nc -v host port Verbose connection
7
- nc -nv host port No DNS, verbose
8
-
9
- LISTENING
10
- nc -lp port Listen on port
11
- nc -lvp port Listen verbose
12
- nc -lp port -e /bin/bash Bind shell (dangerous)
13
-
14
- DATA TRANSFER
15
- # Send file
16
- nc -lp 4444 > received.txt (receiver)
17
- nc host 4444 < send.txt (sender)
18
-
19
- # Pipe command output
20
- echo "data" | nc host port
21
- cat file | nc host port
22
-
23
- SCANNING
24
- nc -zv host 1-1000 Port scan
25
- nc -zvw1 host 80 Single port check (-w1 = 1s timeout)
26
-
27
- OPTIONS
28
- -l Listen mode
29
- -p port Specify port
30
- -v Verbose
31
- -n No DNS resolution
32
- -w seconds Timeout
33
- -z Zero I/O (scan mode)
34
- -u UDP mode
35
- -e prog Execute program on connect
36
- -k Keep listening after disconnect
37
-
38
- NCAT (enhanced netcat)
39
- ncat --ssl host port SSL/TLS connection
40
- ncat -lp port --ssl SSL listener
41
- ncat --proxy proxyhost:port host port Via proxy
42
-
43
- SOCAT (advanced)
44
- socat TCP:host:port - Basic connect
45
- socat TCP-LISTEN:port - Basic listen
46
- socat TCP:host:port EXEC:/bin/bash Connect shell
47
- socat OPENSSL:host:443 - SSL connect
48
-
49
- COMMON CTF PATTERNS
50
- # Connect to challenge
51
- nc challenge.ctf.com 1337
52
-
53
- # Send payload
54
- python3 -c "print('A'*100)" | nc host port
55
-
56
- # Interactive + send file
57
- (cat payload; cat -) | nc host port
58
-
59
- # Receive then interact
60
- nc host port
61
- # type commands interactively
62
-
63
- # Redirect to file for analysis
64
- nc host port | tee output.txt
package/refs/nmap.txt DELETED
@@ -1,57 +0,0 @@
1
- Nmap Quick Reference
2
- ====================
3
-
4
- BASIC SCANS
5
- nmap target Default scan (top 1000 ports)
6
- nmap -p 80,443 target Specific ports
7
- nmap -p 1-65535 target All ports
8
- nmap -p- target All ports (shorthand)
9
- nmap -F target Fast scan (top 100)
10
-
11
- SCAN TYPES
12
- nmap -sT target TCP connect scan
13
- nmap -sS target SYN scan (stealth, needs root)
14
- nmap -sU target UDP scan
15
- nmap -sV target Version detection
16
- nmap -sC target Default scripts
17
- nmap -A target Aggressive (OS + version + scripts)
18
- nmap -O target OS detection
19
-
20
- SERVICE / VERSION
21
- nmap -sV target Detect service versions
22
- nmap -sV --version-intensity 5 target More aggressive
23
-
24
- SCRIPTS
25
- nmap --script=default target Default scripts
26
- nmap --script=vuln target Vulnerability scripts
27
- nmap --script=http-enum target HTTP enumeration
28
- nmap --script=smb-vuln* target SMB vulnerabilities
29
-
30
- OUTPUT
31
- nmap -oN output.txt target Normal output
32
- nmap -oX output.xml target XML output
33
- nmap -oG output.gnmap target Grepable output
34
- nmap -oA basename target All formats
35
-
36
- HOST DISCOVERY
37
- nmap -sn 10.0.0.0/24 Ping sweep (no port scan)
38
- nmap -Pn target Skip host discovery
39
-
40
- TIMING
41
- nmap -T0 target Paranoid (slowest)
42
- nmap -T3 target Normal (default)
43
- nmap -T4 target Aggressive
44
- nmap -T5 target Insane (fastest)
45
-
46
- COMMON CTF COMBOS
47
- # Full enumeration
48
- nmap -sC -sV -p- target
49
-
50
- # Quick overview
51
- nmap -sV -F target
52
-
53
- # UDP + TCP
54
- nmap -sS -sU -p 1-1000 target
55
-
56
- # Script scan for HTTP
57
- nmap --script=http-* -p 80,443,8080 target
package/refs/numpy.txt DELETED
@@ -1,59 +0,0 @@
1
- NumPy Quick Reference
2
- =====================
3
-
4
- IMPORT
5
- import numpy as np
6
-
7
- ARRAY CREATION
8
- np.array([1, 2, 3]) From list
9
- np.zeros((3, 4)) 3x4 zeros
10
- np.ones((3, 4)) 3x4 ones
11
- np.arange(0, 10, 2) [0, 2, 4, 6, 8]
12
- np.linspace(0, 1, 5) 5 evenly spaced [0,1]
13
- np.eye(3) 3x3 identity matrix
14
- np.random.randint(0, 256, 100) Random integers
15
- np.frombuffer(data, dtype=np.uint8) From bytes
16
-
17
- ARRAY INFO
18
- a.shape Dimensions
19
- a.dtype Data type
20
- a.size Total elements
21
- a.ndim Number of dimensions
22
-
23
- OPERATIONS
24
- a + b Element-wise add
25
- a * b Element-wise multiply
26
- a @ b / np.dot(a, b) Matrix multiply
27
- a.T Transpose
28
- np.linalg.inv(a) Inverse
29
- np.linalg.det(a) Determinant
30
- np.linalg.solve(A, b) Solve Ax = b
31
-
32
- TYPE CONVERSION
33
- a.astype(np.uint8) Convert type
34
- a.tobytes() Array → bytes
35
- np.frombuffer(b, np.uint8) Bytes → array
36
-
37
- INDEXING
38
- a[0] First element
39
- a[-1] Last element
40
- a[1:5] Slice
41
- a[a > 5] Boolean indexing
42
- a.reshape(3, 4) Reshape
43
-
44
- USEFUL FOR CTF
45
- # XOR arrays
46
- result = np.bitwise_xor(a, b)
47
-
48
- # Byte frequency analysis
49
- data = np.frombuffer(file_bytes, dtype=np.uint8)
50
- unique, counts = np.unique(data, return_counts=True)
51
-
52
- # Image as array
53
- from PIL import Image
54
- img_array = np.array(Image.open("img.png"))
55
- # img_array.shape → (height, width, channels)
56
-
57
- # Matrix operations for crypto
58
- M = np.array([[1,2],[3,4]], dtype=np.int64)
59
- result = np.linalg.matrix_power(M, n)