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

post/android/capture/screen: Use Msf::Post::Common mixin #14532

Merged
merged 1 commit into from
Dec 22, 2020

Conversation

bcoles
Copy link
Contributor

@bcoles bcoles commented Dec 20, 2020

I have no idea when this stopped working and why. Somewhere along the line the require 'msf/core' line was removed which might be the root cause.

Before:

msf6 post(android/capture/screen) > run

[!] SESSION may not be compatible with this module.
[-] Post failed: NoMethodError undefined method `cmd_exec' for #<Msf::Modules::Post__Android__Capture__Screen::MetasploitModule:0x0000555ae032b8e8>
[-] Call stack:
[-]   /root/Desktop/metasploit-framework/modules/post/android/capture/screen.rb:29:in `run'
[*] Post module execution completed

After:

msf6 post(android/capture/screen) > rexploit 
[*] Reloading module...

[!] SESSION may not be compatible with this module.
[+] Downloading screenshot...
[+] Screenshot saved at /root/.msf4/loot/20201220061323_default_10.1.1.105_screen_capture.s_653869.png
[*] Post module execution completed
msf6 post(android/capture/screen) > file /root/.msf4/loot/20201220061323_default_10.1.1.105_screen_capture.s_653869.png
[*] exec: file /root/.msf4/loot/20201220061323_default_10.1.1.105_screen_capture.s_653869.png

/root/.msf4/loot/20201220061323_default_10.1.1.105_screen_capture.s_653869.png: PNG image data, 1280 x 720, 8-bit/color RGBA, non-interlaced

@bcoles bcoles requested a review from timwr December 20, 2020 11:20
@bcoles bcoles added the easy label Dec 20, 2020
@space-r7 space-r7 self-assigned this Dec 22, 2020
@space-r7
Copy link
Contributor

Working for me

msf6 exploit(multi/handler) > sessions

Active sessions
===============

  Id  Name  Type                  Information  Connection
  --  ----  ----                  -----------  ----------
  1         shell dalvik/android               192.168.57.1:4444 -> 192.168.57.1:52122 (192.168.57.1)

msf6 exploit(multi/handler) > use post/android/capture/screen 
msf6 post(android/capture/screen) > set session 1
session => 1
msf6 post(android/capture/screen) > run

[+] Downloading screenshot...
[+] Screenshot saved at /Users/space/.msf4/loot/20201222144113_default_192.168.57.1_screen_capture.s_197790.png
[*] Post module execution completed

@bcoles
Copy link
Contributor Author

bcoles commented Dec 22, 2020

Working for me

msf6 exploit(multi/handler) > sessions

Active sessions
===============

  Id  Name  Type                  Information  Connection
  --  ----  ----                  -----------  ----------
  1         shell dalvik/android               192.168.57.1:4444 -> 192.168.57.1:52122 (192.168.57.1)

msf6 exploit(multi/handler) > use post/android/capture/screen 
msf6 post(android/capture/screen) > set session 1
session => 1
msf6 post(android/capture/screen) > run

[+] Downloading screenshot...
[+] Screenshot saved at /Users/space/.msf4/loot/20201222144113_default_192.168.57.1_screen_capture.s_197790.png
[*] Post module execution completed

Out of interest, does it work for you without this patch? A confused little bird mentioned to me that this change wasn't necessary on their branch, for reasons that neither of us understand, as the cmd_exec method is clearly not defined without the Common mixin.

@space-r7 space-r7 merged commit 6958f18 into rapid7:master Dec 22, 2020
@bcoles bcoles deleted the post-android-capture-screen branch December 22, 2020 20:52
@space-r7 space-r7 added the rn-fix release notes fix label Dec 22, 2020
@space-r7
Copy link
Contributor

Out of interest, does it work for you without this patch? A confused little bird mentioned to me that this change wasn't necessary on their branch, for reasons that neither of us understand, as the cmd_exec method is clearly not defined without the Common mixin.

Yea, this worked for me without the patch.

@bcoles
Copy link
Contributor Author

bcoles commented Dec 22, 2020

Out of interest, does it work for you without this patch? A confused little bird mentioned to me that this change wasn't necessary on their branch, for reasons that neither of us understand, as the cmd_exec method is clearly not defined without the Common mixin.

Yea, this worked for me without the patch.

Thanks. That's exceptionally confusing.

@space-r7
Copy link
Contributor

space-r7 commented Dec 22, 2020

Release Notes

Fixed a NoMethodError exception caused by the Msf::Post::Common mixin not being included in post/android/capture/screen.

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

Successfully merging this pull request may close these issues.

None yet

3 participants