Django, is a Python-based web framework that allows developers to easily create secure and maintainable websites. This free open source is one of the most popular Python frameworks because it provides many shortcuts to making life easier for web developers. The problem is that many developers easily overlook the importance of security while using these shortcuts.
Upon searching for Django web applications with enabled Debug Mode, Database (hereinafter referred to as DB) accounts information and API Keys of more than thousands of applications were found to be exposed on the internet. This implies that hackers are able to pocket corporate’s personal information and confidential documents without hassles. AI Spera’s CIP team searched for web applications such as Django and Laravel, as well as its related keywords to assess the severity of Credential leakage on Criminal IP, a comprehensive cyber threat intelligence search engine.
What is a Credential?
Credential, in the dictionary, is defined as ‘qualification’ and generally refers to evidence attesting one’s right and authority, such as your identification card and certificates. However, the term ‘Credential’ also applies to cloud environments and Oauth, like Facebook, where you use Access Key ID/Secret Key for social authentication. In recent days, the term Credential doesn’t necessarily mean authentication-related keys, but in a more comprehensive matter, IP information of internal cloud VPC networks.
How to Search for Credentials on Criminal IP Asset Search
When searching for authentication-related keywords (Access Key ID, Secret Access Key) on Criminal IP Asset Search, you can often find IPs with exposed credentials, many of which are of either Oauth or RESTfull API.
- Access Key ID: a.k.a Access Key, refers to the username of general websites.
- Secret Access Key: a.k.a the Secret Key, refers to passwords of general websites.
For example, Access Key types used in Amazon Cloud consist of the following:
Types of Access Key used in Amazon Cloud
Additionally, you can look for authentication-related information through a Bucket, storage often used in cloud services. If accessible, this Bucket could cause serious problems as anybody can steal undisclosed files from the server. The team searched for the keyword Bucket to find buckets on read mode.
Upon searching for “READ_BUCKET_NAME” on Criminal IP, you can find a total of 635 websites. Among them, you can also find websites named “NAVERCloud VOD Service TBD,” which are assumed to be demo pages of uploading buckets for NAVER Cloud users. However, these websites have demo Endpoint domain address, Access Key ID, and Access Secret Key that are used for file upload testing exposed, when they were supposed to be hidden. What exacerbates the problem is that there are way more websites like this.
Exposed Access Credential under HTML Body tag
How to Search for Debug Mode Sites of Django Web
Debug Modes are often used by PHP-based Laravel Framework and python-based Django web applications for convenience in development. Despite the convenience the Debug Mode provides, it also rises a problem for both Laravel Framework and Django as it exposes sensitive information to error messages once activated.
The following filter can be used to search for websites with enabled Django Debug Mode on Criminal IP Asset Search.
Django website with enabled Debug Mode, exposing sensitive information to error messages
The HTTP request header exposed on the Django web application contains not only the API Key mentioned so far but also authentication-related information such as Admin and password, as well as DB account.
Django website with exposed sensitive information such as admin and passwords
Laravel websites with enabled Debug mode can also be searched with the filter below.
title: “Whoops! There was an error”
Result when searched title: “Whoops! There was an error” on Criminal IP Asset Search
Laravel Debug Mode is activated in all of these searched IP addresses, and when accessed, you will be able to see information on APP Key, DB account, and password in the error message.
Laravel website with exposed sensitive information such as DB accounts and passwords
Exposed API Keys in the Form of Text Files
If you search for ‘APIKEY.txt’ on Asset Search, you can find something intriguing.
Result when searching “APIKey.txt” on Criminal IP Asset Search
Glancing at the searched website, it’s difficult to tell the purpose of the site. The page source, however, gives you a clear sense of what this page is all about.
A website after searching for APIKey.txt
The page source notes that this website uses Firebase as its database, and under firebase Configuration, you can see that API Key, AuthDomain, AppID that are issued while using firebase SDK are exposed.
Page source of the website above. Credentials are exposed.
The team has also found a website that appears to be China’s RESTfull API with exposed Admin’s Access Token hash.
A Chinese website with exposed Admin Access Token hash
Criminal IP often shows HTML files containing Credentials that tend to be left unattended through testing or by mistake. The images below, for example, are HTML files with Amazon Cloud Service (AWS) IAM Metadata or DynamoDB AWS Key.
1) HTML file with IAM Metadata. User Accounts are found.
HTML file displaying User Accounts in the AWS IAM Metadata
2) HTML file with DYnamoDB, one of the major AWS NoSQL servers. Credentials including Access Key ID and Secret Key are exposed.
Result when searched AWS DynamoDB Admin on Criminal IP Asset Search
Exposed Access Key in the AWS DynamoDB Work Script
Thanks to cloud-native technology, developers’ productivity has been increasing remarkably. However, as the focus is greatly on productivity, there have been voices of concern that security is considered a low priority.
Whereas security was focused solely on account management such as username and password in the DB in the past, now, in the cloud era, there are API Keys with “change” permission, meaning just one API Key leak can lead to credential leakage or manipulation.
Cloud-related technologies are evolving at a rapid pace and so is security. Therefore, a regular check-up with developers needs to be conducted to see whether they are caught up with the most recent cyber security technologies. Moreover, we should all keep in mind that in the cloud era, one little mistake such as setup errors can lead to credential leakage, causing catastrophic security damage to both individuals and businesses.
About AI Spera
AI Spera is a fast-growing company in cyber threat intelligence. Based on AI and machine learning technologies, it is focusing on abnormality detection and data-oriented security solutions. As a provider of Criminal IP, it shores up various areas in which Criminal IP defends against ever-evolving cyber threats, spanning education and research, corporate security teams, white hackers, national agencies, and cybercrime investigation organizations. The Company supports as many corporates, security developers and researchers as possible to view the attack surface through the eyes of an attacker and provide various AI-based intelligence security solutions across industries.
- Hakin9 is a monthly magazine dedicated to hacking and cybersecurity. In every edition, we try to focus on different approaches to show various techniques - defensive and offensive. This knowledge will help you understand how most popular attacks are performed and how to protect your data from them. Our tutorials, case studies and online courses will prepare you for the upcoming, potential threats in the cyber security world. We collaborate with many individuals and universities and public institutions, but also with companies such as Xento Systems, CATO Networks, EY, CIPHER Intelligence LAB, redBorder, TSG, and others.
- Blog2022.12.13What are the Common Security Weaknesses of Cloud Based Networks?
- Blog2022.10.12Vulnerability management with Wazuh open source XDR
- Blog2022.08.29Deception Technologies: Improving Incident Detection and Response by Alex Vakulov
- Blog2022.08.25Exploring the Heightened Importance of Cybersecurity in Mobile App Development by Jeff Kalwerisky