{"id":21937359,"url":"https://github.com/jasondrawdy/shellgen","last_synced_at":"2025-04-22T12:07:13.927Z","repository":{"id":183138462,"uuid":"141952428","full_name":"jasondrawdy/ShellGen","owner":"jasondrawdy","description":"Dynamic and extensible shell code generator with multiple output types which can be formatted in binary, hexadecimal, and the typical shellcode output standard.","archived":false,"fork":false,"pushed_at":"2020-05-01T21:12:13.000Z","size":70,"stargazers_count":19,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-22T12:06:54.164Z","etag":null,"topics":["cryptography","dotnet","dynamic","generator","library","security","shellcode","utilities"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jasondrawdy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-07-23T02:44:14.000Z","updated_at":"2024-06-07T23:26:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"dcde33b1-1a24-4891-95fa-1bdad5c6355f","html_url":"https://github.com/jasondrawdy/ShellGen","commit_stats":null,"previous_names":["jasondrawdy/shellgen"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasondrawdy%2FShellGen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasondrawdy%2FShellGen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasondrawdy%2FShellGen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasondrawdy%2FShellGen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jasondrawdy","download_url":"https://codeload.github.com/jasondrawdy/ShellGen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250237832,"owners_count":21397401,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography","dotnet","dynamic","generator","library","security","shellcode","utilities"],"created_at":"2024-11-29T01:19:14.847Z","updated_at":"2025-04-22T12:07:13.870Z","avatar_url":"https://github.com/jasondrawdy.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg width=\"256\" height=\"256\" src=\"https://user-images.githubusercontent.com/40871836/43460394-2116cd86-9496-11e8-8c8a-df6522c3037c.png\"\u003e\n\u003c/p\u003e\n\n# ShellGen\n\u003cp align=\"left\"\u003e\n    \u003c!-- Version --\u003e\n    \u003cimg src=\"https://img.shields.io/badge/version-1.0.0-brightgreen.svg\"\u003e\n    \u003c!-- \u003cimg src=\"https://img.shields.io/appveyor/ci/gruntjs/grunt.svg\"\u003e --\u003e\n    \u003c!-- Docs --\u003e\n    \u003cimg src=\"https://img.shields.io/badge/docs-not%20found-lightgrey.svg\"\u003e\n    \u003c!-- License --\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\"\u003e\n\u003c/p\u003e\n\nShellGen is a dynamic shell code generator with multiple output types which can be formatted in binary, hexadecimal, and the typical shellcode output standard. Outputs are also able to be encrypted and shellcode can be generated by either reading all of the bytes of a particular file or a byte array, whether that's embedded, or again, read in from a filestream. The generated output is structured in what is called a `Shell` and contains a few properties:\n\n- **ID** *// The alphanumeric value assigned to the generated shell for easy maintainability.*\n- **Code** *// The actual plainbyte/encrypted byte code of a specified file or raw bytes.*\n- **Error** *// Any caught exception if anything goes wrong during generation.*\n\nA   `Shell` also has a serializable property allowing the ability to serialize the entire structure to a file or byte array instead of copying individual components of the generated shell object.\n\n### Requirements\n- .NET Framework 4.6.1\n\n# Features\n- Generate shellcode from a file or byte array\n- Multiple output types for generated shellcode\n    - Plainbyte\n    - Hexadecimal\n    - Shellcode (standard)\n- Generate unique IDs for all generated shells\n- Encode bytes using Base64\n- Serialize generated shells to a file or byte array\n\n# Examples\n\n### Generating Shells\nThis example shows how to generate a shellcode `Shell` object both with and without encryption and how to serialize the object into a byte array for later usage or for saving to a file — which we will do here — for later retrieval.\n\n```c#\nusing System;\nusing System.IO;\nusing System.Text;\nusing System.Runtime.Serialization.Formatters.Binary;\nusing ShellGen;\n\nnamespace Example\n{\n    class Program\n    {\n        public static void Main(string[] args)\n        {\n            // Get the bytes of a message.\n            var message = \"Hello, World! This is an example message!\";\n            var messageBytes = Encoding.UTF8.GetBytes(message);\n\n            // Generate a standard shell without encryption.\n            Shell standardShell = ShellGenerator.GenerateShell(messageBytes, FormatType.Shellcode);\n            Console.WriteLine(\"A shell has been generated!\");\n\n            // Generate a plainbyte shell without encryption.\n            Shell plainShell = ShellGenerator.GenerateShell(messageBytes, FormatType.Plain);\n            Console.WriteLine(\"A plainbyte shell has been generated!\");\n\n            // Generate a hexadecimal shell without encryption.\n            Shell hexShell = ShellGenerator.GenerateShell(messageBytes, FormatType.Hex);\n            Console.WriteLine(\"A hexadecimal shell has been generated!\");\n\n            // Generate a shell with encryption.\n            Shell encryptedShell = ShellGenerator.GenerateShell(messageBytes, FormatType.Shellcode, \"SomeSecurePassword\");\n            Console.WriteLine(\"An encrypted shell has been generated!\");\n\n            // Serialize one or more shell to a file.\n            var serializedBytes = Serialize(encryptedShell);\n            if (serializedBytes != null)\n            {\n                File.WriteAllBytes(\"PathForDestinationFile\", serializedBytes);\n                Console.WriteLine(\"Shell has been saved!\");\n            }\n\n            // Wait for user interaction.\n            Console.Read();\n        }\n\n        /// \u003csummary\u003e\n        /// Serializes an object that has the \u003csee cref=\"SerializableAttribute\"/\u003e attached.\n        /// \u003c/summary\u003e\n        /// \u003cparam name=\"obj\"\u003eThe object to be serialized to bytes.\u003c/param\u003e\n        public static byte[] Serialize(object obj)\n        {\n            try\n            {\n                var bf = new BinaryFormatter();\n                var ms = new MemoryStream();\n                bf.Serialize(ms, obj);\n                return ms.ToArray();\n            }\n            catch { return null; }\n        }\n    }\n}\n```\n\n### Output\nThe plaintext output of the standard generated shell given in the example should be expected to look like the following: \u003cbr\u003e\n```c#\nunsigned char shellcode[] =\n{\n    0x53,0x47,0x56,0x73,0x62,0x47,0x38,0x73,0x49,0x46,0x64,0x76,\n    0x63,0x6D,0x78,0x6B,0x49,0x53,0x42,0x55,0x61,0x47,0x6C,0x7A,\n    0x49,0x47,0x6C,0x7A,0x49,0x47,0x46,0x75,0x49,0x47,0x56,0x34,\n    0x59,0x57,0x31,0x77,0x62,0x47,0x55,0x67,0x62,0x57,0x56,0x7A,\n    0x63,0x32,0x46,0x6E,0x5A,0x53,0x45,0x3D\n};\nunsigned int size = 56\n```\n\n# Credits\n**Icon:** `Freepik` \u003cbr\u003e\nhttps://www.flaticon.com/authors/freepik \u003cbr\u003e\n\n**Encryption:** `sdrapkin` \u003cbr\u003e\nhttps://github.com/sdrapkin/SecurityDriven.Inferno \u003cbr\u003e\n\n# License\n\nCopyright © ∞ Jason Drawdy \n\nAll rights reserved.\n\nThe MIT License (MIT)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\nExcept as contained in this notice, the name of the above copyright holder\nshall not be used in advertising or otherwise to promote the sale, use or\nother dealings in this Software without prior written authorization.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasondrawdy%2Fshellgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjasondrawdy%2Fshellgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasondrawdy%2Fshellgen/lists"}