In this post, we continue our data collection and evaluation of files stored on removable medias publicly accessible to the Internet. The collection of filenames from 6,500 hosts is ongoing, therefore we’re going to focus on evaluation of sensitivity of a file based only on its filename. Based on the current result, 2 to 9% of the 3000 files reviewed were sensitive or potentially sensitive. Most of the sensitive files are concentrated on a few hosts. These files often include financial information or project data from businesses. So far, 773 hosts containing around 4.5 million files have been scanned.
The amount of filenames collected is quite large and we cannot evaluate manually each filename for its probable sensitivity. As such, we need to devise a procedure to automatically assess its sensitivity. We have some definitions and restrictions to list first to clarify what a sensitive file is and limitation to our evaluation criteria.
In this document, sensitive file refers to user-generated or software-generated files based on user input that contains information that should probably not be publicly accessible and which can be leveraged against an individual or organization. This includes:
- Personal identification documents; passport, driver’s license, visas, government forms…
- Personal finance documents; income tax files, insurance forms, credit card statements, mortgage, pay stubs, banking information
- Personal medical documents; prescriptions, medical records
- Work-related files; emails, proprietary source code, password lists
- Business finances; customer lists, sales data, project costs, business deals, investments, payrolls
- Intellectual property; blueprints, schema, patents, research
- Network configuration; passwords files, configurations files, network diagrams, user databases
- Large databases of emails, addresses and other personal information.
Some of the files not included in our analysis that includes;
- Copyrighted / Illegally downloaded files. However we considered text file containing licensing keys to be sensitive.
- Inappropriate contents (nude selfies, personal politics, group affiliations etc…)
- Personal pictures, letters.
- Addresses and emails were not considered personal, however databases of addresses and emails are considered sensitive
Because of the volume, we cannot download and manually verify each file to confirm its contents, as such our main restriction is that our assessment must be done solely based on the absolute filename recorded. As such, to evaluate the sensitivity, we used three categories; positive, negative and neutral, i.e. either a file is very likely to sensitive, potentially sensitive or clearly not sensitive at all. Of course, there is always a possibility that a file labeled as sensitive may not be. For example, a file called social security numbers.xls may contain only formulas or an empty form. Ideally, files identified as positive or neutral should be manually vetted.
The procedure to automatically assess the sensitivity of a file based on its path and name is first done by assessing a random sample manually. Using the ORDER BY RANDOM (note: there will be a need to review if this function is truly random, which I doubt) function (performance is not an issue in this experiment) of the Postgresql database, multiple random samples of 100 filenames are retrieved from the database. Each file is shown to the evaluator which based on the path, filename and extension assess the sensitivity of the file as ‘positive‘, ‘neutral‘, ‘negative‘. For each run, we log the count of hits for all categories.
/Transcend/privat/Наташа/фотки/с фотика отдых/IMG_9720.jpg ([n],y,m): n
/ELEMENTS/EVERYTHING/Pictures/Small Camera K Wedding/DSC01199.JPG ([n],y,m): n
/Seagate_Expansion_Drive/D/D/D/XXXXX Internet Mail v1.25.06中文版/XXXXX/model/2004台中車展/Honda/pauly04012609.jpg ([n],y,m): n
/FLASH/Distrib/Browser/Tor Browser/Docs/Qt/LICENSE.LGPL ([n],y,m):
/2TB_Router/Music/Pop EN Fem/Ashlee Simpson/Autobiography/desktop.ini ([n],y,m): n
[+] Saving results...
/Seagate_Backup_Plus_Drive/Picture Backup/My Pictures/XXXXX 3rd Bday/WP_20140403_20_10_22_Pro.jpg ([n],y,m): n
/DATEN/Masterarbeit/Anwendung/Webseite/20110601/lib/ExtJS/resources/images/yourtheme/window/top-bottom.psd ([n],y,m): n
Listing 1 : Example of a run in which a script asks an evaluator to assess the sensitivity of files based on its absolute path.
The evaluator is assessing the filename based on keywords that may indicate the contents of the file. As such, a file containing the word, or as we call it in this document, a token such as sales, passport or passwords will be assume to contain information about sales, a passport scan or a list of passwords. In many cases, the filename is too obscure, but the path and extension may indicate the contents of the file. For example, a path containing the tokens project, finances and a Microsoft Excel extension despite a filename of axe189212_c.xls will be considered as neutral, as the file may contents information about a project. Examples of both scenarios are shown in listings 2 and 3:
/My_Book/Documents/XXXX/Career/Symantec/Rotations/Sales Finance FY08-FY09/Funded Heads/LAR/LAR Payreq 1.28.09.xls
/NAS-Disk/Backup All/HP/Customers/Switzerland/TOTSA TOTAL OIL/WBS DP6.2 to 8.x Upgrade Estimation T&M V2.xlsx
/USB-HDD/@Bestanden/OneDrive/Globally/XXXX/dropbox/Planning/XXXX/Customers/Hortico/1st/Purchase order PUR00097-1 WROCLAW.PDF
/Seagate_Expansion_Drive/Backup/20140530/Desktop/Desktop old/NexPower/0.Server Data/00 Project Management/Workshop Minutes/2010.08.30-銷貨折讓及再請款作業流程/2010.08.30-銷貨折讓及再請款作業流程.rtf
Listing 2 : Examples of files that were deemed ‘positive’ hits based on keywords in their absolute path.
/USB-HDD/@Bestanden/OneDrive/Globally/XXXX/dropboxplantacote/Presentations/New AG Rio 2013/IFA New Ag Miami 2010 PPT/2010_ifa_newag_Landels_slides.pdf
/XXXX/Stuff/stuff/OLD FOLDERS/GIS Data/streetmap/landmrks/airport.shx
Listing 3 : Examples of files that were deemed ‘neutral’ (or ‘unknown’) hits based on keywords in their absolute path.
Filenames in foreign languages are roughly translated using Google Translate, as such, many of them are labeled as unsure.
A Python script then divide the filename in tokens, and each token is stored in the database along with the number of times it was found in a positive, neutral and negative hit. Tokens are created slightly differently based if they are located in the path, the filename or in the extension. For the extension, a single token is created which contains the extension itself. If the file does not have an extension or is not an extension usually associated with known software, no token is created. For the filename, tokens are created by splitting each word using characters usually known to separate words such as the underscore, dash, period or spaces. Lastly, for the path, directories are used as token and unlike filenames, are not split further. An example of this process is shown in listing 4:
File: /My_Passport(1)/Name of Company/Owner/ASUSLAPTOP/Data/C/Users/Owner/Documents/Forms/Letter of Understanding for Sub-contractors (2015_03_24 16_00_01 UTC).docx
Path=>/My_Passport(1)/Name of Company/Owner/ASUSLAPTOP/Data/C/Users/Owner/Documents/Forms/
File=>Letter of Understanding for Sub-contractors (2015_03_24 16_00_01 UTC)
Tokens(Path) = ["My_Passport(1)", "Name of Company", "Owner", "ASUSLAPTOP", "Data", "C", "Users", "Documents", "Forms"]
Tokens(File) = ["Letter", "of", "Understanding", "for", "Sub", "contractors", "2015", "03", "24", "16", "00", "01", "UTC"]
Tokens(Extension) = ["docx"]
Listing 4 : Example of the tokenization of a filename.
Once the tokens are created, the script will either add the token in the database or update its count based on the evaluator choice. After each update, a score is given to the token, which is simply the ratio between positive hits and the total count of appearances: p / hits). Note that tokens are considered different depending their location in the filename. As such, a filename such as /My_Passport/backup/Outlook emails backup.pst, will generate 2 distinct ‘backup’ tokens; the one from the path and the one from the filename. We explain this decision in the next paragraphs.
name | type | pos | unk | neg | score
letter | 1 | 1 | 0 | 0 | 1.0000000000
contractors | 1 | 1 | 0 | 0 | 1.0000000000
docx | 0 | 2 | 4 | 1 | 0.5714285714
Listing 5 : Scores of the tokens extracted from the file in listing 4.
By using this procedure, we believe that tokens appearing often in both positive and negative hits will cancel each other, while the tokens strongly associated with positive and negative hits will remain clearly divided. Some sort of mathematical should follow later one (I hope…need to review discrete maths I guess). Some preliminary results appears to confirm this approach as valid. Extensions strongly associated with sensitive contains higher scores while media files have null scores.
However, there is a need to further refine this process by associating a value, or weight, to the location of the token. Tokens in the path are not as indicative of the sensitivity of the file as much as a token in the filename or extension. Even within the path, the highest level is generally less indicative than the lowest one, i.e. /documents/finances 2012/sales/company sales.xls. Therefore when assessing a new filename, we need to give a score to the path, the filename and the extension. For the path, we will get the score of each token and multiply it with a weight that correspond to its location in the structure. For token that are not found the default value of 0 will be given. Then we will take the average of all token for the score of the path. As for the filename, we will not consider the position. Finally the stored score of the extension will be retrieved from the database. If the extension is not found, then a score of 0 will be used. This will transform a filename into a set of three real values which we can range between 0 and 1. To determine the weights needed for each location, we will used a supervised neural network. More research will be conducted to determine how to use this approach.
As of 16 July 2015, 4,568,738 files have been recorded from 773 hosts.
Table 1. Location of the 773 hosts scanned as of 16 July 2015 order by country.
Mp3 and JPEG image files remains the most common. As such, we focus our statistics on document-type of files for a change, i.e. Office documents. Adobe PDF files and Microsoft Word documents are the most common file types based on our current data as shown in figure 1.
At the moment, around 3000 files have been assessed (30 runs of 100 samples). For each run, we recorded the number of positives, neutral and negative hits and found them overall constant at each run. (see figure 2) However more details about the RANDOM function is needed to insure the randomness of the sample. This part may need to be redone. So far, between 2% and 9% of files scanned are considered sensitive or potentially sensitive (see figure 3). However we need to consider the concentration of these files to put this information into perspective. The 278 files identified as sensitive or potentially sensitive were located on 59 hosts, with one host accounting for 101 of these file. This indicates that files of interests for an attacker are likely to be concentrated on a few hosts.
As for tokens, we will have to consider the entire collection of filenames in order to have sample from multiple sources, as such, we will pursue manually assessing samples of 100 filenames as more data is collected. After which we should have an excellent training set for the neural network. Some high-recurring and high-scoring tokens are shown in tables 2 and 3.
Table 2. Sample of high-scoring tokens sorted on the number of times observed.
Table 3. Sample of high-recurring tokens sorted on the number of times observed.
While these results are preliminary, they nevertheless seems to provide a solid indication of what one can find on publicly-available removable drives. Additional work and fine tuning of both code and processes is required to provide more accurate data and the next step while the scan is still on going it to develop a methodology to assess the sensitivity of all files, likely using a neural network for classification based on the method presented above.