Upon searching for Django web applications with enabled Debug Mode on Criminal IP (https://www.criminalip.io/), Database (hereinafter referred to as DB) accounts information and API Keys of more than 3,100 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. The CIP team searched for web applications such as Django and Laravel, as well as its related keywords to assess the severity of Credential leakage.

What is 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, to 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 the 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:

아마존 클라우드에서 사용하는 Access Key 타입

Types of Access Key used in Amazon Cloud

Additionally, you can look for authentication-related information through a Bucket, a storage often used in cloud services. If accessible, this Bucket could cause serious problems as anybody can steal undisclosed files from the server. We searched for the keyword Bucket to find buckets on read mode.

“READ_BUCKET_NAME”

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

Exposed Access Credential under HTML Body tag

How to Search for Debug Mode Sites of Django Web Application on Criminal IP Asset Search

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.

You can use the following filter to search for websites with enabled Django Debug Mode on Criminal IP Asset Search.

“DisallowedHost at“

credential

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.

Admin 계정 및 패스워드 등 민감한 정보가 노출된 장고 웹사이트

Django website with exposed sensitive information such as Admin and passwords

You can also look for Laravel websites with enabled Debug mode with the filter below.

title: “Whoops! There was an error”

Result when searched title: "Whoops! There was an error" on Criminal IP Asset Search

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.

DB 계정 및 패스워드 등 민감한 정보가 노출된 라라벨 웹사이트

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.

APIKey.txt

Result when searched "APIKey.txt" on Criminal IP Asset Search

Result when searched “APIKey.txt” on Criminal IP Asset Search

Glancing on 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.

APIKey.txt 검색을 통해 발견된 웹 사이트 접속 화면

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.

We have 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 which 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

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.

DynamoDB Admin

Result when searched AWS DynamoDB Admin on Criminal IP Asset Search

Result when searched AWS DynamoDB Admin on Criminal IP Asset Search

Credential leakage

Exposed Access Key in the AWS DynamoDB Work Script

Conclusion

Thanks to cloud native technology, developers’ productivities have 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 set up errors can lead to credential leakage, causing catastrophic security damage to both individuals and businesses.


Source : Criminal IP (https://www.criminalip.io)