Every day, more and more Splunk customers are moving from on-prem to Splunk Cloud. While this move simplifies architecting and cuts down on server admin costs, it also makes it more difficult for Splunk admins to install new and existing custom apps (read non-Splunkbase). All apps in Splunk cloud must pass a vetting process called AppInspect. Without understanding the inner workings of the AppInspect process, the task of making an on-prem custom app Splunk Cloud compliant can be tedious and time consuming. This guide will give step-by-step instructions to get your custom app to pass the FIRST time. By the end, you’ll have a cloud app template you can use for other custom apps.
Download Splunk Add-on Builder
To get started, it is recommended to download the Splunk Add-On Builder and start by using the default add-on as a template. It contains the bare essential directories and files expected by the app vetting process (plus some extraneous files that can be removed).
After downloading the app, navigate to the home page under Apps>Splunk Add-on Builder and click New Add-on on the far right. Enter the name of your app, and optionally edit the directory name as needed.
The resulting custom app will be created under $SPLUNK_HOME/etc/apps.
Prep the App
Next the app will need to be prepped in order to pass AppInspect. These are the most common items that must be addressed for apps to pass (easiest to do these from the command line. Assume that the working directory for all steps is “$SPLUNK_HOME/etc/apps/”):
Remove addon_builder.conf in the app’s default directory
Move the auto-generated app.conf from local to default a. It’s recommended to use the auto-generated one, even if there is already an app.conf in the existing version of the custom app.
Modify the auto-generated app.conf to clear errors and warnings a. Check that the package attribute and stanza already exist. Create them if they do not: [package] id = <custom_app_directory_name> b. Add the following additional id stanza and attributes anywhere in app.conf: [id] id = <custom_app_directory_name> name = <custom_app_directory_name> version = x.x.x *Make sure the version numbers are the same if they are listed multiple times.
Ensure that app.manifest to matches what’s in app.conf a. Check the first block of json and ensure that “info.title”, “info.id.name”, and “info.id.version” have values that match what’s in app.conf.
Remove the local directory (double check that it’s empty first!)
Add binaries/conf files a. Be sure to place any executables in “bin/” and all Splunk configurations in “default/”
Edit default.meta with necessary permissions a. The “admin” role is not available in Splunk cloud, so every reference in must be changed to “sc_admin”, which is the Splunk cloud equivalent. b. If the original custom app has a local.meta, it must be merged into default.meta.
Change permissions on app directories/files and compress the app a. All files must be changed to allow others to read, while all directories must allow others to read/write. b. On Linux/macOS, this equates to 755 for directories and 644 for files. c. Once the permissions are correct, compress the custom app into a .tgz or tar.gz archive. i. Note: if this is done on a mac, be sure to exclude any “__MACOSX” files. The command line options for this can vary depending on the current macOS version.
Install in Splunk Cloud
The new custom app is ready to be installed. Navigate to Apps>Manage Apps>Uploaded Apps>Upload app on the desired search head in Splunk cloud and select the custom app archive. Splunk will automatically run the app through AppInspect and create a report of its findings before installation, which can be viewed by clicking the “View Report” link in the pop-up window. If there are no issues, Splunk Cloud will give the option to install the package.
Note: It is recommended to also clear all warnings, even though the app can still technically be installed with warnings present.
Here are some of the most common “gotchas” to look out for:
If the custom app contains scheduled reports within savedsearches.conf, make sure that they are disabled before vetting. To do this, ensure that every instance of “enableSched” is set to 0 or false.
Same with any data models in datamodels.conf – ensure that “acceleration = false” or “acceleration = 0”
If the app utilizes an SDK, ensure that it’s updated to the latest version.
And that’s it! By following this guide, you’ll be able to filter out the most common failures when building a custom app for Splunk Cloud. Depending on the complexity of the custom app, there may be additional failures to address in the custom config files.
Let’s face it, the digital landscape is always changing. Technology keeps evolving, and businesses are constantly looking for ways to optimize operations, cut costs, and stay agile. That’s where AWS Lambda and EventBridge come in. They have the power to revolutionize your business processes through serverless automation. So, hop on board as we embark on a journey that will show you how these technologies can streamline integration, improve scalability and boost operational efficiency.
Serverless Automation
What is serverless automation, you ask? It’s a game-changing approach that combines the best of serverless computing with the magic of automation. With serverless automation, you can automate tasks, workflows, and integrations without the need for manual intervention or the hassle of managing infrastructure. Thanks to nifty tools like AWS Lambda and EventBridge, businesses can achieve seamless automation, real-time data processing, and make agile decisions that drive success.
In the past, businesses had to rely on manual processes, batch jobs, or clunky custom-built solutions to automate operations. Those approaches (mostly) worked, but came with their fair share of complexities, maintenance headaches, and limited scalability. Enter serverless automation, the superhero of the automation world. It offers a scalable, event-driven architecture that can handle all your business events, triggers, and data processing needs with remarkable efficiency.
So, why should you embrace the benefits of serverless architecture? Well, it’s all about automatic scaling, reduced infrastructure management, and the beauty of pay-per-use pricing models. Picture this: with serverless architecture, your business can effortlessly scale up or down based on demand, ensuring top-notch performance while keeping costs in check. Say goodbye to the burden of server management, and hello to the freedom to focus on your core objectives, drive innovation, and deliver real value to your customers. And let’s not forget the cherry on top – pay only for the resources you actually use rather than over-provisioned downtime, maximizing cost efficiency and financial flexibility.
AWS Lambda
Now, let’s dive into the heart of the matter: AWS Lambda, the superhero of business automation. With AWS Lambda, you get a serverless compute service that lets you run your code without worrying about provisioning or managing servers. It’s like having a magic wand that can automate a wide range of business processes – from data processing to file transformations, image resizing, and more. The result? Faster time-to-market, improved scalability, and reduced operational headaches.
But wait, there’s more! Enter EventBridge, the trusty sidekick of serverless automation. EventBridge acts as a central event bus that seamlessly integrates your applications and systems. It’s the master of event-driven automation, effortlessly streamlining workflows and making real-time data processing a breeze. With EventBridge, you can capture and respond to events from various sources – think AWS services, third-party applications, and your own custom systems. It’s the secret sauce that allows you to automate processes, trigger actions, and achieve that seamless integration you’ve always dreamed of.
Use Cases
Now, let’s take a look at some real-world use cases where serverless automation can save the day. Imagine optimizing your order processing with the power of Lambda and EventBridge. Orders fly through the system, automatically validated, inventory updates happening in real-time, and notifications swiftly sent to customers and stakeholders. All of this creates a smooth, efficient order management process that’ll have your customers singing your praises.
Workflow orchestration with Lambda and EventBridge become a piece of cake as tasks get routed, approvals happen like magic, and notifications are sent – all within a seamlessly automated workflow. Say goodbye to manual effort and hello to efficient collaboration and task execution. It’s workflow orchestration taken to a whole new level.
Real-Time Data Analytics
Finally, let’s talk about real-time data analytics. Picture Lambda and EventBridge at work, capturing and processing data events in real-time. The result? Immediate analysis, data-driven decision-making, and actions triggered on the fly. You’ll be making informed decisions faster than ever before, allowing you to proactively respond to changing business conditions where time and efficiency are paramount.
With serverless automation, you take advantage of the power of scalability that dynamically allocates resources based on demand, ensuring optimal performance and cost efficiency. Say goodbye to operational headaches and hello to the freedom to focus on your core objectives. And let’s not forget the magic of seamless integration, courtesy of event-driven architectures powered by Lambda and EventBridge. You’ll have a harmonious ecosystem where applications, systems, and services come together to work cohesively, on your behalf.
Conclusion
In conclusion, get ready to embark on a transformative journey with serverless automation. We’ve got the power of AWS Lambda and EventBridge at our fingertips, ready to streamline your business processes, supercharge your scalability, and achieve that seamless integration you’ve always dreamed of. Partner with TekStream Solutions and let our experience pave the way to operational efficiency and success.
Splunk’s Compliance Essentials provides several features that can help organizations meet the requirements of various compliance frameworks. This app comes pre-packaged with a library of compliance practices, dashboards that can be used to monitor compliance status & track progress, and reports that can be used to demonstrate compliance to auditors.
After a fresh installation, the app will direct you to the App Initial Setup Page to select a framework. You can also select multiple frameworks if more than one is applicable to your organization. Compliance Essentials addresses the requirements for the following five frameworks:
Cybersecurity Maturity Model Certification (CMMC)
Defense Federal Acquisition Regulation Supplement (DFARS)
Federal Information Security Modernization Act (FISMA)
Risk Management Framework (RMF)
Office of Management (OMB) M-21-31
This blog will provide a general overview of the features and benefits of the app, which is available for free on Splunkbase.
Overview Pages
The overview pages provide a high-level overview of your audit and continuous monitoring program. The Domain Overview page displays a selection of domains, each of which drills down into a Practice Overview page. The Practice Overview page, in turn, displays a selection of dashboards that provide more detailed information about the status of the program. For a single pane of glass view, the Executive Overview dashboard provides a top-down view of the status of the various audit review entries across the full scope of the solution.
Practice Dashboards
Compliance Essentials uses lookups and KV Store collections to map content to different controls. It also relies on data models to ensure that pre-built dashboards are populated correctly. The app comes with a robust library of more than 50 dashboards that align with OMB requirements, more than 100 dashboards that align with DFARS practices, more than 170 dashboards that align with CMMC practices, more 300 dashboards that align with FISMA practices and 2,900+ dashboards that align with RMF practices.
Custom Content
The Custom Content page in Compliance Essentials includes a list of custom dashboard panels which can be added to already existing dashboards. These panels are organized by practice and domain, making it easy to locate the panels you need. To add a panel to a dashboard, simply click on the “Add to dashboard” button. The panel will then be added to the corresponding dashboard. The solution includes over 300 custom panels that can be added to dashboards, in addition to the panels that ship out-of-the-box. This gives you a wide range of options to customize the dashboards to meet your specific needs and make them more informative and useful.
Adding Records
Users can also add records to each dashboard, making it easier to store relevant documentation and artifacts directly within Splunk. This is especially useful for practices that are documented or policy-driven, as it eliminates the need to search for artifacts in multiple locations.
Audit Entries
Each dashboard has an audit entry capability that allows you to view, manage, and create audit entries. This workflow can be used by your internal teams to track comments and feedback from reviews, verify compliance status, and set follow-up review dates.
Solution Activity
The Solution Activity page allows you to track the app’s activity and utilization, as well as audit the auditor’s work. It also provides monitoring capabilities for your audit and continuous monitoring program, both in terms of activities and overall trends.
Conclusion
Splunk’s Compliance Essentials is a one-stop shop that can help organizations improve their compliance posture by providing a centralized view of all their compliance data. This can help organizations to identify potential compliance gaps and track their progress towards compliance. If you are looking for a way to improve your organization’s compliance posture, contact us for more information on implementing Compliance Essentials into your environment.
By Bryan Bollou, Team Lead, Cybersecurity Engineering
Introduction
Confirmed to have been in use since February 2020, the Conti Ransomware has made a resurgence with a newer APT – MeowCorp. The ransomware’s code was originally leaked by an alleged Ukrainian hacker after the group publicly expressed support for Russia during the Russia-Ukraine war. With the code public, many other ransomwares have used its code as a base while many decryptors have been built from it at the same time. Being one of the copycats, the MEOW! ransomware shares many all the Conti characteristics from its use of ChaCha20 and RSA-4096 to encrypt files to dropping a ransom note named “readme.txt”.
What is unique about this malware is this use of leaked source code for generating novel ransomware variants. This is a recent phenomenon, which simplifies the process for hackers to produce and spread new strains of ransomware. Such attacks can be disruptive and costly for organizations. The worst outcomes being the potential loss of crucial data and system access, often necessitating the payment of a ransom to regain access.
Threat Overview
The attacks using the Conti-based Ransomware from MeowCorp has been acknowledged by many cyber threat researchers including Kaspersky. Kaspersky has released a free decryptor for the ransomware linked here: https://support.kaspersky.com/common/disinfection/10556#block1
NOTE: If you suspect your machine has been infected by ransomware, please follow good security practices, and escalate it to your information security team. Do not attempt to decrypt your files without the supervision of this team.
Various mitigation steps to prevent a successful attack from MeowCorp are as follows;
Having regularly scheduled phishing simulations, routine education, and awareness training
Having communication on MFA fatigue and web browser hygiene
If MeowCorp IOCs are discovered, prioritize and block all indicators attributed to the threat actors and attacks
Ensure all workstations and servers had endpoint protection that is up-to-date
So far, we have seen many good options and would like to present a few more specific cases using everyone’s favorite SIEM, Splunk.
The goal here is to aggregate the detections to maximize your chances of detecting this critical attack. A part of that is gathering the list of IOCs scattered in multiple locations on the internet and looking at activity that could point to the MeowCorp Ransomware exploitation. Here at TekStream, we have several security engineers that are intimate with cybersecurity knowledge and especially the logs of our clients.
In this blog post, we go through the various steps in the MeowCorp Ransomware exploitation and detection. With this format, we are providing a more generic data model “tstats” command. This is taking advantage of the data model to quickly find data that may match our IOC list. We then provide examples of a more specific search that will add context to the first find. There will be a wide variety of specific searches as each client has their own specific technologies. To get help building detection for your specific client, fill in the form below and get access to our Splunk/security expertise.
Note: This blog is purely focused on discovering IOCs related to the MeowCorp Ransomware. Determining the correct actions in your environment to take once a ransomware infection is an intensive process. This incident response is not covered in this blog post. Reach out to TekStream by filling out the form below if you’d like specific guidance on that aspect. TekStream MeowCorp IOC List
The following detection steps mirror the stages and TTP-related indicators used in the attack:
Detect emails to and from any known addresses associated with the MeowCorp or use of the Conti ransomware
Detect connection to any domains for either C2C communications or malicious domains for drive-by downloads
Detect the existence of any of the file and/or processes hashes related to the MeowCorp ransomware
Detect the existence of any file extensions associated with the MeowCorp Ransomware
Detect the C2C communications to known IP addresses related to the MeowCorp ATP.
Threat Implication
There are many ways the MeowCorp ransomware can infect an environment. The most common ways the malware was discovered in the wild are as follows;
Infected email attachments distributed as part of phishing campaigns
Macros in infected documents (e.g.; word docs, spreadsheets)
Torrent websites
Malicious ads
Threat Detection
Step 1
Detect emails to and from any known addresses associated with the MeowCorp or use of the Conti ransomware. This detection is important in for two reasons – you can detect a possible or a confirmed exploitation attempt. If an employee’s workstations gets infected, they may be drive to reach out to the preparator to resolve the issue without sounding the alarm.
Actions Detect
Detect the any incoming or outgoing communications to the following email addresses and telegram accounts. The accounts are listed below:
SPL
SPL – Detect outgoing/incoming emails to known malicious address using Email Datamodel
| tstats `summariesonly` max(_time) as _time, values(All_Email.protocol) as protocol, values(All_Email.recipient) as recipient, count from datamodel=Email.All_Email where All_Email.src_user IN ("@meowcorp123","@meowcorp2022","amagnus@india[.]com","bitcoin143@india[.]com","braker@plague[.]life","byaki_buki@aol[.]com","byaki_buki@aol[.]com_mod2","crannbest@foxmail[.]com","cryptolocker@aol[.]com","cryptolocker@aol[.]com_graf1","cryptolocker@aol[.]com_mod","funa@india[.]com","grafdrkula@gmail[.]com","iizomer@aol[.]com","ivanivanov34@aol[.]com","lavandos@dr[.]com","load180@aol[.]com","meowcorp2022@aol[.]com","meowcorp2022@proton[.]me","meowcorp@msgsafe[.]io","meowcorp@onionmail[.]org","mkgoro@india[.]com","moshiax@aol[.]com","oduvansh@aol[.]com","pay4help@india[.]com","seven_Legion2@aol[.]com","stopper@india[.]com","trojanencoder@aol[.]com","vpupkin3@aol[.]com","watnik91@aol[.]com","webmafia@asia[.]com","worm01@india[.]com") All_Email.recipient IN ("@meowcorp123","@meowcorp2022","amagnus@india[.]com","bitcoin143@india[.]com","braker@plague[.]life","byaki_buki@aol[.]com","byaki_buki@aol[.]com_mod2","crannbest@foxmail[.]com","cryptolocker@aol[.]com","cryptolocker@aol[.]com_graf1","cryptolocker@aol[.]com_mod","funa@india[.]com","grafdrkula@gmail[.]com","iizomer@aol[.]com","ivanivanov34@aol[.]com","lavandos@dr[.]com","load180@aol[.]com","meowcorp2022@aol[.]com","meowcorp2022@proton[.]me","meowcorp@msgsafe[.]io","meowcorp@onionmail[.]org","mkgoro@india[.]com","moshiax@aol[.]com","oduvansh@aol[.]com","pay4help@india[.]com","seven_Legion2@aol[.]com","stopper@india[.]com","trojanencoder@aol[.]com","vpupkin3@aol[.]com","watnik91@aol[.]com","webmafia@asia[.]com","worm01@india[.]com") by All_Email.src,All_Email.src_user,All_Email.dest | `drop_dm_object_name("All_Email")` | sort - count | fields _time, protocol, src, src_user, dest, recipient, count
Step 2
Detect connection to any domains for either Command-and-Control communications or malicious domains for drive-by downloads. There are many websites and domains associated with the Meow Ransomware ranging from credential harvesting sites, malware remote session sites, sites to buy decryptors, C2C domains, etc. Any attempt (successful or not) to these known malicious domains is a sign of a potential infection.
Actions Detect
Any successful or failed connection attempts to the following domains:
SPL
SPL 1 – Detect C2 and Malicious Domains using the Web Data Model
| tstats `summariesonly` sum("Web.bytes") as bytes,values("Web.http_content_type") as http_content_type,values("Web.http_method") as http_method,values("Web.http_user_agent") as http_user_agent,values("Web.status") as status from datamodel="Web"."Web" by "Web.src", "Web.dest", "Web.user", "Web.http_referrer", "Web.url", _time | `drop_dm_object_name("Web")` | where match(url, "(?i) (anonfiles[.]com)|(badiwaw[.]com)|(balacif[.]com)|(barovur[.]com)|(basisem[.]com)|(bimafu[.]com)|(bujoke[.]com)|(buloxo[.]com)|(bumoyez[.]com)|(bupula[.]com)|(cajeti[.]com)|(cilomum[.]com)|(codasal[.]com)|(comecal[.]com)|(contirecj4hbzmyzuydyzrvm2c65blmvhoj2cvf25zqj2dwrrqcq5oad.[]]onion)|(contirecovery[.]top)|(dawasab[.]com)|(derotin[.]com)|(dihata[.]com)|(dirupun[.]com)|(dohigu[.]com)|(dubacaj[.]com)|(fecotis[.]com)|(fipoleb[.]com)|(fofudir[.]com)|(fulujam[.]com)|(ganobaz[.]com)|(gerepa[.]com)|(gucunug[.]com )|(guvafe[.]com)|(hakakor[.]com)|(hejalij[.]com)|(hepide[.]com)|(hesovaw[.]com)|(hewecas[.]com)|(hidusi[.]com)|(hireja[.]com)|(hoguyum[.]com)|(jecubat[.]com)|(jegufe[.]com)|(joxinu[.]com)|(kelowuh[.]com)|(kidukes[.]com)|(kipitep[.]com)|(kirute[.]com)|(kogasiv[.]com)|(kozoheh[.]com)|(kuxizi[.]com)|(kuyeguh[.]com)|(lipozi[.]com)|(lujecuk[.]com)|(masaxoc[.]com)|(mebonux[.]com)|(mihojip[.]com)|(modasum[.]com)|(moduwoj[.]com)|(movufa[.]com)|(nagahox[.]com)|(nawusem[.]com)|(nerapo[.]com)|(newiro[.]com)|(paxobuy[.]com)|(pazovet[.]com)|(pihafi[.]com)|(pilagop[.]com)|(pipipub[.]com)|(pofifa[.]com)|(radezig[.]com)|(raferif[.]com)|(ragojel[.]com)|(rexagi[.]com)|(rimurik[.]com)|(rinutov[.]com)|(rusoti[.]com)|(sazoya[.]com)|(sidevot[.]com)|(solobiv[.]com)|(sufebul[.]com)|(suhuhow[.]com)|(sujaxa[.]com)|(tafobi[.]com )|(tepiwo[.]com)|(tifiru[.]com)|(tiyuzub[.]com)|(tubaho[.]com)|(vafici[.]com)|(vegubu[.]com)|(vigave[.]com)|(vipeced[.]com)|(vizosi[.]com)|(vojefe[.]com)|(vonavu[.]com)|(wezeriw[.]com)|(wideri[.]com)|(wudepen[.]com)|(wuluxo[.]com)|(wuvehus[.]com)|(wuvici[.]com)|(wuvidi[.]com)|(xegogiv[.]com)|(xekezix[.]com)” | fields _time src, dest, user, http_referrer, url, http_content_type, http_method, http_user_agent, status, bytes | eval ip_pair = src . " - " . dest | stats values(_time) as Time values(ip_pair) AS src_dest, values(user) as user, values(http_referrer) as http_referrer, values(http_user_agent) as http_user_agent, values(http_method) as http_method, values(status) as status, values(bytes) as bytes count by url | fieldformat Time = strftime(Time,"%m/%d/%Y %T")
Note: The malicious domains have been kept sanitized using “[.]” for the periods, please remove these when running the SPL. Please be careful not to navigate to them outside a sandbox.
SPL 2 – Detect C2 and Malicious Domains using the DNS Data Model
| tstats `summariesonly` latest(_time) as _time values("DNS.dest") as dest, values("DNS.query") as query, values("DNS.query_count") as query_count, values("DNS.message_type") as message_type, values("DNS.answer") as answer, values("DNS.reply_code") as reply_code from datamodel="Network_Resolution"."DNS" where DNS.query IN ("anonfiles[.]com","badiwaw[.]com","balacif[.]com","barovur[.]com","basisem[.]com","bimafu[.]com","bujoke[.]com","buloxo[.]com","bumoyez[.]com","bupula[.]com","cajeti[.]com","cilomum[.]com","codasal[.]com","comecal[.]com","contirecj4hbzmyzuydyzrvm2c65blmvhoj2cvf25zqj2dwrrqcq5oad.[]]onion","contirecovery[.]top","dawasab[.]com","derotin[.]com","dihata[.]com","dirupun[.]com","dohigu[.]com","dubacaj[.]com","fecotis[.]com","fipoleb[.]com","fofudir[.]com","fulujam[.]com","ganobaz[.]com","gerepa[.]com","gucunug[.]com ","guvafe[.]com","hakakor[.]com","hejalij[.]com","hepide[.]com","hesovaw[.]com","hewecas[.]com","hidusi[.]com","hireja[.]com","hoguyum[.]com","jecubat[.]com","jegufe[.]com","joxinu[.]com","kelowuh[.]com","kidukes[.]com","kipitep[.]com","kirute[.]com","kogasiv[.]com","kozoheh[.]com","kuxizi[.]com","kuyeguh[.]com","lipozi[.]com","lujecuk[.]com","masaxoc[.]com","mebonux[.]com","mihojip[.]com","modasum[.]com","moduwoj[.]com","movufa[.]com","nagahox[.]com","nawusem[.]com","nerapo[.]com","newiro[.]com","paxobuy[.]com","pazovet[.]com","pihafi[.]com","pilagop[.]com","pipipub[.]com","pofifa[.]com","radezig[.]com","raferif[.]com","ragojel[.]com","rexagi[.]com","rimurik[.]com","rinutov[.]com","rusoti[.]com","sazoya[.]com","sidevot[.]com","solobiv[.]com","sufebul[.]com","suhuhow[.]com","sujaxa[.]com","tafobi[.]com ","tepiwo[.]com","tifiru[.]com","tiyuzub[.]com","tubaho[.]com","vafici[.]com","vegubu[.]com","vigave[.]com","vipeced[.]com","vizosi[.]com","vojefe[.]com","vonavu[.]com","wezeriw[.]com","wideri[.]com","wudepen[.]com","wuluxo[.]com","wuvehus[.]com","wuvici[.]com","wuvidi[.]com","xegogiv[.]com","xekezix[.]com")| table _time, dest, query, query_count, message_type, answer, reply_code | fieldformat Time = strftime(_time,"%m/%d/%Y %T")
Note: The malicious domains have been kept sanitized using “[.]” for the periods, please remove these when running the SPL. Please be careful not to navigate to them outside a sandbox.
Step 3
Detect the existence of any of the file and/or processes hashes related to the MeowCorp ransomware. There are tons of known hashes associated with this malware. This comes from samples submitted from victims, samples identified by researchers in sandbox environments and even data from the Conti ransomware leak.
Actions Detect
The existence of any of the known hashes associated with the MeowCorp ransomware. This points to a potential infection and the hashes are as follows:
SPL
SPL – Detect existence of malicious hashes using the Endpoint Datamodel
| tstats `summariesonly` latest(_time) as _time, latest(Filesystem.file_create_time) as file_create_time, latest(Filesystem.file_modify_time) as file_modify_time, latest(Filesystem.file_access_time) as file_access_time, values(Filesystem.dest) as dest, values(Filesystem.action) as action, values(Filesystem.file_name) as file_name, values(Filesystem.file_hash) as file_hash, values(Filesystem.file_path) as file_path, values(Filesystem.file_size) as file_size from datamodel="Endpoint"."Filesystem" where Filesystem.file_hash IN ("222e2b91f5becea8c7c05883e4a58796a1f68628fbb0852b533fed08d8e9b853","fe311979cd099677b1fd7c5b2008aed000f0e38d58eb3bfd30d04444476416f9","7f624cfb74685effcb325206b428db2be8ac6cce7b72b3edebbe8e310a645099","5a936250411bf5709a888db54680c131e9c0f40ff4ff04db4aeda5443481922f","7f6421cdf6355edfdcbddadd26bcdfbf984def301df3c6c03d71af8e30bb781f","b5b105751a2bf965a6b78eeff100fe4c75282ad6f37f98b9adcd15d8c64283ec","938cbbf9061792b6fc9bd2440b8a93f2db1139212f73e4fde30499568cbe75ea","c4c5b77cceb82cd9b5f5e839136313e2fbfc97db731b162bc2e250d10fd62c1a","3460d66ff62bfccae55a26b499de0f18fc4b2d6efd2283b0278385269b047973","8ac29ab81c98c1b094aa0986a0e66c7473d5b6b7153f7b34ae0e0215eb474e66","e6f6fde7839a21807a321b79ac1395489c0eeea9b9187ba4d20c17559ccef608","c0941c7c8d162d60f73d56aefe36647a31575a5077392202015f480453024a6b","84b8c65ba4cf18f852fd435fc9210f108b090dcd5cc69cf3beaaebff6b8cec2c","0252a7441f7a2595add46aa89b4bf7d0b5e5a9eb4683550907b03c5917ece5bd","fca83ce362e14648eb729547e14b06a7f402c98cce2c96a9ab47bf676755bd02","4f0a7bf521f979afa947001eedd8b18a1ecd1994e1ae0ed90d65739de662684b","78d588aad48812f4421c22eeccee1a5b0499c41ae41e20ab6186982245719b86","ae21a4210486695dbdf514d96250a4e05f0e6e572f7eaad7048b3bdd357b4aad","5cddda3ccbf63faea37daf019437b760daa627632b986e1d764d11978944757a","2191fe7baba338a2b3f5a12a95ea4e42cad96850f2afd4a6c7eaa23289d610c5","9de83968d33d896fc2a2629a271fbc9bcaf5bf504e033cfdb1fb99fd55953cde","041e879548c2839ebb36f642c5a25870ab1b015e875775077b7d8b951d53e0a1","ae6eef72bba38ab89c5cbe418d839b75b78a9247f06aa3e1df4850f103a6b1dd","1eaef39c48fcce2af0bf1ee089dd412d29d1396b31f0536138879cd0421d53ec","2a0f684bb99a9077914961bea16bac5f8baa5368a40a305a0ea0008a4c2f1bdf","c5bf64ac95cc82f65205984c8adb107870c71197c767744209bbc4a3e19aede8","f15cff9bf29f9098999401b16d73f61fe73789866e51319c7c24c4594ed7367d","6065d4b46266a2114dc8363b15ec7f884cbdbed1735f0ca4f1eb60df85d61a9b","f9e47d2cb8ba9a69c9ba8b2bc6017a1e54da68c944ee4324873047b0200546d0","47d7d2027548f7562b221acdebe3b33d67ddd1dd278b98ad05a5f3ac14dea3fe","c32f2ec819fee8581fbeed9b4eea40cb17efda7284beed5d12ed48e5af45c41c","234665c66de8541ef8e95cb9ccbcd5ecccb0189d3cf174c4e11a2c60dbc1742e","1a34ba12130ffff45bb525cce48e5d19e4110e4a4bb06d79ad33d6a816f28927","72c55f299c997ec0f5cb87e82141707482067609f1d631ac3cc825af90540b9f","a18aab0f358b7b8e23ebf6eb1252172625430e9aa461b3dcebff1de357113626","b802f944cc6ba9b33c0d58c04295f9f6cf6473ffa602cfa447acb36a97afcc55","d8aa49acc0b40f52b3ac3027ecc16ee053fd01e383272eca4d0637f24fd51a55","df75243be11b86b6644b671dcfd16fdeaf47a7b64e28bfd3ac179c44a6312b46","d9e24d6bd5e118f04bc36fe3cfc314a808119d12190fd9b661b5f871c33fec6b","6b36a1d647d4de09e7f204f221b3445d499a540823c1c9b9612764e3241cdf62","fad2f925ad2267c01d604e12081017215fa9e5ca83279064885bd7682400b761","c1f5a70c2c5bb42ac973558c5c9ef510a2caab8aae19e4f1f68c76d1d10107b9","ede451e9a65e55d0827e217a25cf895163c46bc42432f7cbed0f46d99769c385","6cd17b4422772c99c93e388bbad4c7c213584e15400fb984d748e4cfecd9dd8d","94a9da09da3151f306ab8a5b00f60a38b077d594","987ad5aa6aee86f474fb9313334e6c9718d68daf","4f5d4e9d1e3b6a46f450ad1fb90340dfd718608b","578b1b0f46491b9d39d21f2103cb437bc2d71cac","5949c404aee552fc8ce29e3bf77bd08e54d37c59","59e756e0da6a82a0f9046a3538d507c75eb95252","4dd2b61e0ccf633e008359ad989de2ed","1d70020ddf6f29638b22887947dd5b9c","8f154ca4a8ee50dc448181afbc95cfd7","3eff7826b6eea73b0206f11d08073a68","033acf3b0f699a39becdc71d3e2dddcc","0bbb9b0d573a9c6027ca7e0b1f5478bf") by Filesystem.src | fields _time, dest, action, file_name, file_hash, file_path, file_size, file_create_time, file_modify_time, file_access_time | fieldformat Time = strftime(_time,"%m/%d/%Y %T")
Step 4
Detect the existence of any file extensions associated with the MeowCorp Ransomware. Like any other ransomware, the MeowCorp ransomware has a unique way it encrypts and renames infected files. It has many similarities with the Conti ransomware file extension naming.
Actions Detect
The creation or movement of any files with the known MeowCorp file extensions. These extensions are as follows:
SPL – Detect the creation or renaming of files file extensions related to the MeowCorp ATP using the Endpoint Datamodel
| tstats `summariesonly` latest(_time) as _time, latest(Filesystem.file_create_time) as file_create_time, latest(Filesystem.file_modify_time) as file_modify_time, latest(Filesystem.file_access_time) as file_access_time, values(Filesystem.dest) as dest, values(Filesystem.action) as action, values(Filesystem.file_name) as file_name, values(Filesystem.file_hash) as file_hash, values(Filesystem.file_path) as file_path, values(Filesystem.file_size) as file_size from datamodel="Endpoint"."Filesystem" where Filesystem.file_name IN ("*.MEOW","*.CONTI","*.KREMLIN","*.RUSSIA","*.PUTIN") ```by Filesystem.src``` | fields _time, dest, action, file_name, file_hash, file_path, file_size, file_create_time, file_modify_time, file_access_time | fieldformat Time = strftime(_time,"%m/%d/%Y %T")
Step 5
Detect the C2C communications to known IP addresses related to the MeowCorp ATP. These C2C IP addresses have been associated with beaconing activity of the malware.
Actions Detect
Connection Attempts to Known C2 IP Addresses including the following: 162.244.80[.]235 85.93.88[.]165 185.141.63[.]120 82.118.21[.]1
SPL
SPL – Detect C2 IPs using Network Resolution Data Model
| tstats `summariesonly` latest(_time) as _time, sum("All_Traffic.bytes") as bytes, values("All_Traffic.src_port") as src_port, values("All_Traffic.transport") as transport, values("All_Traffic.dest_port") as dest_port from datamodel="Network_Traffic"."All_Traffic" where All_Traffic.src IN ("162.244.80[.]235","85.93.88[.]165","185.141.63[.]120","82.118.21[.]1") OR All_Traffic.dest IN ("162.244.80[.]235","85.93.88[.]165","185.141.63[.]120","82.118.21[.]1") by "All_Traffic.action", "All_Traffic.src", "All_Traffic.dest", "All_Traffic.user" | head 10000 | `drop_dm_object_name("All_Traffic")` | table action, src, src_port, dest, transport, dest_port, user, bytes
Note: The malicious IPs have been kept sanitized using “[.]” for the periods, please remove these when running the SPL. Please be careful not to navigate to them outside a sandbox.
IOC List
Below is an aggregate of IOCs found related to the MeowCorp ransomware. It has been presented here for you to have it consolidated in one spot and made easier to export to a lookup for notable detections.
Ideally, you could make scheduled searches like what is shown above with lookup tables for matching more specific and new detections. These can be set to run on a continuous schedule to ensure the monitoring of your assets from new vulnerabilities. Old vulnerabilities that have been patched (and applied) can also be aged out of this lookup table to ensure it is timely and efficient. For questions on how to build such a process that is dynamic and customizable for your environment, ask one of our consultants by filling in the form below. Also, subscribe to the TekStream blog to catch the next monthly security bulletin and apply the latest detections to protect your systems. Happy Splunking!
HivePro: New Ransomware Variants Created Using Leaked Conti Source Code
Disclaimer
The approaches recommended herein have not been tested broadly across the TekStream customer base. They are preliminary in nature and come without any certification of efficacy.
Purpose of TekStream Security Bulletins
With the TekStream Security Bulletin, we are presenting some specific detection use cases using everyone’s favorite SIEM, Splunk. We’ve cherry-picked vulnerabilities that are not only intriguing but also directly impactful for our valued clients. These vulnerabilities were chosen based on a multitude of factors, ranging from the technology in the crosshairs to the specific sectors being targeted. This is not a blog post to fully explain or give recommendations on remediating the vulnerability or exploit – this has been discussed at length by various resources. The goal here is to aggregate the detections to maximize your chances of detecting an attempt to exploit these vulnerabilities. A part of that is gathering the list of IOCs scattered in multiple locations on the internet and looking at activity that could point to the vulnerability being exploited. Here at TekStream, we have an amazing team of cybersecurity engineers armed with a deep knowledge of logs and the secrets they hold, ready to fortify your cyber resiliency.
By Bryan Bollou, Team Lead, Cybersecurity Engineering
Purpose of TekStream Security Bulletins
With the TekStream Security Bulletin, we are presenting some specific detection use cases using everyone’s favorite SIEM, Splunk. We’ve cherry-picked vulnerabilities that are not only intriguing but also directly impactful for our valued clients. These vulnerabilities were chosen based on a multitude of factors, ranging from the technology in the crosshairs to the specific sectors being targeted. This is not a blog post to fully explain or give recommendations on remediating the vulnerability – this has been discussed at length by various resources. The goal here is to aggregate the detections to maximize your chances of detecting an attempt to exploit these vulnerabilities. A part of that is gathering the list of IOCs scattered in multiple locations on the internet and looking at activity that could point to the vulnerability being exploited. Here at TekStream, we have an amazing team of cybersecurity engineers armed with a deep knowledge of logs and the secrets they hold, ready to fortify your cyber resiliency.
Introduction
SysJoker is a backdoor malware that was first discovered in December 2021 by Intezer. This malware is a backdoor that targets multiple operating systems. It was initially discovered on a Linux-based web server belonging to a large educational institution. Recently, there has been a resurgence of its use, specifically a variant written in Rust, which suggests the malware code was completely rewritten. The use of this variant has been associated with some APTs (Advanced Persistent Threats) known to operate regions involved in the curre
nt geopolitical climate in the Middle East. Indicators of compromise (IOCs) associated with the malware have been identified in the infrastructure of companies located in countries involved in the conflict.
Threat Overview
Due to the flexibility of the malware and the way its APT uses it, the recommendations are generic.
These steps include:
Training and mitigations for phishing attacks – the most common way victims are exposed to this malware on workstations versions
Good security practice to ensure software updates and downloads only come from trusted vendors as it is believed this RAT is also spread via malicious NPM packages for server versions.
Ensure all devices on a network have an updated endpoint security system
Ensure the principle of least privilege has been used when setting up the production servers in an environment
At the proxy level, block unwanted connections to non-enterprise file-sharing domains
So far, we have seen many good options and would like to present a few more specific cases using everyone’s favorite SIEM, Splunk.
This is not a blog post to fully explain or give recommendations on remediating the vulnerability, this has been discussed at length by various resources such as VMWare SysJoker Analysis.
The goal here is to aggregate the detections to maximize your chances of detecting this critical attack. A part of that is gathering the list of IOCs scattered in multiple locations on the internet and looking at activity that could point to the presence of the SysJoker malware. Here at TekStream, we have several security engineers that are intimate with cybersecurity knowledge and especially the logs of our clients.
In this blog post, we go through the various steps used by the SysJoker RAT in its exploitation and detection. With this format, we are providing a more generic data model “tstats” command. This is taking advantage of the data model to quickly find data that may match our IOC list. We then provide examples of a more specific search that will add context to the first find. There will be a wide variety of specific searches as each client has their own specific technologies. To get help building detection for your specific client, fill in the form below and get access to our Splunk/security expertise.
Note: The SysJoker RAT may masquerade and gather victim information in various ways not covered in this blog. An anomaly analysis tailored to your environment would be needed to discover this. Reach out to TekStream by filling out the form below if you’d like specific guidance on that aspect.
The following detection steps mirror the stages and TTP-related indicators used in the attack:
Detect persistence attempt of the malware [Windows]
Detect persistence attempt of the malware [Linux]
Detect persistence attempt of the malware [MacOs]
Detect the connection to a malicious Cloud Storage Link
Detect connection attempts to the C2 Server IOCs (domains and IP addresses)
Threat Implication
Step 1
Once the SysJoker malware is present on a victim machine, it first sets up persistence. The methods vary based on operating system, so let’s go through them – starting with Windows. In the Windows version, a dropper is masqueraded as a system update by making a registry object. The malware runs generic commands using common tools (eg; dnslookup, ping, etc) to get MAC address, username, physical media serial number, and IP address of victim machine.
Note: This CSV file includes all the listed hashes, along with other Indicators of Compromise (IOCs), conveniently consolidated for streamlined export into a lookup for notable detections.
SPL 1 – Using the Windows Data Source for Registry Key Creation
SPL 2 – Using the Endpoint Datamodel for Registry Key Creation
| tstats allow_old_summaries=true count, values("Registry.registry_key_name") AS registry_key_name, values("Registry.registry_path") AS registry_path, min(_time) AS firstTime, max(_time) AS lastTime FROM datamodel=Endpoint.Registry WHERE ("Registry.registry_hive" = "HKEY_CURRENT_USERS*" AND "Registry.registry_path" = "*HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRun*" AND "Registry.registry_value_type" = "REG_SZ" AND "Registry.registry_value_name" = "igfxCUIService" BY "Registry.dest", "Registry.user"
SPL 3 – Using the Endpoint Datamodel for Hashes
| tstats `summariesonly` latest(_time) as _time, latest(Filesystem.file_create_time) as file_create_time, latest(Filesystem.file_modify_time) as file_modify_time, latest(Filesystem.file_access_time) as file_access_time from datamodel="Endpoint"."Filesystem", values(Filesystem.dest) as dest, values(Filesystem.action) as action, values(Filesystem.file_name) as file_name, values(Filesystem.file_hash) as file_hash, values(Filesystem.file_path) as file_path, values(Filesystem.file_size) as file_size | Filesystem.file_hash IN ( "61df74731fbe1eafb2eb987f20e5226962eeceef010164e41ea6c4494a4010fc","d476ca89674c987ca399a97f2d635fe30a6ba81c95f93e8320a5f979a0563517","d1d5158660cdc9e05ed0207ceba2033aa7736ed1","888226b749b3fa93dadf5d7c2acf32c71e3a0918","d71e1a6ee83221f1ac7ed870bc272f01","293f116c2c51473ae2bf7f4e787d3ec3","1ffd6559d21470c40dcf9236da51e5823d7ad58c93502279871c3fe7718c901c","36fed8ab1bf473714d6886b8dcfbcaa200a72997d50ea0225a90c28306b7670e") | fields _time, dest, action, file_name, file_hash, file_path, file_size, file_create_time, file_modify_time, file_access_time
| fieldformat Time = strftime(_time,"%m/%d/%Y %T")
Step 2
For the Linux version of the SysJoker malware, persistence is made by creating a cron job. The RAT creates or replaces a process called “updateSystem”.
Actions Detect
Detect the Creation of the “Update System” cron job
@reboot (/.Library/SystemServices/updateSystem)
Detect the presence of Known Hashes Related to SysJoker RAT
Note: This CSV file includes all the listed hashes, along with other Indicators of Compromise (IOCs), conveniently consolidated for streamlined export into a lookup for notable detections.
SPL 1: Detect the Creation of a Cron Job
| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime FROM datamodel=Endpoint.Filesystem where Filesystem.action=created Filesystem.file_path="/etc/cron.*" OR Filesystem.file_path ="* /.Library/SystemServices/updateSystem *" by _time
SPL 2: Detect the presence of Known Hashes Related to SysJoker RAT
| tstats `summariesonly` latest(_time) as _time, latest(Filesystem.file_create_time) as file_create_time, latest(Filesystem.file_modify_time) as file_modify_time, latest(Filesystem.file_access_time) as file_access_time from datamodel="Endpoint"."Filesystem", values(Filesystem.dest) as dest, values(Filesystem.action) as action, values(Filesystem.file_name) as file_name, values(Filesystem.file_hash) as file_hash, values(Filesystem.file_path) as file_path, values(Filesystem.file_size) as file_size | Filesystem.file_hash IN ("1a9a5c797777f37463b44de2b49a7f95abca786db3977dcdac0f79da739c08ac","fe99db3268e058e1204aff679e0726dc77fd45d06757a5fda9eafc6a28cfb8df","d0febda3a3d2d68b0374c26784198dc4309dbe4a8978e44bb7584fd832c325f0","554aef8bf44e7fa941e1190e41c8770e90f07254","f5149543014e5b1bd7030711fd5c7d2a4bef0c2f","01d06375cf4042f4e36467078530c776a28cec05","e06e06752509f9cd8bc85aa1aa24dba2","6fb483e7ec55f8c56849d8f4f31bfd7b","85dbbaa8c4d37ebb9829464f0510787b") | fields _time, dest, action, file_name, file_hash, file_path, file_size, file_create_time, file_modify_time, file_access_time
| fieldformat Time = strftime(_time,"%m/%d/%Y %T")
Step 3
For the MacOS version of the SysJoker malware, persistence is made by creating a service. The RAT uses a service called launchAgents named “Apple launch service” targeting “/Library/MacOsServices/updateMacOs”.
Actions Detect
Detect the Creation of a service with LaunchAgent. Creates persistence via LaunchAgent under the path “/Library/LaunchAgents/com.apple.update.plist.”
Detect the presence of Known Hashes Related to SysJoker RAT
Note: This CSV file includes all the listed hashes, along with other Indicators of Compromise (IOCs), conveniently consolidated for streamlined export into a lookup for notable detections.
SPL 1: Service Creation Through LaunchAgent
| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime FROM datamodel=Endpoint.Filesystem where Filesystem.action=created Filesystem.file_path="*/Library/LaunchAgents/com.apple.update.plist*" by _time
SPL 2: Detect the presence of Known Hashes Related to SysJoker RAT
| tstats `summariesonly` latest(_time) as _time, latest(Filesystem.file_create_time) as file_create_time, latest(Filesystem.file_modify_time) as file_modify_time, latest(Filesystem.file_access_time) as file_access_time from datamodel="Endpoint"."Filesystem", values(Filesystem.dest) as dest, values(Filesystem.action) as action, values(Filesystem.file_name) as file_name, values(Filesystem.file_hash) as file_hash, values(Filesystem.file_path) as file_path, values(Filesystem.file_size) as file_size | Filesystem.file_hash IN ("36fed8ab1bf473714d6886b8dcfbcaa200a72997d50ea0225a90c28306b7670e","1ffd6559d21470c40dcf9236da51e5823d7ad58c93502279871c3fe7718c901c","bd0141e88a0d56b508bc52db4dab68a49b6027a486e4d9514ec0db006fe71eed","d028e64bf4ec97dfd655ccd1157a5b96515d461a710231ac8a529d7bdb936ff3","1e894ddc237b033b5b1dcf9b05d281ff0a053532","fad66bdf5c5dc2c050cbc574832c6995dba086a0","23c56da0cdddc664980705c4d14cb2579a970eed","b21ba8da278b75e1cc515b6e2c84b91be6611800","9a7f0b64007cedfa9ae20dd212892d73","d90d0f4d6dad402b5d025987030cc87c","5e11432c30783b184dc2bf27aa1728b4","c805649d6909bf1d7e220f144801044b") | fields _time, dest, action, file_name, file_hash, file_path, file_size, file_create_time, file_modify_time, file_access_time
| fieldformat Time = strftime(_time,"%m/%d/%Y %T")
Step 4
Once persistence is established, the SysJoker malware grabs an encoded Google Drive (sometimes, OneDrive) link from within its package. This link is decoded, and it is requested to pull down a text file. This text file contains another encoded link – the Command-and-Control URL for the malware that is constantly updated.
Actions Detect
Navigating to the Known Malicious Google Drive URLs
Note: This CSV file includes all the listed URLS, along with other Indicators of Compromise (IOCs), conveniently consolidated for streamlined export into a lookup for notable detections.
SPL 1: Detect Known Malicious Google Drive URLs
| tstats `summariesonly` sum("Web.bytes") as bytes,values("Web.http_content_type") as http_content_type,values("Web.http_method") as http_method,values("Web.http_user_agent") as http_user_agent,values("Web.status") as status from datamodel="Web"."Web" where Web.url IN ("https[://]drive[.]google[.]com/uc?export=download&id=1-NVty4YX0dPHdxkgMrbdCldQCpCaE-Hn", "https[://]drive[.]google[.]com/uc?export=download&id=1W64PQQxrwY3XjBnv_QAeBQu-ePr537eu") by "Web.src", "Web.dest", "Web.user", "Web.http_referrer", "Web.url", _time | `drop_dm_object_name("Web")` | fields _time src, dest, user, http_referrer, url, http_content_type, http_method, http_user_agent, status, bytes | eval ip_pair = src . " - " . dest | stats values(_time) as Time values(ip_pair) AS src_dest, values(user) as user, values(http_referrer) as http_referrer, values(http_user_agent) as http_user_agent, values(http_method) as http_method, values(status) as status, values(bytes) as bytes count by url| fieldformat Time = strftime(Time,"%m/%d/%Y %T")
Note: The malicious URLs have been kept sanitized using “[.]” for the periods, please remove these when running the SPL. Please be careful not to navigate to them outside a sandbox.
Step 5
Once the command-and-control link is acquired, a connection attempt to the various known SysJoker infrastructure is attempted. This C2 connection can be used by an attacker to control the malware to execute remote commands, execute scripts, change registry entries and exit/hide. The malware makes GET requests to the C2 API endpoints and the C2 server responds in JSON with parameters/instructions.
SPL 1 – Detect C2 Domains using Network Resolution Data Model
| tstats `summariesonly` latest(_time) as _time values("DNS.dest") as dest, values("DNS.query") as query, values("DNS.query_count") as query_count, values("DNS.message_type") as message_type, values("DNS.answer") as answer, values("DNS.reply_code") as reply_code from datamodel="Network_Resolution"."DNS" where DNS.query IN ("bookitlab[.]tech","graphic-updater[.]com","office360-update[.]com","winaudio-tools[.]com","github.url-mini[.]com","graphic-updater[.]com","sharing-u-file[.]com","filestorage-short[.]org","audiosound-visual[.]com"
) | table _time, dest, query, query_count, message_type, answer, reply_code | fieldformat Time = strftime(_time,"%m/%d/%Y %T")
SPL 2 – Detect C2 Domains using Web Data Model
| tstats `summariesonly` sum("Web.bytes") as bytes,values("Web.http_content_type") as http_content_type,values("Web.http_method") as http_method,values("Web.http_user_agent") as http_user_agent,values("Web.status") as status from datamodel="Web"."Web" by "Web.src", "Web.dest", "Web.user", "Web.http_referrer", "Web.url", _time | `drop_dm_object_name("Web")` | where match(url, "(bookitlab[.]tech)|(graphic-updater[.]com)|(office360-update[.]com)|(winaudio-tools[.]com)|(github.url-mini[.]com)|(graphic-updater[.]com)|(sharing-u-file[.]com)|(filestorage-short[.]org)|(audiosound-visual[.]com)
") | fields _time src, dest, user, http_referrer, url, http_content_type, http_method, http_user_agent, status, bytes | eval ip_pair = src . " - " . dest | stats values(_time) as Time values(ip_pair) AS src_dest, values(user) as user, values(http_referrer) as http_referrer, values(http_user_agent) as http_user_agent, values(http_method) as http_method, values(status) as status, values(bytes) as bytes count by url | fieldformat Time = strftime(Time,"%m/%d/%Y %T")
Note: The malicious domains have been kept sanitized using “[.]” for the periods, please remove these when running the SPL. Please be careful not to navigate to them outside a sandbox.
SPL 3 – Detect C2 IP Address Using Network Traffic Data Model
| tstats `summariesonly` latest(_time) as _time, sum("All_Traffic.bytes") as bytes, values("All_Traffic.src_port") as src_port, values("All_Traffic.transport") as transport, values("All_Traffic.dest_port") as dest_port from datamodel="Network_Traffic"."All_Traffic" where All_Traffic.src IN ("85.31.231[.]49","62.108.40[.]129") OR All_Traffic.dest IN ("85.31.231[.]49","62.108.40[.]129") by "All_Traffic.action", "All_Traffic.src", "All_Traffic.dest", "All_Traffic.user" | head 10000 | `drop_dm_object_name("All_Traffic")`| eval earliest_time = IF(isnum("$earliest_time$"),"$earliest_time$",strftime(relative_time(now(),"$earliest_time$"),"%s")) | eval latest_time = CASE(isnum("$latest_time$"),"$latest_time$","$latest_time$"="now",now(),1=1,strftime(relative_time(now(),"$latest_time$"),"%s")) | where _time >= earliest_time AND _time <= latest_time | head 10000 | table action, src, src_port, dest, transport, dest_port, user, bytes
Note: The malicious IPs have been kept sanitized using “[.]” for the periods, please remove these when running the SPL. Please be careful not to navigate to them outside a sandbox.
IOC List
The file link below is an aggregate of IOCs found related to the SysJoker RAT malware. It has been presented here for you to have it consolidated in one spot and made easier to export to a lookup for notable detections.
Ideally, you could make scheduled searches like what is shown above with lookup tables for matching more specific and new detections. These can be set to run on a continuous schedule to ensure the monitoring of your assets from new vulnerabilities and/or malware. Old vulnerabilities that have been patched (and applied) can also be aged out of this lookup table to ensure it is timely and efficient. For questions on how to build such a process that is dynamic and customizable for your environment, ask one of our consultants by filling in the form below. Also, subscribe to the TekStream blog to catch the next monthly security bulletin and apply the latest detections to protect your systems. Happy Splunking!
References
Articles referenced and used for this blog post include:
The approaches recommended herein have not been tested broadly across the TekStream customer base. They are preliminary and come without certification of efficacy.
When working in a large Splunk environment it is common to troubleshoot multiple Splunk forwarders at one time. One approach to managing Splunk Forwarders is connecting directly to the hosts to troubleshoot. Connecting to a host, running commands, repeating on another host. This can be extremely time consuming when managing a large Splunk environment with hundreds of Splunk Forwarders. A solution to this time-consuming problem is creating a script which sends commands to multiple Splunk Forwarders.
In this example, we will create a shell script which will be used to search for text in multiple Splunk forwarders. To begin, we will create a text file which will contain the list of the Splunk forwarders we are attempting to connect to.
Here you would replace the IPs 10.0.0.X with the IPs that match your hosts.
Next, we will decide which commands we want to send to the hosts. In our case, we want to search for text that resides in a directory on the hosts. Thus, we want to run the command:
After you have decided which commands you want to run, begin creating the shell script that will be used to contact the hosts. Create a HOST_FILE variable that will read the path to the HostsList.txt file we created earlier.
You will want to replace <path to host file> with the path to your host file.
Next, create a USERNAME variable that will read the username we will be using to connect to the hosts.
Make sure to replace with your username.
For the variables being used in this example, /path/to/directory and “text_to_find” we will be reading the values as inputs and assigning them to the variables PATH_TO_TEXT and TEXT_TO_FIND.
Next, we will create the remote script which will be the commands you want to send to the forwarders. In our case, the text searching commands.
Optional: Before running the commands to the forwarders you can initiate output that will display that we are attempting to connect to the hosts.
Now create a “for loop” which will loop through each host listed in our HOSTS_FILE.
The variable DST is each host and will be referenced again when we are referencing a host and not the HOST_FILE.
Next, you will run an SSH command which will run to connect to each DST.
Finally, finish by closing the shell script.
Notice, that you will still need to input a password every time the SSH connection is made with a forwarder. If you want to avoid this you will have to download SSHPASS. This will allow you to include the password in the SSH command bypassing the manual password input every time a connection is made. Once you download SSHPASS you can replace the SSH command with:
Replacing <password> with your password (Not in quotation marks).
This is what the final shell script for running commands on multiple Splunk forwarders will look like.
That will do it! You should find that your forwarders have each been reviewed for trouble, and should have saved quite a bit of time with this efficient method of sending multiple commands. Happy Splunking everyone!
By Bryan Bollou, Team Lead, Cybersecurity Engineering
Purpose of TekStream Security Bulletins
With the TekStream Security Bulletin, we are presenting some specific detection use cases using everyone’s favorite SIEM, Splunk. We’ve cherry-picked vulnerabilities that are not only intriguing but also directly impactful for our valued clients. These vulnerabilities were chosen based on a multitude of factors, ranging from the technology in the crosshairs to the specific sectors being targeted. This is not a blog post to fully explain or give recommendations on remediating the vulnerability – this has been discussed at length by various resources. The goal here is to aggregate the detections to maximize your chances of detecting an attempt to exploit these vulnerabilities. A part of that is gathering the list of IOCs scattered in multiple locations on the internet and looking at activity that could point to the vulnerability being exploited. Here at TekStream, we have an amazing team of cybersecurity engineers armed with a deep knowledge of logs and the secrets they hold, ready to fortify your cyber resiliency.
Introduction
StripedFly has been a consistent threat since first discovered by Kaspersky in 2016. It is associated with APT malware and is estimated to have infected over 1 million systems – both Windows and Linux. This malware is known to infect machines by exploiting the following:
The initial infection is by piggybacking off a custom EternalBlue SMBv1 exploit.
A lightweight TOR client is then used to communicate with a C2 server and download additional malware – though the main purpose (crypt mining, espionage, etc.) is not fully known.
This additional malware can then engage in a variety of malicious activities including credential harvesting, crypto mining, adware, etc.
The malware disables the SMBv1 protocol and uses SSH along with processes similar EternalBlue to spread.
Threat Overview
The vulnerability has been acknowledged by Kaspersky and they have suggested various mitigation steps to prevent its exploitation. Due to the flexibility of the malware and the way its APT uses it, the recommendations are quite generic.
These steps include:
Training and mitigations for phishing attacks – the most common way victims are exposed to this malware.
Exercising good credential hygiene including the use of a secure password manager
Ensuring all devices on a network have an updated endpoint security system.
Disabling SMBv1 if it is not necessary for critical business processes.
So far, we have seen many good options and would like to present a few more specific cases using Splunk. The goal here is to aggregate the detections to maximize your chances of detecting this critical attack. A part of that is gathering the list of IOCs scattered in multiple locations on the internet and looking at activity that could point to a StripedFly malware infection. Recommendations on remediating the vulnerability are discussed at length by various resources including Secure List.
In this security bulletin, we go through the various ways StripedFly exploits a victim system and how to detect it. With this format, we are providing a more generic data model “tstats” command. This is taking advantage of the data model to quickly find data that may match our IOC list. We then provide examples of a more specific search that will add context to the first find. There will be a wide variety of specific searches as each client has their own specific technologies. To get help building detection for your specific client, fill in the form below and get access to our Splunk/security expertise.
Note: Analyzing trends in your environment to detect anomalies relating to processes normally run and regular access to online code repositories would be ideal. This requires massaging to a specific environment and detecting this part is not covered in this blog post. Reach out to TekStream by filling out the form below if you’d like specific guidance on that aspect.
The following detection steps mirror the stages and TTP-related indicators used in the attack:
Detect beaconing to a command-and-control server in the TOR network.
Detect the existence of files associated with StripedFly malware modules
Threat Implication
StripedFly primarily exploits the weakness of SMBv1 on internet-facing systems. The initial infection is dropped on the machine and this malware self-propagates once on a network. It sets up an encrypted channel using TOR to hide communications with a C2 server. As part of its activities, it downloads updates and additional malware by connecting to malicious code repositories.
The fact the malware has support and pluggable modules to update its functionality points to APT malware. It has been associated with the Shadow Brokers, but the true origin of the malware is still unclear. It has also been associated with the ThunderCrypt ransomware, which may suggest a monetary incentive for the malware’s authors.
Threat Detection
Step 1
If a victim machine is infected with the original malware from StripedFly, PowerShell scripts are run if the tool is available. This is done to set up persistence for the malware. Here we are looking to detect any PowerShell commands that are run and contain more than 50 trailing or leading spaces – not typical for a normal user or process running scripts. The spaces are used to obfuscate the code and avoid detection by an EDR system.
Actions Detect
Using Regex to find a PowerShell command with more than 50 leading or trailing spaces.
SPL – Using Windows Data Source
index=windows sourcetype=WinEventLog EventCode=4104
| where match(ScriptBlockText, "(?i)[ ]{50,}w+") OR match(ScriptBlockText, "(?i)w+[ ]{50,}")
| table _time EventCode name action service UserData_Xml Message Subject_Account_Name ComputerName EventCode cmd ScriptBlockText
Step 2
A mark of the StripedFly infection the disabling of the SMBv1 protocol after infection. This is done once the malware payload is executed and a lightweight TOR client is installed. This step is done to “seal the gates” on the victim’s machine. Here we are detecting the disabling of these protocols.
Actions Detect
We are looking to detect the following activity and parameter set in the appropriate registry entry:
| tstats allow_old_summaries=true count, values("Registry.registry_key_name") AS registry_key_name, values("Registry.registry_path") AS registry_path, min(_time) AS firstTime, max(_time) AS lastTime FROM datamodel=Endpoint.Registry WHERE ("Registry.registry_hive" = "HKEY_LOCAL_MACHINESYSTEM" AND "Registry.registry_path" = "*HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesLanmanServerParameters*" AND "Registry.registry_value_type" = "REG_DWORD" AND "Registry.registry_value_name" = "SMB1" AND ("Registry.registry_value_data" = "0" OR "Registry.registry_value_text" = "0" )) BY "Registry.dest", "Registry.user"
Step 3
As a way to reduce the footprint of the initial exploit, the StripedFly malware has most of its elements offloaded and stored in legitimate websites. Once persistence is set up, the malware will then request these elements to carry out malicious activities on the victim machine. The sophistication of these pluggable, customizable and version control malware modules point to an APT developing this malware. Multiple repositories have been identified to contain code requested by malware.
Actions Detect
Attempts to hit the URL’s associated with the malicious code repositories from within the victim’s environment.
This CSV file includes all the listed URLS, along with other Indicators of Compromise (IOCs), conveniently consolidated for streamlined export into a lookup for notable detections.
SPL – Using the Web Datamodel
Detect URLs
| tstats `summariesonly` sum("Web.bytes") as bytes,values("Web.http_content_type") as http_content_type,values("Web.http_method") as http_method,values("Web.http_user_agent") as http_user_agent,values("Web.status") as status from datamodel="Web"."Web" where Web.url IN (" ghtyqipha6mcwxiz[.]onion:1111", "bitbucket[.]org/JulieHeilman/m100-firmware-mirror/downloads/","bitbucket[.]org/upgrades/um/downloads/","bitbucket[.]org/legit-updates/flash-player/downloads","gitlab[.]com/JulieHeilman/m100-firmware-mirror/raw/master/","gitlab[.]com/saev3aeg/ugee8zee/raw/master/","github[.]com/amf9esiabnb/documents/releases/download/","tcp://pool.minexmr[.]com:4444","tcp://mine.aeon-pool[.]com:5555","tcp://5.255.86[.]125:8080","tcp://45.9.148[.]21:80","tcp://45.9.148[.]36:80","tcp://45.9.148[.]132:808") by "Web.src", "Web.dest", "Web.user", "Web.http_referrer", "Web.url", _time | `drop_dm_object_name("Web")` | fields _time src, dest, user, http_referrer, url, http_content_type, http_method, http_user_agent, status, bytes | eval ip_pair = src . " - " . dest | stats values(_time) as Time values(ip_pair) AS src_dest, values(user) as user, values(http_referrer) as http_referrer, values(http_user_agent) as http_user_agent, values(http_method) as http_method, values(status) as status, values(bytes) as bytes count by url| fieldformat Time = strftime(Time,"%m/%d/%Y %T")
Note: The malicious URLs have been kept sanitized using “[.]” for the periods, please remove these when running the SPL. Please be careful not to navigate to them outside a sandbox.
Step 4
The StripedFly malware has a few known Command-and-Control servers hosted in the TOR network. The malware uses a lightweight TOR client to connect to the C2 server through TCP connections – often sending a unique ID for the victim machine, requesting malware modules/updates and beaconing. Finding any attempts to communicate with these known C2 servers would be a smoking gun for this malware being present in a victim’s environment.
Actions Detect
Any connection attempts with the following domains and/or IP addresses.
This CSV file includes all the listed URLS, along with other Indicators of Compromise (IOCs), conveniently consolidated for streamlined export into a lookup for notable detections.
SPL 1 – Using the Web Datamodel for Domains
Detect Domains
| tstats `summariesonly` sum("Web.bytes") as bytes,values("Web.http_content_type") as http_content_type,values("Web.http_method") as http_method,values("Web.http_user_agent") as http_user_agent,values("Web.status") as status from datamodel="Web"."Web" by "Web.src", "Web.dest", "Web.user", "Web.http_referrer", "Web.url", _time | `drop_dm_object_name("Web")` | where match(url, "(?i)(gpiekd65jgshwp2p53igifv43aug2adacdebmuuri34hduvijr5pfjad[.]onion)|(ghtyqipha6mcwxiz[.]onion)|(ajiumbl2p2mjzx3l[.]onion)") | fields _time src, dest, user, http_referrer, url, http_content_type, http_method, http_user_agent, status, bytes | eval ip_pair = src . " - " . dest | stats values(_time) as Time values(ip_pair) AS src_dest, values(user) as user, values(http_referrer) as http_referrer, values(http_user_agent) as http_user_agent, values(http_method) as http_method, values(status) as status, values(bytes) as bytes count by url | fieldformat Time = strftime(Time,"%m/%d/%Y %T")
Note: The malicious URLs have been kept sanitized using “[.]” for the periods, please remove these when running the SPL. Please be careful not to navigate to them outside a sandbox.
SPL 2 – Using the Network Datamodel for IPs
Detect IPs
| tstats `summariesonly` latest(_time) as _time, sum("All_Traffic.bytes") as bytes, values("All_Traffic.src_port") as src_port, values("All_Traffic.transport") as transport, values("All_Traffic.dest_port") as dest_port from datamodel="Network_Traffic"."All_Traffic" where All_Traffic.src IN ("45.9.148[.]21","45.9.148[.]36","45.9.148[.]132","5.255.86[.]125") OR All_Traffic.dest IN ("45.9.148[.]21","45.9.148[.]36","45.9.148[.]132","5.255.86[.]125") by "All_Traffic.action", "All_Traffic.src", "All_Traffic.dest", "All_Traffic.user" | head 10000 | `drop_dm_object_name("All_Traffic")`| eval earliest_time = IF(isnum("$earliest_time$"),"$earliest_time$",strftime(relative_time(now(),"$earliest_time$"),"%s")) | eval latest_time = CASE(isnum("$latest_time$"),"$latest_time$","$latest_time$"="now",now(),1=1,strftime(relative_time(now(),"$latest_time$"),"%s")) | where _time >= earliest_time AND _time <= latest_time | head 10000 | table action, src, src_port, dest, transport, dest_port, user, bytes
Note: The malicious IPs have been kept sanitized using “[.]” for the periods, please remove these when running the SPL. Please be careful not to navigate to them outside a sandbox.
Step 5
Since the malicious code repositories are known, the files are often requested are known. The filenames and hashes have been taken from malware repos. Evidence of these files in a victim’s environment would point to malware modules requested/downloaded and this malware present. Looking for these known IOCs would also be a smoking gun for StripedFly presence.
Actions Detect
The presence of any of these known bad hashes in the victim’s environment:
SPL
| tstats `summariesonly` latest(_time) as _time, latest(Filesystem.file_create_time) as file_create_time, latest(Filesystem.file_modify_time) as file_modify_time, latest(Filesystem.file_access_time) as file_access_time from datamodel="Endpoint"."Filesystem", values(Filesystem.dest) as dest, values(Filesystem.action) as action, values(Filesystem.file_name) as file_name, values(Filesystem.file_hash) as file_hash, values(Filesystem.file_path) as file_path, values(Filesystem.file_size) as file_size | search Filesystem.file_name IN ("system.img", "delta.dat", "delta.img", "ota.dat", "ota.img ") OR Filesystem.file_hash IN ( "b28c6d00855be3b60e220c32bfad2535", "18f5ccdd9efb9c41aa63efbe0c65d3db", "2cdc600185901cf045af027289c4429c", "54dd5c70f67df5dc8d750f19ececd797", "d32fa257cd6fb1b0c6df80f673865581", "c04868dabd6b9ce132a790fdc02acc14", "c7e3df6455738fb080d741dcbb620b89", "d684de2c5cfb38917c5d99c04c21769a", "a5d3abe7feb56f49fa33dc49fea11f85", "35fadceca0bae2cdcfdaac0f188ba7e0", "00c9fd9371791e9160a3adaade0b4aa2", "41b326df0d21d0a8fad6ed01fec1389f", "506599fe3aecdfb1acc846ea52adc09f", "6ace7d5115a1c63b674b736ae760423b", "2e2ef6e074bd683b477a2a2e581386f0", "04df1280798594965d6fdfeb4c257f6c", "abe845285510079229d83bb117ab8ed6", "090059c1786075591dec7ddc6f9ee3eb", "120f62e78b97cd748170b2779d8c0c67", "d64361802515cf32bd34f98312dfd40d") | fields _time, dest, action, file_name, file_hash, file_path, file_size, file_create_time, file_modify_time, file_access_time
| fieldformat Time = strftime(_time,"%m/%d/%Y %T")
IOC List
This file is an aggregate of IOCs found related to StripedFly exploitation. It has been presented here for you to have it consolidated in one spot and made easier to export to a lookup for notable detections.
Ideally, you could make scheduled searches like what is shown above with lookup tables for matching more specific and new detections. These can be set to run on a continuous schedule to ensure the monitoring of your assets from new vulnerabilities. Old vulnerabilities that have been patched (and applied) can also be aged out of this lookup table to ensure it is timely and efficient. For questions on how to build such a process that is dynamic and customizable for your environment, ask one of our consultants by filling in the form below. Also, subscribe to the TekStream blog to catch the next monthly security bulletin and apply the latest detections to protect your systems. Happy Splunking!
The approaches recommended herein have not been tested broadly across the TekStream customer base. They are preliminary in nature and come without any certification of efficacy.
Datamodel is really like Savedsearches, providing structure to underlying unstructured data. Datamodel has multiple datasets, where datasets are like a table in the traditional database. In Splunk, when we create dataset, we create with some constrains. This blog walks through the end-to-end flow of a datamodel in Splunk ES. By the end of this demonstration, you will find the above definition makes sense.
Let’s take “Authentication” datamodel as an example:
Step One
Login into your Splunk ES search head. Navigate to Settings -> Data models and Click on the “Authentication” DM. We can see the macros and base constrain for the DM. Then click on the failed authentication. Now we can see new constrain on top of the base constrain. The base constrain does not change. The child constrains look into every index that has tag authentication defined in the base constrain and also the “action =success” defined in the child constrain.
Note down the macro used in the Authentication datamodel and proceed to Step Two.
Step Two
Go to ES -> Configure -> CIM Setup -> Click on the Authentication DM -> at the bottom -> Indexes are whitelist -> Only these indexes are scoped for the DM. I.E.: this is only data that is coming into this datamodel. Now, we have to ask ourselves, do all indexes included here have authentication events as desired? Is there anything that we want that is not added here? Please add/remove indexes according to your authentication log sources.
Step Three
Let’s say we are sending authentication logs to an index called “abc”, but we are not seeing any events in the Authentication DM.
Then let’s do a search on that index -> “index=abc | stats count by tag”
If we go back to the Authentication DM constrain, it uses action as one of the tags. But that tag is not available in the above “abc” index. It says that the base constrain for the DM is not met for this index.
Let’s do index=abc | stats count by action
We can see the values in the action field. It says we have to create tag, so we can see the events in the authentication datamodel. Create the tag authentication.
Step Four
All the TAs runs by eventtypes. Let’s go to Settings -> Eventtypes -> search for authentication, and sort by tags. When the accelerated Authentication DM runs, it looks for the tags and runs all the eventtypes related to the authentication tag. If we don’t have the eventtype that is looking for the tag authentication, then it will not give any data for the DM.
Let’s run -> “index=abc action=success”
It will show the list of sourcetype and check the sourcetype that got the data that we wanted.
Go back to the eventtypes -> Create new eventtype and in the search string -> sourcetype=<that we are looking for> and we can use index also in the search string.
Go to tag -> type authentication. Now when we search for eventtype it returns the data for that sourcetype. We don’t have to mention index in the eventtype but the more you scope its better.
Step Five
The above link provides all the ES Dashboards and the DM, the fields it depends on. If our raw data doesn’t have the same field name defined for the DM, then create a field alias for that. In general, we may not have all the fields in our data that is cim compliant.
We have to check the raw data and make a decision which of those fields may potentially map to a datamodel. The prescribed values are those values should be in for that particular field. No other values.
Step Six
a.) |datamodel Authentication
This shows if the datamodel is functional.
b.) |from datamodel:Authentication
This shows all the data in the datamodel. Click on the “users” field on the left side. We can see data for the “users” field. Check if all the data is extracted correctly. If we see ‘unknown’ then data is not extracted correctly. The fields we see in the left side are the fields that are part of the datamodel.
This uses fieldsummary with the datamodel search. It groups all the values for each field. It helps to find the list of fields in the DM that got “unknown” values.
d.) |datamodel Authentication search |datamodel Authentication acceleration_search_string
This is what the accelerated dm search looks like.
Step Seven
a.) When we search only the sourcetype and if it’s not returning anything then because the user not having permission to search all the indexes by default. So it’s better to search index=* sourcetype=abc… -> then it looks for the indexes that use has permissions. b.) Review the permissions on the eventtype and tags and make sure its global. c.) If there is any bundle problem, then creating tag/eventtype won’t reflect immediately. It’s hard to troubleshoot when your bundle is broken. We will cover this topic in a separate blog.
Summary
Configuring DM with proper scoping as explained helps your SVC cost in the cloud environment. When we do Index whitelist and Tag whitelist, we are running specific tags only on specific indexes. Please follow the same steps for all the other datamodels in your environment. If you are on ingest model then it would not cost money but when users are accessing the ES dashboard, it would be slow loading and cause performance problems.
Splunk SOAR, sometimes affectionately referred to by its prior name, Phantom, comes bundled with a plethora of custom functions and API calls to make playbook development easier. These include the ability to add comments or notes to a container, set a label or set a status. One useful and, frankly, cool feature is the ability to add a pin to the HUD of the container. You can add little “post-it” style notes to the HUD to show some messages or pertinent field values.
This is achieved by using the “pin” utility function, shown below. It allows a Splunk SOAR developer to pin a piece of information and designate a color for the pin as well as a name for later reference in case the data needs to be updated.
While these pin cards can be very handy, the limited amount of real estate in the HUD can quickly constrain how many pins you can realistically display in the HUD before having to click arrows to scroll and see pins that are off-screen. However, did you know that these pin cards in Splunk SOAR can also contain lists of data?
As implied in the image above, let’s explore a situation where you want to display a list of field values that may be relevant to the container. There could be one or many fields to display. Instead of pinning up one card for each field/value combination, you could pin up one single card with a list of all of the field/value pairs that you want and only take up one card space in the HUD. So, how to achieve this? It can be done by leveraging a documented, but somewhat hidden, feature of the container_pin REST call in Splunk SOAR. The key input to notice is the input_type and input_choices parameter fields in the container¬_pin call. You can designate the input_type to be “text” or “select”. The “pin” function included with Splunk SOAR does not have an option to define what input_type is and only allows for “text” when generating a pin card using it.
There’s 2 ways to put this REST into effect:
Using the post_data¬ function of the HTTP SOAR app.
Using custom code to programmatically generate the REST API calls
For the purposes of this article, we will leverage the Splunk SOAR/Phantom HTTP app to make this call. If you don’t already have an asset configured for this app, it is a straightforward configuration. Simply configure a new asset of this app and you’ll need to configure the following:
Base URL
Your base SOAR URL with “/rest” at the end
Authentication Token
ph-auth-token
Value of authentication token
Token value of the automation user to be used for this asset
Once your asset is ready for use, create a new action block in your playbook and select the HTTP post_data action. Select the asset for your SOAR instance and populate the inputs.
For the location input, type in “container_pin” (no double-quotes). For the body, you’ll need to populate the JSON payload of the request. The following fields need to be passed in (or are at least recommended):
container_id
ID of the container for pin card
order
Number where pin card will slot in. Set to “1” if you just want it at the beginning
message
A bit misleading, but it is the title of the pin card (i.e. the label that shows up as the header of the pin card)
data
Leave as an empty string (i.e. “”)
pin_type
manual_card
pin_style
This is the color you want for the pin card. Valid options are blue, red, gray (default)
name
This is the identifier of the pin card. If you want to update the pin card later, you can use the reference name (i.e. “field_values”) to overwrite the existing card instead of inserting a new one in the HUD and cluttering it up.
input_choices
This is a JSON list of strings containing list items.
For example, for the pin card displayed above, the JSON payload to the container_pin REST call would look as follows:
{
"container_id":"<container_id>",
"order":1,
"message":"Multivalue Pin",
"data":"",
"pin_type":"manual card",
"pin_style":"blue",
"name":"FIELD_VALUES ",
"input_type":"select",
"input_choices":["Field 1: Value 1","Field 2: Value 2","Field 3: Value 3"]
}
One word of caution: please note that this request is very sensitive! If the input_choices parameter is not passed in as a valid JSON list of strings, it could cause your container view window to not load correctly. Should that happen, you’ll need to basically make a rest call again to post it correctly before the container will display as expected. For this reason, it is heavily advised to code this up inside a custom function that can be leveraged consistently and be augmented with proper error handling in case the input_choice string is not well-formed.
There you have it! An innovative way to pin lists to the HUD that should make your SOAR/Phantom playbook development that much more exciting!
By Bryan Bollou, Team Lead, Cybersecurity Engineering
Purpose of TekStream Security Bulletins
With the TekStream Security Bulletin, we are presenting some specific detection use cases using everyone’s favorite SIEM, Splunk. We’ve cherry-picked vulnerabilities that are not only intriguing but also directly impactful for our valued clients. These vulnerabilities were chosen based on a multitude of factors, ranging from the technology in the crosshairs to the specific sectors being targeted. This is not a blog post to fully explain or give recommendations on remediating the vulnerability – this has been discussed at length by various resources. The goal here is to aggregate the detections to maximize your chances of detecting an attempt to exploit these vulnerabilities. A part of that is gathering the list of IOCs scattered in multiple locations on the internet and looking at activity that could point to the vulnerability being exploited. Here at TekStream, we have an amazing team of cybersecurity engineers armed with a deep knowledge of logs and the secrets they hold, ready to fortify your cyber resiliency.
Introduction
Confirmed to have been in use since September of 2023, the CVE-2023-3519 is an unpatched vulnerability exploited to capture credentials by inserting a malicious script into the HTML content of the authentication web page. This is vulnerability that could be exploited by doing the following; • A vulnerable NetScaler device is identified. • The script is appended to the index.html using the vulnerability. • This script then loads a remote JS file that creates a “Log On” button on the login page. • Once an authentication event occurs the username and password information are sent to a malicious remote server.
Threat Overview
The vulnerability has been acknowledged by Citrix and they have suggested various mitigation steps to prevent its exploitation. These steps include:
“Cloud Software Group strongly urges affected customers of NetScaler ADC and NetScaler Gateway to install the relevant updated versions as soon as possible. Note: NetScaler ADC and NetScaler Gateway version 12.1 is now End Of Life (EOL). Customers are recommended to upgrade their appliances to one of the supported versions that address the vulnerabilities.”
So far, we have seen many good options and would like to present a few more specific cases using everyone’s favorite SIEM Splunk. This is not a blog post to fully explain or give recommendations on remediating the vulnerability, this has been discussed at length by various resources such as: Citrix ADC and Citrix Gateway Security Bulletin.
The goal here is to aggregate the detections to maximize your chances of detecting this critical attack. A part of that is gathering the list of IOCs scattered in multiple locations on the internet and looking at activity that could point to the CVE-2023-3519 vulnerability being exploited. Here at TekStream, we have several security engineers that are intimate with cybersecurity knowledge and especially the logs of our clients.
In this blog post, we go through the various steps in CVE-2023-3519 vulnerability exploitation and detection. With this format, we are providing a more generic data model “tstats” command. This is taking advantage of the data model to quickly find data that may match our IOC list. We then provide examples of a more specific search that will add context to the first find. There will be a wide variety of specific searches as each client has their own specific technologies. To get help building detection for your specific client, fill in the form below and get access to our Splunk/security expertise.
Note: Something specific. Detecting this part is not covered in this blog post. Reach out to TekStream by filling out the form below if you’d like specific guidance on that aspect.
The following detection steps mirror the stages and TTP-related indicators used in the attack:
Detect the initial web request attackers use to append custom HTML code to the index.html hosted on a vulnerable NetScaler device
Detect the hashes and file names that point to malicious files and scripts injected into the vulnerable NetScaler device
Detect Ip Addresses associated with known ATP group that used this exploit as well as addresses seen associated with the attack
Detect connections to domains that hosted the malicious JS script file created by threat actors who exploited this vulnerability
Detect a possible spike in DNS traffic that could point to attempts to hit a command-and-control destination from a victim’s network
Threat Implication
A threat actor discovering an unpatched NetScaler Device on a victim machine can attempt this exploit. It involves injecting a malicious script that creates an element on a login page that directs user credentials upon login activity.
Attacked would first send a web request to trigger a memory corruption a write a PHP web shell on a NetScaler endpoint. This PHP web shell would then be used to append custom HTML code to the index.html that points to a malicious a JavaScript code on infrastructure controller by the attacker. This code would add a custom function with a “Log On” element that would harvest credentials entered by a victim.
Actions to Detect
A web request to your NetScaler servers with any of the following strings;
| tstats `summariesonly` sum("Web.bytes") as bytes,values("Web.http_content_type") as http_content_type,values("Web.http_method") as http_method,values("Web.http_user_agent") as http_user_agent,values("Web.status") as status from datamodel="Web"."Web" where (http_method = GET OR http_method = POST) AND Web.url IN ("*/gwtest/formssso? event=start&target=*","*/items/accounts/*","*/api/now/sp/widget/widget-simple-list*","*/api/now/sp/widget/5b255672cb03020000f8d856634c9c28*") by "Web.src", "Web.dest", "Web.user", "Web.url", _time | fields _time src, dest, user, url, http_content_type, http_method, http_user_agent, status, bytes | fieldformat Time = strftime(_time,"%m/%d/%Y %T")
Note: The destination IPs for the NetScaler devices can be added to filter down this search.
Step 2
As part of Step 1, new files would be introduced on the NetScaler server. This step would be used to detect the hashes and file names that point to malicious files and scripts injected into the vulnerable NetScaler device. These hashes and files were recorded from victims of this attack.
| tstats `summariesonly` latest(_time) as _time, latest(Filesystem.file_create_time) as file_create_time, latest(Filesystem.file_modify_time) as file_modify_time, latest(Filesystem.file_access_time) as file_access_time from datamodel="Endpoint"."Filesystem", values(Filesystem.dest) as dest, values(Filesystem.action) as action, values(Filesystem.file_name) as file_name, values(Filesystem.file_hash) as file_hash, values(Filesystem.file_path) as file_path, values(Filesystem.file_size) as file_size where Filesystem.file_name IN ("*Logouttm.php*","*pykeygen*","*info.php*",”*NPS*”,”*the*”) | fields _time, dest, action, file_name, file_hash, file_path, file_size, file_create_time, file_modify_time, file_access_time
| fieldformat Time = strftime(_time,"%m/%d/%Y %T")
SPL 2: Hashes
| tstats `summariesonly` latest(_time) as _time, latest(Filesystem.file_create_time) as file_create_time, latest(Filesystem.file_modify_time) as file_modify_time, latest(Filesystem.file_access_time) as file_access_time from datamodel="Endpoint"."Filesystem", values(Filesystem.dest) as dest, values(Filesystem.action) as action, values(Filesystem.file_name) as file_name, values(Filesystem.file_hash) as file_hash, values(Filesystem.file_path) as file_path, values(Filesystem.file_size) as file_size where Filesystem.file_hash IN ("3345ad8b43d6771532ca55acf7e95fe98aeadb27","b8f9258e9c7c882944e2b773557b49e5821517fe","55c83cb25be5c521e4874e22b1422c360abf0a29","ec17f7b3acb2334a062c37e0271c31c3c8b6879c","dec36a2aa4ecb86eafd01015e27c06f51d104317","47b8d29319a9e85aaf829f4f2f9c6c00","ee51f599d266be5fd89b423ca24521f1","c0b32901f9c6ce3f965b8552f7d058d4","9b6f12aed2369a99a1132edd2ede779d","b383c4ed6712a0a06fb85b1d8405e0f1") | fields _time, dest, action, file_name, file_hash, file_path, file_size, file_create_time, file_modify_time, file_access_time
| fieldformat Time = strftime(_time,"%m/%d/%Y %T")
Step 3
IP addresses have been associated with exploiting this NetScaler vulnerability. This includes source IP addresses of ATP groups that have been recorded with attempted exploitations and destination IP addresses of the malicious infrastructure. Any occurrence of these known bad IP addresses should be investigated if they appear in an environment.
Actions to Detect
Appearance of the following hashes in a client’s environment:
| tstats `summariesonly` latest(_time) as _time, sum("All_Traffic.bytes") as bytes, values("All_Traffic.src_port") as src_port, values("All_Traffic.transport") as transport, values("All_Traffic.dest_port") as dest_port from datamodel="Network_Traffic"."All_Traffic" where All_Traffic.src IN ("5.2.64.155","5.255.101.76","172.94.124.18","154.6.91.149","216.41.162.172","216.51.171.17") OR All_Traffic.dest IN ("5.2.64.155","5.255.101.76","172.94.124.18","154.6.91.149","216.41.162.172","216.51.171.17") by "All_Traffic.action", "All_Traffic.src", "All_Traffic.dest", "All_Traffic.user" | head 10000 | `drop_dm_object_name("All_Traffic")`| eval earliest_time = IF(isnum("$earliest_time$"),"$earliest_time$",strftime(relative_time(now(),"$earliest_time$"),"%s")) | eval latest_time = CASE(isnum("$latest_time$"),"$latest_time$","$latest_time$"="now",now(),1=1,strftime(relative_time(now(),"$latest_time$"),"%s")) | where _time >= earliest_time AND _time <= latest_time | head 10000 | table action, src, src_port, dest, transport, dest_port, user, bytes
Step 4
The smoking gun is connections out to the malicious domains for credential harvesting. Multiple domains have been identified as being used in this exploit. These domains were stood up by threat actors with their origins masked. The malicious JS script that would inject the fake login element on NetScaler index.html would be hosted here. The JS files were almost all identical. Credentials taken from victim users would also be redirected to these domains. The credential endpoint was a similar path for most of the malicious domains.
Actions to Detect
Any connections to the following domains from a client network:
jscloud[.]ink
jscloud[.]live
jscloud[.]biz
jscdn[.]biz
cloudjs[.]live
cloud-js[.]cloud
Any connections with the following URL string:
/items/accounts/
SPL#1 – Web: Malicious Domains + URL String
| tstats `summariesonly` sum("Web.bytes") as bytes,values("Web.http_content_type") as http_content_type,values("Web.http_method") as http_method,values("Web.http_user_agent") as http_user_agent,values("Web.status") as status from datamodel="Web"."Web" by "Web.src", "Web.dest", "Web.user", "Web.http_referrer", "Web.url", _time | `drop_dm_object_name("Web")` | where match(url, "(?i)(jscloud.ink)|(jscloud.live)|(jscloud.biz)|(jscdn.biz)|(cloudjs.live)|(cloud-js.cloud) | (/items/accounts/)") | fields _time src, dest, user, http_referrer, url, http_content_type, http_method, http_user_agent, status, bytes | eval ip_pair = src . " - " . dest | stats values(_time) as Time values(ip_pair) AS src_dest, values(user) as user, values(http_referrer) as http_referrer, values(http_user_agent) as http_user_agent, values(http_method) as http_method, values(status) as status, values(bytes) as bytes count by url | fieldformat Time = strftime(Time,"%m/%d/%Y %T")
SPL#2 – DNS: Malicious Domains
| tstats `summariesonly` latest(_time) as _time values("DNS.dest") as dest, values("DNS.query") as query, values("DNS.query_count") as query_count, values("DNS.message_type") as message_type, values("DNS.answer") as answer, values("DNS.reply_code") as reply_code from datamodel="Network_Resolution"."DNS" where DNS.query IN ("jscloud.ink","jscloud.live","jscloud.biz","jscdn.biz","cloudjs.live","cloud-js.cloud") | table _time, dest, query, query_count, message_type, answer, reply_code | fieldformat Time = strftime(_time,"%m/%d/%Y %T")
Step 5
In a compromised environment, it would be expected to see an increase in the amount of traffic to control and control destinations. Thus, detecting a possible spike in DNS traffic that could point to an attempt or successful attack on this NetScaler vulnerability.
Actions to Detect
A DNS Spike in an environment that may indicate attempts to connect to a C2C destination.
SPL
| tstats `summariesonly` count from datamodel="Network_Resolution"."DNS" by "DNS.query", _time | rename "DNS.query" as query | fieldformat Time = strftime(_time,"%m/%d/%Y %T")
Note: This is very simple SPL to look at the DNS resolutions by query destination and time. It needs to be tuned for each environment. It would take a Splunk professional to present the data in a more digestible form and cybersecurity professional to use this visualization to spot an anomaly. Reach out to TekStream using the form below to get in contact with both.
IOC List
Below is an aggregate of IOCs found related to the CVE-2023-3519 vulnerability. It has been presented here for you to have it consolidated in one spot and made easier to export to a lookup for notable detections.
Ideally, you could make scheduled searches like what is shown above with lookup tables for matching more specific and new detections. These can be set to run on a continuous schedule to ensure the monitoring of your assets from new vulnerabilities. Old vulnerabilities that have been patched (and applied) can also be aged out of this lookup table to ensure it is timely and efficient. For questions on how to build such a process that is dynamic and customizable for your environment, ask one of our consultants by filling in the form below. Also, subscribe to the TekStream blog to catch the next monthly security bulletin and apply the latest detections to protect your systems. Happy Splunking!
The approaches recommended herein have not been tested broadly across the TekStream customer base. They are preliminary in nature and come without any certification of efficacy.