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

Meterpreter has issues with large (> 4GB) files #11189

Closed
timwr opened this issue Jan 1, 2019 · 3 comments · Fixed by #11193
Closed

Meterpreter has issues with large (> 4GB) files #11189

timwr opened this issue Jan 1, 2019 · 3 comments · Fixed by #11193
Assignees

Comments

@timwr
Copy link
Contributor

timwr commented Jan 1, 2019

This has actually been reported before but not on the framework repo:
rapid7/meterpreter#204
rapid7/metasploit-payloads#281

Steps to reproduce

  1. Get any meterpreter session (currently python)
  2. Create a 4.1 gb file: dd if=/dev/zero of=lol4gb bs=4M count=1025
  3. meterpreter > ls in the directory where you created log4gb

Expected behavior

The ls command should complete and return the correct size

Current behavior

meterpreter > ls
[-] stdapi_fs_ls: Operation failed: Unknown error
[01/01/2019 19:58:21] [e(0)] meterpreter: stdapi_fs_ls: Operation failed: Unknown error
[01/01/2019 19:58:21] [d(0)] meterpreter: Call stack:
/metasploit-framework/lib/rex/post/meterpreter/extensions/stdapi/fs/dir.rb:80:in `entries_with_info'
/metasploit-framework/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb:629:in `list_path'
/metasploit-framework/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb:735:in `cmd_ls'

OS

Linux

@timwr timwr self-assigned this Jan 1, 2019
@timwr
Copy link
Contributor Author

timwr commented Jan 1, 2019

I'm going to attempt to fix this because it caught me out trying to ls a Download directory.

Hopefully we can fix this without breaking backwards compatibility with existing stageless meterpreters, (although let me know if that makes it more fiddly than it should be).
We can create a new TLV_TYPE_STAT_BUF with an 8 byte file size, and fall back to the old one if it's not present in a response.

@OJ
Copy link
Contributor

OJ commented Jan 1, 2019

This also impacts files downloads and whatnot, so we'd need to make sure we cover it off across the board. But yes, agreed, need to fix and need to make sure we don't break existing payloads with it!

timwr added a commit to timwr/metasploit-framework that referenced this issue Jan 2, 2019
@fsacer
Copy link
Contributor

fsacer commented Jan 20, 2019

actually here is the related issue which was posted before on the main repo #10871

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants