Jump to content
Sign in to follow this  
Manko

ProDLLer: Unknown code running? Befriend or Kill!

Recommended Posts

Manko

post-28581-0-99756400-1317831005_thumb.j

Know your system!

Prod your system for unwanted code! (virus/malware)

Please report bugs/requests/criticism or whatever!

ProDLLer v0.503

Update: 23rd of October 2011

ProDLLer.rar

Earlier versions downloaded: 2726 times.

Most Recent changes...
 
; 0.503
; Fixed: Don't leave icon in tray when leaving, XP/7.
; Fixed: Don't leave them after crash either.
; Added: Don't allow shutdown or standby while ProDLLing in XP, Thanks to Prog@ndy. Vista/7, dont alow shutdown.
; Added: Don't let ProDLLer be put to sleep by idletimers in xp/vista/7.
; Fixed: Lockup when returning from sleep in vista/7, . (if "Noprocs" running then disable "noprocs" and resume all procs.)
; Change: No suspending of "theme"-service in XP. On crash, just resume all processes... like we have to in vista/7...
 
; 0.502
; Fixed: Gui-problem fixed by BeginPaint/endpaint... tested on win7
; Fixed: "Crashnet" and SuspendAll. In the unlikely event that this happens. All procs will be resumed on vist and win7.
; Fixed: Fixed false positives in SSDTshadow on vista/win7.
 
; 0.501
; Added: SSDTshadow - not complete, but fully functional. = lacking names. (Logic is painful; need to guard against faults...)
; Fixed: Lockup in crashnet if "Services.exe" and "System" is suspended. Just resume them... You can suspend again...
; Fixed: Further lockups, same, to do with themes and "lsass.exe"...
 
; 0.500
; Added: Startup-killing... to take a load off the GUI... it will ask...
; Fixed: Slowdown because I accidentaly changed ProDLLer to itterate processes every second...
; Fixed: Process-CPU-utilization. Movement of abandoned children... I cheat. Just load up new list...
; Fixed: Got rid of the Adlib. There were too many possible problems...
; Fixed: CPU-load. Is again aligned...
 
; 0.499
; Added: If over 16 procs start from 1 sec to another or if a total of 40 procs have started; "NoProcsAllowed" is activated.
; Added: Crash-recovery... Just start a new instance of ProDLLer... :)
; Change: No loading of moduleinfo at start.
; Added: Refresh moduleinfo when we need it. KINDA CLUNKY SINCE I ITERATE ALL OF THEM, RIGHT NOW....
; Added: On start of app. Disallow new procs. "NoProcsAllowed" is activated.
; Fixed: A number of bugs that crash Prodller if insane amounts of processes start and stop...
 
; 0.498
; Fixed: "KernelNot.". When disabling callbacks; adjacent CBs of same type would sometimes vanish. Famous anti-rootkit had same faulty behavior.
 
; 0.497
; Fixed: Lockup when suspending some procs during modules-itteration. Context-menu disabled during itteration.
; Fixed: Lockup after thread-view due to excessive killing of already terminated security-threads... Now checking IF it needs killing...
; Fixed: Lockup when trying to change state of services while it is already working with your earlier request. Disable display.

Thanks for functions:

Thanks to "Smoke_N" for his "_ProcessListModules()"! Apparently i borrowed it a looooong time ago. :)

Thanks to "Engine" for his GREAT "Windows Services UDF"!!!

Thanks to JScript, Larry, SmOke_N, mrRevoked for _ProcessGetPath. I used this because I'm too lazy to do one myself. :)

Special thanks to:

Thanks to wraithdu for help and support!

Thanks to Ascend4nt for support and friendship!

Thanks to trancexx for good talks and friendship!

Thanks also to this great community! I really feel empowered!

/Manko [EDIT: New version.]

Edited by Manko

Yes i rush things! (I sorta do small bursts inbetween doing nothing.) Things I have rushed and reRushed:* ProDLLer - Process manager - Unload viri modules (dll) and moore...* _WinAPI_ProcessListOWNER_WTS() - Get Processes owner list...* _WinAPI_GetCommandLineFromPID() - Get commandline of target process...* _WinAPI_ThreadsnProcesses() Much info if expanded - optional Indented "Parent/Child"-style Processlist. Moore to come... eventually...

Share this post


Link to post
Share on other sites
wraithdu

