Categories

Showing posts with label INFOSEC TIPS. Show all posts
Showing posts with label INFOSEC TIPS. Show all posts

InfoSec: Threat Hunting Opsec

(This material was presented as a talk during the 2019 BSides Vancouver)

Operational security (or “OpSec”) is not a novel concept in the field of cybersecurity. Like the "DMZ" it is yet another term borrowed by infosec from the military terminology. OpSec refers to the practice of conducting operations in a manner that does not make the adversary’s job easier. Offensive operators tend to pay close attention to their OpSec when conducting their campaigns. Historically, poor OpSec has been one of the most common ways for attackers to get caught or have their identity unmasked. However, practicing good OpSec is just as important for defenders. Security Operations Centers, Incident Responders and Cyber Threat Hunting teams should always consider whether their conduct may help the attacker further their objective.

Experienced Incident Responders could likely recite several OpSec mantras if you woke them up in the middle of the night. "Don’t use a domain admin account for responsive actions," "don’t upload payloads to VirusTotal," and so on. Threat Hunting is often referenced as "Incident Response without an incident." As such, its OpSec goals are the same. However, the challenges in achieving them are rather unique.

If we are performing Incident Response, we already know that an incident has occurred. We are even likely to have at least a general idea of where the attacker is in the environment. Something happened to alert us to the activity. An alert was triggered, a report was received from an end-user, or a degradation of system performance has been observed, which pointed us to the suspected location of the attacker. From there, we can start to pull on the thread and follow the breadcrumbs. We can profile, scope out and, eventually, contain the intrusion. Knowing where the attacker may be, inherently helps us reduce the risk of them being tipped off to being discovered. 

Random Acts of Incident Response

When Threat Hunting, we do not have that luxury. We do not know where the attacker is. In fact, we do not even know if the attacker is in our environment at all. We formulate a hypothesis that if an attacker were in our environment, we would be able to observe indicators of certain techniques on certain systems. We then go out and check every system in scope of the hunt for the presence of said indicators. Now, what happens if the attacker is on one of said systems? What happens if they notice that you have just ran a check intended to identify them? That in a matter of minutes, as you review the results, you will be onto them? If the attacker realizes that you are about to disrupt their campaign, they may do something terrible.



Best-case scenario, if they are not yet close enough to their action on objective, they may decide to go covert. They will take the scorched earth approach and clean their artifacts from the environment. They will set up a low-and-slow C2 channel, or a scheduled reverse shell. And a few months out, when we are no longer looking for them, they will be back. That is a best-case scenario and, yet, we have failed our objective of eradicating them from our environment. Worst case scenario is the attacker deciding to expedite their action on objective. This can range from exfiltrating our crown jewels, to pushing a ransomware payload to every system in your network.

I think we can all agree that, depending on the severity of the resulting incident, this may lead to what we often refer to as a “resume generating event.” We will go from being the “good guys” - threat hunters trying to help our company reduce the attacker dwell time - to being what the industry refers to as a “root cause”. And a "root cause" is not a good thing to be. A "root cause" gets written up in incident reports. A "root cause" gets brought up in "nameless and rankless" post-mortems. A "root cause" is talked about in attorney-client communications. We do not want to be the “root cause.”

Enter Passive Data Sources

How can we minimize the chance of an OpSec failure turning us into a “root cause” while we are threat hunting? One of the most effective measures is the use of passive data sources. This is likely something that most are already doing out of convenience anyways. I am referring to tools that abstract the logs, metadata, and telemetry information away from the endpoints where the attackers might be present. There, we can analyze the data without the risk of attackers realizing we are looking at it. Data sources like SIEMS and EDRs fall into the passive category. They enable us to stack, pivot and analyze indicators without any chance of attackers being tipped off to us doing it*. I have added an asterisk to the last statement so that we can get back to it later.

Here are some examples of the passive data sources that we can use for Threat Hunting:

  • EDR: Tanium, Carbon Black, CrowdStrike, SentinelOne, Sysmon, PowerShell (Oriana)
  • SIEM: Splunk, ArcSight, Qradar, LogRythm, ELK, Greylog
  • NTA: NetWitness, StealthWatch, Vectra, Awake, Snort, ExtraHop, Zeek, Moloch, Security Onion, RITA
  • OSINT: VirusTotal, Hybrid Analysis, URLscan, Mnemonic PDNS, PassiveTotal

One could argue that the “OSINT” sources listed above are not in the same category. They tend to not make our environment telemetry available for offline hunting. However, they can be very helpful for indicator and finding validation, so I will still cover them in this section.

Are They Passive?

Before hunting within passive data sources, it is important to understand how they work and if they are indeed passive. For example, a well-known EDR solution, Tanium, does not abstract the data away from the endpoints in its base implementation. It queries the data on demand, whenever a question is issued. This can be observed on the endpoint, alerting the adversary to the hunting activity. Another common example of a data source that can turn from passive to active is VirusTotal. Searching for a file hash in VirusTotal is perfectly safe from an OpSec standpoint. Uploading that file to VirusTotal for analysis will cause an OpSec failure. If the uploaded payload is unique to your environment, external parties will see a new scan result for that hash the moment it is uploaded. They can then conclude that they have been discovered. This happened to RSA Security in 2011 - someone uploaded the initial phishing email containing the zero-day payload to VirusTotal, allowing the public to perform attribution on the attack. Similar considerations apply to performing public (vs. private) page scans in urlscan.io, and to other OSINT data sources.

