MCPcopy Create free account
hub / github.com/secdev/scapy / getsd

Method getsd

scapy/layers/smbclient.py:1819–1851  ·  view source on GitHub ↗

Get the Security Descriptor

(self, file)

Source from the content-addressed store, hash-verified

1817
1818 @CLIUtil.addcommand(spaces=True)
1819 def getsd(self, file):
1820 """
1821 Get the Security Descriptor
1822 """
1823 if self._require_share():
1824 return
1825 fpath = self.pwd / file
1826 self.smbsock.set_TID(self.current_tree)
1827 # Open file
1828 fileId = self.smbsock.create_request(
1829 self.normalize_path(fpath),
1830 type="",
1831 mode="",
1832 extra_desired_access=["READ_CONTROL", "ACCESS_SYSTEM_SECURITY"],
1833 )
1834 # Get the file size
1835 info = self.smbsock.query_info(
1836 FileId=fileId,
1837 InfoType="SMB2_0_INFO_SECURITY",
1838 FileInfoClass=0,
1839 AdditionalInformation=(
1840 0x00000001
1841 | 0x00000002
1842 | 0x00000004
1843 | 0x00000008
1844 | 0x00000010
1845 | 0x00000020
1846 | 0x00000040
1847 | 0x00010000
1848 ),
1849 )
1850 self.smbsock.close_request(fileId)
1851 return info
1852
1853 @CLIUtil.addcomplete(getsd)
1854 def getsd_complete(self, file):

Callers

nothing calls this directly

Calls 6

_require_shareMethod · 0.95
normalize_pathMethod · 0.95
set_TIDMethod · 0.80
create_requestMethod · 0.80
query_infoMethod · 0.80
close_requestMethod · 0.80

Tested by

no test coverage detected