Ik heb een probleem met driverlib.py binnen Immunity Debugger. In mijn boek staat de volgende instructie welke ik probeer uit te voeren binnen mijn VM:
Try loading the driver beep.sys into Immunity Debugger. Once loaded, use the debugger’s PyShell and enter the following code:
*** Immunity Debugger Python Shell v0.1 ***
Immlib instanciated as 'imm' PyObject
READY.
>>> import driverlib
>>> driver = driverlib.Driver()
>>> driver.getDeviceNames()
['\\Device\\Beep']
>>>
Probleem: dit lukt tot en met import maar het daar op volgende commando werkt niet:
>>>driver = driverlib.Driver()
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "C:\Program Files\Immunity Inc\Immunity Debugger\Libs\driverlib.py", line 35, in __init__
if not self.module.isAnalysed:
AttributeError: 'NoneType' object has no attribute 'isAnalysed'
Enig google werk geeft aan:
"NoneType means that instead of an instance of whatever Class or Object you think you're working with, you've actually got None. That usually means that an assignment or function call up above failed or returned an unexpected result."
Ik ben geen coder dus dit helpt mij niet heel veel verder. Mijn gok zou zijn dat de return-code van isAnalysed om de een of andere reden niet begrepen wordt. Zie code hieronder.
Immunity draait als admin en de error kom ik verder nergens online tegen. Ik zal dus wel iets verkeerd doen
De code welke stuk gaat op regel 35:
De import code welke is aangeroepen op regel 35:
Try loading the driver beep.sys into Immunity Debugger. Once loaded, use the debugger’s PyShell and enter the following code:
*** Immunity Debugger Python Shell v0.1 ***
Immlib instanciated as 'imm' PyObject
READY.
>>> import driverlib
>>> driver = driverlib.Driver()
>>> driver.getDeviceNames()
['\\Device\\Beep']
>>>
Probleem: dit lukt tot en met import maar het daar op volgende commando werkt niet:
>>>driver = driverlib.Driver()
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "C:\Program Files\Immunity Inc\Immunity Debugger\Libs\driverlib.py", line 35, in __init__
if not self.module.isAnalysed:
AttributeError: 'NoneType' object has no attribute 'isAnalysed'
Enig google werk geeft aan:
"NoneType means that instead of an instance of whatever Class or Object you think you're working with, you've actually got None. That usually means that an assignment or function call up above failed or returned an unexpected result."
Ik ben geen coder dus dit helpt mij niet heel veel verder. Mijn gok zou zijn dat de return-code van isAnalysed om de een of andere reden niet begrepen wordt. Zie code hieronder.
Immunity draait als admin en de error kom ik verder nergens online tegen. Ik zal dus wel iets verkeerd doen
De code welke stuk gaat op regel 35:
Python:
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
31
32
33
34
35
36
37
38
39
40
41
| #!/usr/bin/env python """ Immunity Static Driver Analysis for Immunity Debugger (c) Immunity, Inc. 2004-2006 U{Immunity Inc.<http://www.immunityinc.com>} Debugger Driver Library for python """ __VERSION__ = '1.0' from immutils import * from immlib import * import struct class Driver: def __init__(self): # Globals self.imm = Debugger() self.IOCTLDispatchFunction = None self.IOCTLDispatchFunctionAddress = 0x00000000 self.IOCTLCodes = [] self.IOCTLCodesLanding = {} self.deviceNames = [] self.module = self.imm.getModule( self.imm.getDebuggedName() ) # Do some quick setup if not self.module.isAnalysed: self.imm.analyseCode( self.module.getCodebase() ) def getIOCTLCodes( self ): """ Useful function to root out IOCTL codes from a driver. This is also a big part of automating ioctlizer. |
De import code welke is aangeroepen op regel 35:
Python:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| def isAnalysed(self,address): """ Check if module is already analysed @type Address: DWORD @param Address: Address from module @rtype: DWORD @return: 1 if module already analysed """ ret = debugger.is_analysed(address) if ret == -1: return 0 else: return ret |
This signature has been taken down by the Dutch police in the course of an international lawenforcement operation.