<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ba Yin Min on Medium]]></title>
        <description><![CDATA[Stories by Ba Yin Min on Medium]]></description>
        <link>https://medium.com/@bayinmin?source=rss-bb90b160db7f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Fesf1n6a-c6JrwJGmTLpYw.png</url>
            <title>Stories by Ba Yin Min on Medium</title>
            <link>https://medium.com/@bayinmin?source=rss-bb90b160db7f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 15:33:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bayinmin/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Configuring WS‑Security UsernameToken Authentication in SOAPUI]]></title>
            <link>https://bayinmin.medium.com/configuring-ws-security-usernametoken-authentication-in-soapui-58482ad240d8?source=rss-bb90b160db7f------2</link>
            <guid isPermaLink="false">https://medium.com/p/58482ad240d8</guid>
            <category><![CDATA[ws-security]]></category>
            <category><![CDATA[soapui]]></category>
            <category><![CDATA[authorization]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Ba Yin Min]]></dc:creator>
            <pubDate>Wed, 15 Apr 2026 00:21:01 GMT</pubDate>
            <atom:updated>2026-04-15T00:21:01.330Z</atom:updated>
            <content:encoded><![CDATA[<p>Import the WSDL file of your choice. I am using a sample WSDL file from <a href="https://www.tutorialspoint.com/">https://www.tutorialspoint.com/</a>.</p><p>By default, there is no authentication configured.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*GcupHCja6dhcRuPrYRFMOQ.png" /><figcaption>Send the default request fora particular API call by clicking the Play button</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*up7UuiBzAG3qMk5Oeeua8w.png" /><figcaption>The raw request will looks like this with no particular authentication headers</figcaption></figure><h3>Configuring WS-Security UsernameToken Authentication (PasswordText)</h3><p>Double click on the project name &gt; choose WS-Securith Configuration tab &gt; Add a new outgoing profile with a name of your choice as shown in the screenshot below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GjNuX-kIUlJU9TP33DqcqQ.png" /><figcaption>Creating outgoing profile</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vb0kWuTiILuy-RnhV2jioA.png" /><figcaption>Click the plus button and choose Username from the dropdown box</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jAXHOK6fvX0JI5vSP_2O5A.png" /><figcaption>Fill out username and password and choose Password Text</figcaption></figure><p>There are other choices such as PasswordText, Password Digest and PasswordDigest Ext with varying level of password protection security. I chose the PasswordText option for the first demonstration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UZ4rD5YZKx3C2AWDYbF3Fg.png" /><figcaption>Click the Auth menu at the bottom for a particular interface or API call</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*BOd-xWShCYSE-RW8pDH-6w.png" /><figcaption>Choose Add New Authorization</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*UqNsEuPwX_CMpvBR2tS9fQ.png" /><figcaption>Choose Basic from the dropdown menu</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*l_JTCgJ_j9xp_gEFPh5clQ.png" /><figcaption>Choose the option that you have created above for WS-Security and make sure Use global preference radio button is active</figcaption></figure><p>Now, if you click the Play button to send the request to the server, a WS-Security header will be automatically appended by the SoapUI. The request will look like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*aGK9EQaxffwgTh-o21P8qg.png" /><figcaption>Username and plaintext password are sent via a new header appended by SOAPUI for outgoing request</figcaption></figure><p>You can observe that the password is sent in plaintext which is not a good security practice. You can choose Password Digest or Password Digest Ext options when configuring WS-Security profile for higher security level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*7eVDvaOzqjnq8lF9NHPHzQ.png" /><figcaption>This is when Password Digest option is chosen. The password is no longer in plaintext form</figcaption></figure><p>So this is how to easily configure WS-Security through SoapUI than manuall figuring out what headers to append to the raw HTTP request.</p><p>Thanks for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58482ad240d8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configuring Basic Authentication in SoapUI]]></title>
            <link>https://bayinmin.medium.com/configuring-basic-authentication-in-soapui-42d15b5e941b?source=rss-bb90b160db7f------2</link>
            <guid isPermaLink="false">https://medium.com/p/42d15b5e941b</guid>
            <category><![CDATA[authorization]]></category>
            <category><![CDATA[basic-authentication]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[soap-api]]></category>
            <category><![CDATA[authentication]]></category>
            <dc:creator><![CDATA[Ba Yin Min]]></dc:creator>
            <pubDate>Tue, 14 Apr 2026 01:04:52 GMT</pubDate>
            <atom:updated>2026-04-14T01:04:52.863Z</atom:updated>
            <content:encoded><![CDATA[<p>Import the WSDL file of your choice. I am using a sample WSDL file from <a href="https://www.tutorialspoint.com/">https://www.tutorialspoint.com/</a>.</p><p>By default, there is no authentication configured.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*GcupHCja6dhcRuPrYRFMOQ.png" /><figcaption>Send the default request fora particular API call by clicking the Play button</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*up7UuiBzAG3qMk5Oeeua8w.png" /><figcaption>The raw request will looks like this with no particular authentication headers</figcaption></figure><h3>Configuring Basic Authentication</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tde2eiTgPt0LaECt8mIQeQ.png" /><figcaption>Click the Auth menu at the bottom</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*BOd-xWShCYSE-RW8pDH-6w.png" /><figcaption>Choose Add New Authorization</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*UqNsEuPwX_CMpvBR2tS9fQ.png" /><figcaption>Choose Basic from the dropdown menu</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*4uKqJZCT9UfjnS18LgH_Rg.png" /><figcaption>Fill out username and password. Make sure that Authenticate pre-emptively radio box is checked.</figcaption></figure><p>Afterwards, procced to invoke the API click he Play button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*kXIv0oUBXxqfSmO4RuatUw.png" /><figcaption>Voilà — your request will now include the correct Authorization header with a Base64‑encoded Basic Authentication credential attached.</figcaption></figure><p>Thanks for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42d15b5e941b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android: Get Root Access to Android Emulators without Rooting]]></title>
            <link>https://bayinmin.medium.com/android-get-root-access-to-android-emulators-without-rooting-23994d829fda?source=rss-bb90b160db7f------2</link>
            <guid isPermaLink="false">https://medium.com/p/23994d829fda</guid>
            <category><![CDATA[rooting]]></category>
            <category><![CDATA[get-root-access]]></category>
            <category><![CDATA[android-pentesting]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[emulator]]></category>
            <dc:creator><![CDATA[Ba Yin Min]]></dc:creator>
            <pubDate>Sun, 15 Dec 2024 04:24:10 GMT</pubDate>
            <atom:updated>2024-12-15T04:25:43.472Z</atom:updated>
            <content:encoded><![CDATA[<h3>Android: Get Root Access to Android Emulators without Rooting or Jailbreaking</h3><p><strong>tl;dr</strong> — Use android emulator images without Google Play Store icon from the Device Manager in the Android studio.</p><h3>Overview</h3><p>When it comes to mobile application pentesting, rooted devices are handy, but it is hard to maintain multiple physical rooted devices or phones. So android emulators are the go-to as alternatives. There are many tutorials of how to root android emulators. However, I came across a way to get root access to the emulator without actually needing to go through the rooting myself. I am not sure you are getting a true rooted device in this way but I can run adb as root and manipulate and look through files in protected directories, so it works for me during the pentest.</p><p>You can do this without installing the whole Android studio but it is easier through the Android Studio. The key is to install a version of a virtual android device that does not include Play Store APIs. This approach was tested and worked well in Android API 33 and 35 which are quite close to the latest Android version in the market.</p><h3>The full steps:</h3><ul><li>Install <strong>Android Studio</strong> and Create any desired device without<strong> Play Store APIs</strong> with any <strong>Android OS APIs</strong></li><li>Try to run the virtual device with <strong>emulator.exe</strong> as <strong>writable system</strong></li><li>Use <strong>adb</strong> tools to verify root access</li><li>Make sure writable access is achieved (optional step)</li></ul><h3>The Demonstration</h3><h4>Install Android Studio and Create any desired device without Play Store APIs with any Android OS APIs</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pXoELB6Yz39bASmU" /><figcaption>You can choose any type of phone, just make sure you choose the one without the <strong>Play Store icon</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2GJDTLotFnEa1ekh" /><figcaption>Pick any desired <strong>API level</strong>, I chose API level 33 for this test</figcaption></figure><h4>Try to run the virtual device with emulator.exe as writable system</h4><p>Launching the emulator through the command prompt is not mandatory, you can just launch the Android image that you created any way you desired. But I chose to use the following command to launch with writable access to the phone.</p><p>Assuming your emulator.exe is already set in the Environmental Variables:</p><pre>emulator -avd &lt;image name&gt; -writable-system</pre><p>The emulator.exe is typically in the emulator folder under the sdk folder in the Windows OS if you had installed Android Studio:</p><pre>C:\Users\&lt;username&gt;\AppData\Local\Android\Sdk\emulator\emulator.exe -avd &lt;image name&gt; -writable-system</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*98umghbqLxTqUnUv" /><figcaption>Opening the desired device with writable access enabled</figcaption></figure><h4>Use adb tools to verify root access</h4><p>The adb.exe is typically in the emulator folder under the sdk folder in the Windows OS if you had installed Android Studio:</p><pre>C:\Users\&lt;username&gt;\AppData\Local\Android\Sdk\platform-tools\adb.exe</pre><p>Enabling root access:</p><pre><br>// enabling root access<br>adb root<br><br>// making the system on the emulator wriable<br>adb remount<br><br>//logging into the emulator<br>adb shell<br><br>//Verifying what user name you&#39;re logged in to the emulator as<br>whoami</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/0*K7ODNIZfdD0fJ1PB" /><figcaption>Running as root (red arrow), remounted the system to be writable (green arrow) and confirm that your user is root (blue arrow)</figcaption></figure><p>At the very first time, when you do an adb remount, the system may ask you to reboot. So just reboot using the following commands. Then verify again as the steps above.</p><pre>// rebooting<br>adb shell<br>reboot<br><br>//redo the steps when emulator is up <br>adb root<br>adb remount<br>adb shell<br>whoami</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/0*7ziQ5Y_4RnrLk6nv" /><figcaption>If you can list or ls the /data/data/ or /data/app/ folders also means you have root access.</figcaption></figure><h4>Make sure writable access is achieved (optional step)</h4><p>While we are in shell access to the Android emulator phone, verify that you have write access. system/etc/security/cacerts is one of the write protected folders. I tried creating a test file with touch command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/0*FR6LDOt3R_h7V4fM" /><figcaption>Confirmed that the test file is created implying wirable access</figcaption></figure><p>So this is it. You now have an emulator with root access with very minimum effort.</p><p>Thanks for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23994d829fda" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Extract Parameter Values from Burp Suite History]]></title>
            <link>https://bayinmin.medium.com/extract-parameter-values-from-burp-suite-history-d773782999b0?source=rss-bb90b160db7f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d773782999b0</guid>
            <category><![CDATA[burpsuite]]></category>
            <category><![CDATA[url-analyzer]]></category>
            <category><![CDATA[parameter]]></category>
            <category><![CDATA[proxy]]></category>
            <category><![CDATA[url-analysis]]></category>
            <dc:creator><![CDATA[Ba Yin Min]]></dc:creator>
            <pubDate>Wed, 20 Nov 2024 03:25:06 GMT</pubDate>
            <atom:updated>2024-11-20T03:47:24.491Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>tl;dr</strong> —<strong> </strong>Use a combination of regex <strong>[&amp;?]param-name=([^&amp;]+)</strong> and <strong>Sensitive Discover </strong>extension from the BApp Store.</p><p>Sometimes, I want to extract all possible values in use by the application for a certain parameter for further analysis during the security testing. The following flow is what works for me currently.</p><p>Assuming there are many entries in Burp Suite proxy logs, I want to extract all the parameter values for a parameter name <strong>pagekey</strong>. Refer to the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XXZW8ZPPvMQyG12iBk3IvA.png" /><figcaption>The parameter name is <strong>pagekey</strong> (circled in red) and I want to extract all the corresponding parameter values (underlined in green)</figcaption></figure><h4>Install the extension from the BApp Store</h4><p>In your Burp Suite professional, go to extension and install the target extension <strong>Sensitive Discover</strong> as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Of6SRjODlkAgfGaeNt9c0w.png" /><figcaption>Install the <strong>Sensitive Discover</strong> extension</figcaption></figure><h4>Configure the regex (regular expression)</h4><p>The extension comes with pre-configured patterns of finding other sensitive data from the proxy log which is very handy. For our case, I will configure an additional parameter pattern that I want to extract value for. For demonstration purposes, all the default patterns are disabled and only my pattern will be enabled for searching or analyzing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0TxNN8x5moyVp2VfBXBihw.png" /><figcaption>Configure the pattern and make sure to enable or make it active (make a tick)</figcaption></figure><p>I created a new regex for my pattern for the following format:</p><pre>[&amp;?]param-name=([^&amp;]+)</pre><p>As the parameter name that I want is <strong>pagekey</strong> I put the parameter name according into the regex, so the resulting will be:</p><pre>[&amp;?]pagekey=([^&amp;]+)</pre><p>location to search the parameter are in <strong>Request URL</strong> and <strong>Request Header</strong> so I ticked them accordingly in the screenshot above. So, it’s all set for extraction.</p><h4>Extracting the parameter values</h4><p>To extract, go to the <strong>Logger</strong> tab of the <strong>Sensitive Discover</strong> extension and simply click <strong>Analyze HTTP History</strong>. All the matching values will be displayed. The result can be exported via <strong>Export list logs </strong>in in csv or json format for further processing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DFx9VRqH1DAx5bABuUUX2A.png" /><figcaption>The parameter values are circled in green and the export button is circled in orange</figcaption></figure><p>Kudos to <strong>Nadeem Douba</strong> for creating the <strong>Sensitive Discover</strong> extension and making it flexible for additional pattern analysis.</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d773782999b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Check Java Keystore JKS File for Private Keys]]></title>
            <link>https://bayinmin.medium.com/how-to-check-java-keystore-jks-file-for-private-keys-e2f5f8b0e90f?source=rss-bb90b160db7f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2f5f8b0e90f</guid>
            <category><![CDATA[certificate]]></category>
            <category><![CDATA[private-key]]></category>
            <category><![CDATA[java-keystore]]></category>
            <category><![CDATA[private-key-recovery]]></category>
            <category><![CDATA[keystore]]></category>
            <dc:creator><![CDATA[Ba Yin Min]]></dc:creator>
            <pubDate>Tue, 05 Nov 2024 00:54:42 GMT</pubDate>
            <atom:updated>2024-12-19T02:56:45.310Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>tl;dr</strong> — use <strong>keytool</strong> to list content of .jks keystore file and lookout for <strong>SecretKeyEntry </strong>and<strong> PrivateKeyEntry </strong>entry types for <strong>private</strong> key storage and extract private key with <strong>openssl</strong> library</p><p>Sometimes when I come across <strong>Java Keystore</strong> or a file with .<strong>jks</strong> extension as well as its password, I wonder if sensitive data is inside and whether I can extract private keys from the file if the file password is known.</p><blockquote>Can I know whether a private key is stored inside JKS without actually exporting it out? Is it possible?</blockquote><blockquote>The answer is Yes.</blockquote><p>The following items will be used in my demonstration:</p><ul><li><strong>mykeystore.jks</strong> — I imported <a href="http://www.google.com/">www.google.com</a> and <a href="http://www.bing.com/">www.bing.com</a> public keys or public certificates as non-sensitive information storage. A set of public and private key that I generated called mykey for sensitive information storage</li><li><strong>keystore password</strong></li><li><strong>keytool</strong> — I think it typically comes with java installation</li><li><strong>openssl</strong> — Linux OS has it or it can be easily installed</li></ul><h3>Checking What Type of Entries are Stored within the Keystore</h3><p>It is pretty simple. Run the following <strong>keytool</strong> command against the <strong>.jks</strong> file you want to analyse.</p><pre>keytool -list -keystore mykeystore.jks</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D9FeBLBRfG-CL583" /><figcaption>Listing the content of<strong> Java Keystore</strong> file using <strong>keytool</strong> -list command</figcaption></figure><p>So, the yellow circle is nothing much, the column denotes a name or alias of a particular data row. From the screenshot above, I have three items stored in the keystore with alias or name <strong>bing</strong>, <strong>google</strong> and <strong>mykey</strong>.</p><p>What is more important is the entries type value which marked with green. There are 3 possible values as far as I know.</p><ul><li><strong>PrivateKeyEntry</strong>: Contains a private key and the associated certificate chain.</li><li><strong>SecretKeyEntry</strong>: Stores a secret (symmetric) key used in algorithms like AES.</li><li><strong>TrustedCertificateEntry</strong>: Holds a trusted certificate, such as a root or intermediate CA certificate. No private key involved.</li></ul><p>If we happen to crack a password of a .<strong>jks</strong> file and it has items with an entry type of either <strong>SecretKeyEntry</strong> or <strong>PrivateKeyEntry</strong>, we have hit a jackpot. Private keys, either asymmetric or symmetric, can be extracted if you want it further. For this demonstration it has been identified that an item with <strong>mykey</strong> alias has entry type of <strong>PrivateKeyEntry </strong>which means its private key is stored within this <strong>mykeystore.jks</strong> keystore.</p><h3>Extracting Private Keys</h3><p>From a quick search, it looks like we have to convert the .<strong>jks</strong> file into PKCS12 (file extension .p12) then use openssl to export the private key out.</p><p>If you want to extract a <strong>single</strong> item from the keystore, use <strong>-srcalias</strong> to specify the desired alias name:</p><pre>keytool -importkeystore -srckeystore &lt;name&gt;.jks -destkeystore &lt;name&gt;.p12 -srcstoretype jks -deststoretype pkcs12 -srcalias &lt;alias&gt; -deststorepass &lt;password&gt; -destkeypass &lt;password&gt;</pre><p>If you want to extract everything, you don’t need to specify -srcalias parameter:</p><pre>keytool -importkeystore -srckeystore &lt;name&gt;.jks -destkeystore &lt;name&gt;.p12 -srcstoretype jks -deststoretype pkcs12 -deststorepass &lt;password&gt; -destkeypass &lt;password&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YlOnu_LLCtdD3p6T" /><figcaption>We are interested in this item with <strong>mykey</strong> alias</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*47Z2NN7-XbKgHcdb" /><figcaption>Extracting a single <strong>“mykey” </strong>item by specifying in <strong>alias</strong> name and converting into <strong>.p12</strong> file format</figcaption></figure><p>The command to export private keys:</p><pre>openssl pkcs12 -in &lt;name&gt;.p12 -nocerts -out &lt;name&gt;.pem</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2Gr9--ZEw8bYlfVA" /><figcaption>Exporting private key from <strong>.p12</strong> file to another viewable format <strong>.pem</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*om7JhKEp8zNM0NmrI0LHqQ.png" /><figcaption>Viewing the actual private key value from the exported .pem file</figcaption></figure><p>Just make sure to keep track of various passwords if you are giving unique passwords for each steps.</p><p>So this is how we can view if .jks file content and export private keys.</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2f5f8b0e90f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Best Tutorial on How to Build Python Packages with pyproject.toml Yet]]></title>
            <link>https://bayinmin.medium.com/best-tutorial-on-how-to-build-python-packages-with-pyproject-toml-yet-2a8ae9542765?source=rss-bb90b160db7f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a8ae9542765</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[pypi]]></category>
            <category><![CDATA[pyproject]]></category>
            <category><![CDATA[setuptools]]></category>
            <category><![CDATA[package]]></category>
            <dc:creator><![CDATA[Ba Yin Min]]></dc:creator>
            <pubDate>Tue, 22 Oct 2024 00:01:37 GMT</pubDate>
            <atom:updated>2024-10-22T00:01:37.226Z</atom:updated>
            <content:encoded><![CDATA[<p>There are many different ways to build and distribute python packages and there really are many blog posts and tutorials on how to do it.</p><p>However, it looks like the latest trend, leveraging a standard <strong>pyproject.toml</strong>, is<strong> </strong>the promising way to go about. I had difficulties following the folder structure and instructions to build with the pyproject.toml file but</p><p>However, I came across this video tutorial in which I find the conversational way of tutorial starting from basic to the goal is very clear.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fv6tALyc4C10%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dv6tALyc4C10&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fv6tALyc4C10%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a775885248e8379f221ada6e68ebf00e/href">https://medium.com/media/a775885248e8379f221ada6e68ebf00e/href</a></iframe><p>I hope you build some great packages!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a8ae9542765" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tutorial #7: How To Fix Request Hanging Issue When Proxying Through Burp Suite with Python or…]]></title>
            <link>https://bayinmin.medium.com/tutorial-7-how-to-fix-request-hanging-issue-when-proxying-through-burp-suite-with-python-or-29886b87123b?source=rss-bb90b160db7f------2</link>
            <guid isPermaLink="false">https://medium.com/p/29886b87123b</guid>
            <category><![CDATA[burpsuite]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[burp-suite-pro]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[jdk]]></category>
            <dc:creator><![CDATA[Ba Yin Min]]></dc:creator>
            <pubDate>Thu, 17 Oct 2024 21:19:10 GMT</pubDate>
            <atom:updated>2024-11-20T03:27:04.616Z</atom:updated>
            <content:encoded><![CDATA[<h3>Tutorial #7: How To Fix Request Hanging Issue When Proxying Through Burp Suite with Python or PowerShell</h3><p><strong>tl;dr</strong> — If you are using the later version of Burp especially version <strong>2024.8.5</strong>, update java JDK or JRE runtime environment to avoid the proxy issue and random crashes.</p><p>This is not much of a long tutorial. Recently, after upgrading my Burp Suite to the latest version at this time <strong>2024.8.5 (Stable)</strong>, I am frequently facing random crashes of the Burp Suite.</p><p>The more pressing problem for me is being unable to use my existing python scripts which go through Burp Suite as a proxy. The idea is for logging the HTTP traffic, performing vulnerability scanning with Burp Suite for further analysis.</p><p>A sample script looks like below:</p><pre>import requests<br><br>proxies = {&quot;http&quot;:&quot;127.0.0.1:8080&quot;,&quot;https&quot;:&quot;127.0.0.1:8080&quot;}<br>url = &#39;https://www.google.com&#39;<br><br>r = requests.get(url,proxies=proxies)<br>print(&quot;Response Status Code: &quot; + str(r.status_code))<br>print(&quot;Response Length:&quot; + str(len(r.content)))</pre><p>So, when the script tries to connect to the Burp Suite listener at 8080, it will either hang or timeout.</p><p>The culprit is that the new Burp Suite may require a new java runtime version. For me I was using <strong>jdk 1.7</strong> (pretty old, I know). Just upgrade your JDK to 1.8 and above. The more recent one, the better but if you use jdk 23, Burp Suite will still work but it shows a warning that Burp Suite version is not fully tested yet in jdk 23.</p><p>In brief, it has been observed that jdk 1.7 is no longer suitable to run the latest Burp Suite. Just upgrade the java runtime environment or jdk soon to avoid frequent crashes and headaches.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29886b87123b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tutorial #6: Fix SSL Error in Python requests when proxying through Burp Suite]]></title>
            <link>https://bayinmin.medium.com/tutorial-6-fix-ssl-error-in-python-requests-when-proxying-through-burp-suite-0bd67d417663?source=rss-bb90b160db7f------2</link>
            <guid isPermaLink="false">https://medium.com/p/0bd67d417663</guid>
            <category><![CDATA[burpsuite]]></category>
            <category><![CDATA[requests-library]]></category>
            <category><![CDATA[python-request]]></category>
            <category><![CDATA[ssl-error]]></category>
            <category><![CDATA[self-signed-certificate]]></category>
            <dc:creator><![CDATA[Ba Yin Min]]></dc:creator>
            <pubDate>Sat, 04 May 2024 12:01:35 GMT</pubDate>
            <atom:updated>2024-11-20T03:27:39.792Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>tl;dr</strong> — Two ways to fix: either disable SSL checking completely with <strong>verify=False</strong> (the dirty approach) or use <strong>verify=&lt;path to cert&gt;</strong> to enforce certificate check against a chosen certificate from a desired local location.</p><h4>The Background</h4><p>In Python3, we can make use of the <strong>requests</strong> library to invoke HTTP requests. It is a pretty neat library and easy to pick up for writing scripts for any penetration testing engagement. When doing so I wanted to proxy all my python scripts traffic through Burp Suite so that the traffic (the requests and responses) can be examined more closely and troubleshoot if necessary.</p><p>The main issue when proxying the python through Burp Proxy is the certification validation error as Burp Suite is a form of MitM (man-in-the-middle) proxy which uses its own self-signed certificate. The python script<strong> </strong>will find the Burp certificate as invalid, and it would refuse to establish the connection.</p><p>After searching through much on the internet including various Stack Overflow posts, the following are my attempts to fix such SSL validation errors to make the set-up work. The following diagram is the set up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mDzvdll0m4QV-8sRGc_04w.png" /><figcaption>The python script will use Burp Suite as its proxy when communicating with a target website.</figcaption></figure><p>The following is a sample code of python script making a simple GET to <a href="http://www.google.com/">http://www.google.com</a> making use of the python requests library. This will not work as python will be unable to validate the proxy certificate. The <strong>proxies</strong> parameter in requests allows the HTTP request traffic to flow through a proxy. (e.g. 127.0.0.1:8080 is where my Burp proxy is listening)</p><pre>import requests<br><br>proxies = {&quot;http&quot;:&quot;127.0.0.1:8080&quot;,&quot;https&quot;:&quot;127.0.0.1:8080&quot;}<br>url = &#39;https://www.google.com&#39;<br><br>r = requests.get(url,proxies=proxies)<br>print(&quot;Response Status Code: &quot; + str(r.status_code))<br>print(&quot;Response Length:&quot; + str(len(r.content)))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FJsH9NBMVrcIzVdBt2dPvw.png" /><figcaption>When running the above-mentioned code, the <strong>requests</strong> refuses to establish connection and show errors like this</figcaption></figure><h4>Approach 1: The Dirty Fix with verify=False</h4><p>If I am looking for a quick and dirty fix, I can just put an additional parameter of <strong>verify</strong> with the value <strong>False</strong> when triggering a get request as shown in the code below. This will force python to ignore SSL check at all and just establish the HTTP connection.</p><p>This is it; it is fixed! But if you still want to fix this in a better way, keep reading the next the approach 2 below.</p><pre>import requests<br><br>proxies = {&quot;http&quot;:&quot;127.0.0.1:8080&quot;,&quot;https&quot;:&quot;127.0.0.1:8080&quot;}<br>url = &#39;https://www.google.com&#39;<br><br>r = requests.get(url,proxies=proxies,verify=False)<br>print(&quot;Response Status Code: &quot; + str(r.status_code))<br>print(&quot;Response Length:&quot; + str(len(r.content)))</pre><h4>Approach 2: Performing Cert Validation Against a Local Certificate</h4><p>First, I need a copy of Burp public certificate for the python library to validate against. Burp has<strong> its own built-in chromium browser</strong> which is already configured to proxy through 127.0.0.1:8080. Either using that browser or any browser of my own<strong> that is already configured to connect to burp proxy</strong>, I can go to <a href="http://burp/">http://burp</a> and download the CA cert under the <strong>CA Certificate</strong> menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HIqY3273-bGLqOUynz_eCw.png" /><figcaption>Download CA cert under the <strong>CA Certificate</strong> by visiting <a href="http://burp/">http://burp</a> in your Burp default browser or your local browser that is configure to the local Burp Suite proxy</figcaption></figure><p>By doing so, you will get hold of a Burp CA certificate typically named <strong>cacert.der</strong> file. To be able to use this in the python script, the format needs to be converted to <strong>.pem</strong> format. By using <strong>openssl</strong> (which is typically installed by default in Linux boxes but I use it through <strong>wsl</strong>), convert the .der to .pem as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cPNBLCUZLenMJHkVLSqYnA.png" /><figcaption>Convert .der to .pem with openssl e.g. <strong>openssl x509 -inform der -in cacert.der -out burpca.pem</strong></figcaption></figure><p>Then, use parameter <strong>verify</strong> again and <strong>put the file path value </strong>to the newly converted .pem as seen in the code below.</p><pre>import requests<br><br>proxies = {&quot;http&quot;:&quot;127.0.0.1:8080&quot;,&quot;https&quot;:&quot;127.0.0.1:8080&quot;}<br>url = &#39;https://www.google.com&#39;<br><br>r = requests.get(url,proxies=proxies,verify=&#39;C:\\temp\\burpca.pem&#39;)<br>print(&quot;Response Status Code: &quot; + str(r.status_code))<br>print(&quot;Response Length:&quot; + str(len(r.content)))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*nhw7ZFaXvdkKr0RYa4VPdQ.png" /><figcaption>There will be no more SSL error when running the script</figcaption></figure><p>So that was the second way that I tried out to fix the SSL issue. You have been reading my post (written by a real human) rather than information by some ChatGPT or CoPilot! And I thank you for that :D.</p><p>Have a good day.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0bd67d417663" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Application Security #4: What do jwk keypairs look like? Have I found something sensitive?]]></title>
            <link>https://bayinmin.medium.com/application-security-4-what-do-jwk-keypairs-look-like-have-i-found-something-sensitive-9a128c44141a?source=rss-bb90b160db7f------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a128c44141a</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[jwt-token]]></category>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[bearer-token]]></category>
            <category><![CDATA[jwks]]></category>
            <dc:creator><![CDATA[Ba Yin Min]]></dc:creator>
            <pubDate>Fri, 26 Apr 2024 22:02:10 GMT</pubDate>
            <atom:updated>2024-04-26T22:02:10.612Z</atom:updated>
            <content:encoded><![CDATA[<p>What does keypairs look like? What does it mean? Where to find it? How to generate it?</p><p>Whenever I perform penetration testing on an application which uses bearer token authentication based on JWT token, I used to keep Googling what each key parameter means in the JWT header section. Likewise, when I come across jwk keypair files or jwk keypairs set in some paths on the website, I always have to make a decision. Do these keypairs serve as just public information or it is unintended sensitive data disclosure concerning keypairs?</p><p>So, this post is a note for me and for anyone who might be interested.</p><p>The signing and/or encryption keys are the lifeblood of JWT tokens be it symmetric or asymmetric algorithm. if you get your hands on the correct key pairs, you essentially own the whole authentication/session management mechanism of the web application. That is why it is important to decide if the keypair you are looking at is just a public key or it is something more that you can use to forge JWT tokens.</p><p>This post contains the following sections:</p><ul><li>Glossary for jwk, jwks etc</li><li>What does jwk P<strong>ublic</strong> Keypair look like?</li><li>What does jwk <strong>Public and Private </strong>Keypair look like?</li><li>What does each key parameter stand for?</li><li>Where to find jwk keypairs on the websites?</li><li>How can you generate your own jwk keypairs for observations?</li></ul><h4>Glossary for jwk, jwks etc</h4><ul><li>JWK: Java Web Key</li><li>JWKS: Java Web Key Set or a collection of JWK</li><li>JWT: Java Web Token</li></ul><h4>What does jwk public Keypair look like?</h4><p>The following is a public key set which we normally come across. All of this are <strong>public information</strong>, nothing sensitive.</p><pre>{<br>    &quot;kty&quot;: &quot;RSA&quot;,<br>    &quot;e&quot;: &quot;AQAB&quot;,<br>    &quot;kid&quot;: &quot;rsatest1&quot;,<br>    &quot;n&quot;: &quot;p95A77RxUg622xCoYZyFOCfHSh_3dKdH7axV49C4OfLaS12p9zb35pokwfpcYQAKbZJXaxnKkGWMCuHTv_DdVQ&quot;<br>}</pre><p>Refer to <strong>What does each key parameter stand for? </strong>below for what each key parameter means.</p><h4>What does jwk Public and Private Keypair look like?</h4><p>This is very unlikely but if you come across the following kind of key set, you have struck a jackpot. This is a public and private key set which obviously contains private keypair information or secrets such as <strong>secret keys and/or prime factors: d,p,q,qi,u.</strong></p><pre>{<br>    &quot;p&quot;: &quot;5R4S4fuU_nWryNtMc3gJE88XQgfG8_D4Jfduk4bKEwc&quot;,<br>    &quot;kty&quot;: &quot;RSA&quot;,<br>    &quot;q&quot;: &quot;u5B0dKFPccSHQHUQgz35Ee-rCer_yePDSmskIrX16cM&quot;,<br>    &quot;d&quot;: &quot;I9H8uEmgPrrOEQvKal3MXZG7aFlO4_EIG7LA9yZkEVUkjo97ZNQkiEjOJd3IwoZ_5D-XmvrZxjfDxBPxv7tPxw&quot;,<br>    &quot;e&quot;: &quot;AQAB&quot;,<br>    &quot;kid&quot;: &quot;rsatest1&quot;,<br>    &quot;qi&quot;: &quot;sJ3xIr31NHXvpd3vRLiUOz4rYBu3Ldiktq0Qv7B-I-4&quot;,<br>    &quot;dp&quot;: &quot;WjUUBCt0hxc3UnadTB0nncf8hT_goizu1qvrumPobcM&quot;,<br>    &quot;dq&quot;: &quot;eNfpL_t-I95rBaxmpygWgOfZWtp9UqXb_OZqsbJqbeE&quot;,<br>    &quot;n&quot;: &quot;p95A77RxUg622xCoYZyFOCfHSh_3dKdH7axV49C4OfLaS12p9zb35pokwfpcYQAKbZJXaxnKkGWMCuHTv_DdVQ&quot;<br>}</pre><p>Refer to <strong>What does each key parameter stand for? </strong>below for what each key parameter means.</p><h4>What does each key parameter stand for?</h4><p>The following are key names and what they are for (alphabetically sorted by key names)</p><ul><li><strong>alg</strong>: algorithm. e.g. RS256, ES256, PS256</li><li><strong>crv</strong>: Specifies elliptic curve being used. e.g. P-256, P-384</li><li><strong>d</strong>: <em>RSA secret exponent </em>(modular inverse of “e” modulo (p-1)(q-1)).</li><li><strong>e</strong>: RSA public exponent.</li><li><strong>kid</strong>: Key ID.</li><li><strong>kty</strong> : Key type or type of cryptographic key used. e.g. RSA, EC, oct.</li><li><strong>n:</strong> RSA public modulus (the product of two prime numbers).</li><li><strong>p:</strong> First <em>RSA secret prime</em></li><li><strong>q</strong>: The other <em>RSA secret prime</em> (condition — “p” is less than “q”).</li><li><strong>qi</strong>: The <em>modular multiplicative inverse</em> of “q” modulo “p”.</li><li><strong>u</strong>: Multiplicative inverse of “p” modulo “q”.</li><li><strong>use</strong>: use or usage. “enc” for encryption, “sig” for signature.</li><li><strong>x</strong>: The base64-encoded x-coordinate of a point on the elliptic curve.</li><li><strong>x5c</strong>: The certificate chain. A JSON array of base64-encoded DERs</li><li><strong>x5t</strong>: The thumbprint for the certificate. (SHA-1 hash)</li><li><strong>y</strong>: The base64-encoded y-coordinate of a point on the elliptic curve.</li></ul><h4>Where to find jwk keypairs on the websites?</h4><p>By design, the keypairs are usually announced by the websites and can be found typically in the following path:</p><ul><li>https://&lt;domain&gt;/.well-known/openid-configuration</li><li>https://&lt;domain&gt;/.well-known/jwks.json</li></ul><p>You might come across the actual jwk keypairs file from other means of exploits such as Path Traversal attack or command injection etc. For those cases, you can use <strong>keytool</strong> and <strong>openssl</strong> to observe if the key contains private key materials. But that is a topic for another day.</p><h4>How can you generate your own jwk keypairs for observations?</h4><p>First of all, it is best not to generate keypairs online for actual production use for your application. Always use local tools or local command line based means of keypair generation to safeguard your keys. The following are just for testing and observations.</p><ul><li>This website is handy for generation multiple types of jwk keypair: <a href="https://mkjwk.org/">https://mkjwk.org/</a></li><li>If you use Burp Suite Pro, you can leverage <strong>JWT Editor Burp Extension</strong> which can generate both symmetric, asymmetric keypairs and is exportable to both jwk and pem format. I am not sure how long the link will be valid but here it is <a href="https://portswigger.net/bappstore/26aaa5ded2f74beea19e2ed8345a93dd">https://portswigger.net/bappstore/26aaa5ded2f74beea19e2ed8345a93dd</a></li></ul><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a128c44141a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tutorial #5: Prevent Clickjacking Attack with X-Frame-Options]]></title>
            <link>https://bayinmin.medium.com/tutorial-5-prevent-clickjacking-attack-with-x-frame-options-7f5039c73002?source=rss-bb90b160db7f------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f5039c73002</guid>
            <category><![CDATA[how-to-fix]]></category>
            <category><![CDATA[x-frame-option]]></category>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[clickjacking]]></category>
            <dc:creator><![CDATA[Ba Yin Min]]></dc:creator>
            <pubDate>Sat, 20 Apr 2024 22:02:05 GMT</pubDate>
            <atom:updated>2024-04-20T22:02:05.975Z</atom:updated>
            <content:encoded><![CDATA[<p>A video demonstration on how to implement <strong>X-Frame-Options</strong> header to prevent <strong>Clickjacking</strong> or <strong>UI Redressing </strong>attack.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F2MCvDBJ1d0c&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D2MCvDBJ1d0c&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2F2MCvDBJ1d0c%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b8e44e6b92180d16e8bd1838b3af7972/href">https://medium.com/media/b8e44e6b92180d16e8bd1838b3af7972/href</a></iframe><p>Thanks for your attention!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f5039c73002" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>