Skip to content

Windows Script Component (.wsf)

.wsf file signature | application/octet-stream

Windows Script Component (UTF-8)

High

Magic Bytes

Offset 0
EF BB BF

Sources: Gary Kessler

All Known Signatures

2 signature variants are documented for .wsf files across multiple sources.

Hex Signature Offset Sources
EF BB BF 0 Gary Kessler
EF BB BF 3C 0 Gary Kessler

Extension

.wsf

MIME Type

application/octet-stream

Byte Offset

0

Risk Level

High

Validation Code

How to validate .wsf files in Python

Python
def is_wsf(file_path: str) -> bool:
    """Check if file is a valid WSF by magic bytes."""
    signature = bytes([0xEF, 0xBB, 0xBF])
    with open(file_path, "rb") as f:
        return f.read(3) == signature

How to validate .wsf files in Node.js

Node.js
function isWSF(buffer: Buffer): boolean {
  const signature = Buffer.from([0xEF, 0xBB, 0xBF]);
  return buffer.subarray(0, 3).equals(signature);
}

How to validate .wsf files in Go

Go
func IsWSF(data []byte) bool {
    signature := []byte{0xEF, 0xBB, 0xBF}
    if len(data) < 3 {
        return false
    }
    return bytes.Equal(data[:3], signature)
}

API Endpoint

GET /api/v1/wsf
curl https://filesignature.org/api/v1/wsf

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .wsf file?

A .wsf file is a Windows Script Component file. Windows Script Component (UTF-8)

What are the magic bytes for .wsf files?

The magic bytes for Windows Script Component files are EF BB BF at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .wsf file?

To validate a .wsf file, read the first bytes of the file and compare them against the known magic bytes (EF BB BF) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .wsf files?

There is no officially registered MIME type for .wsf files. Systems typically use application/octet-stream as a generic fallback when handling this format.

Is it safe to open .wsf files?

Windows Script Component (.wsf) files are high risk because they can contain executable code. Never open .wsf files from untrusted sources. Always scan with antivirus software, verify the source, and consider running in a sandboxed environment.