Nice idea. However, if you want people to be able to compile / play with it, you'll have to provide the "service.au3" and "skeleton.sys" files. Of course that's totally up to you :)

Edited by wraithdu

Share this post


Link to post
Share on other sites
Manko

Nice idea. However, if you want people to be able to compile / play with it, you'll have to provide the "service.au3" and "skeleton.sys" files. Of course that's totally up to you :)

Thanks! Files now included in first post! I will however not be ferreting out all files for compiling driver in masm32. :)

They are all standard/unmodified but you need the update and the DDK and maybe something else...?

Well if a need arises and it's impossible to find some masm_includefile or other... maybe... PM me...

But driver is included, so it should not be necessary for most.

/Manko


Yes i rush things! (I sorta do small bursts inbetween doing nothing.) Things I have rushed and reRushed:* ProDLLer - Process manager - Unload viri modules (dll) and moore...* _WinAPI_ProcessListOWNER_WTS() - Get Processes owner list...* _WinAPI_GetCommandLineFromPID() - Get commandline of target process...* _WinAPI_ThreadsnProcesses() Much info if expanded - optional Indented "Parent/Child"-style Processlist. Moore to come... eventually...

Share this post


Link to post
Share on other sites
Skrip

I do like it. It's something I've never thought to do before. But I can't see where/how I would really use it.


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites
Skrip

I took your ColdBoot code out of here, and why doesn't it work just standalone?

#include <service.au3>

FileInstall("c:\skeleton.sys","c:\")
_StopService(".","skeleton")
_DeleteService(".","skeleton")
My_Service_Create("skeleton","Skeleton Driver","c:\skeleton.sys",$SERVICE_KERNEL_DRIVER,$SERVICE_DEMAND_START,$SERVICE_ERROR_IGNORE,0)
_StartService("skeleton")
_DeleteService(".","skeleton")
$test=DllStructCreate("char a[128]")
DllStructSetData($test,1,"\\.\skeleton")


$hColdBoot=DllCall("kernel32.dll", "int", "CreateFile", "ptr", DllStructGetPtr($test), "dword", 0xc0000000, "dword", 0, "dword", 0, "dword", 3, "dword", 0, "dword", 0)
DllCall("kernel32.dll", "int", "DeviceIoControl", "dword", $hColdBoot,"dword", 0x00226000, "ptr", 0, "dword", 0, "ptr", 0, "dword", 4, "dword*", 0, "ptr", 0)

Func My_Service_Create($sServiceName, _
                    $sDisplayName, _
                    $sBinaryPath, _
                    $nServiceType = 0x00000010, _
                    $nStartType = 0x00000002, _
                    $nErrorType = 0x00000001, _
                    $nDesiredAccess = 0x000f01ff)
   Local $hAdvapi32
   Local $hKernel32
   Local $arRet
   Local $hSC
   Local $lError = -1   

   $hAdvapi32 = DllOpen("advapi32.dll")
   If $hAdvapi32 = -1 Then Return 0
   $hKernel32 = DllOpen("kernel32.dll")
   If $hKernel32 = -1 Then Return 0
   $arRet = DllCall($hAdvapi32, "long", "OpenSCManager", _
                    "str", ".", _
                    "str", "ServicesActive", _
                    "long", $SC_MANAGER_ALL_ACCESS)
   If $arRet[0] = 0 Then
      $arRet = DllCall($hKernel32, "long", "GetLastError")
      $lError = $arRet[0]
   Else
      $hSC = $arRet[0]
      $arRet = DllCall($hAdvapi32, "long", "OpenService", _
                       "long", $hSC, _
                       "str", $sServiceName, _
                       "long", $SERVICE_INTERROGATE)
      If $arRet[0] = 0 Then
         $arRet = DllCall($hAdvapi32, "long", "CreateService", _
                          "long", $hSC, _
                          "str", $sServiceName, _
                          "str", $sDisplayName, _
                          "long", $nDesiredAccess, _
                          "long", $nServiceType, _
                          "long", $nStartType, _
                          "long", $nErrorType, _
                          "str", $sBinaryPath, _
                          "int", 0, _
                          "ptr", 0, _
                          "int", 0, _
                          "int", 0, _
                          "int", 0)
         If $arRet[0] = 0 Then          
            $arRet = DllCall($hKernel32, "long", "GetLastError")
            $lError = $arRet[0]
         Else
            DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $arRet[0])
         EndIf
      Else
         DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $arRet[0])
      EndIf   
      DllCall($hAdvapi32, "int", "CloseServiceHandle", "long", $hSC)
   EndIf
   DllClose($hAdvapi32)
   DllClose($hKernel32)   
   If $lError <> -1 Then 
      SetError($lError)
      Return 0
   EndIf
   Return 1
