Lucene search
+L

PowerShell XOR Stream Transform

🗓️ 10 Jul 2026 11:14:38Reported by KittySploitType 
kittysploit
 kittysploit
🔗 kittysploit.com👁 1 Views

PowerShell XOR Stream Transform XORs the C2 stream with a repeating key and emits code.

Refs
Code
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from typing import Optional

from modules.transforms.python.stream.xor import Module as PythonXorTransform


class Module(PythonXorTransform):
    """PowerShell XOR stream transform."""

    SUPPORTED_CLIENT_LANGUAGES = ["powershell"]

    __info__ = {
        "name": "PowerShell XOR Stream Transform",
        "description": "XORs the C2 stream with a repeating key and emits PowerShell client code.",
        "author": "KittySploit Team",
        "version": "1.0.0",
    }

    def generate_client_code(self, language: str) -> Optional[str]:
        if language != "powershell":
            return None
        key_val = (str(self.key).strip() or "kittysploit").replace("\\", "\\\\").replace("'", "\\'")
        ps_key = key_val.replace("`", "``").replace('"', '`"').replace("$", "`$")
        return (
            f"$script:xfKey=[Text.Encoding]::UTF8.GetBytes(\"{ps_key}\");\n"
            "$script:xfDoff=0;$script:xfEoff=0;\n"
            "function _xf_decode([byte[]]$d){\n"
            " if($null -eq $d -or $d.Length -eq 0){return [byte[]]@()}\n"
            " $out=New-Object byte[] $d.Length\n"
            " for($i=0;$i -lt $d.Length;$i++){$out[$i]=[byte]($d[$i] -bxor $script:xfKey[($script:xfDoff+$i)%$script:xfKey.Length])}\n"
            " $script:xfDoff += $d.Length\n"
            " return $out\n"
            "}\n"
            "function _xf_encode([byte[]]$d){\n"
            " if($null -eq $d -or $d.Length -eq 0){return [byte[]]@()}\n"
            " $out=New-Object byte[] $d.Length\n"
            " for($i=0;$i -lt $d.Length;$i++){$out[$i]=[byte]($d[$i] -bxor $script:xfKey[($script:xfEoff+$i)%$script:xfKey.Length])}\n"
            " $script:xfEoff += $d.Length\n"
            " return $out\n"
            "}\n"
        )

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

19 Aug 2026 05:37Current
6Medium risk
Vulners AI Score6
1