{"id":38770125,"url":"https://github.com/ricardojoserf/stealthyenv","last_synced_at":"2026-01-17T12:04:08.155Z","repository":{"id":205175110,"uuid":"713541358","full_name":"ricardojoserf/StealthyEnv","owner":"ricardojoserf","description":"Stealthier alternative to whoami.exe in C#, it gets environment variables from PEB (PRTL_USER_PROCESS_PARAMETERS)","archived":false,"fork":false,"pushed_at":"2024-02-12T09:08:54.000Z","size":17,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-01T13:11:43.758Z","etag":null,"topics":["environment-variables","malware-development","prtl-user-process-parameters","whoami"],"latest_commit_sha":null,"homepage":"https://ricardojoserf.github.io/stealthyenv/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ricardojoserf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-11-02T18:20:37.000Z","updated_at":"2024-02-24T15:01:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"f8d2fc73-dc63-4c26-9ec3-a04c76bb6827","html_url":"https://github.com/ricardojoserf/StealthyEnv","commit_stats":null,"previous_names":["ricardojoserf/stealthyenv"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ricardojoserf/StealthyEnv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardojoserf%2FStealthyEnv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardojoserf%2FStealthyEnv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardojoserf%2FStealthyEnv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardojoserf%2FStealthyEnv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ricardojoserf","download_url":"https://codeload.github.com/ricardojoserf/StealthyEnv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricardojoserf%2FStealthyEnv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28508464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T11:50:55.898Z","status":"ssl_error","status_checked_at":"2026-01-17T11:50:55.569Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["environment-variables","malware-development","prtl-user-process-parameters","whoami"],"created_at":"2026-01-17T12:04:08.061Z","updated_at":"2026-01-17T12:04:08.136Z","avatar_url":"https://github.com/ricardojoserf.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StealthyEnv\nAlternative to whoami.exe or other well-known binaries to get the environment variables. It is written in C# and I guess it is stealthier because it gets the values parsing the PEB structure.\n\n- Function [NtQueryInformationProcess](https://learn.microsoft.com/en-us/windows/win32/api/winternl/nf-winternl-ntqueryinformationprocess) returns a \"PROCESS_BASIC_INFORMATION\" structure containing a pointer to the PEB base address.\n\n- The PEB structure contains a pointer \"ProcessParameters\" to a [RTL_USER_PROCESS_PARAMETERS](https://www.geoffchappell.com/studies/windows/km/ntoskrnl/inc/api/pebteb/rtl_user_process_parameters.htm) structure.\n\n- From that structure you can get a pointer \"Environment\" to the environment variables and a pointer \"EnvironmentSize\" to the size of the environment variables.\n\n- Reading the number of bytes indicated in \"EnvironmentSize\" from the address \"Environment\" as UNICODE text, you get the environment variables.\n\n![esquema](https://raw.githubusercontent.com/ricardojoserf/ricardojoserf.github.io/master/images/stealthyenv/Screenshot_0.png)\n\n### Examples\n\n64 bit process:\n\n![64 bits](https://raw.githubusercontent.com/ricardojoserf/ricardojoserf.github.io/master/images/stealthyenv/Screenshot_1.png)\n\n\n32 bit process:\n\n![32 bits](https://raw.githubusercontent.com/ricardojoserf/ricardojoserf.github.io/master/images/stealthyenv/Screenshot_2.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricardojoserf%2Fstealthyenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fricardojoserf%2Fstealthyenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricardojoserf%2Fstealthyenv/lists"}