EndFunc

[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites
Manko

1. I took your ColdBoot code out of here, and why doesn't it work just standalone?

2. I do like it. It's something I've never thought to do before. But I can't see where/how I would really use it.

Hi!

1. Because a DllCall returns an array and you took out this part:

if $hColdBoot[0] = -1 Then 
    msgbox(0,"","Could not aquire cold boot handle!",5)
    $hColdboot=0
Else
    $hColdboot=$hColdBoot[0] ; ###### - Gets the result from the first arrayparameter into the single variable... - ####### 
EndIfoÝ÷ Øò¢çhmÁ©íjYm«r¢çȦ¦©àzÚ-+ºÚ"µÍØ[
    ][ÝÚÙ[Ì ][ÝË  ][ÝÚ[ ][ÝË  ][ÝÑ]XÙR[ÐÛÛÛ    ][ÝË  ][ÝÙÛÜ  ][ÝË  ÌÍÚÛÛÛÝÌK   ][ÝÙÛÜ  ][ÝË  ][ÝÜ][ÝË    ][ÝÙÛÜ  ][ÝË  ][ÝÜ][ÝË    ][ÝÙÛÜ  ][ÝË
    ][ÝÙÛÜ
][ÝË  ][ÝÜ][ÝË
oÝ÷ ÛeX­ßÛ¶%~Ýz׶)àjwkzj/x&j­çeÌ!Èkz¨Ê&zIèÂWçë¢kaz^­«h®ÊZ®Óµéæj­è§}ç-³*.®Ì¬µéÊ)ãyËbe)í£*.®Úî²×¦ºz˱©Ý²Ö²¶«xZ½êÞrÞ­çfj|¬ÊË^ÆòiÊ&n)Ú¶*'¡ûh¢[ºÚ/z¹h¢F§uæ¬zî±èZ±·ªk¡¹^«¶'.ªåÉú+¶¬¥ªí¡ûaz·¦¢ö¥¦ºzË·ljȦ¦WiËm«Zد»¬jlv÷öÖ¥Á¬¬vaz*ã¡´¨!Ú'ßÛkz¨Ø^»p!Øm¶§-Yai×(uè§~ì¶b§u×¥zاǫ¾'ANDG+y«b§vËZ®Ø§pjÈî²Û(ëax¦ëb«hëbëhëk¢éݶiËm«HÁ«©àz)ථ+Þ¬­Ø½é¦ºé¬Z²²­¶)ජajwex"[Zè­¢ëpéÈìm«Þj{©u«^÷öÙ'£!z{ajÜ"VÞ6m«_ºYh~'^jÆ®¶­sdfÆTç7FÆÂgV÷C¶3¢b3#·6¶VÆWFöâç72gV÷C²ÂgV÷C¶3¢b3#²gV÷C²¥õ7F÷6W'f6RgV÷C²âgV÷C²ÂgV÷C·6¶VÆWFöâgV÷C²²222222222ÒDTÄUDRD2ÄäRÒ2222222220¥ôFVÆWFU6W'f6RgV÷C²âgV÷C²ÂgV÷C·6¶VÆWFöâgV÷C²²222222222ÒDTÄUDRD2ÄäRÒ2222222220¤×õ6W'f6Uô7&VFRgV÷C·6¶VÆWFöâgV÷C²ÂgV÷Cµ6¶VÆWFöâG&fW"gV÷C²ÂgV÷C¶3¢b3#·6¶VÆWFöâç72gV÷C²Âb33cµ4U%d4Uô´U$äTÅôE$dU"Âb33cµ4U%d4UôDTÔäEõ5D%BÂb33cµ4U%d4UôU%$õ%ôtäõ$RÃ¥õ7F'E6W'f6RgV÷C·6¶VÆWFöâgV÷C²¥ôFVÆWFU6W'f6RgV÷C²âgV÷C²ÂgV÷C·6¶VÆWFöâgV÷C²¢b33c·FW7CÔFÆÅ7G'V7D7&VFRgV÷C¶6"³#ÒgV÷C²¤FÆÅ7G'V7E6WDFFb33c·FW7BÃÂgV÷C²b3#²b3#²âb3#·6¶VÆWFöâgV÷C²

