Persistence an inventory can see

Hostile programs try to run again after a reboot. The defensive work is to know the legitimate ways to start, notice a new one, and rebuild the host from a known image.

Lesson 17 of 18 · 14 min read · practice only with authorization

Diagram

From a new startup entry to a rebuild

Follow the path. One example at a time.

Step 1 of 4

Baseline

You can list the scheduled tasks, services, login items, and startup folders you expect.

Illustration: start from a baseline
# Scheduled tasks, services, login items,
# and accounts you already approved.
What changes the outcome
Inventory

Nobody can list legitimate startup.

Action

A file is removed.

Result

The host, the account, and the next startup are unchanged.

The example on the open step is one illustration, or the fix you can paste into an application you own.

What this page is made of

4 pieces. Each one says what fails, who is affected, what you would notice, and what you change.

  1. Startup is a small list

    What fails
    Tasks, services, login items, cron, and launch agents are enough to hide a program that comes back. They are also enough to inventory.
    Who is affected
    The person whose session the program used, and anyone that host can reach.
    What you would notice
    A new task with no change ticket, or a task whose action you cannot explain.
    What you change
    Alert on new entries for servers. Review them on a cadence for fleets that cannot alert.
  2. Deleting a file is not a rebuild

    What fails
    The program is also the account, the key, the agent that stopped, and the copies on other hosts.
    Who is affected
    The next person who signs in, if the entry remains.
    What you would notice
    A ticket closed because one path was removed and the machine was not reimaged.
    What you change
    Isolate, rebuild, and rotate credentials that were present on the host.
  3. The agent going quiet

    What fails
    A security agent that stops checking in is itself a signal. Attackers know you trust it.
    Who is affected
    Everyone who was relying on that agent’s silence as safety.
    What you would notice
    A dashboard that grays out offline hosts instead of paging.
    What you change
    Page when an agent goes quiet on a server. Do not wait for the next malware alert from a sensor that is gone.
  4. Samples stay in a lab

    What fails
    A sample someone mailed you is hostile code. It does not get run on a workstation that has production tokens.
    Who is affected
    Your own accounts, if you run it “to see.”
    What you would notice
    A ticket that says the sample was executed on the analyst laptop.
    What you change
    Keep samples with the response team’s controlled process, or do not keep them. This course will not ask you to analyze one.

Know how a clean host starts

Programs that want to survive a reboot use the same places administrators use: scheduled tasks, services, login items, shell startup files, and keys. The defensive advantage is that those places are enumerable. A fleet that can say “these tasks exist on this image” can say “this task does not.” A fleet that cannot list them will discover persistence in a postmortem, described as a mystery.

Start with servers and with the images you control. Alert when a task or a service appears that is not in the image. For laptops, a slower review still beats none. Pair the alert with the one for a security agent that stopped reporting. The two together are a stronger story than either alone.

Rebuild is the cleaning product

Removing a file you found is a guess that you found every file, every key, and every account. You usually did not. Isolate the host from the network, keep the disk if responders need it, and rebuild from an image you can name. Rotate the credentials that lived on the machine: tokens, SSH keys, browser sessions, cloud keys. Then look for the same startup entry on other hosts, because one task name is rarely unique.

This is the malware chapter’s whole bias: recognize, contain, rebuild. It is not a chapter about running a sample to see the task appear. If a sample arrives by mail, it goes to the people who have a controlled process, or it is deleted. It does not go to the laptop that holds your cloud token.

What you would notice

A new task with a vague name, a service whose binary is in a temporary directory, a login item nobody in endpoint management recognizes, an agent offline while the host is online. None of these require a family name for the software. The family name is how you talk after the rebuild. The inventory is how you decide to rebuild.

The people affected are the person whose session was on the host and the owners of data that host could reach. Say that in the ticket. Do not attach the sample to the ticket system that half the company can read.

What you change

Build the startup inventory. Page on deviations for servers and on quiet agents. Practice one rebuild so the image and the credential rotation are real. Edit the response doc so “delete the file” is not the last step. Application control, from the next page, is how fewer unapproved programs start in the first place.

Read the scheduled-task and living-off-the-land glossary pages as the same idea: the operating system’s own features are the hiding place. The control is visibility and a known image, not a longer list of family names.

Check yourself

Recognition and the fix. Nothing here is a procedure.

1 / 3

A server has a new scheduled task nobody ticketed, and its security agent stopped checking in yesterday. What should you assume?

Sibling techniques

Pages at the same depth, plus a lab and a glossary card for this one.

  1. MapPersistence by scheduled task: tasks, cron jobs, and launch agentsScheduled tasks and cron jobs let code run again after reboot.

Practice

  1. LabTerminal mission: A login script that ships your historyEvery interactive shell on ops-02 makes a small HTTP request after each command. Find the startup file responsible, the shell variable it abuses, and where the data goes.

Glossary

  1. CardRansomwareSystems and backups are encrypted or stolen, and work stops until recovery or payment.