<?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 Mark Mo - Fashionproof on Medium]]></title>
        <description><![CDATA[Stories by Mark Mo - Fashionproof on Medium]]></description>
        <link>https://medium.com/@markmotig?source=rss-45f123a0b695------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*tLWSoRouVJomAZ15PvYkxg.jpeg</url>
            <title>Stories by Mark Mo - Fashionproof on Medium</title>
            <link>https://medium.com/@markmotig?source=rss-45f123a0b695------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 21:12:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@markmotig/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[Nested Compiling in Memory]]></title>
            <link>https://medium.com/@markmotig/nested-compiling-in-memory-f4a12881a3c4?source=rss-45f123a0b695------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4a12881a3c4</guid>
            <category><![CDATA[c-sharp-programming]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Mark Mo - Fashionproof]]></dc:creator>
            <pubDate>Tue, 21 Oct 2025 17:49:33 GMT</pubDate>
            <atom:updated>2025-10-21T17:49:33.985Z</atom:updated>
            <content:encoded><![CDATA[<p>I only went two levels deep, but this can be easily modified to write dynamic nested compiling to some theoretical limit.</p><p>Basically, I’m taking a known concept from someone else&#39;s example and extending it.</p><p>The tricky part was just handling quotations and other special characters. I used a string builder to do that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*21MzV9QCSsMvWDg3Saqfxw.png" /></figure><p>I’m just popping calc for fun.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*P0D2Aol8q-BLGKoUADMpBQ.png" /></figure><p>I included some sandbox code I found on stack overflow that I have not incorporated yet, but I left it in there to remind me to play with it when time permits. Currently it is not called in the program.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*sVQ1qMSWjHqam9mDlJ41iw.png" /></figure><p>Here is the code</p><p><a href="https://github.com/fashionproof/NestedCompileInMemory">GitHub - fashionproof/NestedCompileInMemory: compile some code in memory that compiles more code in memory :p</a></p><p>Feel free to follow me on Bluesky</p><p><a href="https://bsky.app/profile/fashionproof.bsky.social">FashionProof (@fashionproof.bsky.social) — Bluesky</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4a12881a3c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Windows Defender Exclusion Persistence with Registry.pol]]></title>
            <link>https://medium.com/@markmotig/windows-defender-exclusion-persistence-with-registry-pol-666acef2bb9?source=rss-45f123a0b695------2</link>
            <guid isPermaLink="false">https://medium.com/p/666acef2bb9</guid>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[windows-defender]]></category>
            <dc:creator><![CDATA[Mark Mo - Fashionproof]]></dc:creator>
            <pubDate>Fri, 31 Mar 2023 14:09:26 GMT</pubDate>
            <atom:updated>2025-08-05T14:38:51.368Z</atom:updated>
            <content:encoded><![CDATA[<p>I didn’t research if anyone already found this. I don’t imagine I am the first person that found this.</p><p>For starters I have one exclusion specified for some testing</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*mKrHuW0MYGLPhcOh3T3-dQ.png" /><figcaption>an excluded folder</figcaption></figure><p>Here is the path in the registry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qd-9VBKpci7JHnMp9MnO4A.png" /><figcaption>excluded folder registry path</figcaption></figure><p>There is a special local machine policy located in c:\windows\system32\GroupPolicy\Machine</p><p>It ithere even if you are not part of a domain</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zb1licH9YIaqH7kAqOI8sg.png" /></figure><p>Now I want to add a setting to it to add another entry in there, another excluded folder for defender. This requires ADMIN RIGHTS.</p><pre>#enable tls12<br>[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12<br>#I had to do this get things running correctly<br>Register-PSRepository -Default<br><br>#install PolicyFileEditor Module<br>Install-Module -Name PolicyFileEditor<br><br>#shows the existing policies<br>Get-PolicyFileEntry -Path $env:systemroot\system32\GroupPolicy\Machine\registry.pol -All<br><br>#this will add an exclusion<br>Set-PolicyFileEntry -Path $env:systemroot\system32\GroupPolicy\Machine\registry.pol -Key &#39;SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths&#39; -ValueName C:\tools\Registry.pol -Data &#39;0x00000000&#39; -Type DWord</pre><p>Here is what that looks like, notice the value is now added to the registry.pol file in c:\windows\system32\GroupPolicy\Machine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qVlWBqB_ax7Dbv_6jplkzQ.png" /><figcaption>running the code adds the entry in registry.pol</figcaption></figure><p>One could also use LGPO and export the policy and modify it and reimport it. I’m sure there are other ways.</p><p>Before I execute gupdate /force my defender exclusions only contains the previous value</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*-x6GseM-HSHzcVw30X6LbQ.png" /><figcaption>exclusions before gpupdate</figcaption></figure><p>now when I run “gpupdate /force” as a REGULAR user the magic happens!</p><p>If you are watching EDR you will see system running a group policy process. It LOOKS like system made the update with group policy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yOy7Dx2Kb1JUzWT0wbUD9A.png" /></figure><p>So now I’ll remove it from the UI</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*X84AqNtlS568iMuYv7DQyA.png" /></figure><p>And its gone for a moment :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*-x6GseM-HSHzcVw30X6LbQ.png" /></figure><p>However the value is still in registry.pol so all I have to do is run GPupdate /force (as a regular user) and it is back again!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*p2hKEzbcRVUcH7zyFErCzw.png" /></figure><p>Mitigations: You must look for modifications to registry path exclusions!!!</p><p>If you see repeated defender exclusions being added over and over and over, the source may be the source.</p><p>Fix: for me I deleted the local registry.pol file and that usually fixes is. If that doesn’t fix it, I would reimage my machine</p><p>Microsoft is aware of this issue and future tamper protections will be implemented in the future. In the mean time. Watch for exclusions in the registry (Paths, Processes, IP, etc)</p><p>Feel free to follow me on bluesky <a href="https://bsky.app/profile/fashionproof.bsky.social">FashionProof (@fashionproof.bsky.social) — Bluesky</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=666acef2bb9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Some things to better protect my home network]]></title>
            <link>https://medium.com/@markmotig/some-things-to-better-protect-my-home-network-77f128b3bd7?source=rss-45f123a0b695------2</link>
            <guid isPermaLink="false">https://medium.com/p/77f128b3bd7</guid>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Mark Mo - Fashionproof]]></dc:creator>
            <pubDate>Fri, 16 Sep 2022 22:30:14 GMT</pubDate>
            <atom:updated>2022-09-16T22:30:14.427Z</atom:updated>
            <content:encoded><![CDATA[<p>Here are some things I do to better protect my home network. There are much more qualified people that have written much better articles on this topic but this is just what I do.</p><ul><li>I bought a reputable router (ask network people what they use for home) that updates daily and has a built in Intrusion Prevention System (IPS).</li><li>I have the router IPS settings on block and setting maxed out.</li><li>I do not use the router that comes from the ISP.</li><li>I have MFA access on my router.</li><li>I have separate networks for myself, my spouse, IOT Devices, etc.</li><li>I have client isolation enabled.</li><li>I use MAC address filtering .</li><li>I use long passwords on WI-FI.</li><li>If something needs to be on the network but does not need to talk to the internet I block it in the router.</li><li>I use 9.9.9.9 for my DNS. I set that DNS on my phone, machines, TV, everywhere <a href="https://www.quad9.net/">https://www.quad9.net/</a></li><li>On windows firewall I have incoming connections blocked on Domain/Public/Private networks. Why would I want someone to NMAP scan/enumerate my computer if I ever need to connect to public Wi-Fi (coffee shot, hotel) or even my home network. I do not allow it on private network either.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*50vkHNtqG9BPcca7yWWI8w.png" /></figure><ul><li>I use VPN on my phone and personal computers.</li><li>I block outbound connections for SMB on public/private/domain. I’m sure there is a better way to do this but just doing 445 for now.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*jS3uQ3-lbSMzyYXEAfm-tg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*wC_0DG463ZR9PW9OM95gLA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*mne60GrSYlgULjWPnwz67Q.png" /></figure><ul><li>I try to keep my systems patched (I even update my (mostly offline) LAB sometimes!).</li><li>I use a password manager. MFA on that too</li><li>I don’t install random garbage on my machine unless it is in my offline lab and then I roll it back when I am done testing.</li><li>If I have to install something on my personal computer I try to use something like <a href="https://ninite.com/">https://ninite.com/</a></li><li>I turn off Wi-Fi, unplug cables and power down my computers when they are not in use.</li><li>I turn off networking on my gaming console when I’m not updating or downloading a game. I’m offline mostly.</li><li>I talk to my family constantly about security. They hate it sometimes! (•_•)</li><li>I back important things up online and offline.</li><li>I have dogs.</li><li>I use wired mice and keyboard. I use wired as much as possible (not always practical). I love Battle Star Galactica 75.</li></ul><p>There is always more to do but it is Friday and that’s all that is coming to me off the top of my head. I am still likely to be hacked by a zero day or government that wants to look at my garbage code. I try to make things more difficult for attackers.</p><p>Have a great weekend.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77f128b3bd7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Brute force domain cached credentials]]></title>
            <link>https://medium.com/@markmotig/brute-force-domain-cached-credentials-5840a6bcb5f0?source=rss-45f123a0b695------2</link>
            <guid isPermaLink="false">https://medium.com/p/5840a6bcb5f0</guid>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Mark Mo - Fashionproof]]></dc:creator>
            <pubDate>Wed, 14 Sep 2022 00:58:37 GMT</pubDate>
            <atom:updated>2025-08-05T14:39:50.789Z</atom:updated>
            <content:encoded><![CDATA[<p>Have I always been able to brute force domain cached credentials just by disabling the network or is my AD lab messed up? I’m sure this isn’t new but it is new to me. My lockout is set but disabling the network seems to negate that.</p><p>Step 1. Disable my network (unplug cable, disable wifi, kill network adapter, whatever)</p><p>Step 2. brute force domain cached credentials to my hearts content. I’m not doing anything malicious. I am just trying to start a program as a different user. My AV does not care. It cannot talk to the mothership anyway 😊</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*cZWNrAf0KE0Bje_bXVRz1A.png" /><figcaption>Notice I’m logged into my machine as Joe User (no admin rights) and brute forcing my SomeDev account that has domain cached credentials.</figcaption></figure><p>Also, if I am admin I can overwrite the lockout policy but I don’t even need to do that. This is just for fun.</p><pre>secedit /export /cfg c:\users\public\securitypolicy.cfg </pre><pre>(gc c:\users\public\securitypolicy.cfg).replace(&quot;LockoutBadCount = 3&quot;, &quot;LockoutBadCount = 1000000&quot;) | Out-File c:\users\public\securitypolicy.cfg </pre><pre>secedit /configure /db c:\windows\security\local.sdb /cfg c:\users\public\securitypolicy.cfg /areas SECURITYPOLICY</pre><p>I tried to change the lockout from 3 to 100,000 but apparently there is a limit of 34,464 ¯\<em>(ツ)</em>/¯</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*E6I6vWzcaWDC6bxYFCY2_g.png" /></figure><p>So…. Defenses</p><p>Protected Users Group so domain cached creds are not stored.</p><p>Reduce the number of domain cached credentials to reduce blast radius. Default is 10 in AD</p><p>Long passwords</p><p>MFA / Hardware key</p><p>Maybe my AD settings are messed up but seems like a serious problem to me if my lab is not setup. Hopefully this will shed some light on the problem or my broke lab.</p><p>feel free to follow me on bluesky <a href="https://bsky.app/profile/fashionproof.bsky.social">FashionProof (@fashionproof.bsky.social) — Bluesky</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5840a6bcb5f0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Find Suspicious Permissions]]></title>
            <link>https://medium.com/@markmotig/find-suspicious-permissions-7a6ee1ad0bf5?source=rss-45f123a0b695------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a6ee1ad0bf5</guid>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Mark Mo - Fashionproof]]></dc:creator>
            <pubDate>Wed, 27 Oct 2021 02:21:29 GMT</pubDate>
            <atom:updated>2025-08-05T14:40:41.538Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m sure this is not net but it is new to me. Maybe you are making sure there are not admins on machines but are you checking for regular users with effectively admin permissions?</p><p>To figure this out, I found some code on stack overflow and modified it slightly to suit my purpose.</p><p><a href="https://stackoverflow.com/questions/31597657/sorting-objects-by-multiple-properties">https://stackoverflow.com/questions/31597657/sorting-objects-by-multiple-properties</a></p><p>Here are the permissions on the machine currently. I must run this as admin to see all the permissions. Nothing suspicious here… Yet… 😊</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*E-lUj1KJ3fd4TW7r6wPVog.png" /></figure><p>I have a regular user in my lab called JoeUser. He doesn’t have any special permissions and he is NOT in an admin group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*-LY4dQzudIjEcGPHdZp2oA.png" /></figure><p>I’m going to give JoeUser the SeTCBPrivilege (“Act as part of the operating system”). An attacker could escalate to admin rights and grant privileged permissions to a regular account to try to fly under the radar and still maintain privileged permissions without being in the administration group.</p><p>I’ll use GPEdit to add the permission.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MIYza6ZwJ3gg0ogVQ1qZ1A.png" /></figure><p>Now when I run the script, it identifies a regular user with one of the privileged permissions it should <em>probably </em>not have (JoeUser may disagree 😊).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WiMTQWQuXNpdIIfLWBgsgw.png" /></figure><p>When I log back in as JoeUser, now I see this when I say “run as administrator” (Even though the account is not in the admin group it still works great!).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*sLP88hTc4UwaIe-RUJQenA.png" /></figure><p>I can see JoeUser now has the SeTcbPrivilege (must log off and back on to see it).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*bb1dDdS1n4zM-j9hh1Nh9g.png" /></figure><p>Code for the powershell to find suspicious permissions is here. I did not spend a lot of time to QA this. Feel free to make it better.</p><p><a href="https://github.com/fashionproof/FindSuspiciousPermissions">GitHub - fashionproof/FindSuspiciousPermissions</a></p><p>With this permission I was able to run code from this article and write to system32 with my “regular” account with SeTcbPrivilege.</p><p><a href="https://hackinparis.com/data/slides/2019/talks/HIP2019-Andrea_Pierini-Whoami_Priv_Show_Me_Your_Privileges_And_I_Will_Lead_You_To_System.pdf">https://hackinparis.com/data/slides/2019/talks/HIP2019-Andrea_Pierini-Whoami_Priv_Show_Me_Your_Privileges_And_I_Will_Lead_You_To_System.pdf</a></p><p>I hope this helps someone. <strong><em>See this great article for prevention</em></strong></p><p><a href="https://blog.palantir.com/windows-privilege-abuse-auditing-detection-and-defense-3078a403d74e">Windows Privilege Abuse: Auditing, Detection, and Defense</a></p><p>Feel free to follow me on bluesky <a href="https://bsky.app/profile/fashionproof.bsky.social">FashionProof (@fashionproof.bsky.social) — Bluesky</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a6ee1ad0bf5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Changing file properties to lower virus total detection]]></title>
            <link>https://medium.com/@markmotig/changing-file-properties-to-lower-virus-total-detection-b1e2207811e3?source=rss-45f123a0b695------2</link>
            <guid isPermaLink="false">https://medium.com/p/b1e2207811e3</guid>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Mark Mo - Fashionproof]]></dc:creator>
            <pubDate>Tue, 07 Sep 2021 12:49:13 GMT</pubDate>
            <atom:updated>2025-08-05T14:41:55.037Z</atom:updated>
            <content:encoded><![CDATA[<p>This is not new, I read about it somewhere else (Thank you to whoever wrote the article I read, I didn’t bookmark it to give you credit ☹).</p><p>I’m just writing about it so I don’t forget 😊.</p><p>All of the screen shots comes from Benjamin Delpy <a href="https://github.com/gentilkiwi/mimikatz">https://github.com/gentilkiwi/mimikatz</a></p><p>I’ll start with the latest mimikatz.exe from the x64 folder</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*biqXL0NwcWoS5yF_Gfw8mA.png" /><figcaption>latest mimikatz in x64 folder</figcaption></figure><p>I check virus total and see 48 out of 68 flag it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*ll34n6NrkU9VlDzsME80Cw.png" /></figure><p>Now I’ll remove some properties with visual studio community edition. I’ll open visual studio and “continue without code”. Next I select “Open” and “File” and browse to my target exe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*GV_98YNwprYdAcJ8MYBuDA.png" /></figure><p>When I open mimikatz.exe, here is what that looks like</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*uhM45vGWWIzcevb_bKch_w.png" /></figure><p>First the icon file. I’ve read some AV’s detect based on the image alone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*aWE4XTkwCNLoy0XesNBkGA.png" /></figure><p>I can remove it or put in a new image or modify it (I haven’t tried modifying or putting in a new image). I’m going to delete it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*jPVO7sayQjWXgeo8zq2A2A.png" /></figure><p>After deleting, only the version information is showing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/261/1*GGz9CI9DeimBKx19riOx5Q.png" /></figure><p>When I look at the version information there are all kinds of detection opportunity strings in here :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*WIdOLM9sE2NTWHFIpqfdhg.png" /></figure><p>An attacker can modify these and put in a new file altogether. In this example, I will add a new resource, add properties, and then delete the existing one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*pnMubpHMHB_XWgg3vWz7kw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*444Be7r1APmYxnmdnLJa0Q.png" /><figcaption>select Version</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*pV4HOEdHp7ksV4qgWiC96Q.png" /><figcaption>when prompted select “no”</figcaption></figure><p>At this point there are two version files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/196/1*9w6RPVb6Lng85bSHwz0RLQ.png" /></figure><p>Next add properties</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*FunW6iwhhzBk4axuUsOUPQ.png" /><figcaption>Just putting in a random string here</figcaption></figure><p>Next, I’ll delete the original version 1 file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*YmVgDwk49VvodHds4rcDsw.png" /></figure><p>And only the new version remains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/186/1*vKz0FPrs6yF8F0Yso-xtUw.png" /></figure><p>I’ll rename it back to 1 in the property window</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*NSvXC5HnGTf3zPinsQJVsw.png" /></figure><p>Now it looks like this in the property (I save here).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*5chmbtCGiCR2luLHyqasOQ.png" /></figure><p>The Mimikatz binary looks like this in my folder after modification</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*A8QFYuz09VChvBCELyJkHg.png" /></figure><p>I’ll rename it and copy the original file in the folder to see the difference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*oiq7vMJVhSRqNtgWRWi14w.png" /><figcaption>original version vs modified version</figcaption></figure><p>Submitting that to Virus total drops it down from 48 to 29.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*m02CTmmUKPz-HgkFoR6RZg.png" /></figure><p>Not to shabby for a few minutes of work. Obviously submitting a binary to virus total and running it against the AV are two entirely different things but I thought this was interesting enough for to share. I’m glad someone showed me how to do that. I hope I was able to help someone too.</p><p>feel free to follow me on bluesky <a href="https://bsky.app/profile/fashionproof.bsky.social">FashionProof (@fashionproof.bsky.social) — Bluesky</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b1e2207811e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dynamic passwords, process hollowing and packers test]]></title>
            <link>https://medium.com/@markmotig/dynamic-passwords-process-hollowing-and-packers-test-926c953b08c2?source=rss-45f123a0b695------2</link>
            <guid isPermaLink="false">https://medium.com/p/926c953b08c2</guid>
            <category><![CDATA[obfuscation]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[red-team]]></category>
            <dc:creator><![CDATA[Mark Mo - Fashionproof]]></dc:creator>
            <pubDate>Mon, 06 Sep 2021 16:31:04 GMT</pubDate>
            <atom:updated>2025-08-05T14:42:27.143Z</atom:updated>
            <content:encoded><![CDATA[<p>This is an educational walk through of me testing with dynamic passwords, process hollowing and packers.</p><p>First, I want to create a realistic program that does something useful. I’ll add in “hidden” functionality (process hollowing to launch calc with msfvenom generated shellcode)</p><p>For this example, I’m using a program that performs a Luhn check to see if a valid credit card number was entered.</p><p><a href="https://github.com/unkdvt/LuhnAlgorithmCSharp">https://github.com/unkdvt/LuhnAlgorithmCSharp</a> .</p><p>All this does is tells me if the value I enter (presumably a credit card number) passes a Luhn check. You can look up sample credit card numbers to test with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*6uovl1KhOlb0TQhQXInHFA.png" /><figcaption>Sample of the output verifying if a number passes a luhn check</figcaption></figure><p>I modified the Luhn.cs file slightly to return false on any failures of any kind</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D3Oz9PdrTPs6PNHGhpTQxg.png" /></figure><p>Next, I add some process hollowing code from this source repo from Ambray.</p><p><a href="https://github.com/ambray/ProcessHollowing">https://github.com/ambray/ProcessHollowing</a></p><p>I took the entire “public sealed class Loader” and pasted it into my program above my main method (this is a screen shot from the ProcHollow Solution).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ETIfxrJ5kMAG9_cBddDxVQ.png" /></figure><p>I’ll create some shellcode to run calc using msfvenom</p><pre>msfvenom -p windows/x64/exec CMD=”calc” EXITFUNC=thread -f csharp</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xxLj_F0BklrRwELfyOYy3A.png" /></figure><p>I have to set these settings for the program to compile as there are some code that needs to compile in unsafe mode. Also, the program needs to target x64.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_GEhS4-YgM-UDi-QqowbBw.png" /></figure><p>The last thing I’m going to do is put a hidden dynamic password in the code.</p><p>Here I’m taking the current minute on the machine and perform a modulus operation (find the remainder after division). I also take the first three characters of the machine name it is running. This is simple dynamic password, but it could be a lot more complicated. My shell code will only run when the input matches the dynamic password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jKfKn75KFt5UlhpcLfvi2A.png" /><figcaption>I’m highlighting the code that is used for the dynamic password</figcaption></figure><p>Next, I’ll pack it with Themida and VMProtect because shellcode from msvenom freaks out AVs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*NTcn3VpuHap61PtubOalPA.png" /><figcaption>selecting all protection options here</figcaption></figure><p>I’ll pick two virtual machines to protect the code and select the “protect” button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qcBObY7sXxjkBXne45Piyg.png" /></figure><p>Here is a VMProtect screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wfuh6fheTfCgCqbC9jSkfg.png" /></figure><p>Here’s my final program running.</p><p>Notice my machine name is DESKTOP-US7DD17 and the time when I run this is 10:30am. The password at this minute will be “2DES”. The first part of the dynamic password is (34 modulus 4) = 2 and I append the first three characters of the machine name and come up with “2DES”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YWzJ8ajVde_RJvbLHIjPIA.png" /></figure><p>Without the packers this gets picked up by the three AV’s I’m currently testing with in my lab. I’m assuming they can detect the msfvenom shellcode string.</p><p>However, when I pack the exe with Themida and VMProtect before running:</p><p>Themida get by 3 or 3 AVs in my lab</p><p>VMProtect get by 2 of 3 AVs in my lab</p><p>Defenses — Application whitelisting</p><p>Code is here: <a href="https://github.com/fashionproof/DynamicPasswordTest">https://github.com/fashionproof/DynamicPasswordTest</a></p><p>feel free to follow me on bluesky <a href="https://bsky.app/profile/fashionproof.bsky.social">FashionProof (@fashionproof.bsky.social) — Bluesky</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=926c953b08c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Run Kali Linux on Windows without admin rights or installation]]></title>
            <link>https://medium.com/@markmotig/run-kali-linux-on-windows-without-admin-rights-or-installation-2699b2537d13?source=rss-45f123a0b695------2</link>
            <guid isPermaLink="false">https://medium.com/p/2699b2537d13</guid>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[red-team]]></category>
            <dc:creator><![CDATA[Mark Mo - Fashionproof]]></dc:creator>
            <pubDate>Sat, 08 May 2021 20:15:25 GMT</pubDate>
            <atom:updated>2025-08-05T14:43:36.684Z</atom:updated>
            <content:encoded><![CDATA[<p>A while back I was trying to follow the steps of another article (link below) but I could never get it to work correctly and see the network. This was itching my brain so I finally looked at it again but with Kali Linux.</p><p><a href="https://www.komodosec.com/post/bypassing-crowdstrike">Bypassing CrowdStrike in an enterprise production network</a></p><p>I do not need to install anything on my target machine but I still need to extract the installation folder so I can copy the files I need to run QEMU on other machines without installing it. I just installed QEMU to a folder on my lab machine.</p><p>I download a windows x64 QEMU installer from here: <a href="https://qemu.weilnetz.de/w64/">https://qemu.weilnetz.de/w64/</a></p><p>Again, this is just so I can get the files and folders that I will need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*epzrBi-IC1sMZG2HFcAkYQ.png" /><figcaption>I just need to install this on a lab box to get the files I need.</figcaption></figure><p>When it is done installing, there will be a lot of files in the folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*gEesxzeBj2-5QJrk9m5x4w.png" /><figcaption>this is what qemu folder should look like after installed</figcaption></figure><p>To make my life easy, I am going to copy the <strong><em>KALI 2018.4</em></strong> Live ISO to this folder so I can bundle it all together in one zip file that I will copy to the machine I want to run Kali on without admin rights with network connection. Please note, I tried testing with the latest (2021.1) Kali Live ISO but I could not get it to see the intranet, I have only tested with kali 2018.4 and the latest version. Only Kali 2018.4 worked for me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*qXeWGsr8pWBvg_TIccj7hA.png" /><figcaption>I will zip the QEMU folder and my Kali 2018.4 ISO into one zip to move to any machine.</figcaption></figure><p>Now I am ready to run Kali on a target machine where I just have regular user rights (no admin) and I am not going to install anything (just copy file to a folder I have write/execute access to).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*QMh7l7cqbiwxRletNzb7cg.png" /><figcaption>No special access</figcaption></figure><p>Also, QEMU is not installed on this machine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*xrJ562aKGmgpP88jht_zMQ.png" /><figcaption>Image of installed software</figcaption></figure><p>I copy the zip file that has everything I need (including my kali 2018.4 ISO) to my c:\users\test user folder and extract it here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*p2Sg43_1cqmyybxCHaO6Eg.png" /></figure><p>I change directories to the QEMU folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*S23PpuJdIcHksVuq0WWELg.png" /></figure><p>The first command I run is:</p><pre>qemu-img create -f qcow2 testing-image.img 20G</pre><p>Next, I run this command (this is one line)</p><pre>qemu-system-x86_64 -m 2048 -boot d -smp 2 -net nic,model=virtio -net user -hda testing-image.img -cdrom kali-linux-2018.4-amd64.iso</pre><p>This should pop up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*-8Cfv3sKbHPfXw4XiI7K9w.png" /></figure><p>I select Live (amd64). Things will scroll by quickly and then I got a black screen for about 5 minutes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*WepfO4b2rW6Uy2x49FlweQ.png" /></figure><p>This part is slow (like 5 minutes or more!). There are acceleration tags that you can add for QEMU if there is support on your system for it. I did not include them in my examples.</p><p>This black screen is normal. It is just slow… really slow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*j7WzUDGUF55uQMajuz76fw.png" /></figure><p>After a few minutes, I am rewarded with kali running without admin and no installation!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*VPwe-yS16UuN9MDtuVikwg.png" /></figure><p>And I can see the internet and the intranet. In the picture below I’m doing an nmap of 8.8.8.8 (google) and two machines on my VM network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*Xmc5htEDDGJFZZptrYk8QA.png" /></figure><p>I can run Metasploit too. I stick to the command line because this really is painfully slow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*eCpMqwZviox1nKw6KOed8g.png" /></figure><p>Defenses: This is something Blue will definitely want to watch for as AV/EDR won’t have visibility into the QEMU VM.</p><p>· Application Whitelisting</p><p>· NAC would probably help but I have not tested it.</p><p>· Obviously, find markers for QEMU as well.</p><p>Feel free to follow me on bluesky <a href="https://bsky.app/profile/fashionproof.bsky.social">FashionProof (@fashionproof.bsky.social) — Bluesky</a></p><p>Cheers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2699b2537d13" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Finding writable folders and hijackable DLLs]]></title>
            <link>https://medium.com/@markmotig/finding-writable-folders-and-hijackable-dlls-3594a9a0b1c8?source=rss-45f123a0b695------2</link>
            <guid isPermaLink="false">https://medium.com/p/3594a9a0b1c8</guid>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[blue-team]]></category>
            <dc:creator><![CDATA[Mark Mo - Fashionproof]]></dc:creator>
            <pubDate>Mon, 03 May 2021 02:43:26 GMT</pubDate>
            <atom:updated>2025-08-05T14:47:32.746Z</atom:updated>
            <content:encoded><![CDATA[<p>This is pretty straight forward. All of the hard work was already done by Petr Hinchley and <a href="https://medium.com/u/43fe4a5cc44">Matt Hand</a>. This finds writable folders and hijackable DLLs.</p><p>First I had to compile HijackHunter from <a href="https://medium.com/u/43fe4a5cc44">Matt Hand</a>. The sourcecode for hijackhunter is here on github:</p><p><a href="https://github.com/matterpreter/OffensiveCSharp">matterpreter/OffensiveCSharp</a></p><p>I compile the EXE and copy it to C:\Users\Public\HijackHunter.exe. Next, I found some code from Petr Hinchley to find writable folders. I got it from his gist here: <a href="https://gist.github.com/hinchley/ade9528e5ce986e9a8131489ad852789">https://gist.github.com/hinchley/ade9528e5ce986e9a8131489ad852789</a></p><p>At the very top of the script is the folder to search from recursively. I just hard coded it to my c:\ path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vbRKxbHSctR8lV23Dm8aEg.png" /></figure><p>I run this as a regular user account and see the folders the account can write to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*fQUwlQv4rBobsHLW0rjucw.png" /></figure><p>After I find the writable folders, I loop through them and look for exe files and feed it to hijack hunter. I hardcoded the path to HijackHunter.exe to C:\Users\Public\HijackHunter.exe. The code below is the code I added.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FvLt-sX3-b_W7dHHebLZOw.png" /></figure><p>Here is a snippet of the output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IbM29BJ2Jd-e5Ord-83wzw.png" /></figure><p>The code is here:</p><p><a href="https://github.com/fashionproof/RunHijackHunter">fashionproof/RunHijackHunter</a></p><p>Hopefully this will help you find hijackable DLL’s before attackers do.</p><p>Feel free to follow me on bluesky <a href="https://bsky.app/profile/fashionproof.bsky.social">FashionProof (@fashionproof.bsky.social) — Bluesky</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3594a9a0b1c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bypass AV/EDR with Safe Mode?]]></title>
            <link>https://medium.com/@markmotig/bypass-av-edr-with-safe-mode-975aacecc809?source=rss-45f123a0b695------2</link>
            <guid isPermaLink="false">https://medium.com/p/975aacecc809</guid>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Mark Mo - Fashionproof]]></dc:creator>
            <pubDate>Sat, 13 Feb 2021 16:28:45 GMT</pubDate>
            <atom:updated>2025-08-05T14:46:25.089Z</atom:updated>
            <content:encoded><![CDATA[<p>Guess what might not be running in safe mode? An AV/EDR. Also, attackers do <strong>NOT </strong>need to be physically in front of the machine to run in safe mode. I learned about this technique reading about snatch ransomware. Here is the article. I learn a lot from reading malware walkthroughs.</p><p><a href="https://news.sophos.com/en-us/2019/12/09/snatch-ransomware-reboots-pcs-into-safe-mode-to-bypass-protection/">Snatch ransomware reboots PCs into Safe Mode to bypass protection</a></p><p>Here is I check if a security product is running in safe mode.</p><p>I copy the files from my github repository here:</p><p><a href="https://github.com/fashionproof/CheckSafeBoot">fashionproof/CheckSafeBoot</a></p><p>to c:\users\public</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*N18DzsJo-Sg3sbja-Esnyg.png" /></figure><p>Here is a quick look at the code. In main it checks if it is running in safe mode. If it is then it will try to figure out the security product and check if it is running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IcRZ1mrjjXSD1Zf3Fw0fog.png" /></figure><p>After that, it writes the output to a file in c:\users\public and removes safeboot and restart the machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fURIJEPDrgU6qsLaYDK6iA.png" /></figure><p>Here is how I Compile/Run it. I find my csc.exe so I can compile the code (under c:\windows\microsoft.net). In my case, it is under the 4.0.30319. Yes, I need to upgrade my lab 😊</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A5bTRcF1s6yq1Zs50xKaiQ.png" /></figure><p>Once the file is compiled I run the Doit.bat file as admin. I need to run Doit.bat file as ADMIN to create the service, modify the registry keys that are needed to run the service in safe mode and boot it into safe mode.</p><p>It is hard coded to look in the C:\users\public folder. All this does is creates a service and modifies the registry keys needed for the service to run in safe mode then reboots the machine in safe mode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6c3dt8_O6zL14QAlSawdmA.png" /></figure><p>When I run the batch file, here is the output. I am a little lazy with this screen shot I did not delete my service before I took it 😊. Here is the batch file running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VNssEvKP72Byco3gcPlPlg.png" /></figure><p>It then tells the machine to boot into safe mode and restarts</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*WLBHWd-iPbfOAbdcvokv9A.png" /></figure><p>When it comes up, I let it sit there a moment. It runs the exe I created to check if the security tools are running, removes safeboot option and then restarts. It takes about 30 seconds on my machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*IReq08hfJ9_-kiWs7PT_8w.png" /></figure><p>After it reboots out of safe mode, I log back in and I see the file it wrote here. This lets me know what security product I have and if it is running. The results below are for defender. EDR vendor results are much more interesting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*yGH6sCxePjhEoVXepvRQGw.png" /></figure><p>Finally, I run undoit.bat so I can remove the service I created and remove the registry key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*XD2cHPkR0lZxAeY1AQq5RQ.png" /></figure><p>I have used this technique to dump LSASS in safe mode. If I remember correctly, I ran lazagne in safeboot with this technique too. It could be used to hide anything.</p><p>Detection:</p><p>· Look for these any change to these registry keys below this.</p><p>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot</p><p>· Keep an eye on BCDEdit and other ways of programmatically booting a machine into safe mode</p><p>· Consider checking if your EDR runs in safe mode. If it doesn’t, check with your vendor to see what they recommend to detect this technique.</p><p>I asked someone much wiser than I am why attackers do not often use this technique. He said because they do not have to, they have plenty of other options.</p><p>Feel free to follow me on bluesky <a href="https://bsky.app/profile/fashionproof.bsky.social">FashionProof (@fashionproof.bsky.social) — Bluesky</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=975aacecc809" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>