/Manko


Yes i rush things! (I sorta do small bursts inbetween doing nothing.) Things I have rushed and reRushed:* ProDLLer - Process manager - Unload viri modules (dll) and moore...* _WinAPI_ProcessListOWNER_WTS() - Get Processes owner list...* _WinAPI_GetCommandLineFromPID() - Get commandline of target process...* _WinAPI_ThreadsnProcesses() Much info if expanded - optional Indented "Parent/Child"-style Processlist. Moore to come... eventually...

Share this post


Link to post
Share on other sites
Innovative

AWESOME and UNBELIEVABLE ! When i first saw the title , i thought that it'll never be possible but ..

*Loss of words*..

Thanks for sharing !

Share this post


Link to post
Share on other sites
Manko

Thanks for sharing !

Thanks for the high praise! Hope it will be useful for you!

Have updated app in first post.

Now it lists processes in parent/child order with indentation. Now you can see what proc started which proc. +it gets easier to read.

(On the downside, it sortof broke sorting of that column... but I wanted to release now and maybe fix later.)

Added info on Company/description/priority/full path

Proclistwindow is larger and it is resizeable!

/Manko


Yes i rush things! (I sorta do small bursts inbetween doing nothing.) Things I have rushed and reRushed:* ProDLLer - Process manager - Unload viri modules (dll) and moore...* _WinAPI_ProcessListOWNER_WTS() - Get Processes owner list...* _WinAPI_GetCommandLineFromPID() - Get commandline of target process...* _WinAPI_ThreadsnProcesses() Much info if expanded - optional Indented "Parent/Child"-style Processlist. Moore to come... eventually...

Share this post


Link to post
Share on other sites
madflame991

way cool! It's not like I'll be using it daily but there are situations when I really need this sort of app...

Bug thing: when resizing the window or moving the lists separator the whole thing flickers and the left list goes over the right one until i release the mouse button... not sure if this is because my cpu has only 1500 mhz

thx for sharing

Share this post


Link to post
Share on other sites
Manko

way cool! It's not like I'll be using it daily but there are situations when I really need this sort of app...

Bug thing: when resizing the window or moving the lists separator the whole thing flickers and the left list goes over the right one until i release the mouse button... not sure if this is because my cpu has only 1500 mhz

thx for sharing

Hi!

It's more like, I'm a crappy programmer. I actually don't know how to make it resize prettily... Ie tracking the mouse, making changes...

App worked in other respects, so I didn't bother. *blush*

Thanks for taking time and effort to comment!

/Manko

[EDIT: Have fixed much prettier resizing... (both listviews follow mouse like they should) Will not release and bump thread now though...]

Edited by Manko

Yes i rush things! (I sorta do small bursts inbetween doing nothing.) Things I have rushed and reRushed:* ProDLLer - Process manager - Unload viri modules (dll) and moore...* _WinAPI_ProcessListOWNER_WTS() - Get Processes owner list...* _WinAPI_GetCommandLineFromPID() - Get commandline of target process...* _WinAPI_ThreadsnProcesses() Much info if expanded - optional Indented "Parent/Child"-style Processlist. Moore to come... eventually...

Share this post


Link to post
Share on other sites
Manko

Problem resolved with new function!

A WARNING to potential users. Since I have a very clean system. I have not realised just how REALLY dangerous suspending threads can be. I just thought that if I kept updating lists of exceptions like for:

"csrss.exe" - NEVER supend on winXP, as this handles keyboard and mouse, and you would not be able to do anything else.

"ctfmon.exe" - App would be unresponsive, and might lock...

"fsgk.exe" - F-Secure antivirus. App would lock. This is used at work. BLODY SLOW AND USELESS...

...all would be good... But then I discovered lots more on laptops and readyinstalled package - brand name - systems... These procs all locked the system... They were too many!!! I had to find the cause.... And discovered it in Global message hooks. (SetWindowsHookEx)

So I started researching a way to warn the user of which processes had set these hooks. A possible way was to set a hook one self that would monitor hooks. WH_DEBUG which would return among others what sort of hook would be called and which process had installed it.

LRESULT CALLBACK DebugProc(   
    int nCode,
    WPARAM wParam,; Returns what sort of hook will be called
    LPARAM lParam   ; Returns below struct...
);

