Click here to Skip to main content
15,886,137 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: WSO CCC OTD 2023-01-05 Pin
DerekT-P5-Jan-23 0:22
professionalDerekT-P5-Jan-23 0:22 
GeneralRe: WSO CCC OTD 2023-01-05 Pin
Craig Robbins5-Jan-23 0:37
Craig Robbins5-Jan-23 0:37 
QuestionRe: WSO CCC OTD 2023-01-05 Pin
Randor 5-Jan-23 16:12
professional Randor 5-Jan-23 16:12 
AnswerRe: WSO CCC OTD 2023-01-05 Pin
Craig Robbins6-Jan-23 0:22
Craig Robbins6-Jan-23 0:22 
GeneralRe: WSO CCC OTD 2023-01-05 - We have a winner! Pin
OriginalGriff5-Jan-23 0:41
mveOriginalGriff5-Jan-23 0:41 
GeneralMystery-Ware Pin
C-P-User-34-Jan-23 20:53
C-P-User-34-Jan-23 20:53 
GeneralRe: Mystery-Ware Pin
Richard MacCutchan4-Jan-23 23:57
mveRichard MacCutchan4-Jan-23 23:57 
GeneralRe: Mystery-Ware Pin
dandy725-Jan-23 8:24
dandy725-Jan-23 8:24 
It'll probably be hard to track that sort of thing down unless you do some extensive logging, or catch it in the act.

It just so happens that last week I was playing with WMI's event watcher...essentially, tracking and logging each and every process that launches, its path on disk, and any command line args it received. It's amazing how much crap nowadays is taking place automatically, all the time, on Windows - recent versions about 10x as worse as, say, 7.

Anyway, if you could log every process that launches/shuts down, and then eliminated the noise, and you had a decent idea when the problem starts, I'd bet you could narrow it down somewhat quickly.

The gist of it is:
private bool SetupEventWatcher()
{
    if (Watcher != null)
        return false;

    int nTimespanInSeconds = 1;
    string strScope = @"\\.\root\CIMv2";
    string strWQL = $"SELECT * FROM __InstanceOperationEvent WITHIN {nTimespanInSeconds} WHERE TargetInstance ISA 'Win32_Process'";
    Watcher = new ManagementEventWatcher(strScope, strWQL);
    Watcher.EventArrived += new EventArrivedEventHandler(OnEventArrived);
    Watcher.Start();

    return true;
}

private void OnEventArrived(object sender, EventArrivedEventArgs e)
{
    // Ignore __InstanceModificationEvent, you'll get tons and they're useless
    TrackedEventType tet = TrackedEventType.Unknown;
    if (e.NewEvent.ClassPath.ClassName == "__InstanceCreationEvent")
        tet = TrackedEventType.Creation;
    if (e.NewEvent.ClassPath.ClassName == "__InstanceDeletionEvent")
        tet = TrackedEventType.Deletion;
    if (tet == TrackedEventType.Unknown)
        return;

    foreach (PropertyData pd in e.NewEvent.Properties)
    {
        // pd.Name = SECURITY_DESCRIPTOR, TargetInstance, TIME_CREATED
        if (pd.Name == "TargetInstance")
        {
            if (pd.Value is ManagementBaseObject mbo)
            {
                if ( mbo.Properties is PropertyDataCollection pdc )
                {
                    // ~45 properties
                    ListViewItem lvi = CreateEventLVI(tet, mbo.Properties);
                    if (lvi != null)
                        InsertEventLVI(lvi);
                }
            }
        }
    }
}

private ListViewItem CreateEventLVI(TrackedEventType tet, PropertyDataCollection pdc)
{
    foreach (PropertyData pd in pdc)
    {
        if (pd.Name == "Name")
            ...pd.Value is the name of the EXE
        if (pd.Name == "CommandLine")
            ...pd.Value contains the cmd line args
    } // foreach PropertyData

I'm using a ListView to show processes that got created/deleted, but I suggest you just dump it to a plain-text file, so it's easily searchable.

Didn't think your question would lead you to actual code, did you? Smile | :)

I'd share the whole thing if it was refined, I just can't afford to do that right now.
GeneralRe: Mystery-Ware Pin
BillWoodruff5-Jan-23 16:36
professionalBillWoodruff5-Jan-23 16:36 
QuestionCurrent status of anti- WannaCry and similar for Windows 7 ? Pin
Member 150787164-Jan-23 19:48
Member 150787164-Jan-23 19:48 
AnswerRe: Current status of anti- WannaCry and similar for Windows 7 ? Pin
OriginalGriff4-Jan-23 19:56
mveOriginalGriff4-Jan-23 19:56 
GeneralRe: Current status of anti- WannaCry and similar for Windows 7 ? Pin
Dan Neely5-Jan-23 3:54
Dan Neely5-Jan-23 3:54 
AnswerRe: Current status of anti- WannaCry and similar for Windows 7 ? Pin
11917640 Member 4-Jan-23 20:49
11917640 Member 4-Jan-23 20:49 
AnswerRe: Current status of anti- WannaCry and similar for Windows 7 ? Pin
theoldfool5-Jan-23 0:29
professionaltheoldfool5-Jan-23 0:29 
GeneralRe: Current status of anti- WannaCry and similar for Windows 7 ? Pin
MarkTJohnson5-Jan-23 2:34
professionalMarkTJohnson5-Jan-23 2:34 
JokeRe: Current status of anti- WannaCry and similar for Windows 7 ? Pin
Daniel Pfeffer5-Jan-23 3:36
professionalDaniel Pfeffer5-Jan-23 3:36 
AnswerRe: Current status of anti- WannaCry and similar for Windows 7 ? Pin
obermd5-Jan-23 3:42
obermd5-Jan-23 3:42 
AnswerRe: Current status of anti- WannaCry and similar for Windows 7 ? Pin
dandy725-Jan-23 8:05
dandy725-Jan-23 8:05 
AnswerRe: Current status of anti- WannaCry and similar for Windows 7 ? Pin
Member 158613856-Jan-23 3:56
Member 158613856-Jan-23 3:56 
GeneralRe: Current status of anti- WannaCry and similar for Windows 7 ? Pin
dandy726-Jan-23 4:30
dandy726-Jan-23 4:30 
AnswerRe: Current status of anti- WannaCry and similar for Windows 7 ? Pin
maze36-Jan-23 4:13
professionalmaze36-Jan-23 4:13 
AnswerRe: Current status of anti- WannaCry and similar for Windows 7 ? Pin
steve.tabler6-Jan-23 5:24
steve.tabler6-Jan-23 5:24 
GeneralRe: Current status of anti- WannaCry and similar for Windows 7 ? Pin
Choroid6-Jan-23 6:14
Choroid6-Jan-23 6:14 
GeneralRe: Current status of anti- WannaCry and similar for Windows 7 ? Pin
steve.tabler6-Jan-23 7:41
steve.tabler6-Jan-23 7:41 
AnswerRe: Current status of anti- WannaCry and similar for Windows 7 ? Pin
Member 1507871611-Jan-23 10:10
Member 1507871611-Jan-23 10:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.