Skip to content

Commit

Permalink
Minor fix in name_registration_request and updated test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
asolino committed Jul 17, 2016
1 parent e351505 commit 24c4921
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion impacket/nmb.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ def name_registration_request(self, nbname, destaddr, qtype, scope, nb_flags=0,
req = p.getData()

res = self.send(p, destaddr, 1)
print res
return res

def name_query_request(self, nbname, destaddr = None, qtype = TYPE_SERVER, scope = None, timeout = 1):
netbios_name = nbname.upper()
Expand Down
14 changes: 14 additions & 0 deletions impacket/testcases/SMB_RPC/test_nmb.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ def test_gethostbyname(self):
resp = n.gethostbyname(self.serverName, nmb.TYPE_SERVER)
print resp.entries

def test_name_registration_request(self):
n = nmb.NetBIOS()
# ToDo: Look at this
#resp = n.name_registration_request('*SMBSERVER', self.serverName, nmb.TYPE_WORKSTATION, None,nmb.NB_FLAGS_G, '1.1.1.1')
resp = n.name_registration_request('*JSMBSERVER', self.serverName, nmb.TYPE_WORKSTATION, None,nmb.NB_FLAGS_ONT_P, '1.1.1.2')
resp.dump()

def test_name_query_request(self):
n = nmb.NetBIOS()
# ToDo: Look at this
# resp = n.name_registration_request('*SMBSERVER', self.serverName, nmb.TYPE_WORKSTATION, None,nmb.NB_FLAGS_G, '1.1.1.1')
resp = n.name_query_request(self.serverName, self.machine)
print resp.entries

class NetBIOSTests(NMBTests):
def setUp(self):
NMBTests.setUp(self)
Expand Down

0 comments on commit 24c4921

Please sign in to comment.