Netskope is recognized as a Leader again in the Gartner® Magic Quadrant™ for SASE Platforms. Get the Report

close
close
Your Network of Tomorrow
Your Network of Tomorrow
Plan your path toward a faster, more secure, and more resilient network designed for the applications and users that you support.
Experience Netskope
Get Hands-on With the Netskope Platform
Here's your chance to experience the Netskope One single-cloud platform first-hand. Sign up for self-paced, hands-on labs, join us for monthly live product demos, take a free test drive of Netskope Private Access, or join us for a live, instructor-led workshops.
A Leader in SSE. Now a Leader in Single-Vendor SASE.
Netskope is recognized as a Leader Furthest in Vision for both SSE and SASE Platforms
2X a Leader in the Gartner® Magic Quadrant for SASE Platforms
One unified platform built for your journey
Securing Generative AI for Dummies
Securing Generative AI for Dummies
Learn how your organization can balance the innovative potential of generative AI with robust data security practices.
Modern data loss prevention (DLP) for Dummies eBook
Modern Data Loss Prevention (DLP) for Dummies
Get tips and tricks for transitioning to a cloud-delivered DLP.
Modern SD-WAN for SASE Dummies Book
Modern SD-WAN for SASE Dummies
Stop playing catch up with your networking architecture
Understanding where the risk lies
Advanced Analytics transforms the way security operations teams apply data-driven insights to implement better policies. With Advanced Analytics, you can identify trends, zero in on areas of concern and use the data to take action.
Netskope Technical Support
Netskope Technical Support
Our qualified support engineers are located worldwide and have diverse backgrounds in cloud security, networking, virtualization, content delivery, and software development, ensuring timely and quality technical assistance
Netskope video
Netskope Training
Netskope training will help you become a cloud security expert. We are here to help you secure your digital transformation journey and make the most of your cloud, web, and private applications.

GitHub Pages Spread Ramnit

Oct 04 2019

Netskope Threat Protection recently blocked several GitHub Pages sites that were infected by Ramnit. This post explores how these sites came to be infected by Ramnit and discusses the  potential reach an attacker has when they compromise a GitHub repository. 

Disclosure

Netskope reported the accounts infected with Ramnit to GitHub on 3 October 2019.

GitHub pages

GitHub Pages are public web pages usually hosted on GitHub’s github.io domain at a URL formatted ‘username.github.io’. GitHub Pages also comes with a powerful static site generator called Jekyll. Jekyll uses templates to convert markdown into static HTML content as shown in Figure 1.

Figure 1: GitHub pages

 Ramnit

Ramnit is a file-infector and a worm that copies itself to removable drives and infects .exe, .dll, .htm and .html files. There are also some variants of the malware family that open a back door on the compromised computer. Though the global footprint of the Ramnit botnet was dismantled in 2015, it continues to remain one of the most predominant malware due to its wormed file infector nature.

Technical Analysis

Ramnit infects .exe, .dll, .htm and .html files. If the victim of a Ramnit infection has also cloned their GitHub Pages repository, the HTML template files in the repository will also be infected. 

When Jekyll generates the HTML pages from the infected templates, the resulting webpages are also infected. As a result, each of the generated pages on the generated site  username.github.io contain multiple traces of the Ramnit infection. An excerpt of the infected code (containing an ActiveX script) is shown in Figure 2.

Figure 2: Ramnit code appended in the infected HTML page

Upon visiting this website in Internet Explorer (ActiveX is only supported in IE), the victim is prompted with a message to enable Microsoft script Runtime ActiveX control as shown in Figure 3. 

Figure 3:  Microsoft script Runtime ActiveX control

When the script runs, it drops the Ramnit payload in the %temp% folder as svchost.exe thereby continuing its infection kill chain.

Netskope Detection

Netskope’s Next-Gen SWG detects and blocks the Ramnit infected page. Additionally, Netskope Threat protection also detects the upload and download activity of infected Ramnit HTML pages over GitHub as Trojan.Dropper.VBS.Q.

Conclusion

This post details the lateral movement of Ramnit from an infected machine to public GitHub pages. This is an interesting attack vector because: 

  • Github pages are public and therefore can infect any users on the internet
  • Github is typically part of normal business operations and repositories are typically shared among teams, which opens up opportunities for the infection to spread within an organization.

This example of Ramnit-infected HTML pages is limited in scope because it only affects IE, but it serves as an example of how any infector might spread through GitHub pages. The potential for infection could have been greater if it had been more similar to a supply chain attack —  if one of the popular Jekyll template repositories had been compromised — or if a more widely used repository was infected. A file infector with a wider scope than just targeting IE with an ActiveX script could have also spread more aggressively. To protect against attacks compromising source code on GitHub, it is very important to have the required security tooling. Netskope’s CASB can help prevent malicious code from being shared and pushed to GitHub.

Indicators of Compromise

URLs

onedayonedot[.]github.io

hashub[.]github.io

author image
Ashwin Vamshi
Ashwin Vamshi is a Security Researcher with innate interest in targeted attacks and malwares using cloud services.
Ashwin Vamshi is a Security Researcher with innate interest in targeted attacks and malwares using cloud services.
Connect with Netskope

Subscribe to the Netskope Blog

Sign up to receive a roundup of the latest Netskope content delivered directly in your inbox every month.