The lParam would return a pointer to the below struct.

typedef struct {
    DWORD idThread;
    DWORD idThreadInstaller;    THIS would return what I wanted. But always return 0. !!!! :( 
    LPARAM lParam;
    WPARAM wParam;
    int code;
} DEBUGHOOKINFO, *PDEBUGHOOKINFO;

Problem resolved with new function!

No matter what I did... It did not work. All the other fields in the struct is filled, but NOT the one I needed. (Of course I had put it in dll... And fiddled with security descriptors and such... no game!)I googled for days, only to find that noone could solve this and all had the same problem. :) I have continued to google and am on the track of a solution involving kernel drivers and undocumented structures deep in kernelspace... My Leads are:

http://www.experts-exchange.com/Programmin...Q_22405364.html

http://zairon.wordpress.com/2006/12/06/any...-on-my-machine/

http://www.woodmann.com/forum/archive/index.php/t-11537.html

This won't be fixed soon, so now you know, and have been warned. And I have no experience with kernel drivers... (The one I have is form a skeleton source, which I have shoves my two line code for rebooting into...)

I have to continue searching...

/Manko [EDIT:Problem resolved with new function!]

Edited by Manko

Yes i rush things! (I sorta do small bursts inbetween doing nothing.) Things I have rushed and reRushed:* ProDLLer - Process manager - Unload viri modules (dll) and moore...* _WinAPI_ProcessListOWNER_WTS() - Get Processes owner list...* _WinAPI_GetCommandLineFromPID() - Get commandline of target process...* _WinAPI_ThreadsnProcesses() Much info if expanded - optional Indented "Parent/Child"-style Processlist. Moore to come... eventually...

Share this post


Link to post
Share on other sites
Manko

the code gives me unendless errors

Have you downloaded extras? (The includes must ofcourse be in the INCLUDEs directory.) :)

Are you using Windows XP? (Prefered, maybe required...)

Are you administrator? (Required!)

Are you using AutoIt v3.3.0.0?

If that doesn't help, what are the errors? first error?

Thanks for replying! Don't see that often... :lmao:

/Manko

Edited by Manko

Yes i rush things! (I sorta do small bursts inbetween doing nothing.) Things I have rushed and reRushed:* ProDLLer - Process manager - Unload viri modules (dll) and moore...* _WinAPI_ProcessListOWNER_WTS() - Get Processes owner list...* _WinAPI_GetCommandLineFromPID() - Get commandline of target process...* _WinAPI_ThreadsnProcesses() Much info if expanded - optional Indented "Parent/Child"-style Processlist. Moore to come... eventually...

Share this post


Link to post
Share on other sites
yehia

yes at all but the errors r code related like endswitch and missing separators as i remember

Edit : line 80 _service_start("Skeleton") in correct number of parameters

i guess the services.au3 that i have is out dated or maybe urs

Edited by yehia

Share this post


Link to post
Share on other sites
Manko

yes at all but the errors r code related like endswitch and missing separators as i remember

Edit : line 80 _service_start("Skeleton") in correct number of parameters

i guess the services.au3 that i have is out dated or maybe urs

I'm guessing, if you switch to the provided services.au3, errors will go away. Make a copy of yours so you can switch back.

If that doesn't help, maybe you can give me more info...

/Manko


Yes i rush things! (I sorta do small bursts inbetween doing nothing.) Things I have rushed and reRushed:* ProDLLer - Process manager - Unload viri modules (dll) and moore...* _WinAPI_ProcessListOWNER_WTS() - Get Processes owner list...* _WinAPI_GetCommandLineFromPID() - Get commandline of target process...* _WinAPI_ThreadsnProcesses() Much info if expanded - optional Indented "Parent/Child"-style Processlist. Moore to come... eventually...

Share this post


Link to post
Share on other sites
Manko

how can i just list all the loaded dlls in an array?

Here you go!

Apparently I borrowed the module_func from Smoke_N a loooong time ago. Credits to him!!!

I just put it in my originally SMALL script and quickly forgot about it... :)

Never thought about publishing own code, back then...

I have used these APIs before, but AM lazy, so since I wasn't accustomed to Autoit-coding I just took it when I found one readymade.