Securing the Data Sources

Another important aspect of using passive data sources is making sure that they cannot be accessed by the adversary. *This is where that asterisk from above comes in. This is where we get to “drink our own Kool-Aid”. Where we get to practice all those controls that we have been preaching to our users for decades. Password complexity, role-based access control, multifactor authentication, principles of least privilege, etc. It does not matter if our data sources are passive if an attacker can gain access to them. With access to our SIEM or EDR, attackers will be able to observe our hunting activities and adapt their TTPs to avoid detection. They may also use them to their advantage: identifying our crown jewels and high-value targets, modifying configurations and purging logs to avoid detection, leveraging remote execution capabilities to deploy their payloads. In the wrong hands our data sources become a powerful weapon. And if we end up arming the adversary with our own tools... well, you get it - "root cause."

Beyond the Passive Data Sources

Fast forward some months. We figured out and secured our passive data sources. We can threat hunt in our environment in an OpSec conscious manner. With this being the real world, we eventually come across a system where our SIEM or EDR just do not get us the visibility we need. We find that eventually we must take a measured OpSec risk and connect to the actual endpoint to get the information we need. Here are some things that we can do to improve your OpSec when forced to hunt on actual endpoints.

Attribution is a Two-Way Street

The funny thing about attribution is that it goes both ways. When an adversary enters our environment, they do not create new accounts with identifiable names (e.g., APT37). Instead, they “live off the land,” using existing accounts that they managed to take over. Or, if they must create one, they will observe and follow our account naming conventions. They do this to blend in and avoid detection by masquerading as common activity in our environment. We can borrow a page from their playbook. We can also use accounts and systems that cannot be attributed back to us when we do Threat Hunting. We already know the accounts whose activities most closely resemble Threat Hunting activities in our environment. In most environments these are vulnerability scanning or asset management discovery accounts. We can work with the corresponding teams to create accounts that, for all intents and purposes, appear to be owned and operated by them. Create some source systems that appear to be owned by them while you are at it. This way should the attackers observe our hunting activity, they will most likely assume that it was just another recurring asset inventory scan. Of course, they will still try to steal those credentials for their purposes (see the beginning of this paragraph), so let us address this next. 

Accounts are Free, Compromises are Not

When an adversary observes accounts connecting to systems under their control, they will absolutely attempt to steal those credentials. As the adage goes - “two is one, one is none.” An attacker with only one privileged account is one password change away from being locked out from the environment. They will attempt to gather additional credentials, including those unattributable accounts that we created for hunting. And that presents another opportunity for becoming the “root cause.” We should always limit the level of privilege that we grant to the accounts used for hunting. If all we need is to be able to pull running processes from workstations, we should set the account permissions for our environment accordingly. If all we need is the “badPwdCount” attribute in Active Directory (for statistical password spray detections) - we should have an account just for that. Accounts are free, compromises are not. Another option for limiting privileged credential exposure is to use unique per-system local admin accounts. While slightly more complicated to implement, solutions such as Microsoft LAPS, CyberArk or Hitachi ID make it possible. Unique local accounts can be used for hunting, with no risk of giving attacker access to additional systems in our environment. And we should never ever hunt using a full-fledged Domain Admin account! 

Another way to reduce the likelihood of attackers stealing our Threat Hunting credentials used for hunting, is choosing how we execute commands on remote systems. For example, PsExec uses local authentication and will most likely expose your credentials to the attacker running Mimikatz or Flamingo on the target endpoint. PowerShell Remoting (without the CredSSP option), uses network authentication and makes it nearly impossible to obtain the credential locally. Some EDR vendors also offer functionality to execute scripts on remote endpoints. This being done in the context of the EDR agent reduces the risk of shared credential exposure during remote command execution. But we need to make sure that we understand how our EDR does this, before choosing this option. SentinelOne on Windows and OS X, for example, creates a new local admin account when remote shell functionality is used. While not giving the adversary access to shared credentials, it will most definitely alert them to the fact that someone is snooping around on the system within their control. Queue the "root cause" conversation…

Summary

Maintaining good operational security is an important aspect of a mature Threat Hunting capability. Use passive data sources as much as possible. EDRs, SIEMs, Netflow and packet capture are your friends. Make sure you understand how your data sources function and how to secure them. Make attribution of your activity to the Threat Hunting difficult for attackers. Hide in the noise, masquerade as non-hunting teams, name your accounts and your source systems accordingly. Control your credentials. Never use a domain admin account for hunting. Consider which services and protocols you use to connect to target systems. Avoid becoming the root cause.

InfoSec: RegEx to Match Linux "Cover Your Tracks" Commands

There are a number of commands that may be used to conceal nefarious activity on a Linux system, mostly through removing or overwriting the shell history files and logon activities:

kill -9 $$
history -c 
export HISTFILESIZE=0 
export HISTSIZE=0 
unset HISTFILE
echo "" > /var/log/auth.log
ln /dev/null ~/.bash_history -sf
rm ~/.bash_history -rf
echo "" > ~/.bash_history
shred -zu ~/.bash_history

Here is a quick-and-dirty RegEx to match on these when hunting through your EDR or system logs:

((rm|ln|echo|shred).*\.bash_history.*)|((export|unset) HIST(FILE)?(SIZE=0)?)|(kill -9 \$\$)|(history -c)|(echo.*\/auth\.log)

