
버그 바운티 프로그램 및 침투 테스트에서 유출된 API 키를 검증하기 위한 명령어 모음입니다. AWS, GitHub, Slack, Twilio 등 80개 이상의 서비스를 다룹니다.
KeyHacks는 버그 바운티 프로그램이나 침투 테스트에서 발견된 다양한 API 키를 검증하는 방법을 보여줍니다.
@Gwen001가 전체 프로세스를 스크립트로 작성했으며, 여기에서 찾을 수 있습니다.
아래 명령어가 missing_text_or_fallback_or_attachments를 반환하면 URL이 유효하다는 뜻이며, 다른 응답이 오면 URL이 유효하지 않다는 의미입니다.```
curl -s -X POST -H "Content-type: application/json" -d '{"text":""}' "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
## [Slack API 토큰](https://api.slack.com/web)```
curl -sX POST "https://slack.com/api/auth.test?token=xoxp-TOKEN_HERE&pretty=1"
또는``` curl -sX POST "https://slack.com/api/auth.test" -H "Accept: application/json; charset=utf-8" -H "Authorization: Bearer xoxb-TOKEN_HERE"
## [SauceLabs 사용자 이름 및 액세스 키](https://wiki.saucelabs.com/display/DOCS/Account+Methods)```
curl -u USERNAME:ACCESS_KEY https://saucelabs.com/rest/v1/users/USERNAME
액세스 토큰은 아래 URL을 방문하여 생성할 수 있습니다.``` https://graph.facebook.com/oauth/access_token?client_id=ID_HERE&client_secret=SECRET_HERE&redirect_uri=&grant_type=client_credentials
## Facebook 액세스 토큰```
https://developers.facebook.com/tools/debug/accesstoken/?access_token=ACCESS_TOKEN_HERE&version=v3.2
사용자 지정 토큰과 API 키가 필요합니다.
curl -s -XPOST -H 'content-type: application/json' -d '{"token":":custom_token","returnSecureToken":True}' 'https://identitytoolkit.googleapis.com/v1/accounts:signInWithCustomToken?key=:api_key'curl -s -XPOST -H 'content-type: application/json' -d '{"idToken":":id_token"}' https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyCustomToken?key=:api_key'curl -s -u "user:apikey" https://api.github.com/user curl -s -H "Authorization: token TOKEN_HERE" "https://api.github.com/users/USERNAME_HERE/orgs"
curl "https://api.github.com/rate_limit" -i -u "user:apikey" | grep "X-OAuth-Scopes:"
## [Github 클라이언트 ID 및 클라이언트 시크릿](https://developer.github.com/v3/#oauth2-keysecret)```
curl 'https://api.github.com/users/whatever?client_id=xxxx&client_secret=yyyy'
참조: https://abss.me/posts/fcm-takeover``` curl -s -X POST --header "Authorization: key=AI..." --header "Content-Type:application/json" 'https://fcm.googleapis.com/fcm/send' -d '{"registration_ids":["1"]}'
## GitHub 개인 SSH 키
SSH 개인 키는 github.com에 대해 테스트하여 기존 사용자 계정에 등록되었는지 확인할 수 있습니다. 키가 존재하면 해당 키에 대응하는 사용자 이름이 제공됩니다. ([출처](https://github.com/streaak/keyhacks/issues/2))```
$ ssh -i <path to SSH private key> -T [email protected]
Hi <username>! You've successfully authenticated, but GitHub does not provide shell access.
curl -X GET 'https://api.twilio.com/2010-04-01/Accounts.json' -u ACCOUNT_SID:AUTH_TOKEN
## [트위터 API 비밀](https://developer.twitter.com/en/docs/basics/authentication/guides/bearer-tokens.html)```
curl -u 'API key:API secret key' --data 'grant_type=client_credentials' 'https://api.twitter.com/oauth2/token'
curl --request GET --url https://api.twitter.com/1.1/account_activity/all/subscriptions/count.json --header 'authorization: Bearer TOKEN'
## [HubSpot API key](https://developers.hubspot.com/docs/methods/owners/get_owners)
모든 소유자 가져오기:```
https://api.hubapi.com/owners/v2/owners?hapikey={keyhere}
모든 연락처 세부 정보 가져오기:``` https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey={keyhere}