#AutoIt3Wrapper_outfile=C:\TEST1.exe
#include <WinAPI.au3>   ; _GetPrivilege_SEDEBUG() - by wraithdu - uses this include. My function needs none.
#include <array.au3>    ; Needed to display array in example. Not needed by Func.

; ############ Example code #######################
#RequireAdmin

Global $avArray[100000][7], $iAdd = 0, $i
_GetPrivilege_SEDEBUG() ; I need this for tricky processes. Not needed for most...
Global $procs=ProcessList()
$avArray[0][0] = "ProcessName"
$avArray[0][1] = "th32ProcessID"
$avArray[0][4] = "ProccntUsage"
$avArray[0][5] = "modBaseSize"
$avArray[0][2] = "hModule"
$avArray[0][3] = "szModuleName"
$avArray[0][6] = "szExePath"
for $i= 3 to ubound($procs,1)-1
$iAdd+=1
_ProcessListModules($procs[$i][1])
Next
ReDim $avArray[$iAdd+1][7]
_arraydisplay($avArray, "Credits to Smoke_N for func... I just slightly modified it.")
; ###############################################


; ############ Here be func! #################### Credits to Smoke_N (Just searched for it...)
Func _ProcessListModules($dwPID)
    Local Const $TH32CS_SNAPMODULE = 0x08
    Local $aDLLCall, $tagMODULEENTRY32, $hModuleSnap
    $aDLLCall = DllCall("Kernel32.dll", "ptr", "CreateToolhelp32Snapshot", "int", $TH32CS_SNAPMODULE, "dword", $dwPID)
    $hModuleSnap = $aDLLCall[0]
    $tagMODULEENTRY32 = DllStructCreate("dword;dword;dword;dword;dword;byte;dword;ptr;char[256];char[257]")
    DllStructSetData($tagMODULEENTRY32, 1, DllStructGetSize($tagMODULEENTRY32))
    $aDLLCall = DllCall("Kernel32.dll", "int", "Module32First", "ptr", $hModuleSnap, "long", DllStructGetPtr($tagMODULEENTRY32))
    While 1
;~      typedef struct tagMODULEENTRY32 {
        ;$avArray[$iAdd][0] = DllStructGetData($tagMODULEENTRY32, 1) ;~             DWORD   dwSize;
        $avArray[$iAdd][0] = $procs[$i][0]
        ;$avArray[$iAdd][1] = DllStructGetData($tagMODULEENTRY32, 2) ;~             DWORD   th32ModuleID;
        $avArray[$iAdd][1] = DllStructGetData($tagMODULEENTRY32, 3) ;~          DWORD   th32ProcessID;
        ;$avArray[$iAdd][3] = DllStructGetData($tagMODULEENTRY32, 4) ;~             DWORD   GlblcntUsage;
        $avArray[$iAdd][4] = DllStructGetData($tagMODULEENTRY32, 5) ;~          DWORD   ProccntUsage;
        ;$avArray[$iAdd][5] = DllStructGetData($tagMODULEENTRY32, 6) ;~             BYTE  * modBaseAddr;
        $avArray[$iAdd][5] = DllStructGetData($tagMODULEENTRY32, 7) ;~          DWORD   modBaseSize;
        $avArray[$iAdd][2] = DllStructGetData($tagMODULEENTRY32, 8) ;~          HMODULE hModule;
        $avArray[$iAdd][3] = DllStructGetData($tagMODULEENTRY32, 9) ;~          char    szModule[MAX_MODULE_NAME32 + 1];
        $avArray[$iAdd][6] = DllStructGetData($tagMODULEENTRY32, 10);~          char    szExePath[MAX_PATH];
;~      } MODULEENTRY32;
        $aDLLCall = DllCall("kernel32", "int", "Module32Next", "ptr", $hModuleSnap, "long", DllStructGetPtr($tagMODULEENTRY32))
        If Not $aDLLCall[0] Then ExitLoop
        $iAdd += 1
    WEnd
    DllCall("Kernel32.dll", "int", "CloseHandle", "ptr", $hModuleSnap)
    Return
EndFunc   ;==>_ProcessListModules