Enjoy.

InfoSec: Querying the Recorded Future API using PowerShell

Recorded Future has a great Connect API with many options to retrieve, search or download every type of IOCs they offer as part of their subscription. Unfortunately, as most API providers out there, they only publish the instructions for accessing the API using common tools/languages (e.g. cURL, Python).

If you have a need to query their API using PowerShell because, for example, you are looking to add reputation checks to your O365 PowerShell Online script (or if you just prefer PowerShell), this post will hopefully save you a few minutes figuring out how to pass the API key to their API in the Invoke-WebRequest cmdlet.

Unlike most SaaS providers that make their API available for consumption nowadays, Recorded Future is different in that it does not require a username to be provided for API authentication. All you need is the key. Then, add the following property to your Invoke-WebRequest cmdlet:

-Headers @{"X-RFToken" = "api_key_here" }

So, for example, if your API key was "827ccb0eea8a706c4c34a16891f84e7b" (not an actual API key), a command to download the Recorded Future hash risk list would be:

Invoke-WebRequest -Headers @{"X-RFToken" = "827ccb0eea8a706c4c34a16891f84e7b" } -Method GET -ContentType "application/json" -Uri "https://api.recordedfuture.com/v2/hash/risklist?format=csv%2Fsplunk&gzip=false&list=positiveMalwareVerdict" -OutFile "out.csv"

Where to Find the Recorded Future API Key


Once you have your subscription and access to Recorded Future, you can get (or, rather, create) your API key under Menu - User Settings:


