icoa-cli 1.0.0

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 (77) hide show
  1. package/dist/commands/connect.d.ts +2 -0
  2. package/dist/commands/connect.js +66 -0
  3. package/dist/commands/ctf.d.ts +2 -0
  4. package/dist/commands/ctf.js +472 -0
  5. package/dist/commands/files.d.ts +2 -0
  6. package/dist/commands/files.js +52 -0
  7. package/dist/commands/hint.d.ts +2 -0
  8. package/dist/commands/hint.js +107 -0
  9. package/dist/commands/lang.d.ts +2 -0
  10. package/dist/commands/lang.js +42 -0
  11. package/dist/commands/log.d.ts +2 -0
  12. package/dist/commands/log.js +36 -0
  13. package/dist/commands/note.d.ts +2 -0
  14. package/dist/commands/note.js +32 -0
  15. package/dist/commands/ref.d.ts +2 -0
  16. package/dist/commands/ref.js +63 -0
  17. package/dist/commands/setup.d.ts +2 -0
  18. package/dist/commands/setup.js +88 -0
  19. package/dist/commands/shell.d.ts +2 -0
  20. package/dist/commands/shell.js +55 -0
  21. package/dist/index.d.ts +2 -0
  22. package/dist/index.js +78 -0
  23. package/dist/lib/budget.d.ts +8 -0
  24. package/dist/lib/budget.js +29 -0
  25. package/dist/lib/config.d.ts +7 -0
  26. package/dist/lib/config.js +60 -0
  27. package/dist/lib/ctfd-client.d.ts +22 -0
  28. package/dist/lib/ctfd-client.js +161 -0
  29. package/dist/lib/gemini.d.ts +7 -0
  30. package/dist/lib/gemini.js +108 -0
  31. package/dist/lib/logger.d.ts +6 -0
  32. package/dist/lib/logger.js +59 -0
  33. package/dist/lib/translation.d.ts +1 -0
  34. package/dist/lib/translation.js +40 -0
  35. package/dist/lib/ui.d.ts +10 -0
  36. package/dist/lib/ui.js +59 -0
  37. package/dist/types/index.d.ts +125 -0
  38. package/dist/types/index.js +29 -0
  39. package/package.json +43 -0
  40. package/refs/ROPgadget.txt +67 -0
  41. package/refs/base64.txt +63 -0
  42. package/refs/bash.txt +79 -0
  43. package/refs/binwalk.txt +43 -0
  44. package/refs/bs4.txt +61 -0
  45. package/refs/checksec.txt +57 -0
  46. package/refs/curl.txt +73 -0
  47. package/refs/cyberchef.txt +78 -0
  48. package/refs/exiftool.txt +50 -0
  49. package/refs/ffuf.txt +73 -0
  50. package/refs/gcc.txt +66 -0
  51. package/refs/gdb.txt +83 -0
  52. package/refs/hashcat.txt +64 -0
  53. package/refs/hint.txt +42 -0
  54. package/refs/icoa.txt +36 -0
  55. package/refs/john.txt +74 -0
  56. package/refs/linux.txt +58 -0
  57. package/refs/nc.txt +64 -0
  58. package/refs/nmap.txt +57 -0
  59. package/refs/numpy.txt +59 -0
  60. package/refs/openssl.txt +75 -0
  61. package/refs/pillow.txt +67 -0
  62. package/refs/pwntools.txt +79 -0
  63. package/refs/pycrypto.txt +77 -0
  64. package/refs/python.txt +94 -0
  65. package/refs/r2.txt +85 -0
  66. package/refs/regex.txt +73 -0
  67. package/refs/requests.txt +83 -0
  68. package/refs/rules.txt +28 -0
  69. package/refs/scapy.txt +80 -0
  70. package/refs/sqlmap.txt +69 -0
  71. package/refs/steghide.txt +71 -0
  72. package/refs/struct.txt +61 -0
  73. package/refs/sympy.txt +77 -0
  74. package/refs/tshark.txt +65 -0
  75. package/refs/vim.txt +74 -0
  76. package/refs/volatility.txt +41 -0
  77. package/refs/z3.txt +78 -0
package/refs/gcc.txt ADDED
@@ -0,0 +1,66 @@
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 ADDED
@@ -0,0 +1,83 @@
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
@@ -0,0 +1,64 @@
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 ADDED
@@ -0,0 +1,42 @@
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
+ USAGE TIPS
25
+ 1. Open a challenge first: icoa ctf open <id>
26
+ This sets context for better hints.
27
+
28
+ 2. Be specific in your question:
29
+ BAD: "how do I solve this?"
30
+ GOOD: "what type of vulnerability might be in a login form
31
+ that doesn't sanitize input?"
32
+
33
+ 3. Start with Level A — it's cheap (50 uses).
34
+ Only escalate to B/C when A isn't enough.
35
+
36
+ 4. Check your budget: icoa hint budget
37
+
38
+ TOKEN CAP
39
+ All AI usage shares a 50,000 token cap.
40
+ Level A uses ~500 tokens per query.
41
+ Level B uses ~1000 tokens per query.
42
+ Level C uses ~1500 tokens per query.
package/refs/icoa.txt ADDED
@@ -0,0 +1,36 @@
1
+ ICOA CLI — Quick Reference
2
+ ==========================
3
+
4
+ COMPETITION COMMANDS
5
+ icoa ctf join <url> Connect to CTFd instance
6
+ icoa ctf activate <code> Validate competition code
7
+ icoa ctf challenges List all challenges
8
+ icoa ctf open <id> View challenge details
9
+ icoa ctf submit <id> <flag> Submit a flag
10
+ icoa ctf scoreboard View scoreboard / rankings
11
+ icoa ctf status Show hint budget, score, rank, time
12
+ icoa ctf time Competition countdown timer
13
+
14
+ AI HINT SYSTEM
15
+ icoa hint <question> Level A — General guidance (50 uses)
16
+ icoa hint-b <question> Level B — Deep analysis (10 uses)
17
+ icoa hint-c <question> Level C — Critical assist (2 uses)
18
+ icoa hint budget Show remaining hint budget
19
+
20
+ TOOLS & FILES
21
+ icoa shell Open Docker sandbox environment
22
+ icoa ref <topic> Quick reference (this system)
23
+ icoa files <id> Download challenge files
24
+ icoa connect <id> Connect to remote target
25
+ icoa note <text> Add personal note
26
+ icoa log View session history
27
+
28
+ LANGUAGE
29
+ icoa lang <code> Switch language (en/zh/ja/ko/es)
30
+
31
+ TIPS
32
+ - Use 'icoa ctf open <id>' before 'icoa hint' to set challenge context
33
+ - Level A hints are cheap — use them freely for direction
34
+ - Level C hints require confirmation — use wisely
35
+ - All prompts are logged automatically
36
+ - Use 'icoa ref <topic>' for zero-cost tool references
package/refs/john.txt ADDED
@@ -0,0 +1,74 @@
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 ADDED
@@ -0,0 +1,58 @@
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 ADDED
@@ -0,0 +1,64 @@
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 ADDED
@@ -0,0 +1,57 @@
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 ADDED
@@ -0,0 +1,59 @@
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)
@@ -0,0 +1,75 @@
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