; ####################### Below Func is Part of example - Needed to get commandline from more processes.
; ####################### Thanks to wraithdu!
Func _GetPrivilege_SEDEBUG()
    Local $tagLUIDANDATTRIB = "int64 Luid;dword Attributes"
    Local $count = 1
    Local $tagTOKENPRIVILEGES = "dword PrivilegeCount;byte LUIDandATTRIB[" & $count * 12 & "]" ; count of LUID structs * sizeof LUID struct
    Local $TOKEN_ADJUST_PRIVILEGES = 0x20
    Local $call = DllCall("advapi32.dll", "int", "OpenProcessToken", "ptr", _WinAPI_GetCurrentProcess(), "dword", $TOKEN_ADJUST_PRIVILEGES, "ptr*", "")
    Local $hToken = $call[3]
    $call = DllCall("advapi32.dll", "int", "LookupPrivilegeValue", "str", Chr(0), "str", "SeDebugPrivilege", "int64*", "")
    ;msgbox(0,"",$call[3] & " " & _WinAPI_GetLastErrorMessage())
    Local $iLuid = $call[3]
    Local $TP = DllStructCreate($tagTOKENPRIVILEGES)
    Local $LUID = DllStructCreate($tagLUIDANDATTRIB, DllStructGetPtr($TP, "LUIDandATTRIB"))
    DllStructSetData($TP, "PrivilegeCount", $count)
    DllStructSetData($LUID, "Luid", $iLuid)
    DllStructSetData($LUID, "Attributes", $SE_PRIVILEGE_ENABLED)
    $call = DllCall("advapi32.dll", "int", "AdjustTokenPrivileges", "ptr", $hToken, "int", 0, "ptr", DllStructGetPtr($TP), "dword", 0, "ptr", Chr(0), "ptr", Chr(0))
    Return ($call[0] <> 0) ; $call[0] <> 0 is success
EndFunc   ;==>_GetPrivilege_SEDEBUG

/Manko


Yes i rush things! (I sorta do small bursts inbetween doing nothing.) Things I have rushed and reRushed:* ProDLLer - Process manager - Unload viri modules (dll) and moore...* _WinAPI_ProcessListOWNER_WTS() - Get Processes owner list...* _WinAPI_GetCommandLineFromPID() - Get commandline of target process...* _WinAPI_ThreadsnProcesses() Much info if expanded - optional Indented "Parent/Child"-style Processlist. Moore to come... eventually...

Share this post


Link to post
Share on other sites
Ibrahim

thanks alot man

What i'm going to do with it is a "dll scanner that would point out a spy or trojan threads injected to windows services"

thanks

Share this post


Link to post
Share on other sites
daywalkereg

Great Program Manko :)

and i used some function of it in my Task Manager


