blob: d7a16917f969dd6c54d6e70e3b55d291bfb1f12a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
import dcerpc
def test_EnumPrinters(pipe):
r = {}
r['flags'] = 0x02
r['server'] = None
r['level'] = 1
r['buffer'] = None
r['buf_size'] = 0
result = dcerpc.spoolss_EnumPrinters(pipe, r)
if result['result'] == dcerpc.WERR_INSUFFICIENT_BUFFER:
r['buffer'] = result['buf_size'] * '\x00'
r['buf_size'] = result['buf_size']
result = dcerpc.spoolss_EnumPrinters(pipe, r)
print dcerpc.unmarshall_spoolss_PrinterInfo1(result['buffer'])
def runtests(binding, domain, username, password):
print 'Testing SPOOLSS pipe'
pipe = dcerpc.pipe_connect(binding,
dcerpc.DCERPC_SPOOLSS_UUID, dcerpc.DCERPC_SPOOLSS_VERSION,
domain, username, password)
test_EnumPrinters(pipe)
|