{"id":19660042,"url":"https://github.com/secana/transnet","last_synced_at":"2025-04-28T20:32:06.932Z","repository":{"id":27404014,"uuid":"105279797","full_name":"secana/TransNet","owner":"secana","description":".Net library to create Maltego transformations.","archived":false,"fork":false,"pushed_at":"2025-02-11T16:42:33.000Z","size":485,"stargazers_count":18,"open_issues_count":2,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-11T11:28:08.935Z","etag":null,"topics":["dotnet","dotnet-core","dotnetcore","maltego","maltego-transformations","osint","transform","transformations","transnet"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/secana.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-29T14:11:08.000Z","updated_at":"2025-02-11T16:42:30.000Z","dependencies_parsed_at":"2023-01-14T06:40:17.080Z","dependency_job_id":"2bbde0fc-2059-44a1-8417-1e1f52cf1c7b","html_url":"https://github.com/secana/TransNet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secana%2FTransNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secana%2FTransNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secana%2FTransNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secana%2FTransNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/secana","download_url":"https://codeload.github.com/secana/TransNet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251383864,"owners_count":21580955,"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":["dotnet","dotnet-core","dotnetcore","maltego","maltego-transformations","osint","transform","transformations","transnet"],"created_at":"2024-11-11T15:45:05.172Z","updated_at":"2025-04-28T20:32:06.606Z","avatar_url":"https://github.com/secana.png","language":"C#","readme":"# TransNet\nTransNet is a .Net Standard library to create [Maltego](https://www.paterva.com/web7/buy/maltego-clients.php) transformations.\n\n[![license](https://img.shields.io/github/license/secana/transnet.svg)](https://raw.githubusercontent.com/secana/TransNet/master/LICENSE)\n[![Build status](https://ci.appveyor.com/api/projects/status/jffcahmtd6u73p6n/branch/master?svg=true)](https://ci.appveyor.com/project/secana/transnet/branch/master)\n[![NuGet](https://img.shields.io/nuget/v/TransNet.svg)](https://www.nuget.org/packages/TransNet/)\n[![NuGet](https://img.shields.io/nuget/dt/TransNet.svg)](https://www.nuget.org/packages/TransNet/)\n\n## Writing a transformation with *TransNet*\nThe following example shows how to write a Maltego transformation with *TransNet*.\n\n### Install TransNet into your project\n*TransNet* is a .Net Standard 2.0 library which means it runs with the .Net Framework and with .Net Core under Windows, Linux and Mac.\nTo use *TransNet* in your project just install the [TransNet Nuget package](https://www.nuget.org/packages/TransNet/) into your project.\n\n### The Code\nWriting a transform is pretty straight forward. Maltego will call your transformation with command line arguments, which are parsed by *TransNet*. \nThe resulting entities which you want to return have to be printed to *stdout*.\n\nA minimal transformation which returns a \"Person\" entity looks like this:\n\n```csharp\nusing System;\nusing TransNet;\n\nnamespace MyTransform\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // Create a new transform based on the command line input from Maltego.\n            var transform = new Transformation(args);\n\n            // Add an entity to return.\n            var person1 = new Entity(\"Person\", \"Alice Yu\");\n\n            // Add the entity to return to the transformation.\n            transform.Entities.Add(person1);\n\n            Console.WriteLine(transform.TransformToXML());\n        }\n    }\n}\n\n```\n\nYou can reach the same result with the floating API. The code above looks like this:\n\n\n```csharp\nusing System;\nusing TransNet;\n\nnamespace MyTransform\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            var transform = new Transformation(args)\n                 .AddEntity(\"Person\", \"Alice Yu\");\n\n            Console.WriteLine(transform.TransformToXML());\n        }\n    }\n}\n\n```\n\nThe example below shows how you can add additional fields to your returned entity and how to add an edge label with some properties.\n\n```csharp\nusing System;\nusing System.Collections.Generic;\nusing TransNet;\n\nnamespace MyTransform\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n            // Create a new transform based on the command line input from Maltego.\n            var transform = new Transformation(args);\n\n            // Add an entity to return.\n            var person1 = new Entity(\"Person\", \"Alice Yu\");\n\n            // Add additional fields to the entity.\n            var person1Age = new Entity.AdditionalField(\"Age\", \"Age\", \"45\");\n            var person1HairColor = new Entity.AdditionalField(\"HairColor\", \"Hair Color\", \"Blond\");\n            person1.AdditionalFields.Add(person1Age);\n            person1.AdditionalFields.Add(person1HairColor);\n\n            // Adding an edge label.\n            person1.AddEdgeLabel(\"My own transformation.\", new List\u003cTuple\u003cstring, string\u003e\u003e\n            {\n                // Adding edge properties.\n                new Tuple\u003cstring, string\u003e(\"My first edge property\", \"My first edge property value\"),\n                new Tuple\u003cstring, string\u003e(\"My second edge property\", \"My second edge property value\")\n            });\n\n            // Add the entity to return to the transformation.\n            transform.Entities.Add(person1);\n\n            Console.WriteLine(transform.TransformToXML());\n        }\n    }\n}\n```\n\nYou can reach the same result with the floating API. The code above looks like this:\n\n```csharp\nusing System;\nusing System.Collections.Generic;\nusing TransNet;\n\nnamespace MyTransform\n{\n    class Program\n    {\n        static void Main(string[] args)\n        {\n             var transform = new Transformation(args)\n                .AddEntity(\"Person\", \"Alice Yu\")\n                .AddAdditionalField(\"Age\", \"Age\", \"45\")\n                .AddAdditionalField(\"HairColor\", \"Hair Color\", \"Blond\")\n                .AddEdgeLabel(\"My own transformation.\", new List\u003cTuple\u003cstring, string\u003e\u003e\n                {\n                    new Tuple\u003cstring, string\u003e(\"My first edge property\", \"My first edge property value\"),\n                    new Tuple\u003cstring, string\u003e(\"My second edge property\", \"My second edge property value\")\n                });\n\n            Console.WriteLine(transform.TransformToXML());\n        }\n    }\n}\n```\n\n#### Access field values\nIf your transformation needs some field values from the input entity provided by Maltego to your transformation via command line arguments use this:\n```csharp\nvar fieldValue = transform.InputArguments[\"fieldName\"];\n```\nThis lets you access the field \"fieldName\" from the input entity.\n\n\n#### Debug prints\nIf you need to output any debug information to Maltego which gets shown in the output panel use:\n\n```csharp\ntransform.PrintDebug(\"My debug message\");\n```\n\nTo set the Maltego progress bar to a specific percentage while your transformation runs use:\n\n#### Progress bar\n```csharp\ntransform.PrintProgress(50);\n```\nThis will set the progress bar to 50%.\n\n## Add a transformation to Maltego\nTo add your own transformation to Maltego follow the next steps:\n\n    1. Go to the \"Transforms\" tab.\n    2. Click on \"Local Transform\".\n    3. Configure the details.\n      1. Add a name and description for your transformation.\n      2. Add an *unique* transformation ID.\n      3. Select the input entity type. Your transformation will be available for this input type.\n    4. Configure the command.\n      1. Add your transformation executable here.\n    5. Click \"Finish\".\n      \n![Image](./Resources/Maltego-Local-Transform-1.png)\n![Image](./Resources/Maltego-Local-Transform-2.png)\n\n## Using the transformation in Maltego\nAfter you've added your transformation to Maltego for one input entity you can use your transformation the following way:\n\n    1. Add one item of the entity type you selected as input to the graph.\n    2. Right click the entity and select your transformation under \"Local Transforms\".\n\n![Image](./Resources/Maltego-Local-Transform-Result.png)\n\nIf you click on the edge, you will find your added edge properties there, too.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecana%2Ftransnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsecana%2Ftransnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecana%2Ftransnet/lists"}