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

Add ip to smb session prompt #18921

Merged
merged 1 commit into from Mar 5, 2024

Conversation

dwelch-r7
Copy link
Contributor

Adds the ip address of the current smb connection when you aren't connected to a share in the smb sessions

Before:

msf6 auxiliary(scanner/smb/smb_login) > sessions -1
[*] Starting interaction with 6...

SMB > shares
Shares
======

    #  Name    Type          comment
    -  ----    ----          -------
    0  ADMIN$  DISK|SPECIAL  Remote Admin
    1  C$      DISK|SPECIAL  Default share
    2  foo     DISK
    3  IPC$    IPC|SPECIAL   Remote IPC

SMB > shares -i foo
[+] Successfully connected to foo
SMB (172.16.158.154\foo) >

After:

msf6 auxiliary(scanner/smb/smb_login) > sessions -1
[*] Starting interaction with 7...

SMB (172.16.158.154) > shares
Shares
======

    #  Name    Type          comment
    -  ----    ----          -------
    0  ADMIN$  DISK|SPECIAL  Remote Admin
    1  C$      DISK|SPECIAL  Default share
    2  foo     DISK
    3  IPC$    IPC|SPECIAL   Remote IPC

SMB (172.16.158.154) > shares -i foo
[+] Successfully connected to foo
SMB (172.16.158.154\foo) >

Verification steps

  • Get an SMB session
  • Interact with the session sessions -1
  • Verify the correct ip address is part of the prompt before and after connecting to a share

@smcintyre-r7 smcintyre-r7 self-assigned this Mar 5, 2024
Copy link
Contributor

@smcintyre-r7 smcintyre-r7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me. Thanks for adding this in.

msf6 auxiliary(scanner/smb/smb_login) > sessions

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

  Id  Name  Type  Information                         Connection
  --  ----  ----  -----------                         ----------
  1         smb   SMB smcintyre @ 192.168.159.10:445  192.168.159.128:33869 -> 192.168.159.10:445 (192.168.159.10)

msf6 auxiliary(scanner/smb/smb_login) > sessions -i -1
[*] Starting interaction with 1...

SMB (192.168.159.10) > shares
Shares
======

    #  Name      Type          comment
    -  ----      ----          -------
    0  ADMIN$    DISK|SPECIAL  Remote Admin
    1  C$        DISK|SPECIAL  Default share
    2  IPC$      IPC|SPECIAL   Remote IPC
    3  NETLOGON  DISK          Logon server share
    4  SYSVOL    DISK          Logon server share

SMB (192.168.159.10) > shares -i C$
[+] Successfully connected to C$
SMB (192.168.159.10\C$) > 

@smcintyre-r7 smcintyre-r7 merged commit 57bc748 into rapid7:master Mar 5, 2024
36 of 37 checks passed
@smcintyre-r7
Copy link
Contributor

Release Notes

This adds the IP address to the SMB session prompt when there is no selected share.

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

2 participants