'how can sent smb annoymous packet like the picture below
[smb annoymous packet]

I have tried empty username password and guest username and got different results than it
from impacket.smb import SMB_DIALECT
from impacket.smbconnection import SMBConnection
def main():
conn = SMBConnection('*SMBSERVER', ip, sess_port=port, preferredDialect=SMB_DIALECT)
conn.setTimeout(timeout=timeout)
# conn.login(user='', password='')
conn.login(user='guest', password='')
share_list, lists = conn.listShares(), []
for item in range(len(share_list)):
lists.append((share_list[item]['shi1_netname'][:-1], share_list[item]['shi1_remark'][:-1]))
print(lists)
conn.logoff()
if __name__ == '__main__':
ip, port, timeout = '192.168.20.102', 445, 15
main()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
