Swap Files Anti-Forensics On Linux
Swap Files Anti-Forensics On Linux
Abstract—Swap file has potentially interesting and size of 1 MiB then this process will occupy 3
rich source of digital evidences. Password, crypto- memory page in the memory. Swapping is happens
graphic key, private data and sensitive data can be if our memory is (relatively) full but there are still
found in the swap file. With a simple technique such
as string matching, digital evidences can be easily more process needed to run. When this happens,
found and identified. There is minimal research on our process X will be evicted from memory to disk
swap file anti-forensics. We found that most of swap (hard disk) and new process Y will occupy memory.
file anti-forensics techniques are still vulnerable to live There is no standard structure on how OS will place
acquisition. So, we propose 2 swap file anti-forensic memory page to swap file. From examinerâĂŹs
technique: inject live swap file and fake swap file.
Inject live swap file is created by injecting(flooding) perspective, swap file is just structureless chunk
fake data to live swap file using a custom script. Fake collections of 4 KiB data.
swap is created by manipulate swap file header then Swap file has potentially interesting and rich
filling swap file with fake artefacts of our choosing. source of digital evidences. Password, crypto-
We perform this technique before user begins his/her graphic key, private data and sensitive data can be
usual activities. We able to implement Inject live
swap file technique but with disadvantage of private found in the swap file. With simple technique such
and sensitive data leak. Making fake swap file is as string matching or carving file, digital evidences
relatively easy and without data leak. Although these can be easily found and identified [3]. On the
two approaches do not solve the problem of live other hand, implementation of swap file still lack of
acquisition, it could confuse, mislead and wasting security features [2]. Therefore, we need swap file
examiner’s time.
anti-forensics to protect our private and sensitive
I. I NTRODUCTION data. This research is only focused on Swap file
Linux OS.
A. Background and Motivation
B. Contributions
Swapping is a process that interchanges the con-
tents of an area of main storage (memory) with Main contributions of this paper are:
the contents of an area in secondary memory (hard • Identification of swap file anti-forensics tech-
disk) [1]. Swapping is always associate with I/O niques using CAF (Computer Anti-Forensics)
operation. Swap file is file in the disk for swapping Classification [4].
purpose. Swapping and swap file is created and Most research on anti-forensics is still focused
managed by OS (operating system). In Windows on memory anti-forensic and very little on
swap file is called pagefile and on Linux is called swap file anti-forensics. Although memory and
swap file. swap file is very closely related, swap file
Swap file is structureless collection of memory is different from memory from perspective
pages (block/chunk) [2]. In modern OS, memory is of forensics. In this paper we made list of
partitioned into hundreds of memory pages. Mem- anti-forensics techniques for swap file, its ad-
ory page usually has predetermined fixed size (4 vantages and disadvantages, vulnerability, data
KiB for example). So if we have process X with leak and complexity.
• Propose 2 (two) simple anti-forensics tech- 2) Anti-forensics Based on Techniques vs. Tac-
niques: inject live swap file and fake swap tics.
file. These 2 simple techniques are created to It classifies techniques based on how general
confuse, mislead and wasting examiner’s time. or specific attack could be carried out. Tech-
niques refers to general anti-forensics (deleting
C. Outline data, disabling, etc.). Tactics refers to crashing
After this introduction, we will review existing specific tool or defeating special methods.
research on swap file anti-forensics. In methodology 3) Anti-forensics Based on Traditional vs. Non-
section we will outline our anti-forensics technique Traditional:
and testing method. In result and discussion we will • Traditional: overwrite data, cryptography,
present our finding. steganography and any data hiding tech-
niques. More focus on data.
II. L ITERATURE R EVIEW • Non-Traditional: memory injection, anony-
Advantages: Digital evidence is hard fill it with fake artefacts. Later, we use this
to acquire if this technique properly modified swap file as legitimate swap file.
implemented. 2.2. Attacking Forensic Tool
Disadvantages: Performance issues [8]. For this technique, we will give example
Vulnerability: Still vulnerable to live how to defeat tool called Page brute. Page
acquisition. brute is signature based software to extract
Complexity: Tools are already exist. artefact in swap file. Page brute will scan-
ning block by block (4096 byte). If block
ii) Partition Hiding swap file or swap par- is NULL then Page brute will skip it. If
titions can be hidden in legitimate parti- not NULL then pattern inside block will be
tion. Example of this technique is True- matched with rule set created by YARA.
crypt‘s hidden partition. Hidden partition YARA is tools to create rule set based on
hides inside legitimate partition. User signatures. To defeat Page brute, technique
must run their software to hide partition called One-Byte Abort Factor [9] is im-
then activate swap with path to hidden plemented. Basic idea of One-Byte Abort
partition. Factor is we must know signature used by
Advantages: Tools are already exist. Page brute then we modify 1 byte of our
Disadvantages: Difficulty to hide big artefacts to escape automatics detection.
swap file. Advantages: Increase examiner time to
Vulnerability: Still vulnerable to live perform analyses. Casting doubt on result.
acquisition. Disadvantages: Only works for specific
Complexity: Relatively easy to use. forensics tool.
Vulnerability: None.
2) Non-Traditional Complexity: We must understand inner
2.1. Artefact Injection working of tool
Basic ideas about this technique are: first,
we want to increase false positive rate. Most
examiner is depends on forensics software. D. Related Works
Injecting fake artefacts will make exami-
nation longer (noise is higher than signal). Swap file compression [2] is technique to analyse
Second, artefacts is easily created. We able RAM (memory) and swap file on Mac and Linux
to create and implant artefact easily. OS. Swap file compression make swap file foren-
On memory forensics, there is tool called sics more difficult to do. swap file encryption is
ADD3 . This tool will inject new process encryption for swap file, [8] comparing performance
into memory using known signature (exam- of Windows based encryption tools. Some attempt
ple:malware process). No one yet propose have been done to convert swap file to virtual
this kind technique for swap anti-forensics. memory (integrate between memory and swap files)
This paper propose injection of fake artefact but still only on Windows OS using Volatility
to swap files. We injecting swap file using [10] and Rekall [11] Framework. Page brute page
two techniques: inject live swap file and fake brute4 is crude version to extract swap file. Some
swap file. In the inject live swap technique, anti-forensics technique attacking specific tools is
we perform some fake user activities then documented by [12]. And there is ADD 5 memory
forcing it to swap file. In the fake swap anti-forensic to confuse examiner.
file technique, we create new swap file then
4 https://github.com/matonis/page_brute
3 https://code.google.com/archive/p/attention-deficit-disorder/ 5 https://code.google.com/p/attention-deficit-disorder/
Fig. 1. Version, page number and UUID of legitimate swap file. Fig. 3. SWAPSPACE2 signature at offset 0xFF6.
overwritten by new incoming swap file. Then, all [4] K. Dahbur and B. Mohammad, “The anti-forensics chal-
artefacts in the swap file are legitimate artefacts. lenge,” Proceedings of the 2011 International Conference
on Intelligent Semantic Web-Services and Applications
Our two approaches do not solve the problem of - ISWSA ’11, pp. 1–7, 2011. [Online]. Available:
live acquisition. Our approach will increasing time http://dl.acm.org/citation.cfm?id=1980822.1980836
for examiner to handle the case, which is still goal [5] S. L. Garfinkel, “Anti-Forensic Techniques,” 2015.
[Online]. Available: http://www.forensicswiki.org/wiki/
of anti-forensics. Anti-forensic{\_}techniques
Evaluation of our techniques as follow: [6] T. Müller, F. C. Freiling, and A. Dewald, “TRESOR
runs encryption securely outside RAM,” Proceeding
Advantages: Fake artefacts or fake swap file SEC’11 Proceedings of the 20th USENIX conference
eventually recognizable by experts but it will on Security, p. 17, 2011. [Online]. Available: http:
increase examiner time to perform analyses. //dl.acm.org/citation.cfm?id=2028067.2028084
[7] P. A. H. Peterson, “Cryptkeeper: Improving security with
Casting doubt on results. encrypted RAM,” in 2010 IEEE International Conference
Disadvantages: Difficulty to create believable fake on Technologies for Homeland Security, HST 2010, 2010,
artefacts. We still developing technique to make pp. 120–126.
[8] B. Albelooshi, K. Salah, T. Marin, and A. Bentiba, “Assess-
fake artefacts believable. ing Overhead Cost Associated with Encrypting Swap File,”
Vulnerability: Possibility of data leak. If we do in IEEE 11th International Conference on Trust, Security
not careful when creating fake artefacts, data leak and Privacy in Computing and Communications, 2012.
[9] T. Haruyama and H. Suzuki, “One-byte modification for
will occurs. Still vulnerable to live acquisition. breaking memory forensic analysis.” Blackhat Europe,
Like many anti-forensics techniques our proposed 2012.
techniques still can not defeat live acquisition. [10] M. Gruhn, “Windows nt pagefile. sys virtual memory anal-
ysis,” in IT Security Incident Management & IT Forensics
Complexity: User create own program, script and (IMF), 2015 Ninth International Conference on. IEEE,
prepare fake artefacts. 2015, pp. 3–18.
[11] M. Cohen, “Windows Virtual Address Translation and
the Pagefile,” 2014. [Online]. Available: http://www.
rekall-forensic.com/posts/2014-10-25-pagefile.html
V. C ONCLUSION [12] J. Stüttgen and M. Cohen, “Anti-forensic resilient
memory acquisition,” Digital Investigation, vol. 10, no.
We made list of anti-forensics techniques for SUPPL., pp. S105–S115, 2013. [Online]. Available:
http://dx.doi.org/10.1016/j.diin.2013.06.012
swap file, its advantages and disadvantages, vul-
nerability, data leak and complexity. We found that
most of anti-forensics techniques are still vulnerable
to live acquisition We successfully implementing 2
simple anti-forensics techniques. Inject live swap
file is created by injecting(flooding) fake data to live
swap file using a custom script. Fake swap is created
by manipulate swap file header then filling swap file
with fake artefacts of our choosing. Our method is
still very simple and need further improvement.
R EFERENCES
[1] W. Stallings, Operating Systems: Internals and Design
Principles (7th Edition). Prentice Hall, 2011, vol. 68.
[2] G. G. Richard and A. Case, “In lieu of swap :
Analyzing compressed RAM in Mac OS X and Linux,”
Digital Investigation, vol. 11, pp. S3–S12, 2014. [Online].
Available: http://dx.doi.org/10.1016/j.diin.2014.05.011
[3] S. L. Garfinkel, “Digital media triage with bulk data
analysis and bulk-extractor,” Computers and Security,
vol. 32, pp. 56–72, 2013. [Online]. Available: http:
//dx.doi.org/10.1016/j.cose.2012.09.011