Click on "API Access" and use the "Generate New API Token" link to create a key, which will then be displayed in the list below (again, this isn't an actual API key):


Recorded Future API Documentation


Better than documentation, Recorded Future has a fantastic Connect API explorer page where you can, after plugging your API key in the top-right corner of the page, test all available API commands:


This page can be accessed at https://api.recordedfuture.com/v2/

A Note on Licensing


As expected, every API query uses up one usage "credit", but it should be noted that some of the queries (like the hash risk list used in the above examples) use up 5 credits per use. This can add up quickly when you're developing/testing something.

However, the Recorded Future's handy browser extension does not eat up your API credits.

Troubleshooting


If you get the following error, you need to add this to your code, to force the Invoke-WebRequest cmdlet to use TLS1.2:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Error:

Invoke-WebRequest : The underlying connection was closed: An unexpected error occurred on a send.
At line:1 char:1
+ Invoke-WebRequest -Headers @{"X-RFToken" = "827ccb0eea8a706c4c34a16891f84e7b...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand


Enjoy!

InfoSec: Online resources and tools for network forensics and cyber threat hunting

Following is a list of free online resources that I have found to be indispensable in the daily network troubleshooting and information security forensic investigations. I will keep updating this list as I remember of or discover more useful tools, but certainly feel free to contribute in the comments if you have any favorites that are not listed here. Last updated on 1/20/2019.


IP/MAC


IP Address Locator
http://www.geobytes.com/ipLocator.htm

By far the best and most accurate geolocating service - will tell you where the IP address is located geographically, what time zone it is located in and whether or not it is a proxy.

Mass Country of Origin Lookup
https://www.infobyip.com/ipbulklookup.php

Great tool for checking the sources of a DDoS attack - will take a list of IP addresses, one per line and return the IP, domain, location, ISP and ASN for each.

MAC Address Lookup
http://www.coffer.com/mac_find

Utility for searching the IEEE MAC address assignment database - quick way to identify what type of device is located at the MAC address in question.

What's My IP
http://www.whatismyip.com/

As the name implies, shows you what your public IP address (and its geolocation) is.

WolframAlpha Subnet Calculator
http://www.wolframalpha.com/input/?i=address+range

Very flexible IP subnet calculator, lets you calculate IP address ranges based on number of addresses needed, subnet mask bits or numeric subnet masks.

TechZoom IP Calculator
http://www.techzoom.net/tools/network-ip-calculator.en


Another handy multi-purpose IP address calculator, has ability to calculate subnets and convert IP address masks into individual address lists. Also includes IP and domain name checkers.


DNS

Robtex DNS Lookup
https://www.robtex.com/

Extremely comprehensive "DNS Lookup" site that goes way beyond just DNS lookups. Can be used to lookup BGP routing and AS information for IP addresses, for example.

DNS Analyzer
http://www.intodns.com

Amazingly detailed DNS information reporter and status analyzer. Will show a slew of details about a specified domain name, including but not limited to NS, SOA, MX and WWW records, reverse records, duplicate records, et cetera, and warn you of any configuration that does not follow the best practices.

DNSDigger
http://www.dnsdigger.com/

Great tool for finding other hosts/servers on the subnet of the domain name in question. The only drawback is that it does not offer a reverse lookup option (enter the IP address range, get the domain names of all the servers), but this can be partially remediated by doing a reverse search in cached Google results: http://www.google.com/#hl=en&q=site%3Adnsdigger.com+66.102.13.103

URLQuery
http://urlquery.net/

Similar to DNSDigger, another great tool for looking up domain names for the IP addresses that may show up in your IPS logs. Again, you can leverage Google's cache if needed: http://www.google.com/search?&q=66.235.180.91+site%3Aurlquery.net Note: this site can be reported as malicious by reputation services such as WOT, perhaps due to links to malicious domain information contained within. Proceed with caution.

ViewDNS IP/DNS Toolkit
http://viewdns.info/


Handy multi-tool website that can perform a variety of tasks, such as looking up WhoIs information, DNS resolution, host traceroute, etc.

DNSStuff Toolkit
https://tools.dnsstuff.com/

Similar toolset to the one above, but with a much wider range of tools. Kind of like a Swiss-army knife of IP an DNS address tools.

Email


Email Header Analyzer
https://mxtoolbox.com/EmailHeaders.aspx

Convenient tool to quickly analyze email headers. Breaks down all the flags into a convenient, easy to read table and calculates delivery delays (with graph) for each hop. Has a link on the bottom to "forget" the header details when you're done with them.

Reputation Databases


Web Of Trust
http://www.mywot.com/

"Crowd-sourced" web reputation service which works by letting its users rank sites they visit in four categories. May contain false positives but is most likely to have ratings for more obscure sites.

McAfee TrustedSource
https://www.trustedsource.org/

Great tool for checking web reputation of a specific domain name. TrustedSource databases are used by McAfee GTI and many spam filtering vendors, so if your emails stop getting to their destination - good place to check whether your SMTP server has been blacklisted. Will also show any recent increases in outgoing email activity, so it could be handing for spotting first signs of infection.

McAfee Website Reputation Database
http://www.siteadvisor.com

Another site by McAfee, which complements the TrustedSource IP and domain name reputation database. Will show any harmful files and behaviours (such as exposed user email addresses, etc), linked websites and annoyances, along with user-contributed feedback (useful for identifying spammer or phishing websites).

Norton Safe Web
http://safeweb.norton.com/

Similar to McAfee Site Advisor but will contain specific malware names and locations.

BlueCoat WebPulse Site Checker
http://sitereview.bluecoat.com

This one isn't extremely useful as it does not provide much detail, but can be used to verify how BlueCoat categorizes a specific site in their database. This database is also used across all BlueCoat proxy and web-content filtering appliances.

VirusTotal URL Checker
https://www.virustotal.com/#url

The popular multi-antivirus online file scanner, now owned by Google, has added the ability to scan provided URLs against over 50 different URL reputation services. Has ability for users to rank the URL "maliciousness" and provide comments. Great resources for quickly gauging if an address is safe.You can also use their "Search" tab to view Passive DNS history collected in previous lookups of the domain.

ThreatStop
https://www.threatstop.com/checkip

Crowdsourced searchable database of active and historical threats for IP addresses and domain names. A bit annoying in that on the first check, it asks you to receive and click an email link.

Endpoint Forensics


Windows Registry Cheat Sheet
https://www.dfir.training/resources/downloads/windows-registry

Massive crowd-sourced cheat sheet of key Windows Registry locations.

Network Forensics


RiskIQ Community (formerly PassiveTotal)
https://community.riskiq.com

Not to be confused with VirusTotal, PassiveTotal (which has now been acquired by RiskIQ) is a fantastic tool for searching current and historical information on IP addresses and domain names. The free community tier does give you a limited number of lookups per day, but this tool is fantastic for looking up historical WhoIs records, passive DNS records, current DNS records, and other available information.

Mnemonic PassiveDNS
https://passivedns.mnemonic.no/

Another great open PassiveDNS repository. No registration required.

hpHosts
http://hosts-file.net/

Crowdsourced "host file" - community built database of IP address and domain name resolutions and reputations. Can be really, really slow to load for the first time, don't give up.

Port Information Lookup
https://isc.sans.edu/port.html?port=

Invaluable tool for port information lookup, powered by the voluntary contributions to the SANS ISC log database. Will show both legitimate and malicious services (backdoors, trojans) that most often use the port, any CVEs associated with it, as well as any recent statistical increase in port activity worldwide. A must have in the arsenal of any network forensic investigator.

SpeedGuide Port Information Lookup
http://www.speedguide.net/port.php

Another excellent port information look-up tool. Does not have the same trending details as the one above, but often has a lot more details about the possible applications utilizing the port, including user-contributed comments.

Open Port Check Tool
http://canyouseeme.org/

Quick and easy utility for checking whether a port is open on the public IP address you're coming from. Will also show you your public IP address, so it can be used instead of the above tool.

Shodan
https://www.shodan.io/

"Search engine for the internet of things". Basically a huge online database of worldwide Nmap scan results. Lets you search for IP address, ranges, organizations, ports or keywords and returns anything that matches and could be seen connected to the public internet in the past few weeks.

Censys
https://censys.io/

Basically the same thing as Shodan, but also shows a pretty map. In my experience the results are not nearly as complete as Shodan.

ZoomEye
https://www.zoomeye.org/

Another Shodan alternative.


Log Analysis

Windows Security Log Events
http://www.ultimatewindowssecurity.com/securitylog/encyclopedia

A very extensive repository of Windows security log event IDs, failure codes and fields.

Event ID Information
http://www.eventid.net

A searchable event ID database, containing event ID descriptions from various sources and applications.

Avaya/Nortel Trace Analyzer
http://sharontools.com/tools/NortelDiagnostic/NortelDiagnostic.php

Shows the Nortel Passport (Avaya ERS) 8600/8800 trace file as a sortable table, helps to determine what is causing high CPU load and allows you to see a sortable table of MAC addresses, IP addresses and Ports.

Malware Analysis

VirusTotal
https://www.virustotal.com

Perhaps the most well-known multi-antivirus online scanning tool, now owned by Google and offering even a desktop-client for right-click uploading of suspicious files. Scans the files with dozens of various antivirus clients and has a user-contributed rating and comments system.

MetaScan
https://www.metadefender.com/#!/scan-file

Very similar to VirusTotal, with fewer antivirus engines but allows for a larger file size. Does not have the same community feedback mechanisms, but handy for double-checking VirusTotal or those cases where you need to scan a file just bigger than its 64Mb limit.

Payload Security Hybrid Analysis
https://www.hybrid-analysis.com/

Free malware analysis service powered by the VxStream Sandbox, which can be used to detonate executables, Office, PDF and APK files up to 180 Mb in size in a sandbox environment.

Browser Sandbox
https://www.browserling.com/

This isn't exactly a malware analysis sandbox, but it does offer the capability to open a website in a virtual browser. Very handy when a lab environment isn't available and you need to check what a suspicious URL looks like when opened.

Malpedia
https://malpedia.caad.fkie.fraunhofer.de/

Online encyclopedia of malware families.

Sucuri Site Check
https://sitecheck.sucuri.net/

Quick scanner for known website vulnerabilities and embedded malware. Will try to sell you the Sucuri WAF every time you run it, but can be handy in identifying/confirming site compromises and seeing exactly where the injected code is.


JavaScript Deobfuscator
http://deobfuscatejavascript.com/

Very effective JavaScript deobfuscator - saves you time figuring out what the final code looks like in obfuscated JavaScript payloads.

Malware Domain List
https://www.malwaredomainlist.com/mdl.php

Searchable database of known malware/C&C domains and IP addresses.

Cyber Chef
https://gchq.github.io/CyberChef/


A proverbial swiss army knife of parsing, decoding and converting just about anything you can think of.


Miscellaneous

Website Status Checker
http://downforeveryoneorjustme.com/

If you run into a website that will not load from your network, and you're wondering if it's something to be concerned about or the website is really down for everyone - the above site is a very quick and easy way to verify that.

Website Redirect Tracer
http://www.wheregoes.com/retracer.php

Most malicious spam/phishing campaigns nowadays use multiple redirects between the link included in the email, and the final payload page. This will trace and show you all the redirect URLs, without opening the final malicious destination.

Hex to ASCII to HEX Converter
http://www.dolcevie.com/js/converter.html

Very simple and easy to use HEX to ASCII and ASCII to HEX converter.

RegEx Composers
http://www.regexr.com/
https://regex101.com/#javascript


Great tools for composing and testing Regular Expressions (RegEx).

InfoSec: McAfee EEPC drive status showing "Partially Encrypted" in ePO

McAfee Endpoint Encryption for PC (formerly SafeBoot) is an enterprise-level solution that allows enterprises to deploy full-disk encryption to managed workstations. One of the many benefits of the solution is the centralized management and reporting capability, which enables asset management teams to report on the encryption status of lost or stolen assets (thus differentiating between a benign asset loss event or a possible full-blown "unencrypted device" data loss incident). Employee reported their laptop stolen? Not a problem, login to ePO, search for their system either by system name or employee's username and check the corresponding tab to see if it is encrypted (see steps 1 through 4 below).

Unfortunately, according to the McAfee KB76098 article, there is a known cosmetic issue with EEPC versions 6.2 Patch 1 and earlier, which results in obscure reporting of the device drive encryption status as "Partially Encrypted", if it has any hidden/system recovery partitions. This may, understandably, send your incident response and risk management teams into a possible "unencrypted device loss" investigation frenzy, despite the primary partition (usually the "C:" drive) being actually encrypted in its entirety. Luckily the solution is available (according to the article, updating to EEPC 7.0 addresses this) and the workaround is fairly straightforward.

How to Check the Volume Encryption Status

1. First, login to your ePO console and locate the system you are investigating in the System Tree.

2. Click the "Drive Encryption" tab under the system view (this may be named something like "SafeBoot" or "Endpoint Encryption" if you have older versions of ePO or corresponding components), confirm that the "State" is "Active" and click the "More" link on the bottom-left of the screen:



If the "State" doesn't say "Active", you may indeed have an unencrypted asset on your hands - proceed accordingly.

3. Once the Drive Encryption details window opens, you want to go to the "Disks" tab, to see the actual HDD drives detected in this particular system:


4. Here is where you would see the worrisome "Partially Encrypted" message, suggesting that not all of your user's data was encrypted:


Don't jump to conclusions yet - go ahead and click on that entire line to load the Disk Details page.

5. On the bottom of the Disk Details page, click on the "Go to related Disk Volumes" link - this will let you see what volumes are detected and what their individual encryption status is:


6. Once the list loads, confirm whether all system and data partitions are encrypted:


As you can see, this particular 115 Gb drive had a 95 Gb system partition (Drive "C:") which was indeed encrypted in its entirety, and it did not have any other unencrypted data partitions, like the "Partially Encrypted" status would lead your incident response team to believe. The remaining 20 Gb was a dedicated "system recovery" partition with the blank image of the laptop's "factory default" operating system, and it was in fact, also encrypted.

What we were seeing, was the manifestation of the KB76098 cosmetic bug affecting EEPC versions 6.2 Patch 1 and older, where hidden partitions caused ePO to falsely report the drive as "Partially Encrypted", when system/data partition size did not match the total drive size. The hidden partitions still got encrypted (we have confirmed this using Encase), but wouldn't get reported to ePO, causing this issue with erroneous partial encryption reporting.

As mentioned above, this is addressed in newer versions of McAfee EEPC/ePO, but in the meantime - you can use the above steps to get your incident response guys off the ledge, whenever a "Partially Encrypted" device gets reported as lost or stolen within your organization.

InfoSec: Check if an email message or a website is malicious

Spam (unsolicited bulk messages) and phishing (obtaining privileged information by masquerading as a trustworthy entity) have become a part of everyday life for anyone who uses email for personal or business communication. Cyber-criminals behind spam and phishing messages have been perfecting their craft for decades and, as a result, it is often difficult to distinguish spam from legitimate emails. Some observational techniques could be helpful and a number of services exist to assist with verifying reputation of various websites and phone numbers, which can be used to gauge the validity of a received email.

While the sender address is a good first indication of whether an email message is legitimate or not (for example, an email that claims to be from AMEX, but was sent from “bob@comcast.net” is almost certainly malicious), but it is worth noting that sender address is very easy to fake (aka “spoofing”). Just like the return address on “snail mail”, the sender information is provided by the sender himself and, in majority of cases, not verified by the email server. Do not rely on the sender address alone for validating the identity and validity of the sender.

The goals of a spam or phishing messages will usually boil down to one of the following:

1. Getting you to click a link in the message
2. Getting you to open the attachment in the message
3. Getting you to call a number and provide information
4. Getting you to reply to the message with requested information

Generally, if you have any doubts about the origin of the message, it is best not to do either of the above. However, if you do think that the request may be legitimate (again, keep in mind that spammers are getting very good and making you think that, that is their 'bread and butter'), here are some tips on how to attempt to verify each of the above before you proceed.




How to check if something is malicious

Links/Websites: following free services will let you copy-paste the link from a suspect email message and check the validity/potential risk rating of that link:

https://www.mywot.com/ - this is a “peer review” site, where site’s ratings are contributed by other site users; so if Bob and Alice say that a site is bad and Jim later goes to check the site’s rating – he will see the previous negative feedback. Anybody can review the site and the service offers a free browser plugin to automatically alert against visiting sites with numerous negative reviews.

http://www.siteadvisor.com/sites/ - this is a service that is very similar to the one above in functionality but is now offered by McAfee. All site reviews are provided by McAfee staff (however, individuals can submit their recommendations on suspect websites). This service also offers a browser plugin for automated website and search validation.

https://www.virustotal.com/#url – free service now owned by Google, which will check the site’s reputation against 51 different reputation services, similar to the ones listed above. It will not show any details on the reputation, but will provide a summary judgment as to whether it could be trusted or not. There is also a section for users to leave comments on each of the URLs but it doesn't seem to be as popular as the MyWOT one. Same service offers antivirus scanning for attachments, but more on that later.

Files/Attachments: following services will let you upload a file to be scanned by an antivirus, other than the one that is already (hopefully) present on your computer. You can save a copy of the file to a folder on your computer and upload it to be scanned from there; do not double-click/open the file and always use your local antivirus to scan the file first. Please note that personal/sensitive data should not be uploaded to third party services, as there is no telling what might happen to that file after it has been scanned.

https://www.virustotal.com – service owned by Google which will let you upload the suspicious file or email attachment, to be scanned by 46 different antivirus programs. Antivirus programs are only as good as their signature definitions and often one or two of them will be able to detect a certain virus variant before everyone else creates a signature for it. This lets you make sure that none of the antivirus vendors think the file you’ve received is malicious.

https://www.metascan-online.com – another service similar to the one above, which will scan an uploaded file with 42 different antivirus programs. All the same limitations apply, but the permitted file size is slightly higher.

Please note that just because an antivirus does not detect a virus in the file, it doesn’t mean that it isn’t there. Antiviruses can generally only detect malware that they are aware of, and a new variant, or a variant encrypted in a password-protected ZIP archive, for example, will not be detected. Be extra vigilant if files are sent to you in password-protected archives, this is a common technique used to bypass antivirus detection.

Phone Numbers: confirming phone numbers can be tricky because a large number of websites offering phone number reputation services are “commercialized” and require you to pay for the information. So far only the following website, using information provided by other users, has been free and consistently accurate with identifying suspicious phone numbers:

http://800notes.com/ - website similar in functionality to MyWOT, where users are able to contribute their experiences with a certain phone number to an overall number review page. Keep in mind, that while this can be used to validate phone numbers included in an email, one should not rely on it for phone numbers on received calls. Similar to the sender address on email messages, caller phone numbers can be easily spoofed to masquerade as any other number and this is a technique often used for social engineering attacks.





In conclusion, you should always avoid clicking links or opening attachments in emails that you did not expect to receive, even if they appear to be sent by someone you know. Even the most legitimate-looking messages may be phishing for your sensitive information, to be used for identity theft or further attacks against you or your organization. If you do believe that a message is legitimate, or you have any doubts about it - double-check using one of the above reputation services before acting on anything requested in said email. Good luck out there!

InfoSec: Avoid using the same password for multiple websites

Abstract: a lot of people use the same password, or a variation of it, for logging into different websites or servers, to avoid having to remember multiple sets of credentials. Unfortunately, this backfires when one of the websites gets hacked and the password data becomes public. This leads to attackers using that same password to gain unauthorized access to every single account the person owns, turning a potentially limited breach into a widespread one.

Additional considerations: many people will designate a reusable password for use with "low risk" sites, sites that require compulsory registration to post a comment, sites that store no sensitive data or sites that they don't particularly care about. While this is a good risk reduction tactic, it might still result in negative consequences if the details from multiple "low risk" sites can be combined and used in social engineering attacks (ie. state of residence from one site, DOB from another, full name from third, phone number from fourth and so on until there is enough data to open a credit card in your name). Another likely risk comes from gradual increase in site's importance to the user over time (ie. original "low risk" registration done to get a free trial version of the product, but then credit card details are added at a later date, with the purchase of the full version of the product). Alternatively, while no sensitive data may be stolen from you, the attacker might use the compromised accounts to impersonate you, to either damage your reputation or attempt to social engineer your friends and relatives into sending them money.

Alternatives: there are many alternatives available for storing and accessing passwords for various websites and services from all of your devices, which would eliminate the need for remembering multiple passwords, while helping you avoid reusing the same one on multiple websites. Apps like 1Password and LastPass let you maintain and access an online repository of all of your credentials, protected by one master password. If you are uncomfortable with storing your credentials online, there are multiple offline options available, such as PasswordSafe for PC, which stores all your credentials in a local, or network shared, encrypted container and offers convenient browser integration features. Various mobile devices will typically have native password management applications for local password management as well. Of course, with offline solutions, there is the drawback of having to sync your passwords manually. Another alternative, which is my personal favorite, is PwdHash - it can run as a Firefox or Chrome plugin and let you enter the same password when logging in to all websites, but actually replacing it with a one-way hash of your password and domain name combination. As a result, what is stored as a password on the website is different for every site and cannot be reverted back to your master password even if the "plain text" password is stolen in a cyber-attack. There are also client applications for PwdHash password generation available on all major mobile platforms, and if all else fails - you can always just do it through their website and copy-paste it to login.

Conclusion: reusing the same password for multiple accounts is a very appealing and convenient option, especially for accounts perceived as low risk. However, many risks of data theft, identity theft and reputation loss through impersonation make this an unsafe practice in this day and age of nearly daily website and service compromises. With many secure alternatives such as PwdHash, PasswordSafe, LastPass and 1Password, moving away from reusing passwords is easy and (mostly) free and might save you and your employer a lot of time and hardship in a next multi-million account service cyber-attack.

InfoSec: Protect your 2WIRE router from getting exploited

Disclaimer: none of the exploit information below has been discovered by me, I am not attempting to take the credit for it, I am merely summarizing the information to provide a background for the workaround solution that I describe in this article. All of the exploit, device model and provider information is readily available online on the sites listed in the Links section.

Which 2WIRE devices are affected?


Multiple vulnerabilities have been released in the wild that affect a wide range of 2WIRE routers, used by many ISPs, such as:

  • BT
  • AT&T
  • Telmex
  • Qwest
  • Sasktel
  • Telus
  • and many others.

All firmware versions have been reportedly affected, except 3.5.X.X and the 2WIRE models affected include, but are not limited to:

  • 1000SW
  • 1701
  • 1801
  • 2700
  • 2701
  • 3700
  • 3800

How does this affect you?

A potential attacker could perform a number of configuration changes on your 2WIRE router, just by posting a specifically crafted URL for you to open on a site such as Facebook or by including it in a 1x1 pixel image on any page or email. The following exploits have been tested for above models:

  • Set a custom administrator password on the router
  • Add names to the DNS list (doesn't work on 2700)
  • Disable Wireless Authentication
  • Set Dynamic DNS
  • Modify your password and password hint
Once again - no action will be required from you for the attacker to perform the above configuration changes, you will only need to open a page or email containing the malicious URI.

How does it work?

I will not re-post the exact links that I used to exploit the above vulnerabilities on my 2WIRE 2700, for obvious reasons. However - there are some generic examples available in the SecurityFocus records, links to which you can find in the Links section below.

Consider that the IP address given in the SecirutyFocus examples is the default gateway for the private subnet used by the router and the fact that 2WIRE gateway will always resolve the following names to that IP and you can easily see at least three attack vectors for this exploit:

  • gateway.2wire.net
  • home
Are there fixes available?Neither 2WIRE or any of the ISPs providing the routers to their customers have an update available that fixes this issue, however there are some workarounds that you can put in place that will render attacker's malicious URIs unusable.

The Workaround

Here is the fun part. First, we need to make sure that the default hostnames that the 2WIRE gateway automatically resolves to your private subnet default gateway are pointing somewhere else. This will make any malicious URIs using these hostnames harmless (they will simply timeout instead of doing you any harm).

To do that - open your hosts file in notepad (if you are using Windows, the hosts file is located under C:\WINDOWS\system32\drivers\etc; if you are using Linux - you probably know where your hosts file is). In the file you should see some comments on top with the bottom line being:

127.0.0.1 localhost

This is a default entry that points hostname "localhost" to the internal loopback address of your network card. Let's add two more lines under it, pointing the dastardly 2WIRE hostnames to this same loopback address (or you can use any other IP address other than your default gateway IP, I personally used Google's current IP):

127.0.0.1 gateway.2wire.net
127.0.0.1 home

Save and close the file and this part is done - now any attempt to trick you into opening your default gateway IP/management IP of your 2WIRE router will simply point your computer back onto itself (or whichever IP you entered above) and time out without doing it any harm.

Second, we need to get rid of that default IP range (and corresponding default gateway) that 2WIRE comes with. If you navigate to your 2WIRE management page (by default you could open them by browsing to the following URLs in your browser: http://gateway.2wire.net or http://home - but we have dealt with this in the first step, so lets use the IP address instead) - http://192.168.1.254 you should see Advanced Settings under Home Network part of the menu*.

Now I can only go by my 2700 seried device, so if your device is different - the location of this setting may be different, but basically you are looking for something that says "Private Network" and has IP ranges such as 192.168.1.0, 172.16.0.0 and 10.0.0.0 to chose from. These are the ones we don't want to use, since the attacker is most likely to try the default ones in the exploited URIs. Configure a custom one like 192.168.234.0 or 10.23.45.0:

Router Address: 10.23.45.254
Subnet mask: 255.255.255.0
Enable DHCP: Checked
First DHCP Address: 10.23.45.1
Last DHCP Address: 10.23.45.253

Note: submitting this will most likely disconnect you from internet and 2WIRE manegement interface since both your IP and the IP of the router will now be different. But, this is exactly what we wanted - now the attacker does not know what they are and will have hard time coming up with a URL that will exploit your router. In my case - I needed to turn the router off and on after changing the IP address, to apply the new network settings.

*If this default IP address doesn't open your 2WIRE management page, you may not need to do this step. However if you would still like to change your subnet range (Sasktel customers may have a different default subnet range that may become public and get exploited at a later date) - you can find out what your Default Gateway address is by launching Command Prompt and entering "ipconfig" command. Default Gateway is usually the management IP of your router.

Summary

Sorry for the lengthy article, I got a little carried away while trying to make sure that include as many details as possible to make the workaround accessible for everyone. If you have some additional information, such as configuration steps for routers other than the 2700 series - please post them in the comments I will make sure to add them to the article.

Links

http://www.securityfocus.com/bid/27246/exploit
http://www.securityfocus.com/bid/27516/exploit
http://www.dslreports.com/forum/r19987755-2Wire-Cross-Site-Request-Forgery-Vulnerability
http://tech.slashdot.org/article.pl?sid=08/04/08/1946214

Updates

April 9, 2008 - According to Slashdot AT&T spokesman Seth Bloom has announced that: "The majority of our customers did not have gateways affected by this vulnerability. For those that did, as soon as we became aware of the issue, we expeditiously implemented a permanent solution to close the vulnerability. In fact, we've already updated the majority of affected 2Wire gateways, and we're nearing completion of the process. We've received no reports of any significant threats targeting our customers." Number of AT&T customers on the site, even those that received their new 2WIREs in the last two weeks are reporting that exploits are still present on AT&T devices (comment).

May 5, 2009 - According to 2WIRE support, they have distributed updates to all ISP's to address the vulnerabilities last year, and while it appears that 27246 exploit may have indeed been eliminated, the 27516 still remains exploitable (I even tried it on my "patched" 2700 and was able to reset my password on the first try). Don't click the links your neighbors send you, unless you want to share your wireless with them!

June 24, 2009 - Tired of my complaints, my ISP has "upgraded" me to the "new" ADSL modem. I guess that "fixes" the problem for me, but be aware of the fact that 27516 still seems to be exploitable on at least some of the devices that ISP's claim have been patched. If you hear any updates on this issue - please post them in comments.

August 27, 2009 - Warning! Another vulnerability has just been discovered to be affecting all current version of 2WIRE routers, which allow the attacker to reset the administrative password on the system using nothing but the browser. Basically, if someone connects to your wireless - they can do anything they want to your network: http://www.securityfocus.com/bid/36075/info. Good time to phone up your ISP and demand a new router.

April 5, 2013 - A similar vulnerability is reported for Cisco Linksys EA2700 routers (I found the same numerical series to be rather ironic), upgrading to the latest firmware is highly advised.

InfoSec: Detect cross-site scripting attempts on your Apache web-server

If you are running an Apache web-server (or renting a Linux-based hosting package), and have some open-source, or custom PHP applications - you may expose yourself to malicious cross-site scripting attempts. If successful, they may allow the attacker to add their code (ads, viruses, key-loggers) to your web-pages, compromising your applications and breaking your users' trust.

While there are many methods in which cross-site scripting and alike attacks can be executed, the most wide-spread methods used by worms can easily be detected in the Apache server access logs. If you do not have access to your Apache logs, you will need to contact your system administrator or hosting provider for the next step. If you run your own server - the logs are most likely located under /var/log or you could find them using 'locate access.log' command from the command line (or SSH session).

Once you find the location of the log files, navigate to that directory and execute the following command to see if they an "=http" - pattern (which, as per above example, signifies and attempt to hijack POST request on your website in a cross-side scripting attempt):

For a single log file:

'grep "=http" access.log less' or

For multiple log files:

'grep "=http" access.* less'

Some hosting companies (like 1&1 Internet Inc.) will archive old log files to save space, in which case you can use a 'zgrep' command to look through them for the "=http" pattern:

'zgrep "=http" access.log.* less'

Additional information about cross-site scripting techniques and detection/prevention methods:

Cross-site Scripting (XSS)
Reverse Cross-site Scripting (CSRF or XSRF)
HTTP Header Injection