1 £0\\/3 |-|3® $0 |\\/|µ(|-|

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • marcoauto
      By marcoauto
      Ciao
      I would like to control an ATEM Video Mixer from autoit. I downloaded his SDK which is written in c ++ and I found the sequences to interface, but I was not able to convert the script to self.
      The instructions say to follow this sequence:
      and to connectTo with C++ is:
      string address = "192.168.1.240"; _BMDSwitcherConnectToFailure failureReason = 0; IBMDSwitcher switcher = null; var discovery = new CBMDSwitcherDiscovery(); discovery.ConnectTo(address, out switcher, out failureReason); From Blackmagic SDK:
      IBMDSwitcherDiscovery::ConnectTo method
      The ConnectTo method connects to the specified switcher and returns an IBMDSwitcher object interface for the switcher.
      Syntax HRESULT ConnectTo (string deviceAddress, IBMDSwitcher** switcherDevice, BMDSwitcherConnectToFailure* failReason); Parameters: deviceAddress in Network hostname or IP address of switcher to connect to. switcherDevice out IBMDSwitcher object interface for the connected switcher. failReason out Reason for connection failure as a BMDSwitcherConnectToFailure value. So, I have I tried these solutions but with non success:
      $DllName =@ScriptDir&"\BMDSwitcherAPI.dll" $result = DllCall($DllName, "none", "IBMDSwitcherDiscovery::ConnectTo" & @CRLF) ConsoleWrite("DLLCall Result: " & $result & @CRLF) and I have tried also create an Object (That I think is the best way solution):
      #include <MsgBoxConstants.au3> $oSwitcher=ObjCreate("IBMDSwitcher") If IsObj($oSwitcher) Then MsgBox(64, "", "Object $oSwitcher created successfully") EndIf $oAtem=ObjCreate("IBMDSwitcherDiscovery") If IsObj($oAtem) Then MsgBox(64, "", "Object $oAtem created successfully") EndIf $failureReason =ObjCreate("_BMDSwitcherConnectToFailure") If IsObj($failureReason) Then MsgBox(64, "", "Object $failureReason created successfully") EndIf $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") ; Install a custom error handler Global $errore,$oSwitcher1 $oAtem.ConnectTo("192.168.1.36",$oSwitcher,$failureReason); ; This is the custom error handler Func MyErrFunc() $HexNumber = Hex($oMyError.number, 8) MsgBox(0, "", "We intercepted a COM Error !" & @CRLF & _ "Number is: " & $HexNumber & @CRLF & _ "Windescription is: " & $oMyError.windescription & @CRLF & _ "Source is: " & $oMyError.source & @CRLF & _ "Description is: " & $oMyError.description & @CRLF & _ "Helpfile is: " & $oMyError.helpfile & @CRLF & _ "Helpcontext is: " & $oMyError.helpcontext & @CRLF & _ "Lastdllerror is: " & $oMyError.lastdllerror & @CRLF & _ "Scriptline is: " & $oMyError.scriptline) EndFunc ;==>MyErrFunc But the result is:
      We intercepted a COM Error !
      Number is: 000000A9
      Windescription is: Variable must be of type 'Object'.
      Source is: 
      Description is: 
      Helpfile is: 
      Helpcontext is: 
      Lastdllerror is: 0
      Scriptline is: 17
      The BMDSwitcherAPI.dll is registered in system. Can someone help me?
      Grazie
      Marco
    • nacerbaaziz
      By nacerbaaziz
      Hello my friends
      I have an inquiry after your permission
      I found a function to get the special line commands for any operation
      It requires the name of the process to be searched
      I want to use it to know the process
      Is this possible with this function
      Here is the code
       
      Func commandLineGet($proc, $strComputer=".")
      dim $array[1]
      local $ArrayNumber
      local $oWMI = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2")
      local $oProcessColl = $oWMI.ExecQuery("Select * from Win32_Process where Name= " & '"'& $Proc & '"')
      local $Process
      For $Process In $oProcessColl
      $Process = $Process.Commandline
          ReDim $Array[UBound($Array)+1]
      $ArrayNumber = UBound($Array)-1
      $array[$ArrayNumber] = $Process
      Next
      $ArrayNumber = UBound($Array)-1
      $array[0] = $ArrayNumber
      return $array
      EndFunc
    • simy8891
      By simy8891
      Hi guys,
      It's been a while since I wrote my last message here and a while since I used AutoIt. I'm currently sort of desperate and I'm trying to find some help in regards of getting the network usage per process!
      I'm not interested in the total network usage of the NIC, but only on a specific PID's network utilization. They idea is to collect the amount of traffic uploaded and downloaded by a list of specific processes. So far Process Hacker and Process Explorer are capable of getting what I need, but I need to use these numbers in another script so they're sort of useless to me. I can't seem to find a way around it.
      Any idea, help is greatly appreciated.
      Thanks
    • ur
      By ur
      with the below code, I am keeping waiting for a particular file and waiting in the background.
      While $i <> 10 Sleep(60000) If FileExists(@ScriptDir&"\Binaries.ini") then --some processing-- $i = 10 endif WEnd I thought keeping the Sleep will freeze the process from resources but the CPU being uilized.But it is taking 47%.
      How to free this CPU usage also.?

    • Earthshine
      By Earthshine
      This baby can do almost any language! I found Gleany on this site and set it up on a fresh win10 install. all i would need to do to make it build an exe of the search files app we discovered is the .NET Target Framework download to build 100 % but the exe works and generates! You also need to add the path the the version of csc.exe that you want to run. MSBuild is part of .NET and can read your .csproj file.
      YOU can develop .NET OR C/C++ on this baby!
      Super lightweight (fit for crappy laptops), and you can use any dev compilers you wish, Ming, MS, etc, whatever.
      To use the build, you need to open the csproj file, else, to check your syntax it can compile individual files as well. The warning are because I do not have the .NET 4.6 Targeting Pack installed... LOL, and I could get rid of the Core warning, yes, I did not want to build a .NET Core.dll I wanted a live x64 exe! Told you MSBUILD could handle .CSPROJ, .VBPROJ, and all others Microsoft. Don't let Visual Code or Visual Studio slow you down, although, this works with Visual Code as well but there is only debugging in CORE.DLL projects

      ListFiles Example.zip
       

×