Covering Your Tracks - Anti-forensics for the Cloud - Introduction


Before delving into cloud forensics there are some concepts that need to be explained. The cloud consisted of two entities, provider (companies that host cloud technologies) and tenants (companies that use cloud technologies from the providers). The cloud generally consists of three service models: 

  1. Infrastructure-as-a-Service (IaaS) where the provider provides the hardware and network.
  2. Platform-as-a-Service (PaaS) where the provider provides all the components to a tenant's application.
  3. Software-as-a-Service (SaaS) where the provider supplies the software and the components to run it and the tenant uses and at most configures the application.

Chris Brenton gives a great overview of the cloud and the challenges it poses in the link below:
Surprisingly there is not a lot of coverage out on the web for cloud forensics and this makes sense. Cloud forensics analysts, especially for tenants, may be somewhat limited on access. In example, if a forensic analyst is hired by a tenant, its not likely that the forensic analyst will be able to go to the cloud provider and have access to their servers; at least not without a court order or the provider’s approval. This requires forensic analysts to become familiar with the cloud vendor and to be creative. A great place to start an investigation is to look at the logs the virtual machine.
For Ubuntu Server, the logs may be found in the path /var/log directory as shown below:
















Figure 1
On AWS Ubuntu Server instance nano is installed and the grep command may be used to search for ssh connections. The image below is very peculiar (I did not generate these connections myself; someone is trying to brute force log into my ip). The auth.log in the image below shows sshd Authorization Logins which appears to contain many invalid attempts:


















Figure 2
A great article for learning more about ubuntu logs can be found below. Using grep and nano, a forensic investigator can check many logs such as the apache web server logs and see the activity for the virtual machine:
For windows it is the same concept except with event viewer. A quick Google search on Microsoft’s technet forums and discussion will get you up to speed on how search the Microsoft’s logs for unauthorized connections. In AWS’s case (as I’m sure it is with other cloud vendors) log sources such as CloudTrail, CloudWatch, the Resource Config Logs, and Data/Object Access Logs can also be set up and the links below are a good resource on how to do this:
SANS DFIR AWS Forensics Overview: https://www.youtube.com/watch?v=VLIFasM8VbY
The anti-forensics techniques of deleting the auth.log or .bash_history or copying the files and then replacing them and modifying them with the touch command can be done in this case. On my ubuntu server this does not appear to have been done which tells me that there has not been a successful log in attempt (I also verified this in auth.log). While leveraging your virtual machine’s and cloud provider’s logging capabilities, this is not the only thing that can be done.
A lot of cloud providers allow for snapshots to be taken and this can be great for acquisitioning evidence. According to Hartman, AWS allows EBS volume snapshots to be encrypted to prevent sensitive data from being leaked. It is also possible to provision a forensic workstation on AWS. Hartman provided the following steps in his paper (Hartman, 2018, pp. 7-8):
  1. Log into AWS.
  2. Launch an EC2 instance of Ubuntu Server 16.04
  3. Choose a instance type of t2.large or larger.
  4. Create a security group and configure it so the only ingress rule is to allow SSH from external IP addresses. Egress rule should be left as default.
  5. Choose an SSH key by either generating it or using an existing one.
  6. SSH into the instance with the appropriate key.
  7. Run the following commands:
    wget https://github.com/sans-dfir/sift-cli/releases/download/v1.5.1/sift-cli-linux
  8. Move and rename the SIFT Install tool:
    sudo mv sift-cli-linux/usr/local/bin/sift
  9. Set proper permissions:
    sudo chmod 755 /usr/local/bin/sift
    sudo sift install

Once the SIFT workstation is installed evidence may be mounted to it. This allows for forensic analysts to acquire evidence they need for an investigation without having direct access to the cloud vendor’s servers.
The same anti-forensic techniques discussed in the previous blogs can be applied the same to the cloud. In this scenario, it is the forensic analysts who are at somewhat at a disadvantage when doing forensics on the cloud, however, the references below should make a forensic analyst’s life easier. Cloud forensics is a vast topic and deserves its own book (which could probably be found on the internet) so keep researching and happy hacking! 
References
Amazon Web Services. (2020). Amazon S3 Server Access Logging [software]. Retrieved from
            https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerLogs.html
Brenton, C. (2012, July 5). Pen Testing in the Cloud. Retrieved from
            https://pen-testing.sans.org/blog/2012/07/05/pen-testing-in-the-cloud
Hartman, K. (2018, January). Digital Forensic Analysis of Amazon Linux EC2 Instances.
Retrieved from https://www.sans.org/reading-room/whitepapers/cloud/digital-forensic-analysis-amazon-linux-ec2-instances-38235
Poling, J. (2017, September 20). Incident Response in the Cloud (AWS) – SANS Digital
            Forensics & Incident Response Summit 2017 [Video file]. Retrieved from
            https://www.youtube.com/watch?v=VLIFasM8VbY

Comments

Popular posts from this blog

Covering Your Tracks

LDAP Vulnerabilities

Setting Up a Proxy to Protect Your Public IP (An Introduction to Proxies)