└── README.md
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | KeyHacks shows ways in which particular API keys found on a Bug Bounty Program can be used, to check if they are valid.
7 |
8 | @Gwen001 has scripted the entire process available here and it can be found [here](https://github.com/gwen001/pentest-tools/blob/master/keyhacks.sh)
9 |
10 | # Table of Contents
11 |
12 | - [Algolia API key](#Algolia-API-key)
13 | - [Asana Access token](#Asana-Access-Token)
14 | - [AWS Access Key ID and Secret](#AWS-Access-Key-ID-and-Secret)
15 | - [Bit.ly Access token](#Bitly-Access-token)
16 | - [Branch.io Key and Secret](#BranchIO-Key-and-Secret)
17 | - [BrowserStack Access Key](#BrowserStack-Access-Key)
18 | - [Buildkite Access token](#Buildkite-Access-token)
19 | - [CircleCI Access Token](#CircleCI-Access-Token)
20 | - [DataDog API key](#DataDog-API-key)
21 | - [Deviant Art Access Token](#Deviant-Art-Access-Token)
22 | - [Deviant Art Secret](#Deviant-Art-Secret)
23 | - [Dropbox API](#Dropbox-API)
24 | - [Facebook Access Token ](#Facebook-Access-Token)
25 | - [Facebook AppSecret](#Facebook-AppSecret)
26 | - [Firebase](#Firebase)
27 | - [FreshDesk API Key](#FreshDesk-API-key)
28 | - [Github client id and client secret](#Github-client-id-and-client-secret)
29 | - [GitHub private SSH key](#GitHub-private-SSH-key)
30 | - [Github Token](#Github-Token)
31 | - [Gitlab personal access token](#Gitlab-personal-access-token)
32 | - [Google Cloud Messaging (GCM)](#Google-Cloud-Messaging)
33 | - [Google Maps API key](#Google-Maps-API-key)
34 | - [Google Recaptcha key](#Google-Recaptcha-key)
35 | - [Google Cloud Service Account credentials](#Google-Cloud-Service-Account-credentials)
36 | - [Heroku API key](#Heroku-API-key)
37 | - [HubSpot API key](#Hubspot-API-key)
38 | - [Ipstack API Key](#Ipstack-API-Key)
39 | - [Instagram Access Token](#Instagram-Access-Token)
40 | - [JumpCloud API key](#JumpCloud-API-Key)
41 | - [Loqate API Key](#Loqate-API-key)
42 | - [MailChimp API Key](#MailChimp-API-Key)
43 | - [MailGun Private Key](#MailGun-Private-Key)
44 | - [Mapbox API key](#Mapbox-API-Key)
45 | - [Microsoft Azure Tenant](#Microsoft-Azure-Tenant)
46 | - [Microsoft Shared Access Signatures (SAS)](#Microsoft-Shared-Access-Signatures-(SAS))
47 | - [NPM token](#NPM-token)
48 | - [Pagerduty API token](#Pagerduty-API-token)
49 | - [Paypal client id and secret key](#Paypal-client-id-and-secret-key)
50 | - [Pendo Integration Key](#Pendo-Integration-Key)
51 | - [Razorpay API key and secret key](#Razorpay-keys)
52 | - [Salesforce API key](#Salesforce-API-key)
53 | - [SauceLabs Username and access Key](#SauceLabs-Username-and-access-Key)
54 | - [SendGrid API Token](#SendGrid-API-Token)
55 | - [Slack API token](#Slack-API-token)
56 | - [Slack Webhook](#Slack-Webhook)
57 | - [Spotify Access Token](#Spotify-Access-Token)
58 | - [Square](#Square)
59 | - [Stripe Live Token](#Stripe-Live-Token)
60 | - [Travis CI API token](#Travis-CI-API-token)
61 | - [Twilio Account_sid and Auth token](#Twilio-Account_sid-and-Auth-token)
62 | - [Twitter API Secret](#Twitter-API-Secret)
63 | - [Twitter Bearer token](#Twitter-Bearer-token)
64 | - [WakaTime API Key](#WakaTime-API-Key)
65 | - [WPEngine API Key](#WPEngine-API-Key)
66 | - [Zapier Webhook Token](#Zapier-Webhook-Token)
67 | - [Zendesk Access token](#Zendesk-Access-Token)
68 |
69 |
70 | # Detailed Information
71 | ## [Slack Webhook](https://api.slack.com/incoming-webhooks)
72 |
73 | If the below command returns `missing_text_or_fallback_or_attachments`, it means that the URL is valid, any other responses would mean that the URL is invalid.
74 | ```
75 | curl -s -X POST -H "Content-type: application/json" -d '{"text":""}' "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
76 | ```
77 |
78 | ## [Slack API token](https://api.slack.com/web)
79 | ```
80 | curl -sX POST "https://slack.com/api/auth.test?token=xoxp-TOKEN_HERE&pretty=1"
81 | ```
82 |
83 | ## [SauceLabs Username and access Key](https://wiki.saucelabs.com/display/DOCS/Account+Methods)
84 | ```
85 | curl -u USERNAME:ACCESS_KEY https://saucelabs.com/rest/v1/users/USERNAME
86 | ```
87 |
88 | ## Facebook AppSecret
89 |
90 | You can generate access tokens by visiting the URL below.
91 |
92 | ```
93 | https://graph.facebook.com/oauth/access_token?client_id=ID_HERE&client_secret=SECRET_HERE&redirect_uri=&grant_type=client_credentials
94 | ```
95 |
96 | ## Facebook Access Token
97 | ```
98 | https://developers.facebook.com/tools/debug/accesstoken/?access_token=ACCESS_TOKEN_HERE&version=v3.2
99 | ```
100 |
101 | ## [Firebase](https://firebase.google.com/)
102 | Requires a **custom token**, and an **API key**.
103 |
104 | 1. Obtain ID token and refresh token from custom token and API key: `curl -s -XPOST -H 'content-type: application/json' -d '{"token":":custom_token","returnSecureToken":True}' 'https://identitytoolkit.googleapis.com/v1/accounts:signInWithCustomToken?key=:api_key'`
105 | 2. Exchange ID token for auth token: `curl -s -XPOST -H 'content-type: application/json' -d '{"idToken":":id_token"}' https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyCustomToken?key=:api_key'`
106 |
107 | ## [Github Token](https://developer.github.com/v3/)
108 | ```
109 | curl -s -u "user:apikey" https://api.github.com/user
110 | curl -s -H "Authorization: token TOKEN_HERE" "https://api.github.com/users/USERNAME_HERE/orgs"
111 | # Check scope of your api token
112 | curl "https://api.github.com/rate_limit" -i -u "user:apikey" | grep "X-OAuth-Scopes:"
113 | ```
114 |
115 | ## [Github client id and client secret](https://developer.github.com/v3/#oauth2-keysecret)
116 | ```
117 | curl 'https://api.github.com/users/whatever?client_id=xxxx&client_secret=yyyy'
118 | ```
119 |
120 | ## [Google Cloud Messaging](https://developers.google.com/cloud-messaging/)
121 | ```
122 | curl -s -X POST --header "Authorization: key=AI..." --header "Content-Type:application/json" 'https://fcm.googleapis.com/fcm/send' -d '{"registration_ids":["1"]}'
123 | ```
124 |
125 | ## GitHub private SSH key
126 |
127 | SSH private keys can be tested against github.com to see if they are registered against an existing user account. If the key exists the username corresponding to the key will be provided. ([source](https://github.com/streaak/keyhacks/issues/2))
128 |
129 | ```
130 | $ ssh -i -T git@github.com
131 | Hi ! You've successfully authenticated, but GitHub does not provide shell access.
132 | ```
133 |
134 | ## [Twilio Account_sid and Auth token](https://www.twilio.com/docs/iam/api/account)
135 | ```
136 | curl -X GET 'https://api.twilio.com/2010-04-01/Accounts.json' -u ACCOUNT_SID:AUTH_TOKEN
137 | ```
138 |
139 | ## [Twitter API Secret](https://developer.twitter.com/en/docs/basics/authentication/guides/bearer-tokens.html)
140 | ```
141 | curl -u 'API key:API secret key' --data 'grant_type=client_credentials' 'https://api.twitter.com/oauth2/token'
142 | ```
143 |
144 | ## [Twitter Bearer token](https://developer.twitter.com/en/docs/accounts-and-users/subscribe-account-activity/api-reference/aaa-premium)
145 | ```
146 | curl --request GET --url https://api.twitter.com/1.1/account_activity/all/subscriptions/count.json --header 'authorization: Bearer TOKEN'
147 | ```
148 |
149 | ## [HubSpot API key](https://developers.hubspot.com/docs/methods/owners/get_owners)
150 |
151 | Get all owners:
152 | ```
153 | https://api.hubapi.com/owners/v2/owners?hapikey={keyhere}
154 | ```
155 | Get all contact details:
156 | ```
157 | https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey={keyhere}
158 |
159 | ```
160 |
161 | ## [Deviant Art Secret](https://www.deviantart.com/developers/authentication)
162 | ```
163 | curl https://www.deviantart.com/oauth2/token -d grant_type=client_credentials -d client_id=ID_HERE -d client_secret=mysecret
164 | ```
165 |
166 | ## [Deviant Art Access Token](https://www.deviantart.com/developers/authentication)
167 | ```
168 | curl https://www.deviantart.com/api/v1/oauth2/placebo -d access_token=Alph4num3r1ct0k3nv4lu3
169 | ```
170 |
171 | ## [Pendo Integration Key](https://help.pendo.io/resources/support-library/api/index.html?bash#authentication)
172 | ```
173 | curl -X GET https://app.pendo.io/api/v1/feature -H 'content-type: application/json' -H 'x-pendo-integration-key:KEY_HERE'
174 | curl -X GET https://app.pendo.io/api/v1/metadata/schema/account -H 'content-type: application/json' -H 'x-pendo-integration-key:KEY_HERE'
175 | ```
176 |
177 | ## [SendGrid API Token](https://sendgrid.com/docs/API_Reference/api_v3.html)
178 | ```
179 | curl -X "GET" "https://api.sendgrid.com/v3/scopes" -H "Authorization: Bearer SENDGRID_TOKEN-HERE" -H "Content-Type: application/json"
180 | ```
181 |
182 | ## [Square](https://squareup.com/)
183 | **Detection:**
184 |
185 | App id/client secret: `sq0[a-z]{3}-[0-9A-Za-z\-_]{22,43}`
186 | Auth token: `EAAA[a-zA-Z0-9]{60}`
187 |
188 | **Test App id & client secret:**
189 | ```
190 | curl "https://squareup.com/oauth2/revoke" -d '{"access_token":"[RANDOM_STRING]","client_id":"[APP_ID]"}' -H "Content-Type: application/json" -H "Authorization: Client [CLIENT_SECRET]"
191 | ```
192 |
193 | Response indicating valid credentials:
194 | ```
195 | empty
196 | ```
197 |
198 | Response indicating invalid credentials:
199 | ```
200 | {
201 | "message": "Not Authorized",
202 | "type": "service.not_authorized"
203 | }
204 | ```
205 |
206 | **Test Auth token:**
207 | ```
208 | curl https://connect.squareup.com/v2/locations -H "Authorization: Bearer [AUHT_TOKEN]"
209 | ```
210 |
211 | Response indicating valid credentials:
212 | ```
213 | {"locations":[{"id":"CBASELqoYPXr7RtT-9BRMlxGpfcgAQ","name":"Coffee \u0026 Toffee SF","address":{"address_line_1":"1455 Market Street","locality":"San Francisco","administrative_district_level_1":"CA","postal_code":"94103","country":"US"},"timezone":"America/Los_Angeles"........
214 | ```
215 |
216 | Response indicating invalid credentials:
217 | ```
218 | {"errors":[{"category":"AUTHENTICATION_ERROR","code":"UNAUTHORIZED","detail":"This request could not be authorized."}]}
219 | ```
220 |
221 | ## [Dropbox API](https://www.dropbox.com/developers/documentation/http/documentation)
222 | ```
223 | curl -X POST https://api.dropboxapi.com/2/users/get_current_account --header "Authorization: Bearer TOKEN_HERE"
224 | ```
225 |
226 | ## [AWS Access Key ID and Secret](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html)
227 |
228 | Install [awscli](https://aws.amazon.com/cli/), set the [access key and secret to environment variables](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html), and execute the following command:
229 | ```
230 | AWS_ACCESS_KEY_ID=xxxx AWS_SECRET_ACCESS_KEY=yyyy aws sts get-caller-identity
231 | ```
232 |
233 | AWS credentials' permissions can be determined using [Enumerate-IAM](https://github.com/andresriancho/enumerate-iam).
234 | This gives broader view of the discovered AWS credentials privileges instead of just checking S3 buckets.
235 |
236 | ```
237 | git clone https://github.com/andresriancho/enumerate-iam
238 | cd enumerate-iam
239 | ./enumerate-iam.py --access-key AKIA... --secret-key StF0q...
240 | ```
241 |
242 |
243 | ## [MailGun Private Key](https://documentation.mailgun.com/en/latest/api_reference.html)
244 | ```
245 | curl --user 'api:key-PRIVATEKEYHERE' "https://api.mailgun.net/v3/domains"
246 | ```
247 |
248 | ## [FreshDesk API Key](https://developers.freshdesk.com/api/#getting-started)
249 | ```
250 | curl -v -u user@yourcompany.com:test -X GET 'https://domain.freshdesk.com/api/v2/groups/1'
251 | This requires the API key in 'user@yourcompany.com', pass in 'test' and 'domain.freshdesk.com' to be the instance url of the target. In case you get a 403, try the endpoint api/v2/tickets, which is accessible for all keys.
252 |
253 | ```
254 | ## [JumpCloud API Key](https://docs.jumpcloud.com/1.0/authentication-and-authorization/authentication-and-authorization-overview)
255 | ```
256 | List systems:
257 | curl -H "x-api-key: APIKEYHERE" "https://console.jumpcloud.com/api/systems"
258 | ```
259 |
260 | ## Microsoft Azure Tenant
261 | Format:
262 | ```
263 | CLIENT_ID: [0-9a-z\-]{36}
264 | CLIENT_SECRET: [0-9A-Za-z\+\=]{40,50}
265 | TENANT_ID: [0-9a-z\-]{36}
266 | ```
267 | Verification:
268 | ```
269 | curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d 'client_id=&scope=https%3A%2F%2Fgraph.microsoft.com%2F.default&client_secret=&grant_type=client_credentials' 'https://login.microsoftonline.com//oauth2/v2.0/token'
270 | ```
271 |
272 | ## [Microsoft Shared Access Signatures (SAS)](https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/storage/common/storage-dotnet-shared-access-signature-part-1.md)
273 |
274 | The following powershell can be used to test a Shared Access Signature Token:
275 | ```powershell
276 | static void UseAccountSAS(string sasToken)
277 | {
278 | // Create new storage credentials using the SAS token.
279 | StorageCredentials accountSAS = new StorageCredentials(sasToken);
280 | // Use these credentials and the account name to create a Blob service client.
281 | CloudStorageAccount accountWithSAS = new CloudStorageAccount(accountSAS, "account-name", endpointSuffix: null, useHttps: true);
282 | CloudBlobClient blobClientWithSAS = accountWithSAS.CreateCloudBlobClient();
283 |
284 | // Now set the service properties for the Blob client created with the SAS.
285 | blobClientWithSAS.SetServiceProperties(new ServiceProperties()
286 | {
287 | HourMetrics = new MetricsProperties()
288 | {
289 | MetricsLevel = MetricsLevel.ServiceAndApi,
290 | RetentionDays = 7,
291 | Version = "1.0"
292 | },
293 | MinuteMetrics = new MetricsProperties()
294 | {
295 | MetricsLevel = MetricsLevel.ServiceAndApi,
296 | RetentionDays = 7,
297 | Version = "1.0"
298 | },
299 | Logging = new LoggingProperties()
300 | {
301 | LoggingOperations = LoggingOperations.All,
302 | RetentionDays = 14,
303 | Version = "1.0"
304 | }
305 | });
306 |
307 | // The permissions granted by the account SAS also permit you to retrieve service properties.
308 | ServiceProperties serviceProperties = blobClientWithSAS.GetServiceProperties();
309 | Console.WriteLine(serviceProperties.HourMetrics.MetricsLevel);
310 | Console.WriteLine(serviceProperties.HourMetrics.RetentionDays);
311 | Console.WriteLine(serviceProperties.HourMetrics.Version);
312 | }
313 | ```
314 |
315 | ## [Heroku API key](https://devcenter.heroku.com/articles/platform-api-quickstart)
316 | ```
317 | curl -X POST https://api.heroku.com/apps -H "Accept: application/vnd.heroku+json; version=3" -H "Authorization: Bearer API_KEY_HERE"
318 | ```
319 | ## [Mapbox API key](https://docs.mapbox.com/api/)
320 |
321 | Mapbox secret keys start with `sk`, rest start with `pk` (public token), `sk` (secret token), or `tk` (temporary token).
322 |
323 | ```
324 | curl "https://api.mapbox.com/geocoding/v5/mapbox.places/Los%20Angeles.json?access_token=ACCESS_TOKEN"
325 | ```
326 |
327 | ## [Salesforce API key](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/quickstart_oauth.htm)
328 | ```
329 | curl https://instance_name.salesforce.com/services/data/v20.0/ -H 'Authorization: Bearer access_token_here'
330 | ```
331 |
332 | ## [Algolia API key](https://www.algolia.com/doc/rest-api/search/#overview)
333 |
334 | Be cautious when running this command, since the payload might execute within an administrative environment, depending on what index you are editing the `highlightPreTag` of. It's recommended to use a more silent payload (such as XSS Hunter) to prove the possible cross-site scripting attack.
335 |
336 | ```
337 | curl --request PUT \
338 | --url https://-1.algolianet.com/1/indexes//settings \
339 | --header 'content-type: application/json' \
340 | --header 'x-algolia-api-key: ' \
341 | --header 'x-algolia-application-id: ' \
342 | --data '{"highlightPreTag": ""}'
343 | ```
344 |
345 | ## [Zapier Webhook Token](https://zapier.com/help/how-get-started-webhooks-zapier/)
346 | ```
347 | curl -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d '{"name":"streaak"}' "webhook_url_here"
348 | ```
349 |
350 | ## [Pagerduty API token](https://support.pagerduty.com/docs/using-the-api)
351 | ```
352 | curl -H "Accept: application/vnd.pagerduty+json;version=2" -H "Authorization: Token token=TOKEN_HERE" -X GET "https://api.pagerduty.com/schedules"
353 | ```
354 |
355 | ## [BrowserStack Access Key](https://www.browserstack.com/automate/rest-api)
356 | ```
357 | curl -u "USERNAME:ACCESS_KEY" https://api.browserstack.com/automate/plan.json
358 | ```
359 |
360 | ## [Google Maps API key](https://developers.google.com/maps/documentation/javascript/get-api-key)
361 |
362 | **Key restrictions are set per service. When testing the key, if the key is restricted/inactive on one service try it with another.**
363 |
364 | | Name| Endpoint| Pricing|
365 | | ------------- |:-------------:| -----:|
366 | | Static Maps | https://maps.googleapis.com/maps/api/staticmap?center=45%2C10&zoom=7&size=400x400&key=KEY_HERE| $2 |
367 | | Streetview | https://maps.googleapis.com/maps/api/streetview?size=400x400&location=40.720032,-73.988354&fov=90&heading=235&pitch=10&key=KEY_HERE| $7 |
368 | | Embed | https://www.google.com/maps/embed/v1/place?q=place_id:ChIJyX7muQw8tokR2Vf5WBBk1iQ&key=KEY_HERE| Varies |
369 | | Directions | https://maps.googleapis.com/maps/api/directions/json?origin=Disneyland&destination=Universal+Studios+Hollywood4&key=KEY_HERE| $5 |
370 | | Geocoding | https://maps.googleapis.com/maps/api/geocode/json?latlng=40,30&key=KEY_HERE| $5 |
371 | | Distance Matrix| https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=40.6655101,-73.89188969999998&destinations=40.6905615%2C-73.9976592%7C40.6905615%2C-73.9976592%7C40.6905615%2C-73.9976592%7C40.6905615%2C-73.9976592%7C40.6905615%2C-73.9976592%7C40.6905615%2C-73.9976592%7C40.659569%2C-73.933783%7C40.729029%2C-73.851524%7C40.6860072%2C-73.6334271%7C40.598566%2C-73.7527626%7C40.659569%2C-73.933783%7C40.729029%2C-73.851524%7C40.6860072%2C-73.6334271%7C40.598566%2C-73.7527626&key=KEY_HERE | $5 |
372 | |Find Place from Text | https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=Museum%20of%20Contemporary%20Art%20Australia&inputtype=textquery&fields=photos,formatted_address,name,rating,opening_hours,geometry&key=KEY_HERE | Varies |
373 | | Autocomplete | https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Bingh&types=%28cities%29&key=KEY_HERE| Varies |
374 | | Elevation | https://maps.googleapis.com/maps/api/elevation/json?locations=39.7391536,-104.9847034&key=KEY_HERE | $5 |
375 | | Timezone | https://maps.googleapis.com/maps/api/timezone/json?location=39.6034810,-119.6822510×tamp=1331161200&key=KEY_HERE | $5 |
376 | | Roads | https://roads.googleapis.com/v1/nearestRoads?points=60.170880,24.942795\|60.170879,24.942796\|60.170877,24.942796&key=KEY_HERE | $10|
377 | | Geolocate | https://www.googleapis.com/geolocation/v1/geolocate?key=KEY_HERE| $5 |
378 |
379 | *\*Pricing is in USD per 1000 requests (for the first 100k requests)*
380 |
381 | More Information available here-
382 |
383 | https://medium.com/@ozguralp/unauthorized-google-maps-api-key-usage-cases-and-why-you-need-to-care-1ccb28bf21e
384 |
385 | https://github.com/ozguralp/gmapsapiscanner/
386 |
387 | https://developers.google.com/maps/api-key-best-practices
388 |
389 | ## [Google Recaptcha key](https://developers.google.com/recaptcha/docs/verify)
390 |
391 | Send a POST to the following URL:
392 |
393 | ```
394 | https://www.google.com/recaptcha/api/siteverify
395 | ```
396 |
397 | `secret` and `response` are two required POST parameters, where `secret` is the key and `response` is the response to test for.
398 |
399 | Regular expression: `^6[0-9a-zA-Z_-]{39}$`. The API key always starts with a 6 and is 40 chars long. Read more here: https://developers.google.com/recaptcha/docs/verify.
400 |
401 | ## [Google Cloud Service Account credentials](https://cloud.google.com/docs/authentication/production)
402 |
403 | Service Account credentials may be found in a JSON file like this:
404 |
405 | ```
406 | $ cat service_account.json
407 | {
408 | "type": "service_account",
409 | "project_id": "...",
410 | "private_key_id": "...",
411 | "private_key": "-----BEGIN PRIVATE KEY-----...-----END PRIVATE KEY-----\n",
412 | "client_email": "...",
413 | "client_id": "...",
414 | "auth_uri": "https://accounts.google.com/o/oauth2/auth",
415 | "token_uri": "https://oauth2.googleapis.com/token",
416 | "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
417 | "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/..."
418 | }
419 | ```
420 |
421 | If this is your case you may check these credentials using `gcloud` tool ([how to install `gcloud`](https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu)):
422 |
423 | ```
424 | $ gcloud auth activate-service-account --key-file=service_account.json
425 | Activated service account credentials for: [...]
426 | $ gcloud auth print-access-token
427 | ya29.c...
428 | ```
429 |
430 | In case of success you'll see access token printed in terminal. Please note that after verifying that credentials are actually valid you may want to enumerate permissions of these credentials which is another story.
431 |
432 | ## [Branch.IO Key and Secret](https://docs.branch.io/pages/apps/deep-linking-api/#app-read)
433 |
434 | Visit the following URL to check for validity:
435 |
436 | ```
437 | https://api2.branch.io/v1/app/KEY_HERE?branch_secret=SECRET_HERE
438 | ```
439 |
440 | ## [Bit.ly Access token](https://dev.bitly.com/authentication.html)
441 |
442 | Visit the following URL to check for validity:
443 |
444 | ```
445 | https://api-ssl.bitly.com/v3/shorten?access_token=ACCESS_TOKEN&longUrl=https://www.google.com
446 | ```
447 |
448 | ## [Buildkite Access token](https://buildkite.com/docs/apis/rest-api)
449 | ```
450 | curl -H "Authorization: Bearer ACCESS_TOKEN" \
451 | https://api.buildkite.com/v2/user
452 | ```
453 |
454 | ## [Asana Access token](https://asana.com/developers/documentation/getting-started/auth#personal-access-token)
455 | ```
456 | curl -H "Authorization: Bearer ACCESS_TOKEN" https://app.asana.com/api/1.0/users/me
457 | ```
458 |
459 | ## [Zendesk Access token](https://support.zendesk.com/hc/en-us/articles/203663836-Using-OAuth-authentication-with-your-application)
460 | ```
461 | curl https://{subdomain}.zendesk.com/api/v2/tickets.json \
462 | -H "Authorization: Bearer ACCESS_TOKEN"
463 | ```
464 |
465 | ## [MailChimp API Key](https://developer.mailchimp.com/documentation/mailchimp/reference/overview/)
466 | ```
467 | curl --request GET --url 'https://.api.mailchimp.com/3.0/' --user 'anystring:' --include
468 | ```
469 |
470 | ## [WPEngine API Key](https://wpengineapi.com/)
471 |
472 | This issue can be further exploited by checking out [@hateshape](https://github.com/hateshape/)'s gist https://gist.github.com/hateshape/2e671ea71d7c243fac7ebf51fb738f0a.
473 |
474 | ```
475 | curl "https://api.wpengine.com/1.2/?method=site&account_name=ACCOUNT_NAME&wpe_apikey=WPENGINE_APIKEY"
476 | ```
477 |
478 | ## [DataDog API key](https://docs.datadoghq.com/api/)
479 | ```
480 | curl "https://api.datadoghq.com/api/v1/dashboard?api_key=&application_key="
481 | ```
482 |
483 | ## [Travis CI API token](https://developer.travis-ci.com/gettingstarted)
484 |
485 | ```
486 | curl -H "Travis-API-Version: 3" -H "Authorization: token " https://api.travis-ci.com/user
487 | ```
488 |
489 | ## [WakaTime API Key](https://wakatime.com/developers)
490 | ```
491 | curl "https://wakatime.com/api/v1/users/current/projects/?api_key=KEY_HERE"
492 | ```
493 |
494 | ## [Spotify Access Token](https://developer.spotify.com/documentation/general/guides/authorization-guide/)
495 | ```
496 | curl -H "Authorization: Bearer " https://api.spotify.com/v1/me
497 | ```
498 |
499 | ## [Instagram Access Token](https://www.instagram.com/developer/endpoints/users/)
500 | Visit the following URL to check for validity
501 | ```
502 | https://api.instagram.com/v1/users/self/?access_token=ACCESS-TOKEN
503 | ```
504 |
505 | ## [Gitlab personal access token](https://docs.gitlab.com/ee/api/README.html#personal-access-tokens)
506 | ```
507 | curl "https://gitlab.example.com/api/v4/projects?private_token="
508 | ```
509 |
510 | ## [Paypal client id and secret key](https://developer.paypal.com/docs/api/get-an-access-token-curl/)
511 | ```
512 | curl -v https://api.sandbox.paypal.com/v1/oauth2/token \
513 | -H "Accept: application/json" \
514 | -H "Accept-Language: en_US" \
515 | -u "client_id:secret" \
516 | -d "grant_type=client_credentials"
517 | ```
518 |
519 | The access token can be further used to extract data from the PayPal API. More information: https://developer.paypal.com/docs/api/overview/#make-rest-api-calls.
520 |
521 | This can be verified using:
522 |
523 | ```
524 | curl -v -X GET "https://api.sandbox.paypal.com/v1/identity/oauth2/userinfo?schema=paypalv1.1" -H "Content-Type: application/json" -H "Authorization: Bearer [ACCESS_TOKEN]"
525 | ```
526 |
527 | ## [Stripe Live Token](https://stripe.com/docs/api/authentication)
528 |
529 | ```
530 | curl https://api.stripe.com/v1/charges -u token_here:
531 | ```
532 |
533 | Keep the colon at the end of the token to prevent `cURL` from requesting a password.
534 |
535 | The token is always in the following format: `sk_live_24charshere`, where the `24charshere` part contains 24 characters from `a-z A-Z 0-9`. There is also a test key, which starts with `sk_test`, but this key is worthless since it is only used for testing purposes and most likely doesn't contain any sensitive information. The live key, on the other hand, can be used to extract/retrieve a lot of info — ranging from charges to the complete product list.
536 |
537 | Keep in mind that you will never be able to get the full credit card information since Stripe only gives you the last 4 digits.
538 |
539 | More info/complete documentation: https://stripe.com/docs/api/authentication.
540 |
541 | ## [Razorpay API key and Secret key](https://razorpay.com/docs/api/)
542 |
543 | This can be verified using:
544 |
545 | ```
546 | curl -u : \
547 | https://api.razorpay.com/v1/payments
548 | ```
549 |
550 | ## [CircleCI Access Token](https://circleci.com/docs/api/#api-overview)
551 |
552 | ```
553 | curl https://circleci.com/api/v1.1/me?circle-token=
554 | ```
555 |
556 | ## [Loqate API key](https://www.loqate.com/resources/support/apis)
557 |
558 | ```
559 | curl 'http://api.addressy.com/Capture/Interactive/Find/v1.00/json3.ws?Key=&Countries=US,CA&Language=en&Limit=5&Text=BHAR'
560 | ```
561 |
562 | ## [Ipstack API Key](https://ipstack.com/documentation)
563 |
564 | ```
565 | curl 'https://api.ipstack.com/{ip_address}?access_key={keyhere}'
566 | ```
567 |
568 | ## [NPM token](https://docs.npmjs.com/about-authentication-tokens)
569 |
570 | You can verify NPM token [using `npm`](https://medium.com/bugbountywriteup/one-token-to-leak-them-all-the-story-of-a-8000-npm-token-79b13af182a3) (replacing `00000000-0000-0000-0000-000000000000` with NPM token):
571 |
572 | ```
573 | export NPM_TOKEN="00000000-0000-0000-0000-000000000000"
574 | echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
575 | npm whoami
576 | ```
577 |
578 | Another way to verify token is to query API directly:
579 |
580 | ```
581 | curl -H 'authorization: Bearer 00000000-0000-0000-0000-000000000000' 'https://registry.npmjs.org/-/whoami'
582 | ```
583 |
584 | You'll get username in response in case of success, `401 Unauthorized` in case if token doesn't exists and `403 Forbidden` in case if your IP address is not whitelisted.
585 |
586 | NPM token can be [CIDR-whitelisted](https://docs.npmjs.com/creating-and-viewing-authentication-tokens#creating-tokens-with-the-cli). Thus if you are using token from *non-whitelisted* CIDR you'll get `403 Forbidden` in response. So try to verify NPM token from different IP ranges!.
587 |
588 | P.S. Some companies [uses registries other than `registry.npmjs.org`](https://medium.com/bugbountywriteup/one-token-to-leak-them-all-the-story-of-a-8000-npm-token-79b13af182a3). If it's the case replace all `registry.npmjs.org` occurrences with domain name of company's NPM registry.
589 |
590 | # Contributing
591 |
592 | I welcome contributions from the public.
593 |
594 | ### Using the issue tracker 💡
595 |
596 | The issue tracker is the preferred channel for bug reports and features requests.
597 |
598 | ### Issues and labels 🏷
599 |
600 | The bug tracker utilizes several labels to help organize and identify issues.
601 |
602 | ### Guidelines for bug reports 🐛
603 |
604 | Use the GitHub issue search — check if the issue has already been reported.
605 |
606 | # ⚠ Legal Disclaimer
607 |
608 | This project is made for educational and ethical testing purposes only. Usage of this tool for attacking targets without prior mutual consent is illegal. Developers assume no liability and are not responsible for any misuse or damage caused by this tool.
609 |
--------------------------------------------------------------------------------