2026-03-29T12:11:13+00:00https://piosek.pl/Marcin PiosekPractical articles and consulting insights on Kubernetes security, web application security, and penetration testing by Marcin Piosek.
Marcin PiosekSecond book2023-09-05T20:20:01+00:002023-09-05T20:20:01+00:00https://piosek.pl/2023/09/second-book<p>Together with several other authors, I had the opportunity to co-create the second book in my career, <em>Wprowadzenie do bezpieczeństwa IT</em> (also known as <em>Introduction to IT Security</em>). The book is written in Polish and covers a broad range of topics in the field of IT security.</p>
<p>It is intended for readers such as:</p>
<ol>
<li>IT managers interested in IT security</li>
<li>Individuals working in IT who want to learn current security recommendations</li>
<li>Those taking their first steps in technical IT security</li>
<li>People responsible for implementing security measures in organizations</li>
<li>Pentesters who want to expand their knowledge in different areas of IT security</li>
</ol>
<p>My chapter, titled <em>Penetration Testing</em>, has the following introduction:</p>
<blockquote>
<p>The “Penetration Testing” chapter was created for those who wish to acquire or organize knowledge related to the essence and the process of conducting penetration tests from an organizational standpoint. In this chapter, I will outline the individual steps that need to be taken to define the scope of work, choose the appropriate methodology, and set requirements for the summary report. The information provided here should suffice for independently coordinating penetration tests from defining the scope to accepting the work.</p>
<p>The knowledge presented in this chapter is based on experience from over 550 penetration tests conducted in 2021 and 750 completed projects in 2022. In each case, I was the person responsible for defining the scope of work and assisting with problem-solving during their execution.</p>
<p>The goal of this text is not to convey knowledge about all possible techniques for conducting penetration tests, nor to discuss the career path of a pentester. Readers of this chapter do not need any experience other than what comes from working in the broadly defined IT industry.</p>
</blockquote>
<p>Authors of the individual chapters are:</p>
<ol>
<li>On Ethics in Hacking (Gynvael Coldwind)</li>
<li>What Every Administrator Should Know About Web Application Security (Michał Sajdak)</li>
<li>Android – System Security and Basic Penetration Testing of Mobile Applications (Marek Rzepecki)</li>
<li>iOS – System Security and Basic Penetration Testing of Mobile Applications (Marek Rzepecki)</li>
<li>Penetration Testing (Marcin Piosek)</li>
<li>Introduction to Cyber Threat Intelligence (Bartosz Jerzman)</li>
<li>Threat Modeling and Risk Analysis of Applications (Łukasz Basa, Wiktor Sędkowski)</li>
<li>Introduction to the MITRE ATT&CK® Framework (Wojciech Lesicki)</li>
<li>Cryptology at a Glance (Iwona Polak)</li>
<li>Introduction to the Security of Industrial Control Systems (ICS/OT) (Marcin Dudek)</li>
<li>Data Security at Rest – Encryption and Data Deletion (Krzysztof Wosiński)</li>
<li>OSINT – An Introduction (Tomasz Turba)</li>
<li>Physical Security – Asset Protection (Tomasz Dacka)</li>
<li>Modern Fuzzing (Marek Zmysłowski)</li>
<li>Email Message Authentication Mechanisms – SPF, DKIM, and DMARC (Grzegorz Trawiński)</li>
<li>Hashcat - Racing Against Time in a Balance of Forces and Resources (Konrad Jędrzejczyk)</li>
<li>Introduction to the Metasploit Tool (Piotr Ptaszek)</li>
<li>PowerShell in Offense (Paweł Maziarz)</li>
</ol>
<p>More information:</p>
<ul>
<li><a href="https://wydawnictwo.securitum.pl/ksiazka-wprowadzenie-do-bezpieczenstwa-it-tom-1">Book page</a></li>
<li><a href="https://cdn.sekurak.pl/ksiazka2/mediakit-ksiazka-wdbit.pdf">Media kit (PDF)</a></li>
</ul>Marcin PiosekTogether with several other authors, I had the opportunity to co-create the second book in my career, Wprowadzenie do bezpieczeństwa IT (also known as Introduction to IT Security). The book is written in Polish and covers a broad range of topics in the field of IT security.Book2019-11-29T15:20:01+00:002019-11-29T15:20:01+00:00https://piosek.pl/2019/11/book<p>Together with the <a href="https://sekurak.pl">Sekurak.pl</a> team, we released a book titled <em>Bezpieczenstwo aplikacji webowych</em> (<a href="https://sklep.securitum.pl/ksiazka-bezpieczenstwo-aplikacji-webowych">book page</a>; PL only), in which I wrote several chapters, including:</p>
<ol>
<li>Authentication, session management, and authorization</li>
<li>Advantages and disadvantages of OAuth 2.0 from a security perspective</li>
<li>The SameSite flag: how does it work, and what does it protect against?</li>
<li>Burp Suite Community Edition: an introduction to the HTTP proxy</li>
<li>The Path Traversal vulnerability</li>
<li>Command Injection and Code Injection vulnerabilities</li>
<li>Introduction to WebSocket security</li>
</ol>
<p>Table of contents: <a href="/wp-content/uploads/Bezpieczenstwo-aplikacji-webowych-Spis-tresci.pdf">download PDF</a>.</p>Marcin PiosekTogether with the Sekurak.pl team, we released a book titled Bezpieczenstwo aplikacji webowych (book page; PL only), in which I wrote several chapters, including:Hunting for Webshells2017-08-17T16:43:37+00:002017-08-17T16:43:37+00:00https://piosek.pl/2017/08/hunting-for-webshells<p>When you maintain many web applications on your server, sooner or later you may encounter a nasty surprise in the form of an unwanted addition to one of them. These additions are, of course, backdoors, and in the case of web applications the term “webshell” is used more often. Such a piece of code, uploaded to a server through an application vulnerability, allows unauthorized access to files on the server. In many cases, the attacker can also execute arbitrary commands on the compromised machine. The probability of such a situation rises dramatically when you maintain an application based on one of the popular CMSs, such as Joomla or WordPress. If you suspect that someone has gained unauthorized access to your server, how can you solve the problem, locate the threat, and remove it? This is explained in an article entitled “Webshells,” published in the <a href="https://sekurak.pl/zine/sekurak-offline-4-final.pdf">Sekurak ZIN #4</a> and later on the <a href="https://sekurak.pl/jak-wykrywac-backdoory-webshelle-w-aplikacjach-webowych/">sekurak.pl</a> portal.</p>Marcin PiosekWhen you maintain many web applications on your server, sooner or later you may encounter a nasty surprise in the form of an unwanted addition to one of them. These additions are, of course, backdoors, and in the case of web applications the term “webshell” is used more often. Such a piece of code, uploaded to a server through an application vulnerability, allows unauthorized access to files on the server. In many cases, the attacker can also execute arbitrary commands on the compromised machine. The probability of such a situation rises dramatically when you maintain an application based on one of the popular CMSs, such as Joomla or WordPress. If you suspect that someone has gained unauthorized access to your server, how can you solve the problem, locate the threat, and remove it? This is explained in an article entitled “Webshells,” published in the Sekurak ZIN #4 and later on the sekurak.pl portal.Hardening WordPress2016-11-29T15:19:27+00:002016-11-29T15:19:27+00:00https://piosek.pl/2016/11/wordpress-hardening<p>The most popular <a href="https://en.wikipedia.org/wiki/Content_management_system">CMS</a>, thousands of plugins and themes, and millions of users - this is <a href="https://wordpress.org/">WordPress</a>. The question is whether, alongside the enormous number of features that WordPress offers right after installation, it also provides adequate security. Although today’s threats to WordPress mostly come from poor-quality plugins and themes, it is still a good idea to take a few steps to improve the overall security of a WordPress instance.</p>
<p>By reading the article “Hardening WordPress,” published in the “<a href="https://programistamag.pl/programista-11-2016-54/">Programista</a>” 11/2016 magazine, the reader can learn, among other things, how to stop WordPress from disclosing unnecessary information and what threats may result from user enumeration. In addition, the text explains step by step how to enable <a href="https://en.wikipedia.org/wiki/Multi-factor_authentication">two-factor authentication</a> using <a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2">Google Authenticator</a>, and how an attacker can move from a <a href="https://en.wikipedia.org/wiki/Cross-site_scripting">Cross-site Scripting</a> vulnerability to <a href="https://en.wikipedia.org/wiki/Arbitrary_code_execution">Remote Code Execution</a> by using the plugin and theme editor.</p>
<p><em>Update Jul 7, 2017:</em> this article was published on <a href="https://sekurak.pl/jak-zabezpieczyc-wordpress-poradnik-krok-po-kroku/">sekurak.pl</a>.</p>Marcin PiosekThe most popular CMS, thousands of plugins and themes, and millions of users - this is WordPress. The question is whether, alongside the enormous number of features that WordPress offers right after installation, it also provides adequate security. Although today’s threats to WordPress mostly come from poor-quality plugins and themes, it is still a good idea to take a few steps to improve the overall security of a WordPress instance.OAuth 2.0 Security2016-10-26T16:39:37+00:002016-10-26T16:39:37+00:00https://piosek.pl/2016/10/oauth-20-from-security-perspective<p>While reading <a href="https://tools.ietf.org/html/rfc6749">RFC6749</a>, one may get the impression that it is a document describing general guidelines for building support for <a href="https://oauth.net/2/">OAuth 2.0</a>. This observation is consistent with the title, which includes the word “framework”. OAuth 2.0 is therefore not a collection of strict and precisely defined rules. Leaving some freedom in how RFC6749 is interpreted creates more room for implementation mistakes. That is why the need arose for an article that would comprehensively explain what the second version of the OAuth standard is and what threats are associated with it. To meet the needs of people responsible for implementing and testing OAuth 2.0-based solutions, I prepared an article published in the “<a href="https://programistamag.pl/programista-10-2016-53/">Programista</a>” 10/2016 journal.</p>
<p>Before discussing the framework itself, the reader gets a brief refresher on the meaning of the most important terms. This includes, among other things, a precise explanation of the differences between “<a href="https://en.wikipedia.org/wiki/Authentication">authentication</a>” and “<a href="https://en.wikipedia.org/wiki/Authorization">authorization</a>”.</p>
<p>This article covers the following topics:</p>
<ul>
<li>The rules governing OAuth 2.0</li>
<li>The advantages of using this authorization method</li>
<li>What OAuth is not, including issues related to using OAuth for authentication</li>
<li>Methods that can be used to obtain a token</li>
<li>Which token acquisition method should be chosen for a given usage scenario</li>
<li>Common security mistakes in OAuth 2.0, along with practical examples</li>
<li>OAuth in the mobile app environment (including <a href="https://tools.ietf.org/html/rfc7636">PKCE</a> and the threats stemming from the use of <a href="https://developer.android.com/reference/android/webkit/WebView.html">WebView</a>)</li>
</ul>
<p>The article concludes with a long list of questions that should be asked during <a href="https://www.owasp.org/index.php/Application_Threat_Modeling">threat modeling</a> for applications using OAuth 2.0.</p>
<p><em>Update Feb 13, 2017:</em> this article was published on <a href="https://sekurak.pl/oauth-2-0-jak-dziala-jak-testowac-problemy-bezpieczenstwa/">sekurak.pl</a>.</p>Marcin PiosekWhile reading RFC6749, one may get the impression that it is a document describing general guidelines for building support for OAuth 2.0. This observation is consistent with the title, which includes the word “framework”. OAuth 2.0 is therefore not a collection of strict and precisely defined rules. Leaving some freedom in how RFC6749 is interpreted creates more room for implementation mistakes. That is why the need arose for an article that would comprehensively explain what the second version of the OAuth standard is and what threats are associated with it. To meet the needs of people responsible for implementing and testing OAuth 2.0-based solutions, I prepared an article published in the “Programista” 10/2016 journal.Introduction to WebSocket Security2016-09-18T04:39:37+00:002016-09-18T04:39:37+00:00https://piosek.pl/2016/09/websocket-security<p>The development of web applications has made it increasingly necessary to implement solutions that allow asynchronous data exchange between the client and the server. One of the proposed approaches was the use of the “<a href="https://en.wikipedia.org/wiki/Push_technology#Long_polling">long polling</a>” technique; later, <a href="https://en.wikipedia.org/wiki/Ajax_(programming)">AJAX</a> appeared in web browsers. These approaches seemed sufficient, but there was still room for improvement. This was particularly evident because there were no methods for truly asynchronous communication in which, once a connection had been established, either side could decide when to send a data packet. To meet this need, the <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API">WebSocket</a> protocol was created.</p>
<p>As with most new technologies, WebSocket comes with specific security risks. To draw attention to them, I prepared a text that was published in the “<a href="https://programistamag.pl/programista-09-2016-52/">Programista</a>” 9/2016 magazine. In it, the reader can learn, among other things:</p>
<ul>
<li>How does WebSocket work?</li>
<li>What is the security of data transferred using this protocol?</li>
<li>What are the risks associated with using WebSocket (bypass authentication, bypass authorization, Same Origin Policy issues, injections, server resource exhaustion, and more).</li>
<li>How to test applications using WebSocket with <a href="https://github.com/zaproxy/zaproxy">OWASP Zaproxy</a>.</li>
</ul>
<p>At the end of the article, the reader will find a list of questions that should be asked during the security review of an application based on WebSocket.</p>
<p><em>Update Feb 2, 2017:</em> This article was published on <a href="https://sekurak.pl/bezpieczenstwo-protokolu-websocket-w-praktyce/">sekurak.pl</a>.</p>Marcin PiosekThe development of web applications has made it increasingly necessary to implement solutions that allow asynchronous data exchange between the client and the server. One of the proposed approaches was the use of the “long polling” technique; later, AJAX appeared in web browsers. These approaches seemed sufficient, but there was still room for improvement. This was particularly evident because there were no methods for truly asynchronous communication in which, once a connection had been established, either side could decide when to send a data packet. To meet this need, the WebSocket protocol was created.