# T1491 - Defacement

## SOC Recommendation
Investigate Defacement activity in the context of Impact: confirm scope, affected host/identity, and whether it matches expected administrative behaviour before deciding this is benign.

## D3FEND Mappings
| D3FEND Technique | Relationship | Practical SOC Action |
|---|---|---|
| Network Resource Access Mediation | Isolate | Apply Network Resource Access Mediation to contain the blast radius once this technique is observed. |
| Decoy Network Resource | Deceive | Deploy Decoy Network Resource to detect and mislead an adversary attempting this technique. |

## Investigation Steps
1. Confirm matching entities (user, host, IP) and validate data freshness in the lookback period.
2. Check whether activity aligns with a planned change or approved business process.
3. Identify all affected users/devices/resources over the prior 24 hours.
4. Determine whether this is isolated or part of a broader campaign.
5. Correlate with identity, endpoint, and email/cloud telemetry for related suspicious actions.
6. Elevate severity if privileged identities, critical systems, or repeated activity is observed.
7. Capture all evidence (query results, entities, timeline) in the incident record.
8. Route to the appropriate response playbook and customer escalation path.

## Evidence to Collect
- Host or resource affected
- Account or identity involved
- Timestamp of the activity
- Related process, file, or network artifact
- Any preceding or follow-on alerts

## Response Actions
| Action | Risk | Automation Safe | Approval Required |
|---|---|---|---|
| Contain impacted identities/endpoints/sessions based on obse | Low | No | Yes |
| Block malicious indicators (IP, URL, domain, hash) where ava | Medium | No | Yes |
| Complete blast radius analysis across related logs and entit | Low | No | Yes |
| Notify stakeholders according to incident priority and custo | Low | Yes | No |
| Remove persistence or unauthorized access paths identified d | Low | No | Yes |
| Capture lessons learned and update rule tuning/watchlists. | Low | No | Yes |

## KQL
```kql
let lookback = 1h;
let suspiciousPageNames = dynamic(["home.aspx", "default.aspx", "index.aspx", "sitepage", "landing", "portal", "homepage"]);
let suspiciousContentTerms = dynamic(["hacked", "defaced", "owned", "pwned", "pay ransom", "ransomware", "bitcoin", "monero"]);
let officeActivitySource =
    union isfuzzy=true OfficeActivity,
    (datatable(TimeGenerated:datetime, OfficeWorkload:string, Operation:string, UserId:string, ClientIP:string, Site_Url:string, SourceFileName:string, ObjectId:string, UserAgent:string, ModifiedProperties:string)[]);
officeActivitySource
| where TimeGenerated >= ago(lookback)
| where OfficeWorkload in~ ("SharePoint", "OneDrive")
| where Operation in~ ("FileModified", "FileUploaded", "PageModified", "SitePageModified", "FileRenamed")
| extend FileName = tolower(tostring(coalesce(SourceFileName, ObjectId))),
         ModifiedText = tolower(tostring(ModifiedProperties)),
         UserPrincipalName = tolower(tostring(UserId))
| where FileName has_any (suspiciousPageNames) or ModifiedText has_any (suspiciousContentTerms)
| summarize
    FirstSeen = min(TimeGenerated),
    LastSeen = max(TimeGenerated),
    ModifiedObjects = make_set(ObjectId, 25),
    FileNames = make_set(FileName, 25),
    ClientIPs = make_set(ClientIP, 10),
    UserAgents = make_set(UserAgent, 10),
    OperationCount = count()
    by UserPrincipalName, SiteUrl = tostring(Site_Url)
| extend TimeGenerated = LastSeen,
         timestamp = LastSeen,
         AccountCustomEntity = UserPrincipalName,
         URLCustomEntity = SiteUrl
| order by OperationCount desc, LastSeen desc
```
```kql
let lookback = 1h;
let suspiciousWebPaths = dynamic(["/admin", "/upload", "/editor", "/wp-admin", "/cms", "/api/content"]);
let approvedDeploymentTools = dynamic(["msdeploy.exe", "git.exe", "runner.exe", "octopus.tentacle.exe", "kudu.exe", "zipdeploy.exe"]);
let suspiciousWrites =
    DeviceFileEvents
    | where TimeGenerated >= ago(lookback)
    | where FolderPath has_any ("\\inetpub\\wwwroot", "\\wwwroot", "\\public_html", "\\htdocs", "\\site\\wwwroot")
    | where ActionType in~ ("FileModified", "FileCreated", "FileRenamed")
    | where InitiatingProcessFileName !in~ (approvedDeploymentTools)
    | project DeviceName, WriteTime = TimeGenerated, FolderPath, FileName, ActionType, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessAccountName;
let suspiciousInbound =
    W3CIISLog
    | where TimeGenerated >= ago(lookback)
    | where csMethod in~ ("POST", "PUT", "PATCH")
    | where csUriStem has_any (suspiciousWebPaths)
    | project DeviceName = sComputerName, RequestTime = TimeGenerated, SrcIP = cIP, csMethod, csUriStem, csUserName;
suspiciousWrites
| join kind=leftouter suspiciousInbound on DeviceName
| where isnull(RequestTime) or abs(datetime_diff("minute", WriteTime, RequestTime)) <= 10
| project TimeGenerated = coalesce(RequestTime, WriteTime), DeviceName, SrcIP, csMethod, csUriStem, FolderPath, FileName, ActionType, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessAccountName
| extend timestamp = TimeGenerated,
         HostCustomEntity = DeviceName,
         IPCustomEntity = SrcIP,
         AccountCustomEntity = InitiatingProcessAccountName
| order by TimeGenerated desc
```
```kql
let timeframe = 24h;
BitSightAlerts
| where ingestion_time() > ago(timeframe)
| extend Severity = case( Severity contains "INCREASE", "Low",
                          Severity contains "WARN" or Severity contains "DECREASE", "Medium",
                          Severity contains "CRITICAL", "High",
                          "Informational")
| extend CompanyURL = strcat("https://service.bitsighttech.com/app/spm",CompanyURL)
| project CompanyName, Severity, Trigger, CompanyURL, AlertDate, GUID
```

## Escalation Criteria
- Defacement activity observed on a privileged account or critical system.
- Activity follows or precedes other suspicious behaviour in the same investigation.
- Automated triage cannot confidently rule out malicious intent.

## False Positive Considerations
- Legitimate admin or business workflow — Activity maps to approved change tickets or known process owners
- Security testing or red-team exercise — Source identity/host matches approved test plan

Generated by SOC Response Atlas by Basyrix.
