{"id":13474075,"url":"https://github.com/cyberark/shimit","last_synced_at":"2025-04-09T13:07:51.463Z","repository":{"id":50703646,"uuid":"109871647","full_name":"cyberark/shimit","owner":"cyberark","description":"A tool that implements the Golden SAML attack","archived":false,"fork":false,"pushed_at":"2018-10-15T21:27:38.000Z","size":25,"stargazers_count":336,"open_issues_count":2,"forks_count":57,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-04-02T07:44:12.996Z","etag":null,"topics":["conjbot-skip-stalepr"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cyberark.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}},"created_at":"2017-11-07T17:59:04.000Z","updated_at":"2025-03-21T02:29:29.000Z","dependencies_parsed_at":"2022-09-06T02:10:37.437Z","dependency_job_id":null,"html_url":"https://github.com/cyberark/shimit","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/cyberark%2Fshimit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberark%2Fshimit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberark%2Fshimit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyberark%2Fshimit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyberark","download_url":"https://codeload.github.com/cyberark/shimit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045232,"owners_count":21038553,"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":["conjbot-skip-stalepr"],"created_at":"2024-07-31T16:01:09.369Z","updated_at":"2025-04-09T13:07:51.444Z","avatar_url":"https://github.com/cyberark.png","language":"Python","funding_links":[],"categories":["Uncategorized","Other Awesome Lists","Python","Tools"],"sub_categories":["Uncategorized","SAML"],"readme":"# shimit\r\n\r\n`shimit` is a python tool that implements the Golden SAML attack. More informations on this can be found in the following [article](https://www.cyberark.com/threat-research-blog/golden-saml-newly-discovered-attack-technique-forges-authentication-cloud-apps/) on our blog.\r\n\r\n```\r\npython .\\shimit.py -h\r\nusage: shimit.py [-h] -pk KEY [-c CERT] [-sp SP] -idp IDP -u USER [-reg REGION]\r\n                 [--SessionValidity SESSION_VALIDITY] [--SamlValidity SAML_VALIDITY] -n SESSION_NAME\r\n                 -r ROLES -id ARN [-o OUT_FILE] [-l LOAD_FILE] [-t TIME]\r\n                 \r\n              ██╗   ███████╗██╗  ██╗██╗███╗   ███╗██╗████████╗     ██╗ ██╗  \r\n             ██╔╝   ██╔════╝██║  ██║██║████╗ ████║██║╚══██╔══╝    ██╔╝ ╚██╗ \r\n            ██╔╝    ███████╗███████║██║██╔████╔██║██║   ██║      ██╔╝   ╚██╗\r\n            ╚██╗    ╚════██║██╔══██║██║██║╚██╔╝██║██║   ██║     ██╔╝    ██╔╝\r\n             ╚██╗   ███████║██║  ██║██║██║ ╚═╝ ██║██║   ██║    ██╔╝    ██╔╝ \r\n              ╚═╝   ╚══════╝╚═╝  ╚═╝╚═╝╚═╝     ╚═╝╚═╝   ╚═╝    ╚═╝     ╚═╝  \r\n```\r\n## Overview\r\nIn a golden SAML attack, attackers can gain access to an application (any application that supports SAML authentication) with any privileges they desire and be any user on the targeted application.\r\n\r\n*shimit* allows the user to create a signed _SAMLResponse_ object, and use it to open a session in the Service Provider. *shimit* now supports AWS Console as a _Service Provider_, more are in the works...\r\n### AWS \r\nAfter generating and signing the _SAMLResponse_'s _assertion_, shimit will call the _AssumeRoleWithSAML()_ API in AWS. Then, the session token and key will be applied to a new session, where the user can use aws cli to perform action using the permissions obtained using the *golden SAML*. \r\n\r\n## Requirements:\r\nFor installing the required modules, run the following command:\r\n\r\n```\r\npython -m pip install boto3 botocore defusedxml enum python_dateutil lxml signxml\r\n```\r\n### AWS cli ###\r\nNeeds to be installed in order to use the credentials obtained.\r\nCan be downloaded for [Windows](http://docs.aws.amazon.com/cli/latest/userguide/awscli-install-windows.html) or\r\n[Linux](http://docs.aws.amazon.com/cli/latest/userguide/awscli-install-linux.html)\r\nfrom these links.\r\n\r\n\r\n## Usage:\r\n\r\n\r\n### Apply session for AWS cli\r\n```\r\npython .\\shimit.py -idp http://adfs.lab.local/adfs/services/trust -pk key_file -c cert_file\r\n-u domain\\admin -n admin@domain.com -r ADFS-admin -r ADFS-monitor -id 123456789012\r\n```\r\n**idp** - Identity Provider URL e.g. http://server.domain.com/adfs/services/trust\r\n\r\n**pk**  - Private key file full path (pem format)\r\n\r\n**c**   - Certificate file full path (pem format)\r\n\r\n**u**   - User and domain name e.g. domain\\username (use \\\\ or quotes in *nix)\r\n\r\n**n**   - Session name in AWS\r\n\r\n**r**   - Desired roles in AWS. Supports Multiple roles, the first one specified will be assumed.\r\n\r\n**id**  - AWS account id e.g. 123456789012\r\n\r\n\r\n\r\n### Save SAMLResponse to file\r\n```\r\npython .\\shimit.py -idp http://adfs.lab.local/adfs/services/trust -pk key_file -c cert_file\r\n-u domain\\admin -n admin@domain.com -r ADFS-admin -r ADFS-monitor -id 123456789012 -o saml_response.xml\r\n```\r\n**o**  - Output encoded SAMLResponse to a specified file path\r\n### Load SAMLResponse from file\r\n```\r\npython .\\shimit.py -l saml_response.xml\r\n```\r\n**l**  - Load SAMLResponse from a specified file path\r\n\r\n## Contributions\r\n\r\n`shimit` supports AWS as a service provider at the moment, as a POC. We highly encourage you to conribute with a new modules for other service providers. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberark%2Fshimit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyberark%2Fshimit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberark%2Fshimit/lists"}