Author: Clear Infosec

  • Microsoft has sent a warning to millions of Windows 10, Windows 11 users.

    Microsoft has sent a warning to millions of Windows 10, Windows 11 users.

    A new zero-day exploit has been discovered that affects all versions of Windows. Microsoft has also confirmed that all versions of windows have critical vulnerabilities which can turn into a serious threat that requires immediate action.

    The “zero-day” vulnerabilities known as CVE-2021-34484 which is been known for quite some time allow hackers and get control of your computer by compromising all versions of Windows which includes recent Windows 10, Windows 11, and Windows Server 2022.  

    Cause:

    Microsoft thought it had already patched this exploit in the month of October which was found in August. However, many businesses acknowledged that the patch was discovered to be defective which has attracted more attention to this issue.

    Microsoft agreed to “take appropriate steps to keep users protected,” yet a new patch has yet to arrive two weeks later and that’s the spot where all Windows users took control.

    Micropatch:

    0patch, a third-party security firm has released a “micropatch” which is now available to all Windows users to beat Microsoft. “Micropatches for this vulnerability will be free until Microsoft has issued an official fix,” 0patch confirmed.

    Also, you can go through the video to help you with installing the micropatch: https://youtu.be/mIpaxqKNhi0

    Microsoft is expected to deliver an effective patch sooner rather than later, but until then, all Windows users must act now to be secure. But, with 0patch quickly becoming a go-to source for effortless implementation of hot patches which beat other software firms in the market.

    Before you can apply the fix, you’ll need to create an account with 0patch and install its download agent. Download the Micropatch from the link here: https://blog.0patch.com/2021/11/micropatching-incompletely-patched.html

     

    Reference:

    Kelly, G. (2021, November 13). Warning issued for millions of Microsoft Windows 10, Windows 11 users. Forbes. Retrieved November 16, 2021, from https://www.forbes.com/sites/gordonkelly/2021/11/13/warning-issued-for-millions-of-microsoft-windows-10-windows-11-users/?sh=46cee80d49c0.

  • Windows Server authentication issues triggered by new security upgrades

    Windows Server authentication issues triggered by new security upgrades

    User Experience:

    “After installing the November security updates, you might have authentication failures on servers relating to Kerberos Tickets acquired via S4u2self,” Microsoft explains on the Windows health dashboard. On Tuesday after installating of security patches provided during Patch Users on Windows Server Domain Controllers (DCs) may face authentication difficulties, according to Microsoft. With some Kerberos delegation circumstances, these authentication vulnerabilities affect systems running Windows Server 2019 and lower versions.

    Affected Servers and Windows Issues:

    The following are all Windows Servers affected with issues :

    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2 SP1
    •  Windows Server 2008 SP2.

    The following are Windows updates with their versions :

    The following are Windows errors:

    Event Viewer may appear. The System event log contains the Microsoft-Windows-Kerberos-Key-Distribution-Center event 18.

    The Azure AD Application Proxy event log in Microsoft-AAD Application Proxy Connector event 12027 has the error 0x8009030c with the text Web Application Proxy encountered an unexpected.

    A signature similar to the following can be found in network traces:

    • 7281 24:44 (644) 10.11.2.12 .contoso.com KerberosV5 KerberosV5:TGS Request Realm: CONTOSO.COM Sname: http/xxxxx-xxx.contoso.com
    • 7282 7290 (0) . CONTOSO.COM

    The following are services used by the servers:

    • Active Directory Federated Services (ADFS)
    • Microsoft SQL Server
    • Load Balancers and other intermediate devices that conduct delegated authentication.
    • Integrated Windows Authentication (IWA) uses Kerberos Constrained Delegation in Azure Active Directory (AAD) Application Proxy (KCD).
    • Integrated Windows Authentication is used by Internet Information Services (IIS) (IWA)
    • Single Sign On (SSO) Web Application Proxy (WAP) Integrated Windows Authentication (IWA) (SSO).

     

    Microsoft Verdict on Impact:

    Kerberos authentication will fail on Kerberos delegation scenarios that rely on the front-end service to retrieve a Kerberos ticket on behalf of a user to access a backend service. Important Kerberos delegation scenarios where a Kerberos client provides the front-end service with an evidence ticket are not impacted. Pure Azure Active Directory environments are not impacted by this issue. – Microsoft

     

    Reference:

    Gatlan, S. (2021, November 11). Microsoft: New Security updates Trigger Windows Server Auth issues. BleepingComputer. Retrieved November 12, 2021, from https://www.bleepingcomputer.com/news/microsoft/microsoft-new-security-updates-trigger-windows-server-auth-issues/.

  • Zeek for pcap files

    Zeek for pcap files

    I have only used inbuilt scripts or commands, or tools in REMnux virtual machine in my previous blogs. So, this time I am going to download a Zeek tool in REMnux and use it to analyze .pcap files.

    Zeek is a tool to examine the .pcap files, and this platform is free to utilize and open-source software. It is made to investigate real-time network traffic, mainly used to distinguish oddities for cybersecurity purposes. Zeek deciphers and creates compact translation logs, file content, and fully customized output.

    .pcap is a data file containing the packet data of the network. .pcap is the short form of packet capture. This file contains the data and network analysis used to control network traffic and network status. These files cannot be opened normally and need special applications to open and analyze the contents.

    Some of the applications are

    Wireshark,

    WinDump, 

    Tcpdump and more.

    Similarly, online tools are available too like

    A-packets,

    MyPcapAnalyzer,

    PacketTotal and more.

    Introductions are over now; let’s get into the installation of the Zeek in REMnux. I will give a step-by-step procedure to install the tool.

    Step 1: Go to https://zeek.org/ and select downloads in get zeek.

    Step 2: REMnux is Linux oriented, so select Linux Binaries

    Step 3: Scroll the page down, and select the download link for the latest feature (highlighted in the image)

    Step 4: Select the Operating System Ubuntu. And choose Add repository and install manually.

    Step 5: The REMnux I have installed is Ubuntu 20.04 version, so I chose that. Copy the four lines and paste them into the REMnux terminal. For those who are not sure of their version, when you run the REMnux, the version of Ubuntu will be displayed on the screen.

    Step 6: After copying the command lines, press enter and let the code run its course. It will ask for permission to continue or not; choose yes. And the software will install in the system, and it will take some time depending on the network speed.

    Step 8: Select ok for the following command, and installation will be finished.

    The installed tool will be in opt folder. Now let’s change the directory and check the Zeek tool.

    cd /opt/zeek/bin/

    These are all the options that are available in the zeek tool

    Now let’s see how to use the zeek to open the .pcap file. If you don’t have a .pcap file to analyze, it can be downloaded from many available sources.

    It is better to create a separate directory as zeek will create many logs, so it will be easy to view the logs from the .pcap file and not confuse them with already existing files. After creating the new folder/directory, we need to specify the location of zeek as mentioned above. And the location of the .pcap files that need to be read by zeek.

    I have created a directory named trial in a tmp folder, and the .pcap file I used for this analysis is in downloads.

    /opt/zeek/bin/zeek -r ~/Downloads/fuzz-2006-06-26-2594.pcap

    Executing the command mentioned above will give the required logs such as conn.log, dns.log, packet_filter.log, etc.

    By using less command, we can read the log files in a detailed manner.

    less -S conn.log

    Similarly, all logs can be verified. If the data is too large and needs to view only the selected field, we can use the zeek cut option. For example, I need to view only the uid field in conn.log, and the following command is used.

    cat conn.log | /opt/zeek/bin/zeek-cut uid

    If needed, we can also easily take a single id and find where it correlates with all the other logs. We need to use the grep command for this purpose.

    grep CIoYZM2osApk8BUVVl *.log

    These are all the simple techniques in zeek, which are very easy to access the network traffic. Another important thing is that the log files obtained from the zeek can be used in the SIEM tool to compare further/correlate or analyze our data or other functions. We are converting the network traffic packets into logs and using them for a different purpose. By analyzing these log files, any unusual activities or threats can be identified, and other effects can be taken to neutralize the threat.

  • APT Used Commodity RATs to Take Advantage of a Geriatric Microsoft Bug – CVE-2017-11882

    APT Used Commodity RATs to Take Advantage of a Geriatric Microsoft Bug – CVE-2017-11882

    • Threat actors are targeting entities in India and Afghanistan using malicious domains with political and government themes.
    • A lone wolf threat actor is operating a crimeware campaign to get early access to high-value targets using a front company for future operations or monetary benefit.
    • Malicious documents with dcRAT and QuasarRAT delivered CVE-2017-11882  for Windows
    • CVE-2017-11882  – Microsoft Office’s memory corruption vulnerability, and AndroidRAT is being used to target mobile devices.
    • During the first reconnaissance phase of the attack, the actor additionally employs a custom file enumerator and infector.

    CVE-2017-11882 is a memory corruption issue in Microsoft Office that has been there for over 20 years and was just corrected in 2017. However, attackers were detected exploiting the weakness as recently as two years ago, which allowed them to run malicious malware without any user interaction. Researchers have discovered that a “Lone Wolf” APT is using a decades-old Microsoft Office weakness to deploy a flood of commodity RATs to organizations in India and Afghanistan.

    CVE-2017-11882–  Vulnerability lets the attacker to run arbitrary code in the context of the current user by failing to handle objects in memory correctly, aka “Microsoft Office Memory Corruption Vulnerability”. If the receiver falls for the bait and clicks on the RTF file, it downloads and runs numerous scripts of various types (VBScript, PowerShell, PHP, and others), which then download a backdoor payload. The backdoor payload then attempts to connect to a command-and-control server (which was unavailable at the time Microsoft Security Intelligence issued its warning).

    Attackers use domains with a political or governmental administration to deliver the RATs in destructive paperwork by exploiting CVE-2017-11882 as a trap in the marketing campaign. They use out-of-the-box RATs like dcRAT and QuasarRAT for Windows, as well as AndroidRAT, which Cisco Talos released on Tuesday.

     

    Attacker Benefits:

    Researchers stated that using commodity RATs allows attackers a wide range of out-of-the-box capabilities including preliminary reconnaissance, unrestricted command execution, and data exfiltration. For a variety of reasons, fraudsters and APTs are increasingly turning to commodity RATs rather than proprietary malware to attack users.

    Researchers broke down the attack process and RAT specifics used by attackers in the campaign. The process is of two stages.

     

    Exploiting Stages:

    The attack starts with RTF exploiting  CVE-2017-11882 in a vulnerable version of Microsoft Office which enables arbitrary code execution and finds every file on an infected endpoint.

    Remote shells, process management, file management, keylogging, arbitrary command execution, and credential-stealing are some of the features provided by RATs, which vary depending on the payload. These RATs also have stock features that require very minimal configuration changes to make it customized malware which made attackers use this commodity malware anywhere with ease.

    Reconnaissance:

    The Attackers use the malicious RTF and execute PowerShell to exploit the Office bug. PowerShell command extracts & executes the next-stage PowerShell script.

     

    Phase1: That script base64 decodes another payload through certutil.exe activates it on the infected endpoint.

     

    Payload base64-encoded as a fake certificate in the maldoc.

    Phase 2: This time another PowerShell script with an executable loader that base64 decodes another payload and activates it on the infected endpoint.

    PowerShell script snippet

     

    Phase 3: The loader executable first creates a shortcut in the current user’s Startup directory to establish persistence, and then compiles hardcoded C# code into an executable assembly. It then calls the entry point for the malicious code that has been generated.

     

    Phase 4: C# code with the file enumerator executed in stage 3 is the closing payload in the reconnaissance phase.

    • File Enumerator scans the endpoint for particular file types and provides the file paths to the command-and-control (C2) server.
    • File Infector Modules are rarely found executable infectors used to exploit CVE-2017-11882 by infecting susceptible Office documents with malicious OLE objects.

     

    Attack :

    Malicious RTF documents are used as the final payloads in RAT infection chains, notably dcRAT, which exploit CVE-2017-11882 to run a Stage 2 PS1 script.

    After that, the Stage 2 script exploits a BAT file, which runs another PowerShell command to download and execute the final payload on the infected endpoint.

    Three types of payloads will be delivered from the campaign’s remote locations: DcRAT, QuasarRAT, and a genuine copy of AnyDesk, a remote desktop client.

    PowerShell command.

     

    Final Payload :

    The last payload focused on manual activities, in which the actor would log onto infected computers to see if the access was valuable. Organizations should be aware of dangers that are strongly driven to spread through automated means. Also, it appears that the attackers will eventually forgo RATs in favor of developing their customized tools which implies that there will be more threat campaigns in the future.

     

     

    Reference:

    Malhotra, A. (1970, January 1). A malicious campaign uses a barrage of commodity rats to target Afghanistan and India. Cisco Talos Intelligence Group – Comprehensive Threat Intelligence: Malicious campaign uses a barrage of commodity RATs to target Afghanistan and India. Retrieved October 22, 2021, from https://blog.talosintelligence.com/2021/10/crimeware-targets-afghanistan-india.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A%2Bfeedburner%2FTalos%2B%28Talos%E2%84%A2%2BBlog%29.

  • APT28 attack attempts against 14,000 Gmail users

    APT28 attack attempts against 14,000 Gmail users

    On 6th, Google has warned about 14,000 Gmail users that they’ve been targets of Russian government sponsored APT28 phishing campaign.

    “We detected an APT28 phishing campaign targeting a large volume of Gmail users (approx 14,000) across a wide variety of industries in late September,” Shane Huntley, Director of Google’s Threat Analysis Group, told The Record in an email, in response to a question about how many users took to social media to post the message they received from Google.

    APT28 – Fancy Bear phishing

    The APT28, also known as Fancy Bear has previously targeted governments, militaries, and security organizations worldwide since 2004 on behalf of Russia’s General Staff Main Intelligence Directorate (GRU) 85th Main Special Service Center (GTsSS) military unit 26165 and now responsible for higher number of warnings for Gmail users across a variety of businesses.

    Their most recent targets are members of the Bundestag and member of Norwegian Parliament. APT28 attackers use spear-phishing techniques to breach gmail inboxes and obtain access to confidential information and then provide gateway to internal networks.

    Huntley says that “Fancy Bear’s phishing campaign accounts for 86% of all the batch warnings delivered this month and frequently targets on activists, journalists, government officials or National Security employees. Emails were automatically classified as spam and blocked by Gmail and we send awareness notices in batches to above mentioned people who were targeted by government backed attackers

    source: Barton Gellman

     

    Learnings :

    Phishing Attack Techniques:

    • Email Phishing : Emails with embedded link which will redirects to an unsecure website that requests sensitive information from employee once they click on it
    • Clickjacking : Malicious email or ad attached with Trojan which will allow the attacker to exploit security flaws to access sensitive information
    • Domain Spoofing : Spoofing as a reputable sender email address and request sensitive information
    • Voice Phishing : Impersonating a known firm vendor or IT department to get company information over the phone

    Steps for companies to protect against phishing:

    • Employee Training : Conduct training sessions and educate employees with mock phishing scenarios.
    • Spam Filter : Install a SPAM filter that can detect malware, blank senders, and other spam.
    • Updates : Maintain all systems with the most recent security patches and updates.
    •  Firewall : Install best firewall antivirus solution and schedule updates to monitor all the systems, application and network.
    • Security Policy : Create a security policy that addresses password expiration and complexity, among other things.

    Awareness :

    The APT28 attack primarily informs people that they may be a target for the next attack, therefore now is a good time to take security precautions. Google recommendation is to enroll in the Advanced Protection Program for work and personal email.

    Reference :

    Google blocked Russian government phishing emails targeting 14,000 users. VICE. (n.d.). Retrieved October 8, 2021, from https://www.vice.com/en/article/93yxe3/google-blocked-russian-government-phishing-emails-targeting-14000-users.

  • GriftHorse Android Trojan Stole Millions from 10 Million Users

    GriftHorse Android Trojan Stole Millions from 10 Million Users

    More than 10 million Android users are being impacted by the new GriftHorse mobile virus. According to security experts, these typical premium service scams are using phishing techniques to make $41 every month per user by

    GriftHorse apps in all categories were discovered by Zimperium on Google Play and third-party app stores. GriftHorse, a Trojan code discovered in more than 200 malicious apps in at least 70 countries, has been afflicting Android phones since November 2020, according to Zimperium researchers Aazim Yaswant and Nipun Gupta. Google has taken down the flagged apps, but there could be more play store and a variety of unofficial store apps on people’s phones could still be active.

    Distribution of GriftHorse Android malware victims. Source: Zimperium.

     

    How GriftHorse Trojan Android Malware Attacks:

    The new Trojan malware deceives Android users into sign up for a variety of paid services. Following their successful attack, affected Android users are required to pay around $41 in monthly premium subscription fees.

    The Trojans are built using the Apache Cordova mobile application development framework, according to Zimperium’s latest blog post. For cross-platform mobile development, Cordova allows developers to use standard web technologies such as HTML5, CSS3, and JavaScript. Developers can use this technology to push out app updates without requiring users to do so manually.

    While this framework improves the user’s experience and security, it can also be used to host malicious code on the server and develop an application that executes the code in real-time. The application appears as a web page with HTML, CSS, JavaScript, and image references.

    When an app is launched, for example, AES is used to decrypt the encrypted files in the “assets/www” folder. After a little more digging, the source code for the core functionality uses the GetData() function to encrypt an HTTP POST request and establish communication between the application and a first-stage command-and-control (C2) server.

    The app then receives an encrypted response, which is decrypted with AES to obtain a C2 URL for the second stage. According to the analysis, it also performs a GET request using Cordova’s “InAppBrowser” function to uncover a third-stage URL, and it begins sending user notifications about the alleged “prize” once every hour, five times in a row.

    Regardless of the application or the victim’s geolocation, the second-stage C2 domain is always the same.

    The third-stage URL redirects to a final page that requests the victim’s phone number and enrolls them in a variety of paid services and premium subscriptions.

    According to researchers, the JavaScript Interface facilitates interaction between the WebPage and in-app functions by allowing JavaScript code inside a WebView to trigger actions in native (application-level) code. This can include gathering information about the device, such as the IMEI and IMSI numbers, among other things.

    GriftHorse’s success, according to the researchers, is due in part to the fact that it avoids pattern-based detection and blocking by not reusing common strings in the application code.

    GriftHorse Apps:

    • 100% Projector for Mobile Phone
    • 3D Camera To Plan
    • Amazing Sticky Slime Simulator ASMR\u200f
    • Amazing Video Editor
    • AR Phone Booster – Battery Saver
    • Bag X-Ray 100% Scanner
    • Battery Live Wallpaper 4K
    • Bus – Metrolis 2021
    • Bus Driving Simulator
    • Call Blocker-Spam Call Blocker
    • Call Blocker-Spam Call Blocker
    • Call Recorder Pro
    • Call Record Pro
    • Call Recorder iCall
    • Caller ID & Spam Blocker
    • CallerID
    • Caller-x
    • CallHelp: Second Phone Number
    • Chat Translator All Messengers
    • CIAO – Live Video Chat
    • Cinema Hall: Free HD Movies
    • Clap
    • Clap To Find My Phone
    • ClipBuddy
    • Color Call Changer
    • Coupons & Gifts: InstaShop
    • CutCut Pro
    • Daily Horoscope & Life Palmestry
    • Dating App – Sweet Meet
    • Easy Bass Booster
    • Easy TV Show
    • Ela-Salaty: Muslim Prayer Times & Qibla Direction
    • English Arabic Translator direct
    • Face Analyzer
    • FastPulse – Heart Rate Monitor
    • FindContact
    • Fingerprint Changer
    • Fingerprint Defender
    • Fitness Point
    • Fitness Trainer
    • Forza H Mobile 4 Ultimate Edition
    • PikCho Editor app
    • Plant Camera Identifier

    • Heart Rate and Meal Tracker
    • Heart Rate and Pulse Tracker
    • Heart Rate Pro Health Monitor
    • Heart Rhythm
    • HOO Live – Meet and Chat
    • Horoscope: Fortune
    • Hunt Contact
    • iCare – Find Location
    • iConnected Tracker
    • Icony
    • Idle Gun Tycoo\u202an\u202c
    • Instant Speech Translation
    • Intelligent Translator Pro
    • iSalam Qibla Compass
    • iTranslator_ Text & Voice & Photo
    • Keyboard Themes
    • Keyboard: Virtual Projector App
    • KFC Saudi – Get free delivery and 50% off coupons
    • Language Translator-Easy&Fast
    • Launcher iOS 15
    • Launcher iOS for Android
    • Lifeel – scan and test
    • Live Mobile Number Tracker
    • Live Wallpaper & Background
    • Loca – Find Location
    • Locatoria – Find Location
    • Locker Tool
    • Ludo Game Classic
    • Ludo Speak v2.0
    • Mine Easy Translator
    • Mobile Things Finder
    • My Chat Translator
    • My Locator Plus
    • OFFRoaders – Survive
    • Parallax paper 3D
    • Phone Caller Screen 2021
    • Phone Finder by Clapping
    • Phone Search by Clap
    • PhoneControl Block Spam Calls
    • Photo Effect Pro
    • Photo Lab
    • Piano Bot Easy Lessons
    • Handy Translator Pro
    • Pony Video Chat-Live Stream

    • Qibla Compass (Kaaba Locator)
    • Qibla correct Quran Coran Koran
    • Qibla direction watch (compass)
    • Qibla Finder – Qibla Direction
    • Qibla Pass Direction
    • Qibla Ultimate
    • QR Code Reader – Barcode Scanner
    • QR Reader Pro
    • R Circle – Location Finder
    • Racers Car Driver
    • Safe Lock
    • Scanner App Scan Docs & Notes
    • Scanner Pro App: PDF Document
    • Screen Mirroring TV Cast
    • Second Translate PRO
    • Skycoach
    • Slime Simulator
    • Smart Call Recorder
    • Smart Spot Locator
    • SnapLens – Photo Translator
    • Soul Scanner – Check Your
    • Squishy and Pop it
    • Stickers Maker for WhatsApp
    • Street Cars: pro Racing
    • TagsContact
    • Translate It – Online App
    • Truck – RoudDrive Offroad
    • TrueCaller & TrueRecoder
    • Vector arts
    • Video & Photo Recovery Manager 2
    • VPN Zone – Fast & Easy Proxy
    • What’s Me Sticker
    • WiFi Unlock Password Pro X
    • You Frame
    • Zodiac : Hand
    • Быстрые кредиты 24\7
    • Free Calls WorldWide
    • Free Coupons 2021
    • Free Islamic Stickers 2021
    • Free Translator Photo
    • FX Keyboard
    • Geospot: GPS Location Tracker
    • GetContacter
    • GPS Phone Tracker – Family Locator

    Victims are tricked into downloading Android apps that appear to be safe and legitimate. The most popular malicious app — a translator — has received at least 500,000 downloads and ranges from puzzle games and utilities to dating software, food, and drink.

    Source: zLabs

    Prevention and Safety:

    Mobile application sources and permissions:

    The researchers discovered that 10.5 percent of the 68,051 apps they looked at shared personal information with third-party services without disclosing it in their privacy policies. In addition, only 22.2 percent of the 68,051 apps named third-party partners or affiliates in their privacy policies, with most apps concealing where user data is collected.

    Sensor data, call logs, camera and microphone access, location, storage, and contact lists are among the permissions that apps can request. While many legitimate apps require access to certain features, you should always be aware of which apps have access to which data in order to avoid unnecessary security risks or data leaks.

    No matter which mobile operating system we use, download apps from verified, trusted sources is the best option to maintain your security and privacy. To be on the safe side, you should uninstall any application that you no longer require.

    Mobile malware:

    Mobile malware has become as popular as malicious software but with these variants infecting Android, iOS, and sometimes make their way into official app stores. Malware developers frequently use the technique of submitting a legitimate-looking mobile application and then uploading malicious functions once a user base has been established.

    It’s recommended that you download and install an antivirus software solution for mobile devices, however, you will probably be safe enough as long as you do not jailbreak your phone and Instead of third-party repositories, you only download the app. APKs from trusted sources.

     

    Reference:

    GriftHorse Android TROJAN steals millions from over 10 million VICTIMS Globally. Zimperium Mobile Security Blog. (2021, September 29). Retrieved September 30, 2021, from https://blog.zimperium.com/grifthorse-android-trojan-steals-millions-from-over-10-million-victims-globally/.

    Seals, A. T., & Seals, T. (n.d.). GriftHorse money-stealing TROJAN Takes 10M Android users for a ride. Threatpost English Global threatpostcom. Retrieved September 30, 2021, from https://threatpost.com/grifthorse-money-stealing-trojan-android/175130/.

  • Phishing Email & attachment Analysis

    Phishing Email & attachment Analysis

    We’re going to talk about how to address infected PDF files and extract malicious indicators from within them without endangering yourself or your PC. Dealing with infected pdf and doc files happens nearly all day in IT security operations centres. The users may report phishing, and our job as security analysts will be to figure out if those files are malicious or not. We have to do that safely, quickly, and accurately.

    Let’s consider a scenario where we have received a pdf file in the mail or other methods. We don’t know whether the pdf file is infected or not, and we are not able to use most of the soc tools. So we have to manually check if the pdf contains any phishing attack.

    The first thing we need for malware analysis is to get ourselves a virtual machine. It is highly advisable never to play with any malware files on your computer or any computer you care about.

    The easiest way to seclude malicious files in a safe space is to put them in a virtual machine and then isolate that virtual machine from the rest of the network and our computer.

    The virtual machine that is going to be discussed in this blog is REMnux.

    It is a virtual machine full of reverse engineering tools ready to go premade for the users.

    I would highly recommend downloading this first. On the home page, you can click on the distro and download REMnux VM.

    When you click the download option, it will take you to the next page, and there we can download the ova file from a primary or mirror source.

    I am using a VMware workstation, so I have downloaded the ova file from the general category. If someone uses VirtualBox (Oracle), they can download the ova file from that category.

    In the VMware workstation, we can directly import the ova file.

    Once the installation is finished, we will be moved to the virtual machine with Linux and many pre-loaded malware analyzing tools.

    In this blog, we will see only the basics of dealing with phishing in PDF and office doc files.

    So first, we need an infected file to work with. For that, we are going to download a file from any.run it’s an online malware sandbox. There are other online sandboxes available too. To download the sample file from the sandbox, we are required to have an account on the site. It’s applicable to almost all sandboxes, and most of it will be free accounts only.

    On the webpage, go to services and select public tasks, which will be on the left side of the page.

    There will be multiple files available on that page. We are looking only for the malicious PDF file, so using the filter option to search for the pdf file with the verdict malicious will give the results we needed. I have downloaded a random pdf file named VR-009.pdf.

    In the REMnux terminal, we are going to check this file without opening it. The file will be available in the download folder.

    It can be seen that the file is in zip format, so first, we need to unzip it. These kinds of sample files will usually be password-protected so that we won’t accidentally open them and infect our system.

    The password for the file was given when the sample was downloaded. Usually, it will be infected for all the samples.

    Now the pdf file is extracted, and we need to check for any threats without opening it. There is an easy way to avoid opening this and still kind of extracting what might be inside.

    In most pdf files, the threat will be some kind of link, so when you open the pdf, it will direct you to the web link with the file. Our job is to extract that link without opening the pdf as it might have caused some exploits.

    The easiest way is to use the strings command, and strings is a command that’s basically in every Linux. So now we use the strings command with the name of the pdf; it is also recommended to pipe into less command.

    strings VR-009.pdf | less

    The output of strings is going to be every sequence of printable ASCII characters in that file.

    It is easy to find the URL in the pdf by using the strings command as printable text. So the easiest way to look for that URL without having a sandbox or anything like that is by looking for the word http in the pdf file. For that, we are going to use the grep command.

    strings VR-009.pdf | grep http

    The results show the URL found in the pdf. This might be a phishing attack where the attacker wants the user to go to that link in that file.

    Now, let’s check how the malicious pdf file might look in the sandbox tool. If we click the pdf file in any.run website, it’ll show all the reports below.

    The pdf file opens the link to some webpage, and it continues to YouTube channel and asking to change some settings.

    So, working as SOC analyst, if we get this pdf file for verification and don’t have a sandbox or other tools, this is the easiest manual method to extract the link without exposing ourselves to the risk.

  • THM Walkthrough – Vulnversity Part 2

    THM Walkthrough – Vulnversity Part 2

    In this blog as promised last time we will compromise the webserver with Burp Suite.

    Task 4: Compromise the webserver

    I have tried uploading few extensions like .jpeg, .txt, .php etc but it was blocking my uploads.

    Now we need to find out extension that can be successfully uploaded. To do that Option 1 is to do this process manually by uploading file and if the website rejects it then upload another file with different extension and keep repeating this process until something gets through. But its tedious, time consuming and no fun as I have already tried with few files.

    So, for this we will use Option 2 which is the Fuzzing technique. For that my go to tool is Burp Suite.

    Burp Suite:

    For this blog I am using free “Community” edition which comes preinstalled with Kali.

    If you are suing Burp for the 1st time, then you need to configure your we browser to use it. For that please refer https://portswigger.net/burp/documentation/desktop/getting-started/proxy-setup/browser

    Also don’t forget to install Installing Burp’s CA certificate. https://portswigger.net/burp/documentation/desktop/getting-started/proxy-setup/certificate

    Last and optional step of burp setup is configuring some add-on that will allow you to easily switch between web proxies with a single click. For my Firefox browser I am suing FoxyProxy. https://addons.mozilla.org/en-US/firefox/addon/foxyproxy-standard/

    Below is my configuration for Burp proxy. 

     

    So now using this add-on, I can easily switch to Burp with a simple click when needed.

    Now lets move on to part where we will have some hands-on action with Burp.

    Here we will use Intruder to fuzz the Vulversity website upload function and find out which extension is accepted.

    Intruder has 4 types of Attack: Sniper, Battering ram, Pitchfork, Cluster bomb. Out of them Sniper attack is most suitable here.

    Burp Intruder Sniper Attack:

    Sniper – This uses a single set of payloads. It targets each payload position in turn, and places each payload into that position in turn. Positions that are not targeted for a given request are not affected – the position markers are removed and any enclosed text that appears between them in the template remains unchanged.

    This attack type is useful for fuzzing a number of request parameters individually for common vulnerabilities. The total number of requests generated in the attack is the product of the number of positions and the number of payloads in the payload set.

    Step 1: Start a New/Temporary Project on Burp Suite. Go to Target and set up scope. Add Vulnversity IP address. http://10.10.249.116:3333

    If you also get this Proxy History logging, click yes and move on. So now we can see that the target is added in the scope.

    Step 2: Go to Target > Site map > click on Filter and you will get following options.

    Here select show only in-scope item filter.

    Step 3: Go to Proxy and click on Intercept tab and ensure that interception is on (if the button says “Intercept is off” then click it to toggle the interception status).

    Step 4: Now before visiting to Vulnversity website it’s a good idea to go to Proxy > HTTP History tab. Click on filter and enable show only in scope items.

    Step 5: Go to Foxy Proxy and turn the Burp on

    Step 6: Now, Go to vulversity site and upload any extension file on that. I am uploading Pwd.txt file here.

    Step 7: Now check in Proxy > HTTP History. You must have a captured a POST request for file upload on  vulnversity site internal upload page.

    Select that and send it to Intruder sing right click.

    Step 8: When you go to Intruder > Positions tab, you will find following.

    Clear § – This removes all position markers, either from the entire template or from the selected portion of the template.

    Here click on clear which will clear all 3 selected payload positions like Filename, contents of file, Submit.

    Step 9: Now only select extension of a file, in my case I have selected “txt” and click on add which will insert a new payload marker for extension of file.

    Add § – If no text is selected, this inserts a single payload marker at the cursor position. If you have selected some text, a pair of markers are inserted enclosing the selected text.

    Step 10: Now Go to Intruder > Payloads tab. Check for Paylod set selections as below.

    Step 11:  Now here we can either create our own simple word list file with all possible extensions and upload that or can also add few manually in payload options. But I know very good GitHub Repository which has many possible and common files of word lists for different purposes. We will also be using this for other tasks in this blog. https://github.com/danielmiessler/SecLists

    I have cloned it in my Kali machine.

    Step 12: Click on the load button and Select payload.

    Here I am using extensions-most-common.fuzz.txt file.

    As you can see content of file is loaded here in Payload options. So this sniper attack will try to upload this 30 extensions to find out which one works.

    Step 13:  Click on start attack. Once Sniper attack starts, and it will take few sec to run and will provide us with following results.                                              

    Here when checking a length column for each file extension type, we can see that .phtml stands out. Yei..!!! Attack successful. So using fuzzing technique and sniper attack, now we know that this website allows only .phtml file uploads.

    Quick google search about What is a PHTML file gave me following:

    Files with the .phtml extension are most commonly associated with PHP Web pages. The PHTML files contain PHP code that is parsed by a PHP engine. This allows the Web server to generate dynamic HTML that is displayed in a Web browser. The PHTML files are often used to access databases. The pages containing the PHTML code are usually displayed with the .php page extension.

     

    Using Reverse Shell:

    Now we will use a PHP reverse shell payload. A reverse shell works by being called on the remote host and forcing this host to make a connection to you. So you’ll listen for incoming connections, upload and have your shell executed which will beacon out to you to control!

    There are many php reverse shell you can use but the one we will use is by provided by pentestmonkey on Github.

    You can use the one which is available in Seclists which we just downloaded. You can find it in Web shells directory.

    But this machine instructed us on using following so we will go with that for this walkthrough. There are many php reverse shell you can use but the one we will use is by provided by pentestmonkey on Github.

    https://github.com/pentestmonkey/php-reverse-shell

    Download it to /usr/share directory.                                                        

    Checking if its cloned correctly.

    Since I am using this pentestmonkey’s reverseshell 1st time, so i was curious about what it does and how it works so I decide to check out code.

    And here I found out that loopback address is specified in the IP address and we have to change that. But 1st lets analyze the rest of the code.

    Okay so after going through this script, now we know that it will make an outbound TCP connection to a hardcoded IP and port and the recipient will be given a shell running as the current user (Apache normally).

    Now coming back to changes for IP Address, I must change it to my current IP address of my local machine. For this use Command: ifconfig

    For port number you can specify any port.

    While saving the changes I have Saved file using the “phtml” extension that we discovered with our sniper attack.

    Yes, it’s here.

    Uploaded php-reverse-shell.phtml.

    Yes..!!! That’s uploaded successfully as expected.

    Now we are one step closer to hacking the Vulnversity machine.

    Stay tuned for Next part where, we will find out where that file is being uploaded. Then connect to the machine using php reverse shell and try to find out user flag and root access through privilege escalation. Till then, Happy Hacking..!!!

    References:

    https://portswigger.net/burp/documentation/desktop/tools/intruder

  • Optimum – HackTheBox Walkthrough – Part 2

    Optimum – HackTheBox Walkthrough – Part 2

    As we saw in the first part of this Optimum walkthrough, it is a beginner-level machine that is more of an enumeration of services with known exploits. These exploits are easy to work out and get the flag.

    Let us continue from where we left.

    As I had an issue with Windows-Exploit-Suggester I am using Metasploit to do privilege escalation.

    msf6 exploit> use post/multi/recon/local_exploit_suggester

    before using the post-exploitation, we have to know the session

    then set the session in my case

    >set SESSION 1

    Sherlock

    PowerShell script to quickly find missing software patches for local privilege escalation vulnerabilities: https://github.com/rasta-mouse/Sherlock/

    We have to import the Sherlock script to Powershell to execute it.  DO NOT USE SHELL !! it won’t work. Use Powershell

    meterpreter> powershell_import /home/kali/Downloads/Sherlock/Sherlock.ps1

    meterpreter>powershell_execute Find-AllVulns

     Title      : User Mode to Ring (KiTrap0D)

    MSBulletin : MS10-015

    CVEID      : 2010-0232

    Link       : https://www.exploit-db.com/exploits/11199/

    VulnStatus : Not supported on 64-bit systems

     

    Title      : Task Scheduler .XML

    MSBulletin : MS10-092

    CVEID      : 2010-3338, 2010-3888

    Link       : https://www.exploit-db.com/exploits/19930/

    VulnStatus : Not Vulnerable

     

    Title      : NTUserMessageCall Win32k Kernel Pool Overflow

    MSBulletin : MS13-053

    CVEID      : 2013-1300

    Link       : https://www.exploit-db.com/exploits/33213/

    VulnStatus : Not supported on 64-bit systems

     

    Title      : TrackPopupMenuEx Win32k NULL Page

    MSBulletin : MS13-081

    CVEID      : 2013-3881

    Link       : https://www.exploit-db.com/exploits/31576/

    VulnStatus : Not supported on 64-bit systems

     

    Title      : TrackPopupMenu Win32k Null Pointer Dereference

    MSBulletin : MS14-058

    CVEID      : 2014-4113

    Link       : https://www.exploit-db.com/exploits/35101/

    VulnStatus : Not Vulnerable

     

    Title      : ClientCopyImage Win32k

    MSBulletin : MS15-051

    CVEID      : 2015-1701, 2015-2433

    Link       : https://www.exploit-db.com/exploits/37367/

    VulnStatus : Not Vulnerable

     

    Title      : Font Driver Buffer Overflow

    MSBulletin : MS15-078

    CVEID      : 2015-2426, 2015-2433

    Link       : https://www.exploit-db.com/exploits/38222/

    VulnStatus : Not Vulnerable

     

    Title      : ‘mrxdav.sys’ WebDAV

    MSBulletin : MS16-016

    CVEID      : 2016-0051

    Link       : https://www.exploit-db.com/exploits/40085/

    VulnStatus : Not supported on 64-bit systems

    Title      : Secondary Logon Handle

    MSBulletin : MS16-032

    CVEID      : 2016-0099

    Link       : https://www.exploit-db.com/exploits/39719/

    VulnStatus : Appears Vulnerable

     

    Title      : Windows Kernel-Mode Drivers EoP

    MSBulletin : MS16-034

    CVEID      : 2016-0093/94/95/96

    Link       : https://github.com/SecWiki/windows-kernel-exploits/tree/master/MS16-034?

    VulnStatus : Appears Vulnerable

     

    Title      : Win32k Elevation of Privilege

    MSBulletin : MS16-135

    CVEID      : 2016-7255

    Link       : https://github.com/FuzzySecurity/PSKernel-Primitives/tree/master/Sample-Exploits/MS16-135

    VulnStatus : Appears Vulnerable

    Title      : Nessus Agent 6.6.2 – 6.10.3

    MSBulletin : N/A

    CVEID      : 2017-7199

    Link       : https://aspe1337.blogspot.co.uk/2017/04/writeup-of-cve-2017-7199.html

    VulnStatus : Not Vulnerable

    There are only 3 exploits that seem to work MS16-135, MS16-032, MS16-034.

    Out of three only MS-16-032 – This module exploits the lack of sanitization of standard handles in Windows’ Secondary Logon Service. The vulnerability is known to affect versions of Windows 7-10 and 2008-2012 32 and 64 bit. This module will only work against those versions of Windows with Powershell 2.0 or later and systems with two or more CPU cores.

    Now let’s see if the exploit is available in Metasploit

    >search ms16-032

    We got the exploit so now set the necessary options and don’t forget to set the session. Without setting the session the exploit will not work

    EXPLOITED !!!  We got the session perfectly and after checking the id

    >getuid

    Server username: NT AUTHORITY\SYSTEM

    Now finally to get the flag we have to go to the administrator folder

    >type\Users\Administrator\Desktop\root.txt

    We successfully pwned(owned) the system.

     You can also use this exploit https://www.exploit-db.com/exploits/41020/

  • THM Walkthrough – Vulnversity Part 1

    THM Walkthrough – Vulnversity Part 1

    I am back with my favorite type of blog which is walkthrough of THM machine. In this machine we will Learn about active recon, web app attacks and privilege escalation. We will also learn how to attack using burp suite Intruder.

    Task 1: Deploy the machine 

    Got Connected to THM server and OpenVPN Servers and deployed Vulnversity machine.

    Task 2 : Reconnaissance

    Using Nmap for this with command: namp -T4 -sC -sV -vv <IP>

    As we can see here in the namp Scan results,
    • We found 6 open ports.
    • Squid http-proxy is open on port 3128
    • http is open on port 3333
    • They are using OS Ubuntu Linux
    As ftp is open on port 21, lets try to connect:

    Both of them are password protected. So we should try other ways.
    From namp scan we also got that http is running on port 3333. Let’s browse it to find out what do we have:

    Task 3: Locating directories using GoBuster

    Now that we have a website access, Lets start scanning the website to find any hidden directories. Here this machine required us to use GoBuster tool for that but you can use any other tool. Check Out my  Rick & Morty Blog I have used dirbuster tool for same purpose. 

    GoBuster is a tool used to brute-force URIs (directories and files), DNS subdomains and virtual host names. For this machine, we will focus on using it to brute-force directories.

    If you are like me and don’t have gobuster installed in your system, Download GoBuster here, or run sudo apt-get install gobuster

    But when I tried to install it, I was having following issues:

    I tried to troubleshoot by checking and adding source repositories to source file /etc/apt/sources.list (It Can be found here: https://www.kali.org/docs/general-use/kali-linux-sources-list-repositories/)

    But again, got same error message. Then I thought of cloning it from git repository.

    Still it was not getting installed. Upon investigating further got to know that my system was lacking Go language.

    Since this tool is written in Go language we need to install the Go language/compiler/etc. Full details of installation and set up can be found on the Go language website. Once installed, we need at least go 1.16.0 to compile gobuster.

    This is one way to do it or you can directly go to https://github.com/OJ/gobuster/releases and install this latest release ( at the time of writing this blog, I have used this: gobuster-all.7z ) which comes with everything we need to make gobuster work like go language and compiler.

    Finally got my Gobuster installed and running:

    Now to get started with directory search, we will need a wordlist for GoBuster (which will be used to quickly go through the wordlist to identify if there is a public directory available. If you are using Kali Linux you can find many wordlists under /usr/share/wordlists.)

    Command: gobuster dir http://<IpAddress>:<Port> <Path To Wordlists>

    gobuster dir -u http:// 10.10.135.231:3333 -w /usr/share/wordlists/dirb/common.txt

    dir: uses directory/file brute forcing mode

    -u: the target URL or domain

    -w: path to word list

    After Checking, Out of all this results, found something interesting in /internal page.

    Yes your guess is right…!!! It’s a File upload Vulnerability.

    In this part of the blog, I have completed Task 1,2 & 3 of the vulnversity machine.

    In next part we will learn how to compromise the web server. We will also use Application security testing tool, Burp Suite and I will show you step by step process to execute Burp suite Intruder attack, so we can compromise Vulnversities webserver and get user flag. It will be interesting so stay Tuned for next part. Until then, Happy Hacking…!!!