<?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 Taha Hisoglu on Medium]]></title>
        <description><![CDATA[Stories by Taha Hisoglu on Medium]]></description>
        <link>https://medium.com/@tahahisoglu?source=rss-41f5229948b9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*i4oM0P56j6WxbKOi5VvjvA.jpeg</url>
            <title>Stories by Taha Hisoglu on Medium</title>
            <link>https://medium.com/@tahahisoglu?source=rss-41f5229948b9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 17:37:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tahahisoglu/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[TOMCAT RCE(CVE-2025–24813)]]></title>
            <link>https://medium.com/@tahahisoglu/tomcat-rce-cve-2025-24813-c3b698722bf2?source=rss-41f5229948b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3b698722bf2</guid>
            <category><![CDATA[tomcat]]></category>
            <category><![CDATA[cve-2025-24813]]></category>
            <category><![CDATA[insecure-deserialization]]></category>
            <category><![CDATA[rce-vulnerability]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Taha Hisoglu]]></dc:creator>
            <pubDate>Thu, 12 Jun 2025 00:14:27 GMT</pubDate>
            <atom:updated>2025-06-12T00:14:27.010Z</atom:updated>
            <content:encoded><![CDATA[<p>Yakın geçmişteki zafiyetleri incelerken Tomcat’de bulunan CVE-2025–24813 gözüme çarptı ve incelemeye karar verdim. Zafiyet CVSS skoru 9.8 (kritik) olarak değerlendirilen ve insecure deserialization sonucunda Remote Code Execution elde edilmesini sağlayan bir zafiyet olarak karşıma çıktı. Zafiyeti incelememin ardından notlarımı bir araya getirerek paylaşmaya karar verdim.</p><p>Etkilenen Tomcat sürümleri:</p><ul><li>11.0.0-M1–11.0.2,</li><li>10.1.0-M1–10.1.34,</li><li>9.0.0.M1–9.0.98</li></ul><p>şeklindedir.</p><p>Zafiyeti denerkeren Tomcat’in 9.0.98 sürümünü ve IDE ve debug işlemleri içinse IntelliJ kullandım.</p><h3>Gereksinimler</h3><p>Zafiyete geçmeden önce düzgün bir şekilde zafiyeti gerçekleştirebilmemiz için birkaç ön ayar veya koşul gerekmekte. Bunlar şu şekilde listelenebilir</p><ul><li>“Servlet Writes” metodunun etkin (enabled) olması → Bu ayar default olarak etkin değildi.</li><li>Sunucunun Content-Range başlığıyla gönderilen kısmi (partial) PUT isteklerini desteklemesi gerekmekte → Bu ayar Tomcat’de zaten etkin bir şekilde gelmekte.</li><li>Uygulama oturumları (session) dosya tabanlı olarak ve varsayılan dizin (Tomcat dizini) konumunda saklanmalı.</li><li>Uygulamada Java Deserialization zafiyetine sahip bir kütüphane bulunmalı veya kullanılmalı.</li></ul><blockquote><strong>NOT:</strong> Ana hedeften sapmamak adına fazla detaya inmeyeceğim.</blockquote><blockquote><strong>Servlet Nedir?</strong><br> Servlet, Java EE teknolojisine ait bir framework’tür ve dinamik web sayfaları oluşturmak için kullanılır. Servlet’ler, HTTP isteklerini işleyebilir ve bu isteklere karşılık HTTP yanıtları oluşturup gönderebilir.</blockquote><blockquote>Servlet’ler, main metodu içermeyen Java sınıflarıdır ve web sunucusu tarafından bir <strong>Servlet Container</strong> aracılığıyla yönetilirler.</blockquote><blockquote>Servlet container içeren ve birçok başka işleve de sahip olan en popüler web container’lardan biri <strong>Apache Tomcat</strong>’tir.</blockquote><h3>Projeyi Hazır Hale Getirmek</h3><p>Projemizi oluşturduktan sonra (ben sadece çok basit bir index.jsp dosyasına sahip bir web sitesi oluşturdum.) gereksinim için ayarlarımız yapalım.</p><p>İlk olarak web.xml dosyası için “Servlet Writes” metodunu etkin hale getirmemiz gerek. Dosyamızı açtıktan sonra şu satırları eklememiz yeterli olacaktır.</p><pre>    &lt;servlet&gt;<br>        &lt;servlet-name&gt;default&lt;/servlet-name&gt;<br>        &lt;servlet-class&gt;org.apache.catalina.servlets.DefaultServlet&lt;/servlet-class&gt;<br>        &lt;init-param&gt;<br>            &lt;param-name&gt;debug&lt;/param-name&gt;<br>            &lt;param-value&gt;0&lt;/param-value&gt;<br>        &lt;/init-param&gt;<br>        &lt;init-param&gt;<br>            &lt;param-name&gt;listings&lt;/param-name&gt;<br>            &lt;param-value&gt;false&lt;/param-value&gt;<br>        &lt;/init-param&gt;<br>        &lt;init-param&gt;<br>            &lt;param-name&gt;readonly&lt;/param-name&gt;<br>            &lt;param-value&gt;false&lt;/param-value&gt;<br>        &lt;/init-param&gt;<br>        &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;<br>    &lt;/servlet&gt;</pre><p>Burada readonly parametresinin değerini false yapmalıyız.</p><p>Diğer bir koşul olarak, context.xml dosyası üzerinden session’ın dosya tabanlı olarak tutulmasını ve varsayılan dizinin kullanılmasını ayarlamamız gerekmektedir.</p><pre>    &lt;Manager className=&quot;org.apache.catalina.session.PersistentManager&quot;<br>             debug=&quot;0&quot;<br>             saveOnRestart=&quot;false&quot;<br>             maxActiveSession=&quot;-1&quot;<br>             minIdleSwap=&quot;-1&quot;<br>             maxIdleSwap=&quot;-1&quot;<br>             maxIdleBackup=&quot;-1&quot;&gt;<br>        &lt;Store className=&quot;org.apache.catalina.session.FileStore&quot; /&gt;<br>    &lt;/Manager&gt;</pre><p>Uygulamada deserialization zafiyetini kolayca tetikleyebilmek için, zafiyet barındıran commons-collections kütüphanesinin 3.1 sürümünü ekledim. Bu eklemeyi pom.xml dosyası üzerinden gerçekleştirdim.</p><pre>&lt;dependency&gt;<br>  &lt;groupId&gt;commons-collections&lt;/groupId&gt;<br>  &lt;artifactId&gt;commons-collections&lt;/artifactId&gt;<br>  &lt;version&gt;3.1&lt;/version&gt;<br>&lt;/dependency&gt;</pre><p>Son koşulumuz olan PUT isteği ise, halihazırda varsayılan olarak etkin geldiği için herhangi bir işlem yapmama gerek kalmadı.</p><h3>Zafiyet Geçiş</h3><p>Öncelikle ysoserial aracını kullanarak bir dosya oluşturacağız ve zafiyeti gerçekleştirirken anlatmaya çalışacağım.</p><pre> java -jar ysoserial-all.jar CommonsCollections6 &quot;calc&quot; &gt; deneme.session</pre><p>ysoserial ile birlikte deneme.session adında ve deserialize işlemine uğrarsa hesap makinesini (calc) çalıştıracak bir dosya hazırladım.</p><p>Zafiyetin ilk noktası olan PUT isteği ile devam edelim. PUT isteği ile birlikte sistem gelen dosyayı javax.servlet.context.tempdir geçici dizinine yüklemektedir.</p><p>PUT isteği sırasında yüklenen dosyanın adı, kullanıcı tarafından istek esnasında belirlediği dosya adına göre oluşturulur. Ayrıca dosya uzantısını belirlemekte kullancının elindedir.</p><p>Yani biz saldırgan olarak .session uzantılı bir dosyayı sunucuya yazdırırsak ve uygulama daha sonra bu session dosyasını deserialize işlemi için okursa RCE elde etmeyi hedefliyoruz. Tomcat içinde de tam olarak hedeflediğimiz konumdaki dosyayı session bilgileri için okuyacak bir sistem mevcut.</p><blockquote>NOT: Tomcat session verilerini diske yazarken her bir oturumu bir dosya olarak saklamaktadır.</blockquote><p>PUT isteği ile dosya yüklemememizin iki yolu mevcut. İlki direkt olarak PUT isteğinin gönderirken dosya ismini dizinler şeklinde vermek.(İkinciye yazının sonunda değineceğim). Bunu şöyle tarif edebiliriz dosyanızın ismi deneme.session olsun. O halde gönderilecek path /deneme/session şeklinde olmalı.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HYqQW_rPNdoL3URg2Q3hQw.png" /></figure><blockquote>NOT: Örnekte gösterirken /test dizini kendi yazdığım uygulamada bulunan ana dizinlerden biri.</blockquote><p>PUT isteği ile birlikte ysoserial aracı ile oluşturduğumuz deneme.session dosyasını göndermekteyim.</p><p>Debug işlemiyle detaylı inceleme yapabilmek için gerekli noktalara break point’leri daha önce yerleştirdim. Dosya yükleme işlemi, Tomcat dizini altında bulunan lib\catalina.jar\org\apache\catalina\servlets\DefaultServlet.class yolundaki sınıf üzerinden gerçekleşmektedir. Şimdi bu sınıf içerisinde yer alan executePartialPut fonksiyonuna bakalım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ntbh4g-vadDIUTTEeztRWg.png" /></figure><p>İlk etapta, istemci tarafından gönderilen /deneme/session path’i executePartialPut() metodunda / karakteri . ile değiştirilerek .deneme.session formatına dönüştürülür.</p><p>Kodun devamında, bu dosya javax.servlet.context.tempdir ile tanımlı olan temp dizini altında oluşturulur. Ardından gelen HTTP isteği içerisindeki serialized içerik, bu dosyaya byte byte yazılır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yB7lHME9ltPLhJRDAa4fRA.png" /></figure><p>resources.getResource(path) ile fiziksel olarak /deneme/session gibi bir path bulunamadığı için oldResource.isFile() bloğuna girilmez ve nihayetinde dışarıda resources.write(...) çağrısı başarısız olur. Bu durumda uygulama, HTTP 409 (Conflict) yanıtı dönecektir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jPs6MjyLAGmO6ftwXxUGQQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tOkE51Ed3DwbFzjAIIfZcA.png" /></figure><p>Şu an, zararlı session dosyamızı hedef uygulamaya başarılı bir şekilde kaydetmiş olduk. Bundan sonra yapmamız gereken tek şey, uygulamanın bu dosyayı deserialization işlemine tabi tutmasını sağlamaktır. Bunu gerçekleştirmek için iki seçeneğimiz bulunuyor.</p><h4>Deserialization</h4><p>İlk yol göndereceğimiz basit bir istekle dosyamızın deserialize işlemini tetiklemek olacaktır.</p><p>Bunu gönderilecek olan geçerli bir GET isteği sırasında Cookie değerimizi .deneme yaparak deneyebiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b3T1HEq2waL5gI0Jbj1vbA.png" /></figure><blockquote><strong>NOT:</strong> Burada cookie değerini doğrudan deneme olarak vermememizin sebebi, az sonra kodda da göreceğimiz üzere, session deserialization işlemi sırasında sistemin bu cookie değeri üzerinden dosyayı aramasıdır. Hedef dosyamız .deneme.session şeklinde kaydedildiği için, cookie değerini .deneme olarak vermemiz gerekir. Aksi halde, sistem deneme.session dosyasını arayacaktır ki bu dosya mevcut değildir.</blockquote><p>Kodda neler olduğunu görebilmek için, Tomcat dizininde bulunan \lib\catalina.jar\org\apache\catalina\session\FileStore.class içerisinde yer alan Session load fonksiyonuna break point’lerimi yerleştirdim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iRscHiSZyLavS7e6_Emp0A.png" /></figure><p>Yukarıda görüldüğü gibi, burada kontrol edebildiğimiz kısım id parametresidir. Bu parametreyi cookie yardımıyla .deneme olarak belirledik ve sistem, .deneme.session dosyasının var olup olmadığını kontrol etmekte.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Eyke5h5ZE4y4f0y_fssiBQ.png" /></figure><p>Bu noktada bizim için en kritik kısım, 127. satırda yer alan session.readObjectData(ois) ifadesidir. Bu satırda, readObjectData metodu parametre olarak aldığı ois nesnesi üzerinden doğrudan deserialization işlemini başlatmaktadır.</p><p>ois nesnesi ise bir önceki adımda fis (FileInputStream) kullanılarak oluşturulmuş olup, diskte bulunan .deneme.session dosyasını işaret etmektedir.</p><p>Yani özetle, diske yazılmış .session uzantılı dosya ObjectInputStream aracılığıyla okunmakta ve içeriği doğrudan readObjectData() çağrısıyla belleğe alınıp deserialize edilmekte ve herhangi bir input validation yapılmamaktadır.</p><blockquote><strong>NOT:</strong> readObjectData() fonksiyonunu incelediğimizde, readObject() metoduna referans verdiğini görebiliriz. readObject(), Java deserialization zafiyetlerinin tetiklenmesine neden olabilecek bir metottur. Dikkatli kullanılmaması durumunda kritik güvenlik açıklarına yol açabilir.</blockquote><p>127. satırı kodda çalıştırmamızın ardından başarılı bir şekilde hedef sistemde kod çalıştırmış oluyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yTa15XWFI_dxtQWXcXGIyQ.png" /></figure><p>Dosyanın deserialization işlemine uğramasını sağlamanın ikinci yolu ise herhangi bir işlem yapmamaktır. Uygulama, belirli bir süre sonra bu işlemi otomatik olarak gerçekleştirmek üzere ilgili dosyaya kendisi erişecektir.</p><p>Tomcat’in altında bulunan \lib\catalina.jar\org\apache\catalina\session\ManagerBase.class sınıfı, uzantısı .session olan dosyaları yüklemek ve ardından deserialize etmek üzere yapılandırılmıştır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A9qCLrxJz1B3e6w7zm4hEQ.png" /></figure><p>Yazının uzamaması adına bu fonksiyonu incelemeyeceğim. Ancak sistemde fark edilmeme adına bu eylemsizlik yoluda dosyanın çalıştırılması için tercih edilebilir.</p><h4>Dosya Yüklemenin İkinci Yolu</h4><p>PUT isteği ile beraber dosya yüklemenin iki metodu olduğunu söylemiştim. Sistem var olmayan bir dizine istek attığınızda 409 dönerek size yanıt vermektedir.</p><p>Ancak doğrudan dizin şeklinde değil dosya adını vererek de yükleme yapılabilir.</p><p>Örnek verecek olursak</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YjsmN45XHSKWBsW2Sm5iaw.png" /></figure><p>Dosyayı doğrudan uzantısıyla birlikte path’e verdiğimizde, yükleme işlemi gerçekleşecektir. Eğer dosya belirtilen dizinde mevcut değilse <strong>201</strong>, mevcutsa <strong>204 </strong>HTTP yanıt kodunu alırız.</p><p>Geriye kalan adımlarda herhangi bir değişiklik yapmamıza gerek yok.</p><p>Zaman ayırıp okuduğunuz için teşekkür ederim. Umarım ilgilenenler için faydalı olmuştur.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3b698722bf2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Insecure Deserialization 2 — DotNetNuke Cookie Zafiyeti]]></title>
            <link>https://medium.com/@tahahisoglu/insecure-deserialization-2-dotnetnuke-cookie-zafiyeti-d8c2013fef5f?source=rss-41f5229948b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8c2013fef5f</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[insecure-deserialization]]></category>
            <category><![CDATA[code-review]]></category>
            <dc:creator><![CDATA[Taha Hisoglu]]></dc:creator>
            <pubDate>Fri, 15 Nov 2024 20:08:41 GMT</pubDate>
            <atom:updated>2024-11-15T20:08:41.524Z</atom:updated>
            <content:encoded><![CDATA[<h3>Insecure Deserialization 2 — DotNetNuke Cookie Zafiyeti</h3><p>Insecure Deserialization zafiyetinde örnekleri incelemeye devam ederken .NET’de birçok örnek ile karşılaştım. Örneklerden DotNetNuke uygulamasında çıkan zafiyeti localimde kurarak denemeye ve pekiştirmeye karar verdim.</p><h4>DotNetNuke (DNNSoftware)</h4><p>DotNetNuke yenilenen adıyla DNN açık kaynak kodlu bir web content management platformudur (CMS). İçerisinde birçok dinamik yapı bulundurur.</p><p>DNN kurmak için Windows Server, IIS, ASP.NET ve Windows SQL Server gerekmekte. Kurulum için videodaki adımları takip edebilirsiniz.</p><blockquote><a href="https://www.youtube.com/watch?v=iYx_ES7MJEA&amp;t">https://www.youtube.com/watch?v=iYx_ES7MJEA&amp;t</a></blockquote><p>.NET içerisinde deserialize veya serialize gerçekleştirebileceğimiz birçok sınıf bulunmakta. Örneğin Xml, json, binary vs. yapılar için farklı farklı sınıf veya fonksiyonlar mevcut. İnceleyeceğimiz zafiyet XmlSerializer sınıfını ile alakalı olduğundan bu blogda bu sınıfa yoğunlaşıp inceleyeceğiz.</p><p>Zafiyete tam manasıyla geçmeden önce XmlSerializer yapısını anlayabilmek için basit bir örnek yapalım.</p><h4>XmlSerializer</h4><p>XmlSerializer içerisinde birçok metot bulunduran bir sınıftır. Bu kısımda biz serialize ve deserialize metotlarını inceleyeceğiz.</p><p>Serialize metodu için örnek bir kod yazacak olursak</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*Pqvsj_mmbp2r-QU5crCTrA.png" /></figure><p>Koda biraz değinecek olursak kullanıcıdan alacağımız string ifadeyi XmlSerialize sınıfının Serialize metodunu 28. satırdaki gibi çağırarak serileştiriyoruz.</p><ul><li>Yazma hedefi (XmlVeri.txt dosyasının yolu) writer parametresiyle belirtilmiş,</li><li>Serileştirilecek olan string ifadeyi içeren nesne ise txt parametresiyle metoda verilmiştir.</li></ul><p>NOT: 26. satırda gördüğümüz gibi bir XmlSerializer objesi oluştururken serialize veya deserialize edeceğimiz objenin türünü typeof() ile XmlSerializer’a belirtmemiz gerekir.</p><p>Deserialize işlemine gelecek olursak ise yine basit bir örnek kodla açıklayalım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*G8TI3y1VFhJaXxDZOQ9nDA.png" /></figure><p>Burada ilk yazdığımız kodu referans kısmına ekledik bunun nedeni deserialize işlemini gerçekleştirirken 15. satırda daha öncede bahsettiğim gibi objenin türünü typeof() ile birlikte vermemiz gerekiyor.</p><p>Kodun yaptığı kısaca kullanıcıdan aldığı dosya yolu ile dosyanın içeriğini XmlSerializer ile deserilize ediyor.</p><p>Kodu deneyelim</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bgYMR_MPslLE4AeWuvwvwQ.png" /></figure><p>Serialize ardından deserialize işlemini deneyelim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AV0yARlMlIXdNqOgpx-TJQ.png" /></figure><p>Başarıyla deserialize işleminide gerçekleştirmiş olduk.</p><h4>CVE-2017–9822</h4><p>Zafiyet DotNetNuke 5.2.0 sürümünden 9.1.1 sürümüne kadar etki etmektedir. Bu yazıda zafiyet incelenirken 9.1.0 sürümü kullanılmıştır.</p><p>Programın debug işlemleri ve kodun incelenmesinin daha rahat yapılması için <strong>dnSpy</strong> uygulamasını kullanmayı tercih ettim.</p><blockquote><a href="https://github.com/dnSpy/dnSpy">https://github.com/dnSpy/dnSpy</a></blockquote><p>dnSpy uygulamasından debug işlemlerinden w3wp.exe işlemini açalım ve modules kısmından DotNetNuke.dll’i seçelim.</p><p>Kodda bulunan Deserialize işlemlerini inceleyecek olursak karşımıza çıkacak kısımlardan biri DotNetNuke.Services.Personalization kısmında bulunan LoadProfile metodu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AJCT7Le4xGecOhZStYg7pA.png" /></figure><p>Zafiyet araştırmacıları zafiyeti bulurken ilk aşama olarak fark ettikleri şey DNN içerisinde olmayan herhangi bir dizine bir istek gönderildiğinde LoadProfile metodu çağrılmakta.</p><p>Kodun inceleyeceğimiz asıl kısmı 23. satırdan itibariyle gerçekleşiyor.</p><p>Açıklayacak olursak if bloğuna DNNPersonalization Cookie değeri ile girebilirse (ve tabiki httpContext boş değilse) text değerine Cookie değeri atanıyor.</p><p>29. satırda ise eğer text parametresi boş değilse <strong><em>DeserializeHashTableXml()</em></strong> çağrılıyor.</p><p>Denemek için koda breakpoint yerleştirdikten sonra bir web proxy yardımıyla Cookie değerini ayarlayıp var olmayan bir dizine istek atalım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*2TltN8xtKc-ws5STjqd_pQ.png" /></figure><p>“text” değerine bakalım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*nMdW2_hPR-LwXWgg14tv7w.png" /></figure><p>Görüldüğü gibi verdiğimiz değer text kısmına atanmış. Kodun işleyişine göre sırada <strong><em>DeserializeHashTableXml(text)</em></strong> kısmı çağrılmakta. Bu sınıfı inceleyip nasıl çalıştığını anlayalım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*4YJBPT67pClchUjHUc3lVQ.png" /></figure><p>Direkt olarak aldığı parametreyi DeSerializeHashtabla ilk parametre olarak göndermekte. Bunun yanında giden ikinci parametre ise hardcoded string olan “profile”.</p><p>DeSerializeHashtable inceleyelim. Bu sırada gönderdiğimiz örnek istekle kodu debug işlemine devam edelim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*YW4SBBghHB3HMva6CYuTlA.png" /></figure><p>İki parametre almakta. İlk gelen parametre olan text veya buradaki tanımıyla xmlSource boş değil bu yüzden if bloğunun içine giriyoruz. Gönderilen ikinci parametre ise hardcoded gelen “profile”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iXeC5GO3k6YWwVqCpRZZmQ.png" /></figure><p>Debug işlemini ilerlettip try bloğu içine girelim. Bir xml dosyasına göndermiş olduğumuz xmlSource değeri yazılıyor.</p><p>foreach kısmına bakacak olursak SelectNodes “profile/item” olduğundan ancak biz sadece “&lt;TAHA&gt;&lt;/TAHA&gt;” değeri gönderdiğimizden foreach döngüsü çalışmaz. Bu durumda cookie değerini buna göre ayarlamamız gerekmekte bunu not alalım.</p><p>Artık elimizde kullancının kontrol edebildiği bir veri ve bu verinin xmlDeserialize işlemine uğradığı bilgileri var. Bu aşamada kod içerisinde kullanabileceğimiz tetiklendiğinde istenmeyen bir durum oluşturacak sınıf veya obje arayabiliriz. Daha sonra bu sınıfı çağırarak kontrol edebiliriz.</p><p>Kodu incelediğimizde karşımıza güvenlik araştırmacılarının bulduğu FileSystemUtils adlı sınıf içersinde bulunan <strong><em>PullFile</em></strong> metodu çıkmakta. Koda bakalım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*fi6MX3uVyI6-UUKufEYZng.png" /></figure><p>Belirtilen bir adresten hedef dosyayı indirerek kaydediyor. Bu durumu kullanarak bir aspx shell alınmaya çalışılabilir.</p><p>Ancak XmlSerializer’ın bazı sınırlamalar içermesinden kaynaklı burada bir sorunla karşılaşıyoruz. XmlSerializer yalnızca public property ve fieldları serileştirebilmekte. FileSystemUtils ise serileştirme için kullanılabilecek herhangi bir public property içermemekte.</p><p>Zafiyet araştırmacıları bu durumun önüne geçmek için başka bir sınıf olan ObjectDataProvider sınıfından yararlanmıştır. Bu sınıf veri bağlama (data binding) senaryolarında kullanılan yani programcıya ilgili verileri sağlayan bir sınıftır.</p><p>Bu sınıfla rastgele bir objeyi kapsamamıza (wrapped) ve MethodName property’sini kullanarak wrapped nesneden bir metot çağırmamıza olanak tanır. Buradaki anahtar nokta ObjectDataProvider proporty lerinin yardımıyla tamamen farklı bir nesnede metot çağrılarını tetikleyebiliriz.</p><p>ObjectDataProvider System.Windows.Data namespace’de ve PresentationFramework.dll dosyasında bulunur. dnSpy ile derleyerek kodunu inceleyelim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*R-Xr70NEjuLtzlOia26oKw.png" /></figure><p>MethodName şekilde _methodName değişkeni ayarlanıyor ve Refresh() çağırılıyor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*DUydTkHSaPaSHxP3SyKnbQ.png" /></figure><p>Refresh() incelendiğinde başka bir fonksiyon olan BeginQuery() çağırılmakta.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*Yas2Xftq8FyPRdzH7tP4dw.png" /></figure><p>BeginQuery fonksiyonunun sonunda ise QueryWorker() fonksiyonu çağırılıyor. Son olarak bunu inceleyelim.</p><blockquote>Bu kısımda aradığımız şey sarmanlanmış nesnedeki (wrapped object) hedef metotun çağrıldığı yeri bulmak. Ara fonksiyonları detaylı olarak yazı uzamaması için açıklamıyorum.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*XCr4hVHoTwN5CLXQ6sjuaQ.png" /></figure><p>Ve aradığımız noktaya ulaştık. InvokeMethodOnInstance kısmında hedef metot çağırılıyor.</p><p>Daha kolay anlaşılması için örnek bir kod hazırlayarak PullFile metodunu ObjectDataProvider yardımı ile çağıralım. Öncesinde localhost içerisinde basit bir apache server ayağa kaldırdım ve deneme.txt adlı dosyayı buraya koydum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*CcqHpkQECx2Jc75ZW1Wxlg.png" /></figure><p>Kodda ObjectDataProvider ile bir nesne oluşturduktan sonra ObjectInstance özelliği ile FileSystemUtils() nesnesine atanıyor ve PullFile metodu ve PullFile metedunun alacağı parametreler belirleniyor. İşlemin sonunda beklediğimiz belirtilen dizinde PullFile.txt yi bulmak.</p><p>Kodumuzu derledikten sonra dnSpy start debbug kısmından uygulamamızı seçelim ve entry point ile başlatalım. Programın nasıl çalıştığını ve ObjectDataProvider’ın nasıl işlediğini inceleyelim.</p><p>Program başarıyla çalıştı.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UAK3hxWtKXdGq9m5w7GCuw.png" /></figure><p>Sıradaki adımımız payloadı oluşturmaya başlamak. Yazıda daha önce belirttiğim gibi DNNPersonalization Cookie değerinin serileştirilebilmesi için belirli başlı bir yapı şeklinde olması gerekiyor.</p><p>Bu yapı “profile” düğümünü ve içinde bir “type” özelliği taşıyan “item” etiketini içermelidir. Bu yapıyı elle yeniden oluşturmaya çalışmak yerine, cookie değerini baştan oluşturan DNN (DotNetNuke) fonksiyonu kullanılabilir.</p><p><strong>DotNetNuke.Common.Utilities.XmlUtils</strong> namespace’inde bulunan SerializeDictionary fonksiyonu bu işlevi gerçekleştirir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*NH5Tkd6L14hOfATMedpOYA.png" /></figure><p>Ve gadget chain’i oluşturmak için kullanmamız gereken son şey ExpandedWrapper sınıfı. Bu sınıf ile birlikte ObjectDataProvider nesnesini dönüştürerek serileştirilebilir bir yapı oluşturmamıza yarar. Diğer türlü ObjectDataProvider ile birlikte XmlSerializer işlemini kullanamamaktayız.</p><p>Son olarak bir deneme kodu yazacak olursak</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*yAhgg6BZaAsBHmuKYKBSSg.png" /></figure><p>Kodumuz bu şekilde görünecek. Deserialize işleminde hedefteki dosyayı basitçe Deserialize ederken, Serialize işleminde öncelikle hata almamak için ExpandedWrapper kullanarak FileSystemUtils’i ObjectDataProvider ile sarıyoruz (wrapped).</p><p>Daha sonra önceki örnekte yapıldığı gibi metodlar ve property’ler belirleniyor. SerializeDictionary ile daha önce bahsettiğimiz Xml yapısı otomatik olarak oluşturuluyor. Daha sonra payload test.txt ye kaydediliyor.</p><p>Kodu derleyip çalıştırdıktan sonra belirtilen dizin altına giderek test.txt’nin olduğunu görebiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wb-eYGrymbriLYgVTrDOAA.png" /></figure><p>Şimdi sisteme bir aspx shell yükleme zamanı.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ULai_6gGbm1so4p_hjUmKQ.png" /></figure><p>Daha önce açtığımız ve kodda da belirtiğimiz apache server dizini altına bir aspx shell koydum. <br>Son olarak kodu şu şekilde düzenledim ve çalıştırdım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ULai_6gGbm1so4p_hjUmKQ.png" /></figure><p>Elde ettiğimiz payload</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a-bcUhoEA8tXYI8LBDYTIw.png" /></figure><p>Kopyalayıp proxy yardımıyla DNN’e gönderiyorum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*RABIWzmL7Ylu-d6xW8AhyQ.png" /></figure><p>ve cmdasp.aspx konumunu ziyaret ediyorum.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*9o4GkEPVI996uihPDTwkkg.png" /></figure><p>Başarıyla aspx shellimiz yüklendi. Bu şekilde insecure deserialization zafiyetini .NET üzerinden gerçekleştirebiliriz.</p><p>Umarım bu yazı ilgilenenlere yardımcı olmuştur.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8c2013fef5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Insecure Deserialization ve CVE-2024–24725]]></title>
            <link>https://medium.com/@tahahisoglu/insecure-deserialization-ve-cve-2024-24725-823c87a46c47?source=rss-41f5229948b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/823c87a46c47</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[secure-coding]]></category>
            <category><![CDATA[white-box-testing]]></category>
            <category><![CDATA[siber-guvenlik]]></category>
            <category><![CDATA[insecure-deserialization]]></category>
            <dc:creator><![CDATA[Taha Hisoglu]]></dc:creator>
            <pubDate>Thu, 24 Oct 2024 14:24:26 GMT</pubDate>
            <atom:updated>2024-10-25T08:30:52.614Z</atom:updated>
            <content:encoded><![CDATA[<p>Herkese merhaba, bir süredir Insecure Deserialization zafiyetini araştırıyorum ve örnekleri inceliyordum. Bu yazımda genel hatlarıyla Insecure Deserialization zafiyetini anlattıktan sonra incelediğim basit bir örnek olan CVE-2024–24725 inceleyerek size açıklamaya çalışacağım.</p><h3>Serialization &amp; Deserialization</h3><p>Öncelikle Serialize ve Deserialize işlemlerini konuşarak başlayalım. Serialize işlemi gönderilmek veya saklanılmak istenen bir nesnenin istenilen forma dönüştürülme işlemi diyebiliriz.</p><p>Deserialize işlemi ise serialize edilen nesnenin işlenerek tekrar eski formuna döndürülmesine denir.</p><p>PHP de basit bir örnek verecek olursak</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*sj9RoY8utV3UNDB_1FcnbQ.png" /><figcaption>PHP Serialize</figcaption></figure><p>PHP dilinde basit bir serialize işlemi gerçekleştiğinde obje çıktıda görülen formatta saklanıyor.</p><blockquote>O:5:”Users”:2:{s:8:”username”;s:4:”Taha”;s:8:”is_admin”;b:1;}</blockquote><p>Görülen formatı açıklayacak olursak</p><blockquote>O:5:”Users” -&gt; Objenin uzunluğu ve ismi,</blockquote><blockquote>2-&gt; Objenin içerisinde bulunan attribute sayısını,</blockquote><blockquote>Süslü parantezler içerisinde kalan kısım ise <em>bu attrib</em>uteların isimlerini ve aldıkları değerleri içermekte.</blockquote><p>Serialization ve Deserialization işlemlerinin web dünyasında genelde kullanılma amaçları, API işlemlerinde, veri tabanı işlemlerinde, oturum yönetiminde, form verilerinin işlenmesinde gibi sıralanabilir. Bu noktada kritik olan ise kullanıcıdan alınan veya kullanıcının kontrol edebildiği verinin validation işlemi yapılmadan serialize ve deserialize işlemlerine sokulmasıdır. Deserialization işleminin sömürülmesi sırasında bilinmesi gereken iki kavram mevcuttur. Magic metodlar ve gadget chains yapısı.</p><p>Magic metodlar kullanılan dilde özel olarak tanımlanmış fonksiyonlardır. Genel olarak belirli durumlarda sınıfların içlerinde kendi kendilerini çağırırlar.</p><p>PHP dilinde örnek vericek olursak <strong><em>__wakeup(), __destruct(), __call() </em></strong>vs. şeklinde sıralanabilir.</p><p>Gadget chain ise istenilen magic metodu çağırabilmek için zincir şeklinde bir dizi nesne ve sınıfı kullanır. Gadget chain ile beraber deserialize işlemini güvensiz bir şekilde gerçekleştiren uygulamada uzaktan kod çalıştırma, dosya okuma veya silme gibi zafiyetler elde edilebilir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*K32hSG0AauDpHAB2Os4ZTg.png" /></figure><p>Gadget chain yapısı ile bir payload oluşturmak vakit alabilen ve uygulamanın kapsamlı incelenmesini gerektiren bir süreç olabilir. Bu durumda işlemi kısaltmak ve hızlı sonuç elde edebilmek için toolara başvurulabilir.</p><p>PHP özelinde ilerleyecek olursak <strong><em>phpggc</em></strong> toolu gadget chain oluşturabilmek için en önemli yardımcılardan biridir.</p><blockquote><a href="https://github.com/ambionics/phpggc">https://github.com/ambionics/phpggc</a></blockquote><h3>CVE-2024–24725</h3><p>Örnek üzerinden giderek yapılan atağı localimizde incelemek zafiyetin pekişmesine yardımcı olucaktır. Zafiyetin bulunduğu uygulama <strong><em>Gibbon LMS</em></strong> uygulamasıdır.</p><p>Gibbon açık kaynak bir okul yönetim uygulamasıdır. Öğrenciler, öğretmenler, aileler ve okul müdürü gibi yönetici ekipler tarafından kullanılabilir.</p><p>Php dili ile yazılmıştır. Bloğun yazıldığı tarihte stabil olan sürümü 1.27.00 sürümüdür. Zafiyet 1.26.00 sürümünde keşfedilmiştir. Github sayfası üzerinden uygulamayı indirerek localimizde kurulumunu yaparak başlatalım.</p><blockquote><a href="https://github.com/GibbonEdu/core">https://github.com/GibbonEdu/core</a></blockquote><p>Açık kaynak kodlu bir uygulama olduğundan zafiyetin white box bir test esnasında keşfedilmiş olduğunu görebiliriz. Bizde kaynak kod üzerinden giderek nasıl Inscure Deserialization zafiyetini bulabileceğimize göz atacağız.</p><p>PHP de Serialization ve Deserialization işlemleri hazır fonksiyonlar olan serialize() ve unserialize() ile gerçekleşir. Kaynak kodda ilk bakılacak olan kısımlardan biri unserialize() işleminin nerelerde nasıl gerçekleştiğidir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*S2eNa3FD6nzrjExWHmqvog.png" /></figure><p>Proje içerisinde unserialize işlemi birçok kısımda karşımıza çıkıyor. Bu noktada ise incelememiz gereken şey bu işlemler sırasında hangi unserialize() işlemi kullanıcılar tarafından kontrol edilebiliyor. Yani kullanıcıdan alınnan veya kullanıcının değiştirip manipüle edebileceği input sonucunda unserialize işlemi kullanılıyor mu dikkat edilmeli.</p><p>Proje içerisinde böyle bir kısım mevcut.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*Kgo1ZzeESr4Ub5f83xXjmA.png" /></figure><p>unserialize() işlemi POST isteği ile gelen columnOrder ve columnText parametresinin aldığı değerler ile işleme giriyor ve herhangi bir kontrolden geçmemekte.</p><p>Bu durumda eğer POST isteği sırasında kullanıcı columnOrder veya columnText parametrelerinin birini değiştirerek manipüle edebilirse istenmeyen bir veri sistemde unserialize işelemine tabi tutularak zararlı hale gelicek.</p><p>Kaynak kodda bulduğumuz bu bilgi ışığında uygulama içerisinde bu işlemin nasıl tetiklenebileceğine bakalım. Bulduğumuz kısım /modules/System Admin/import_run.php içerisinde.</p><p>Kodu ve uygulamayı incelememizin ardından zafiyetli kısma erişebilmek için dummy data kullanarak adımları atlayalım. Erişmek istediğimiz yer yukarıdaki kodda belirtildiği gibi kodun adım 4 kısmında bulunan POST isteği.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5-u1xHyXR21alUG1lDBAbQ.png" /></figure><p>Dummy data kullandığımızdan dolayı hata alsakda POST isteği başarıyla gönderiliyor. POST isteği içerisini bir proxy kullanarak inceleyelim.</p><p>POST isteği Header kısmı:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*1rl3t1t23aT1pR6J3sYF3g.png" /></figure><p>POST isteği Body kısmı — Zafiyetli parametrenin bulunduğu kısım:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*SIWLXCI-W_hluG5lPtHE9A.png" /></figure><p>Görüldüğü gibi columOrder parametresinde gönderilen bir serialize edilmiş PHP objesi bulunuyor. Bu PHP objesi daha sonra keşfettiğimiz unsreialize işlemine uğruyor.</p><p>Yapmamız gereken bir sonraki adım ise gadget chain yapısını başarılı bir şekilde kullanarak gönderilen objeyi değiştirip sistemde zafiyet yaratmak. Bunu gerçekleştirebilmek için projede kullanılan PHP kütüphanelerini inceleyerek başlayalım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hpAnhp7MW-jywy0nr9w8Tg.png" /></figure><p>Projede bulunan vendor dizinin altına bakıldığında kullanılan kütüphaneler gözükmektedir.</p><p>phpggc aracı ile bu kütüphanelerin herhangi biri içerisinde gadget chain yapısı ile bir payload oluşturabilecek miyiz buna bakalım. Öncelikle phpggc ile kullanabileceğimiz kütüphaneler bakalım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R0UQul-WPBvuA3uUvr111g.png" /></figure><p>Çıkan sonucu aşşağı doğru kaydırdığımızda monolog kütüphanesini görmekteyiz. monolog kütüphanesi projemiz içerisinde de kullanılan bir kütüphane. Projede monolog kütüphanesi 1.27.1 sürümünde gözüküyor. Bu sürümü destekleyen bir gadget chain yapısının olup olmadığını inceleyebilmek için phpggc aracı ile birlikte gelen test-gc-compatibility.py scriptini kullanabiliriz.</p><pre>python3 test-gc-compatibility.py monolog/monolog:1.27.1 monolog/fw1 monolog/rce1 monolog/rce2 monolog/rce3 monolog/rce4 monolog/rce5 monolog/rce6 monolog/rce7 monolog/rce8 monolog/rce9 -w 4dö</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yXpDcQ5fi7f-xQmH8tP3Sw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zElW8a1ZTJo_yPA9JeJj6A.png" /></figure><p>Çıktıda görüldüğü gibi monolog/rce1 zinciri bu sürüm ile desteklenmektedir. O halde uzaktan kod çalıştırmak (RCE) için payloadımızı oluşturalım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*Wq1PWDqx6kpI2vtUKtP8qw.png" /></figure><p>monolog/rce1 kullanımı için örnek yukarıda gözüktüğü gibidir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*FDBZw0hgA5j5Nq1tB9ZYDQ.png" /></figure><p>Ve sistemde <strong><em>“id”</em></strong> komutunu çalıştırmak için gadget chain ile oluşturduğumuz obje yukardaki gibidir. Objeyi deneyebilmek için POST isteğimizi bir proxy yardımıyla tutarak gerekli değişikliği yaptıktan sonra sisteme göndereceğiz.</p><blockquote>ÖNEMLİ NOT</blockquote><blockquote>Yukarıda oluşturulan payloadda görüldüğü gibi bazı uzunuluklar fazla verilmiştir. Örneğin s:9:”*socket” 9 birim uzunluğunda verilmiş bulunmakta. Bunun nedeni PHP’de bir sınıfın <strong>protected</strong> ya da <strong>private</strong> bir özelliği serialize edilirken, bu özellik ismi doğrudan depolanmaz. Bunun yerine PHP, özelliğin erişim düzeyini belirtmek için null byte’lar (\x00) kullanır.</blockquote><blockquote>Yani aslında s:9&quot;\x00*x\00socket” şeklinde 2 null byte mevcuttur. Bu durum bash içerisinde elde ettiğimiz payloadda belli olmadığından dolayı ve kopayalayamdığımızdan elle eklenebilir veya payload oluşturulurken base64 şeklinde oluşturduktan sonra tekrar decode edilerek oluşturulabilir.</blockquote><blockquote>Altta payloadımızın base64 halini koyuyorum. Decode ederek kullanabilirsiniz.</blockquote><pre>YToyOntpOjc7TzozMjoiTW9ub2xvZ1xIYW5kbGVyXFN5c2xvZ1VkcEhhbmRsZXIiOjE6e3M6OToiACoAc29ja2V0IjtPOjI5OiJNb25vbG9nXEhhbmRsZXJcQnVmZmVySGFuZGxlciI6Nzp7czoxMDoiACoAaGFuZGxlciI7cjozO3M6MTM6IgAqAGJ1ZmZlclNpemUiO2k6LTE7czo5OiIAKgBidWZmZXIiO2E6MTp7aTowO2E6Mjp7aTowO3M6MjoiaWQiO3M6NToibGV2ZWwiO047fX1zOjg6IgAqAGxldmVsIjtOO3M6MTQ6IgAqAGluaXRpYWxpemVkIjtiOjE7czoxNDoiACoAYnVmZmVyTGltaXQiO2k6LTE7czoxMzoiACoAcHJvY2Vzc29ycyI7YToyOntpOjA7czo3OiJjdXJyZW50IjtpOjE7czo2OiJzeXN0ZW0iO319fWk6NztpOjc7fQo=</pre><p>Payloadı POST isteğine ekleyerek gönderelim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rgDJW944boXgLzHtEoCjKg.png" /></figure><p>Gözüktüğü üzere geri dönen istekte body kısmında çalıştırmış olduğumuz id komutunun cevabı geri dönmektedir. Bu şekilde Insecure Deserialization zafiyetinin sömürüsünü gerçekleştirebilirsiniz.</p><h3>Yapılan Güncelleme</h3><p>Uygulamada çıkan bu zafiyetten sonra gelen güncelleme incelendiğinde unserialize() işleminin kaldırldığını görebiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*KlJxf4qYAPdm0ZUTQ3Zhfw.png" /></figure><p>Görüldüğü üzere unserialize işlemi yerine json_decode yöntemi kullanılmaya başlanmış ve zafiyet ortadan kaldırılmıştır.</p><h3>Insecure Deserialization Zafiyetine Karşı Önlemler</h3><ul><li><strong>Güvensiz verilerle unserialize() kullanmaktan kaçının</strong>: Yalnızca güvenilir kaynaklardan gelen veya doğrulanmış verilerle unserialize() kullanın.</li><li><strong>Beyaz liste uygulayın</strong>: Serileştirilen verileri deserialize etmeden önce izin verilen sınıf ve özelliklerin yer aldığı bir beyaz liste ile doğrulayın ve temizleyin.</li><li><strong>Güvenli serileştirme alternatiflerini kullanın</strong>: PHP’nin yerel serileştirme işlevi yerine, yerleşik güvenlik özelliklerine sahip JSON veya XML gibi daha güvenli serileştirme formatlarını tercih edin.</li><li><strong>PHP’yi düzenli olarak güncelleyin</strong>: Güvenlik yamaları ve iyileştirmelerden faydalanmak için PHP sürümünüzü güncel tutun.</li></ul><h3>PoC</h3><p>Internette hızlı bir araştırma ile incelediğimiz de CVE nin exploitdb üzerinde daha önce python ile yazılmış olan PoC sini bulabilirsiniz. Python ile daha önce yazıldığından dolayı farklılık olması amacıyla kendi exploitimi PHP dilinde yazarak gerçekleştirdim. Ulaşmak için linki ziyaret edebilirsiniz.</p><blockquote><a href="https://github.com/MelkorW/CVE-2024-24725-PoC">https://github.com/MelkorW/CVE-2024-24725-PoC</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=823c87a46c47" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TASK 5: Web Dynamics: Illuminating Frontend, Backend, Authentication, Authorization, and Proxies]]></title>
            <link>https://medium.com/@tahahisoglu/task-5-web-dynamics-illuminating-frontend-backend-authentication-authorization-and-proxies-eb6c7dcfa6bc?source=rss-41f5229948b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb6c7dcfa6bc</guid>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[authorization]]></category>
            <category><![CDATA[proxy]]></category>
            <category><![CDATA[backend]]></category>
            <dc:creator><![CDATA[Taha Hisoglu]]></dc:creator>
            <pubDate>Mon, 08 Jan 2024 22:17:47 GMT</pubDate>
            <atom:updated>2024-01-08T22:17:47.873Z</atom:updated>
            <content:encoded><![CDATA[<p>Greetings everyone, in this article, I will be addressing the concepts of Frontend and Backend, Authentication and Authorization, and Proxy.Let’s begin by explaining Frontend and Backend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*_R-YSbR3j-M4m5G3qB7toA.png" /></figure><h3>Frontend &amp; Backend</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*gUUPekyDore4hjIAi8XmoQ.png" /></figure><p>As we surf the vast sea of the internet, two crucial elements work harmoniously to deliver the seamless experiences we encounter on websites and applications: frontend and backend. Imagine a website as an iceberg; the frontend is the visible tip, the sleek user interface you interact with, while the backend is the massive submerged structure, orchestrating the behind-the-scenes magic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*YGtvKCL7-LVzD-vr7JwMNg.png" /></figure><h4>Frontend</h4><p>Front-end development, often referred to as client-side development, involves creating the visual elements and user interactions of a website or application. It’s the art of turning design concepts into reality, ensuring a seamless and engaging user experience.</p><p>Key Technologies in Front-End Development:</p><ol><li><strong>HTML (HyperText Markup Language):</strong> The backbone of web development, HTML structures the content of a webpage. It provides a foundation for other technologies to build upon.</li><li><strong>CSS (Cascading Style Sheets):</strong> CSS is responsible for styling HTML elements, defining the layout, colors, and fonts. It brings aesthetic appeal to the web by enhancing the visual presentation.</li><li><strong>JavaScript:</strong> The powerhouse behind interactivity, JavaScript enables dynamic and responsive user interfaces. It allows developers to manipulate the DOM (Document Object Model) and respond to user actions in real-time.</li></ol><h4>Backend</h4><p>Backend development refers to the server-side of web development, where the focus is on managing and processing data, ensuring security, and handling requests from the frontend. It involves creating the logic that enables the frontend to interact with databases, manage user authentication, and perform various server-side operations.</p><p><strong>Server-Side Programming Languages</strong></p><p>1. Node.js: Node.js enables server-side JavaScript, known for its efficiency in handling concurrent connections.</p><p>2. Django (Python): Django, a Python framework, emphasizes rapid development and clean design with an MVC architecture.</p><p>3. Ruby on Rails (Ruby): Ruby on Rails streamlines development with its convention over configuration and DRY principles.</p><p><strong>Databases</strong></p><p>1. MongoDB: MongoDB, a NoSQL database, stores flexible JSON-like documents, ideal for evolving data structures.</p><p>2. MySQL: MySQL, a reliable relational database, ensures strong ACID compliance for structured data.</p><p>3. PostgreSQL: PostgreSQL, an extensible open-source RDBMS, supports complex queries and adheres to SQL standards.</p><p><strong>APIs</strong></p><p>1. RESTful APIs: RESTful APIs, following REST architecture, use standard HTTP methods for scalable communication.</p><p>2. GraphQL: GraphQL, a query language for APIs, optimizes data transfer by allowing clients to request specific data.</p><h3>Authentitaction and Authroization</h3><p>In the realm of web development and security, two fundamental concepts govern access to digital resources: authentication and authorization. Let’s explore these concepts, their significance, and the various types associated with each.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*wydCiYmK1Jx6n3q4idOKEA.png" /></figure><h4>What is Authentication?</h4><p>Authentication is the process of verifying the identity of a user, system, or application, ensuring that the entity requesting access is who it claims to be. Various methods are used for authentication:</p><h4>Types of Authentication:</h4><ol><li>Password-Based Authentication:</li></ol><ul><li>Users provide a unique password associated with their account.</li><li>Common and widely used, but susceptible to breaches if not properly managed.</li></ul><p>2. Biometric Authentication:</p><ul><li>Involves the use of unique biological traits like fingerprints, retina scans, or facial recognition.</li><li>Enhances security by relying on distinctive, difficult-to-replicate features.</li></ul><p>3. Multi-Factor Authentication (MFA):</p><ul><li>Combines two or more authentication methods (e.g., password + SMS code or fingerprint + security token).</li><li>Offers an extra layer of security by requiring multiple forms of verification.</li></ul><p>4. Single Sign-On (SSO):</p><ul><li>Enables users to access multiple services with a single set of credentials.</li><li>Enhances user experience and reduces the need for multiple logins.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*M0SyrBfBsCKBzmxx1Er9Ug.png" /></figure><h4>What is Authorization?</h4><p>Authorization, often referred to as access control, is the process of granting or denying access rights and permissions to authenticated users. Once a user’s identity is verified through authentication, authorization determines what actions or resources the user is allowed to access based on their assigned permissions.</p><h4>Types of Authorization:</h4><ol><li>Role-Based Access Control (RBAC):</li></ol><ul><li>Assigns permissions based on predefined roles.</li><li>Simplifies management by associating users with specific roles (e.g., admin, user, guest).</li></ul><p>2. Attribute-Based Access Control (ABAC):</p><ul><li>Considers various attributes (user attributes, environmental conditions) in determining access.</li><li>Provides more granular control over permissions based on dynamic factors.</li></ul><p>3. Rule-Based Access Control:</p><ul><li>Access decisions are based on specified rules and conditions.</li><li>Offers flexibility in defining complex access control policies.</li></ul><p>4. Mandatory Access Control (MAC):</p><ul><li>Assigns access levels based on security labels and policies.</li><li>Commonly used in high-security environments to enforce strict data confidentiality.</li></ul><h4>The Relationship Between Authentication and Authorization:</h4><p>While authentication verifies the identity, authorization determines what actions that identified entity is allowed to perform. Together, they form a crucial part of a robust security framework, ensuring that only authenticated and authorized users gain access to sensitive resources.</p><h3>Proxy</h3><p>So, proxies are like your internet buddies. Instead of you chatting directly with a website, you shoot your request to a proxy, and it does the talking for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*a0DsMSvqC6CDWXUVfEaUFw.png" /></figure><h4>The Nitty-Gritty of How Proxies Roll:</h4><ol><li><strong>Sneaky Request Moves:</strong> You ask for something online, but the proxy steps in and makes the request on your behalf.</li><li><strong>Passing the Parcel:</strong> The proxy forwards your request to the actual website, keeping your IP address on the down-low.</li><li><strong>Got the Response</strong>: The website responds, and the proxy swings it back your way. It’s like a secret online handshake.</li><li><strong>Extra Tricks: </strong>Proxies can do more than just relay messages. They can cache stuff, filter requests, or even tweak responses.</li></ol><h4>Why Proxies Rock in Security Testing:</h4><p><strong>1. Sneaky Moves for Privacy:</strong> Proxies let security testers do their thing on the down-low.</p><p><strong>2. Spying on Traffic: </strong>Proxies let testers peek into web traffic. They can spot vulnerabilities, sniff out shady activities, and keep applications on their toes.</p><p><strong>3. Content Makeover: </strong>Testers can dive into the content flowing between you and the website.</p><p><strong>4. Traffic Cop Vibes: </strong>Proxies let testers control the flow — allowing or blocking certain traffic types.</p><p>We have reached the end of this article:)) Until the next one, farewell!</p><p>UNIQUESEC Student Club</p><blockquote><em>Website: </em><a href="https://uniquesec.org/"><em>https://uniquesec.org/</em></a></blockquote><blockquote><em>Linkedin: </em><a href="https://www.linkedin.com/company/uniquesec)%E2%80%9D"><em>https://www.linkedin.com/company/uniquesec</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb6c7dcfa6bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TASK 4:Exploring the Foundations: TCP 3-Way Handshake and HTTP Protocol — Understanding Their…]]></title>
            <link>https://medium.com/@tahahisoglu/task-4-exploring-the-foundations-tcp-3-way-handshake-and-http-protocol-understanding-their-2fe2305d639a?source=rss-41f5229948b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/2fe2305d639a</guid>
            <category><![CDATA[three-way-handshake]]></category>
            <category><![CDATA[https]]></category>
            <category><![CDATA[wireshark]]></category>
            <category><![CDATA[http-headers]]></category>
            <category><![CDATA[tcp]]></category>
            <dc:creator><![CDATA[Taha Hisoglu]]></dc:creator>
            <pubDate>Mon, 01 Jan 2024 20:11:22 GMT</pubDate>
            <atom:updated>2024-01-01T20:11:22.415Z</atom:updated>
            <content:encoded><![CDATA[<h3><em>TASK 4:Exploring the Foundations: TCP 3-Way Handshake and HTTP Protocol — Understanding Their Significance and Operations</em></h3><p>In this article, I will attempt to address several issues simultaneously. Our initial focus will delve into TCP and explore the significance of the <strong>three-way handshake </strong>within the TCP protocol.</p><h4>TCP and Three-Way Handshake</h4><p>The TCP three-way handshake serves as a cornerstone for reliable and orderly communication among devices within a network. Its paramount significance lies in the establishment of a secure and synchronized connection prior to the initiation of data exchange.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*Crmok_Xa2OKcHBpjoN3c3g.png" /></figure><p>Commencing with the originating device transmitting a SYN (synchronize) packet to the recipient device, the latter responds with a SYN-ACK (synchronize-acknowledge) packet, signaling its readiness to forge a connection. The final phase entails the originating device dispatching an ACK (acknowledge) packet to confirm the connection.</p><p>This meticulous process is instrumental on multiple fronts. Firstly, it validates the readiness of both devices, thwarting data transmission if one is unprepared. Secondly, it institutes initial sequence numbers for data interchange, ensuring the accurate reception and acknowledgment of transmitted data.</p><p>Beyond its technical functions, the three-way handshake acts as a security measure, preempting unauthorized connections and mitigating the risk of data corruption.</p><p>Now that we have grasped the concept of a three-way handshake, let’s proceed to our second topic.</p><h4>What is HTTP Protocol, how does it work?</h4><p>HTTP (Hypertext Transfer Protocol) stands as the cornerstone of communication in the online world, regulating information exchange over the internet. Devised by Tim Berners-Lee in 1989, this protocol is utilized to govern interactions between web browsers and servers.</p><p>Following a client-server model, where a browser (client) makes a request to a server, and the server responds, HTTP facilitates the exchange of text, images, videos, and other media types during this communication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/0*5UOtSIoVvTmnf_8t.png" /></figure><p>One fundamental characteristic of HTTP is its statelessness. Each request is independent of others, and the server distinguishes between them. This feature allows web browsers to load pages swiftly, enabling users to navigate the internet seamlessly. However, this statelessness may require additional protocols to handle situations like session management.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*Yw27JTHcVeGot4nmP1qisw.png" /></figure><p>Let’s take a closer look at how the HTTP protocol fundamentally operates.</p><p>The first step involves the client sending a request to the server. Typically, the client is a browser and contains a URL entered by the user or a link directing to another resource. The client sends the request to the server to retrieve a specific resource such as a web page, image, video, etc.</p><p>The server evaluates the received request and generates a response containing the requested resource. This response typically includes various components like HTML, CSS, JavaScript files, and media content. The server sends the created response back to the client along with header information and status codes.</p><p>The client interprets the received response and organizes the contents for the user to view. If there are other resources within the page, the client may request these resources from the server using the same HTTP protocol, as needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*nM8RMEXd8v6u9-qjXSQN1A.png" /></figure><p>By following these fundamental steps, the HTTP protocol organizes information exchange on the internet, ensuring reliable communication between web browsers and web servers. This process is integral to our daily web browsing experiences, making HTTP a foundational element of the internet.</p><h4>HTTP Header and Body</h4><p>Delving into the intricacies of the HTTP protocol unveils two pivotal components that orchestrate the symphony of communication between clients and servers: headers and bodies. Think of headers as the meticulous archivists of digital correspondence, encapsulating metadata critical for deciphering the payload. They elegantly convey information such as content type, encoding methodologies, and temporal specifics, providing a framework for the discerning interpretation of transmitted data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*4FdtEQ7-t45Mrq7ZO7GN4A.png" /></figure><p>Contrastingly, the body assumes the mantle of substance, encapsulating the essence of the communication. Whether it be the fundamental HTML structure defining a webpage, the graphical allure of images, or diverse media formats, the body is the repository of meaningful content. Its structural composition is contingent upon the Content-Type delineated by the headers, akin to a tailored manuscript aligning with prescribed literary norms.</p><p>Together, headers and bodies coalesce harmoniously, orchestrating an effective exchange of information. In this intricate ballet of data, headers act as the guiding beacon, while bodies articulate the core narrative. Their symbiotic interplay ensures a seamless and structured dialogue between clients and servers within the HTTP protocol, constituting the backbone of refined digital communication.</p><p>Let’s explore some of the most commonly used HTTP headers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*C5GNpavzzDlQOYLYCD_d3w.png" /></figure><p><strong>HTTP Request Headers:</strong></p><ol><li><strong>Host</strong>: Think of this as the address on a letter. It tells the server which domain you’re trying to reach. Imagine asking, “Hey server, I need something from this specific place!”</li><li><strong>User-Agent</strong>: Your browser or application introduces itself here. It’s like saying, “Hi server, I’m Chrome on a Windows PC,” so the server knows how to tailor the response.</li><li><strong>Accept</strong>: This one’s like telling the server, “I prefer this type of content.” It helps in negotiating what format (HTML, JSON, etc.) your browser is comfortable receiving.</li><li><strong>Authorization</strong>: When you log in somewhere, your credentials go here. It’s like proving you’re allowed to access a certain area.</li><li><strong>Content-Type</strong>: Imagine you’re sending a gift. This header says, “Hey server, this is a picture,” or “This is a document.” It helps the server unpack and understand what it’s receiving.</li><li><strong>Cookie</strong>: Cookies are like little notes your browser carries around. This header shares those notes with the server, reminding it of your past interactions.</li></ol><p>HTTP Response Headers:</p><ol><li><strong>Date</strong>: The server stamps the response with a date. It’s like getting a letter and knowing exactly when it was written.</li><li><strong>Server</strong>: Just as you introduce yourself, servers do too. This header tells you what server software they’re using.</li><li><strong>Content-Type</strong>: Similar to the request side, but now it’s the server saying, “Here’s what’s in the box — it’s a video, an image, or some plain text.”</li><li><strong>Content-Length</strong>: This header is like telling you how many pages are in a book. It helps your browser know when it has received the complete response.</li><li><strong>Location</strong>: Ever been redirected to a different page? This header says, “Hey, your requested content is actually over there!”</li><li><strong>Set-Cookie:</strong> The server might send you a new cookie in the response. It’s like the server saying, “Next time you come around, bring this cookie with you.”</li></ol><p>These headers are like the language of the internet — they help servers and browsers understand each other and make your online experience smoother!</p><p>Now, let’s examine an HTTP request using Wireshark and delve into its header and body sections.</p><h4>How to Capture and View Sample HTTP Traffic with Wireshark</h4><p>After opening Wireshark, let’s type ‘http’ in the filtering section to capture HTTP requests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bDTTqBo_Yod-ko4QYfQuVA.png" /></figure><p>Secondly, we need to find a website that operates over HTTP. I’ll be using <a href="http://testphp.vulnweb.com/login.php">http://testphp.vulnweb.com/login.php</a>, a site that many of you might be familiar with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*T6QYkuH6S6Jo9byBsztFTw.png" /></figure><p>Let’s enter ‘melkor’ for the username and ‘melkor’ for the password in the login section. Click on the login button, and then we can analyze the outgoing and incoming packets in Wireshark.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zFZWSHdee4OGENYyXQ2NZw.png" /></figure><p>Let’s carefully examine the requests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SLtMkOJkafCkkm27oDaUvg.png" /></figure><p>When we look closely, we can observe the mentioned HTTP headers, and even see the username and password we sent.</p><p>I hope this article has been helpful to you. Until next time :))!</p><blockquote>UNIQUESEC Öğrenci Kulübü</blockquote><blockquote>Website: <a href="https://uniquesec.org/">https://uniquesec.org/</a></blockquote><blockquote>Linkedin: <a href="https://www.linkedin.com/company/uniquesec)%E2%80%9D">https://www.linkedin.com/company/uniquesec</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fe2305d639a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Task 3: Exploring Security Flaws with Nessus: A Comprehensive Guide to Vulnerability Scanning…]]></title>
            <link>https://medium.com/@tahahisoglu/task-3-exploring-security-flaws-with-nessus-a-comprehensive-guide-to-vulnerability-scanning-a5c7424157c0?source=rss-41f5229948b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5c7424157c0</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[metasploit]]></category>
            <category><![CDATA[nessus]]></category>
            <category><![CDATA[metasploitable2]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Taha Hisoglu]]></dc:creator>
            <pubDate>Tue, 26 Dec 2023 22:31:06 GMT</pubDate>
            <atom:updated>2023-12-26T22:31:06.949Z</atom:updated>
            <content:encoded><![CDATA[<h3>Task 3: Exploring Security Flaws with Nessus: A Comprehensive Guide to Vulnerability Scanning, Exploitation, and Closure</h3><p>Hello everyone!</p><p>In this article, I will guide you on how to discover vulnerabilities using Nessus, exploit the identified vulnerabilities, and implement preventive measures against them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*q92kA5LiFSU2pommXbiyZQ.png" /></figure><p>Let’s talk a bit about Nessus before we dive into the main stuff.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*C-Nuf_MJdFPC65PDV_uKVg.png" /></figure><h3>Nessus</h3><p>Nessus is like our go-to buddy for finding security loopholes. It’s this awesome open-source security scanner developed by Tenable. Basically, it goes through all the devices on your computer network, spots any potential weaknesses, and even suggests ways to lock them down. With its massive database, Nessus can mimic all sorts of fancy attack and defense scenarios, helping us figure out how secure our info systems really are.</p><p>If you’re experiencing issues while downloading Nessus, this link might be helpful -&gt;<a href="https://docs.tenable.com/nessus/Content/InstallNessusLinux.htm">https://docs.tenable.com/nessus/Content/InstallNessusLinux.htm</a></p><p>If you have successfully installed Nessus, you will be presented with this screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qUdU9TNDF2tPdSpru-WulQ.png" /></figure><p>Let’s click on the ‘Create a New Scan’ button and initiate a new scan to explore the capabilities of Nessus.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GvevnoL2uH4eFTbJmz05dw.png" /></figure><p>We are presented with pre-made templates that Nessus offers for scanning. In this article, we will proceed by utilizing the “Advanced Scan” option.</p><p>Now, before conducting the scan, there are a few settings we need to configure. In the General section, after filling in the Name and Description fields, the perhaps most crucial part is the Targets section, where we need to enter the IP or Domain address of the system we intend to target.</p><p>The system we will be focusing on today is Metasploitable2. Let’s go ahead and start up the Metasploitable2 machine and take a look at its IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*o5IEf_ZRH9t6fbtqsJJD3g.png" /></figure><p>After finding the IP address, I configured the general settings as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*ldkGuGazb886NawFLyNviw.png" /></figure><p>Now, let’s take a look at the Credentials section.</p><p>Since I know the username and password for the Metasploitable2 machine (msfadmin:msfadmin), by filling in the username and password fields under the SSH section in the Credentials part, I aim to make the scan more comprehensive and yield more results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*60SRuqr-z8gGtPVRvgHkPQ.png" /></figure><p>After making these settings, our scan is ready to be initiated. You can save the settings by clicking the ‘Save’ button at the bottom right of the page and start the scan. (The scanning process may take a bit of time:))</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*xWAo82XasQYjNGUE4SPFjQ.png" /></figure><p>And our scanning process is complete. Let’s navigate to the Vulnerabilities section right away and take a look at the identified vulnerabilities</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DyPKgINvAGRHFnoxtKnOkg.png" /></figure><p>In this section, you can review the identified vulnerabilities and choose any specific one to attempt exploiting the machine. Here, I will focus on the ‘Samba Badlock Vulnerability’.</p><p>Let’s click on it to explore what Nessus offers regarding this vulnerability</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*egz4mGTMI7hGQ8zdjyKo3A.png" /></figure><h4>What’s Samba Badlock Vulnerability</h4><p>So, let’s talk about the Badlock vulnerability — This vulnerability took center stage due to its roots in the SMB (Server Message Block) protocol, the backbone of file sharing and network access in many systems.</p><p>Samba, a software package relying on SMB, found itself at the heart of this security hiccup. While the name “Badlock” set the stage for an intense marketing campaign, some critics argued that it added unnecessary drama to the situation.</p><p>The vulnerability, if exploited, had the potential to grant unauthorized access to mischievous actors, paving the way for a host of malicious activities.</p><p>However, before any widespread havoc could unfold, diligent developers swiftly addressed and patched the Badlock vulnerability, saving the day and reinforcing the importance of proactive cybersecurity measures.</p><h4>Exploiting</h4><p>After researching a bit on how to exploit this vulnerability online, I discovered that we can exploit it using the Metasploit tool.</p><p>(The Metasploit tool is one of the most effective vulnerability exploitation tools. However, I will delve into Metasploit more comprehensively in another one of my writings.)</p><p>Firstly, let’s initiate our Metasploit tool by typing ‘msfconsole’.</p><pre>msfconsole </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*mx07GQspAminjOq3MYWejQ.png" /></figure><p>After my online research, I learned that we can find the exploit ‘exploit/samba/usermap_script’ for Metasploit by searching.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rfl7RlGWUmuZ18PNo9PNgg.png" /></figure><p>Now that we’ve selected our script using the ‘use 0’ command, we need to configure the settings by typing ‘options’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DtoG_dXgO8C8EMhDtVn8tQ.png" /></figure><p>We need to adjust the RHOST and RPORT sections according to the machine we are attacking, which is Metasploitable2. In the RHOST section, enter the IP address of Metasploitable2, and in the RPORT section, input the port number where SMB is running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U53TsenGQMIvswheyRwtkw.png" /></figure><p>Now, we can execute our script. Type ‘run’ in the console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bkIFIbPcKOOncNd0qFYeFA.png" /></figure><p>In just a few seconds, we establish a connection to the Metasploit machine, gaining remote access and effectively acquiring root privileges. This highlights the critical significance of the SAMBA BADLOCK vulnerability we exploited. Understanding the severity of this vulnerability becomes evident as we gain remote access to the machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CxGU4cu-3MndetWgcwhlaQ.png" /></figure><h4>How can we protect ourselves from this vulnerability?</h4><p>In fact, there are two simple ways to protect against this vulnerability.</p><p><strong>Checking Samba Updates:</strong> Regularly verify if the Samba software is up to date and apply updates consistently. The latest version of the software is typically released to address security vulnerabilities.</p><p><strong>Configuring the Firewall: </strong>By configuring the firewall, you can control SMB traffic and set the port where Samba operates to ‘filtered’ or ‘closed’ instead of ‘open,’ thereby preventing unwanted scans.</p><p>My choice among these two options is to demonstrate how to close the port of a vulnerable application.</p><p>For this task, we will use <strong>iptables</strong>, known as a firewall, on Linux systems. It is readily available on my Metasploitable2 machine.</p><p>Before proceeding with this task, I would like to demonstrate to you that SAMBA is running and accessible on ports 139 and 445 when we scan Metasploitable2 using nmap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*nBgv0qj-bZORkJ8jLfhApA.png" /></figure><p>Now, let’s use the iptables tool to close these ports where vulnerable SAMBA versions are running.</p><pre><br> iptables -A INPUT -p tcp -m multiport --sports 139,445 -j DROP</pre><ul><li>-A INPUT: This option appends a rule to the &quot;INPUT&quot; chain, indicating that the rule will be applied to incoming packets.</li><li>-p tcp: Specifies that the rule should only impact TCP (Transmission Control Protocol) packets.</li><li>-m multiport: This module facilitates the specification of multiple ports.</li><li>--sports 80,443: This designates the source ports to which the rule applies. In this context, it is used for both HTTP (port 80) and HTTPS (port 443). While specifying source ports may not be necessary in this scenario, it&#39;s included for completeness.</li><li>-j DROP: Indicates that if a packet matches this rule (i.e., originates from the specified source ports), it should be dropped or rejected. Consequently, incoming TCP traffic on ports 80 and 443 will be denied.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*lcjV91TlmjBR-TMF5lY42A.png" /></figure><p>Iptables rules are applied temporarily. To make them permanent, we need to save the changes.</p><pre>iptables-save</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*3Q4Iu1oREh6E-THzxwP76w.png" /></figure><p>After that, Let’s rerun our nmap scan and review the output again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*WWwCHLTrRVcBnzSbgkoYkg.png" /></figure><p>You can observe that the SAMBA services on ports 139 and 445 have been filtered.</p><p>Alright, let’s check whether the script we used with the Metasploit tool is still effective.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bJAi8mKaM0kcwlgb3HaJgQ.png" /></figure><p>I believe we have successfully overcome the vulnerability :))))</p><p>I hope this article proves useful for you. Until the next one, take care!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*4B_ARkhjKo5PDtKnRAu1YQ.png" /></figure><blockquote>UNIQUESEC Student Club</blockquote><blockquote><em>Website: </em><a href="https://uniquesec.org/"><em>https://uniquesec.org/</em></a></blockquote><blockquote><em>Linkedin: </em><a href="https://www.linkedin.com/company/uniquesec)%E2%80%9D"><em>https://www.linkedin.com/company/uniquesec</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5c7424157c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Task 2: Detecting External Port Scanning with TCPDump: Identifying the Source IP Address of the…]]></title>
            <link>https://medium.com/@tahahisoglu/task-2-detecting-external-port-scanning-with-tcpdump-identifying-the-source-ip-address-of-the-fed5bd3f8bf6?source=rss-41f5229948b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/fed5bd3f8bf6</guid>
            <category><![CDATA[tcpdump]]></category>
            <category><![CDATA[metasploitable]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[nmap]]></category>
            <dc:creator><![CDATA[Taha Hisoglu]]></dc:creator>
            <pubDate>Tue, 19 Dec 2023 14:49:21 GMT</pubDate>
            <atom:updated>2023-12-19T14:49:21.417Z</atom:updated>
            <content:encoded><![CDATA[<h3>Task 2: Detecting External Port Scanning with TCPDump: Identifying the Source IP Address of the Scan</h3><p>Greetings everyone!</p><p>In the ever-evolving landscape of cybersecurity, safeguarding our systems against potential threats is paramount. External port scanning stands out as a common technique employed by attackers to identify vulnerabilities in target systems. In this blog post, we delve into the art of detecting such port scanning activities using TCPDump, a powerful packet analyzer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*JtsvPDnCzs3L62-DIMUNKA.png" /></figure><p>To detect any port scanning activity on your machine from external sources, we first need two machines. The first machine will serve as our attacker machine.</p><p>I&#39;ve chosen Kali Linux as my attacker machine for its ease of use with the widely known port scanning tool, Nmap.</p><p>The second machine will be our victim machine. In this case, I&#39;ve opted for the Metasploitable2 machine, which contains vulnerabilities and won&#39;t pose issues during the scanning process.</p><p>Before we start our topic, let’s talk a little about NMAP and TCPDump.</p><h4>Nmap</h4><p>Short for Network Mapper, Nmap is a renowned open-source tool known for its effectiveness in network exploration and security auditing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*YABbOXtF83Yj4fXhRducGw.png" /></figure><p>Widely respected for its versatility, Nmap excels in identifying hosts and services within a computer network, providing a comprehensive overview of its structure. Its robust features include precise port scanning, version detection, and the ability to script interactions with the target.</p><p>In both professional cybersecurity contexts and enthusiast pursuits, Nmap emerges as an invaluable asset, significantly contributing to the understanding and fortification of network environments.</p><h4>TCPDump</h4><p>TCPDump, a packet analyzer, plays a pivotal role in network troubleshooting and security analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*pqzYp_Uu7a48AKfv9bKlfg.png" /></figure><p>With its command-line interface and robust capabilities, TCPDump is a go-to tool for capturing and analyzing network packets. It allows us to inspect the intricate details of data transmitted over a network, making it an essential asset for diagnosing network issues and ensuring security.</p><p>TCPDump stands as a reliable companion, providing valuable insights into network traffic dynamics.</p><blockquote>Now that we have a grasp of Nmap and TCPDump, let’s redirect our focus to the main topic at hand.</blockquote><p>Firstly, we need to ensure that our two machines are on a common network. In this case, as I am using two virtual machines, I have configured both of them to the NAT network.</p><p>After that, let’s run the ‘ifconfig’ command to obtain the IP address of our victim machine, which is Metasploitable2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*kuoL3VqxtrLkctjCeN3GHA.png" /></figure><p>To ensure that our Kali machine and Metasploitable2 are operating on the same network, we can send a ping from our Kali machine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*ZZL3mIxcoAwJ1RW65wCCDw.png" /></figure><p>Now that we have the IP address of our victim machine, let’s proceed to perform an Nmap scan from Kali machine. But before that, let’s run TCPDump on our Metasploitable machine.</p><pre>sudo tcpdump -i eth0 -v</pre><blockquote>-i eth0: This option specifies which network interface tcpdump should listen on.</blockquote><blockquote>-v: This option increases the verbosity of the output. It provides more detailed information about each packet. You can use additional -v options to increase the level of detail (-vv, -vvv, and so on).</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*MeH1ADKuATDLcZvgF3Zhkw.png" /></figure><p>After running TCPDump on our Metasploitable machine, let’s execute Nmap on our Kali machine.</p><pre>nmap -sV -p- --open &lt;IP_Adress&gt;</pre><blockquote>-sV: Used for service version detection. This option instructs Nmap to interact with the target system to determine the versions of services running on it.</blockquote><blockquote>-p-: Ensures that the scan covers all ports. In other words, it scans all ports from 1 to 65535.</blockquote><blockquote>--open: This option is used to identify open ports. It shows the open ports on the target system as part of the scan results.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*i2vFbN_JuhKBV2NhhBkxzA.png" /></figure><p>Let’s take a look at what’s happening in TCPDump while the Nmap scan is in progress.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*C4TK1REllgxNK0_Mqr5XQg.png" /></figure><p>In these outputs, what should we pay attention to?</p><blockquote>- Source and Destination IP Addresses:</blockquote><blockquote>If you observe a series of packets originating from a specific source IP address and targeting different destination IP addresses, this could be an indication of a port scan.</blockquote><blockquote>- Sequential Port Scanning:</blockquote><blockquote>If you see a series of packets targeting sequential port numbers from a specific source IP address, this may be indicative of a port scan.</blockquote><blockquote>- Packet Frequency:</blockquote><blockquote>Port scans often occur at a specific rate. If you notice packets from a specific source IP address arriving at a consistent rate and sequentially, this could be a sign of a scan.</blockquote><blockquote>- Port Numbers and Protocols:</blockquote><blockquote>Focus on the port numbers and protocols to which the packets are directed. Sequential connection attempts to a specific port number may indicate a port scan.</blockquote><p>While taking these factors into account, I suggest examining your network using TCPDump before initiating the Nmap scan. This will enable you to readily identify notable disparities in network traffic between the dormant state and when a scan is underway.</p><p>I hope this article has been helpful to you :). Until the next one, take care!</p><blockquote>Website: <a href="https://uniquesec.org/">https://uniquesec.org/</a></blockquote><blockquote>Linkedin: <a href="https://www.linkedin.com/company/uniquesec)%E2%80%9D">https://www.linkedin.com/company/uniquesec</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fed5bd3f8bf6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Task 1.2:Understanding Cron Jobs in Linux: Scheduling Tasks with Crontab]]></title>
            <link>https://medium.com/@tahahisoglu/task-1-2-understanding-cron-jobs-in-linux-scheduling-tasks-with-crontab-1adf806fdbac?source=rss-41f5229948b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/1adf806fdbac</guid>
            <category><![CDATA[cronjob]]></category>
            <category><![CDATA[crontab]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Taha Hisoglu]]></dc:creator>
            <pubDate>Mon, 04 Dec 2023 00:30:03 GMT</pubDate>
            <atom:updated>2023-12-04T00:54:14.280Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, we’re going to unravel the magic of cronjobs, explore the crontab, and empower your Kali Linux machine with automated tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UxtjXvO_yQruI4eJ.png" /></figure><h4>Understanding Cronjobs:</h4><p>Let’s start with the basics. Cronjobs are scheduled tasks that run automatically at specified intervals on Unix-like operating systems. These tasks, known as cron jobs, are essential for automating repetitive processes, allowing you to focus on more exciting aspects of your work.</p><p>On your Kali Linux machine, the crontab command is your gateway to scheduled tasks. Open your terminal and type:</p><pre>cat /etc/crontab</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*V7oWLucCfsu2ye1uJQY5aw.png" /></figure><p>This command displays the contents of the system-wide crontab file, providing a comprehensive overview of scheduled tasks that impact the entire Kali Linux system.</p><p>Let’s take a closer look at other crontab commands.</p><pre>crontab -h </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*rPkwq7NooxiMUs_zE8de0g.png" /></figure><p>The crontab -h command is another useful command for listing additional commands available for crontab. This command provides an overview of various functionalities, offering valuable insights into the diverse set of commands that can be employed with crontab.</p><pre>crontab -l</pre><p>When the command crontab -l is executed, it displays the contents of the crontab file associated with the current user on the screen. This file outlines the scheduled tasks for the user, indicating the specific time intervals during which these tasks are set to run. Additionally, it provides details about the nature of these tasks and the actions they perform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*M0JcRAdoSvtyP9D_P5mN0Q.png" /></figure><p>Our current user (i.e., kali) doesn’t currently have an active crontab. Let’s go ahead and add one</p><h4>Adding a Task to Crontab:</h4><p>Before we dive into this section, I’d like to share a helpful picture with you :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VhiDr8BG2M6AfMw4.jpg" /></figure><p>To add a task to our crontab, we need to first execute the crontab -e command.</p><pre>crontab -e </pre><p>This command opens the crontab file in the default text editor (often nano or vim), where you can add, edit, or remove scheduled tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*va-j274qQEwZP-EYf6jAxg.png" /></figure><p>In fact, from this point forward, it’s all about your imagination. As an example, I’ve created a ‘clean-trash.sh’ file to sweep away the remnants. Perhaps you genuinely prefer not to see the things you’ve deleted resurface :). I’ve configured a process to automatically run the ‘clean-trash.sh’ file every 2 minutes with crontab. Now, you no longer need to clear the trash manually or by typing a command; it will handle the task automatically for you at two-minute intervals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*E9VXmxmQ2EJyIz_w_xNUBg.png" /></figure><p>Automation is a powerful ally, saving you time and effort. Experiment with different schedules and tasks to tailor your system to your needs.</p><p>I hope this article will be helpful for you. See you in the next one!</p><blockquote><em>UNIQUESEC Öğrenci Kulübü</em></blockquote><blockquote><em>Website: </em><a href="https://uniquesec.org/"><em>https://uniquesec.org/</em></a></blockquote><blockquote><em>Linkedin: </em><a href="https://www.linkedin.com/company/uniquesec)%E2%80%9D"><em>https://www.linkedin.com/company/uniquesec</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1adf806fdbac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Task 1.1:Installing Kali Linux on VMware Workstation: A Step-by-Step Guide]]></title>
            <link>https://medium.com/@tahahisoglu/task-1-1-installing-kali-linux-on-vmware-workstation-a-step-by-step-guide-21a7ea55d888?source=rss-41f5229948b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/21a7ea55d888</guid>
            <category><![CDATA[virtual-machine]]></category>
            <category><![CDATA[vmware]]></category>
            <category><![CDATA[gui̇de]]></category>
            <category><![CDATA[kali-linux]]></category>
            <dc:creator><![CDATA[Taha Hisoglu]]></dc:creator>
            <pubDate>Sun, 03 Dec 2023 10:47:27 GMT</pubDate>
            <atom:updated>2023-12-03T10:47:27.140Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everyone, this article is my first task for the <a href="https://uniquesec.org/">Uniquesec</a>. I hope it will be useful for you :)</p><p>Embarking on the journey of setting up Kali Linux within VMware Workstation opens the door to a powerful and versatile penetration testing environment. In this article, we will walk through a step-by-step guide to ensure a seamless installation process, enabling both beginners and experienced users to harness the capabilities of Kali Linux for ethical hacking, security testing, and various cybersecurity tasks.</p><p>Before we start, I would like to tell you a little bit about virtual machines and their benefits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jcKjtrcjSEasbYQsP0jJSQ.jpeg" /></figure><h3>Virtual Machines</h3><p>Virtual machines, often hailed as digital chameleons, serve a variety of tech purposes, encapsulating a computer within a computer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LrWmURQH77wN9GrLNnEzmw.jpeg" /></figure><p>Firstly, they offer secure isolation for testing and experimentation, providing a protected sandbox for software development and cybersecurity exploration.</p><p>Additionally, virtualization facilitates resource optimization, allowing the efficient operation of different operating systems concurrently on a powerful machine without overheating.</p><p>Moreover, virtual machines breathe new life into legacy software by creating a compatible environment where ancient applications coexist seamlessly with modern systems.</p><h4>Now, let’s talk about why using Kali Linux in VMware</h4><p>Kali Linux, the superhero of ethical hacking and penetration testing, becomes even mightier when paired with virtual machines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*9ki3AhSYABnsvism8reOWQ.jpeg" /></figure><p>Firstly, virtual machines provide an incognito mode, allowing hackers to operate anonymously. Secondly, they offer disposable environments for testing potentially dangerous exploits, safeguarding the main system from harm. Lastly, Kali Linux on a virtual machine becomes a training ground for aspiring cyber warriors, allowing them to refine their skills in a controlled environment before facing real-world challenges.</p><p>And finally, before we delve into our main topic, it’s worth noting that there are several virtualization platforms available. However, my extensive experience has been rooted in VMware over an extended period. Therefore, in this guide, I’ll be drawing upon my familiarity with VMware Workstation to demonstrate the installation of Kali Linux.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YIWgYuA2BurjJ3iqYlKzxA.png" /></figure><h4>Installing VMware Workstation</h4><p>Before we dive into the installation process, it’s essential to note that VMware offers two versions: the standard edition and the Pro version. While the differences between these versions exist, for the sake of brevity, we won’t delve into the details in this article.</p><p>It’s worth mentioning that the installation procedures for the Pro version and the standard version are remarkably similar. In fact, you can follow the same steps to install the standard version, should you opt for it. So, whether you’re going for the Pro or standard edition, the journey begins with the same set of steps. Let’s get started!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r_usCvj703a0U33OhEVuHA.jpeg" /></figure><blockquote><strong>1)</strong>First let’s download VMware Workstation by visiting this link <a href="https://www.vmware.com/products/workstation-pro/workstation-pro-evaluation.html"><strong>https://www.vmware.com/products/workstation-pro/workstation-pro-evaluation.html</strong></a>. There are two options for downloading one is Windows and other for Linux. My Base Operating System is Windows10, So I choose for VMware for Windows.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aTWnx4yiR0cqIpxzbL73JQ.png" /></figure><blockquote>2) Let’s go to the Download folder and click the VMware downloaded File</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*cdfdvgzNXhAVbojDZK1Ttw.png" /></figure><blockquote>3) Install VMware</blockquote><p>After this point, we can move on by pressing the ‘Next’ button, which is somewhat like what we all do when downloading something :))</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*bdhWnJEDgQT8d3QbCUuLig.png" /></figure><blockquote>4) Finish the Installation</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*sJXo5QyaCRhpYChq-IT8sg.png" /></figure><p>You have two options here. If you have a license key, click on the ‘License’ button and enter your key. (if you don’t have I suggest you do a little googling :) )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*NHiNWI2OtzpvNwElgEc1zw.png" /></figure><p>And we’ve finally finished installation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*6rtwSnb42GlwEJ0VUWPBRw.png" /></figure><p>When we open VMware, we will be greeted by a screen like this. Now that we have successfully installed VMware, we can move on to our next target, which is downloading Kali Linux.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c-apLRExLaIBx_OiKrD2-A.png" /></figure><blockquote>5) You can visit this page to download Kali Linux <a href="https://www.kali.org/get-kali/#kali-platforms"><strong>https://www.kali.org/get-kali/#kali-platforms</strong></a><strong>.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*93U2_YqK3ma281KTp6G-OA.png" /></figure><p>I would like to demonstrate how to download Kali Linux using the ISO file. Therefore, we will choose the option on the left. This selection requires a bit more effort but provides greater flexibility for creating a customized setup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*Y6tKiCh6zHt1iLoGSbak1g.png" /></figure><p>If you have obtained the ISO file, we are ready to proceed to the next step.</p><blockquote>6) Let’s open VMware Workstation and click on ‘<strong>Create a New Virtual Machine</strong>’ option.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*kknP02MpHdH2ouzW12drsg.png" /></figure><p>We’ve reached another installation, but this time, I recommend paying a bit more attention instead of just pressing the ‘Next’ button to proceed.</p><blockquote>7) If you are a new user, I recommend selecting the first option, which is ‘<strong>Typical (Recommended),</strong>’ in the first tab that appears and proceeding with the setup.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*fE3CYRaKDALlIxweV5ak6g.png" /></figure><p>8) Afterward, choose the Kali Linux ISO file you have installed and proceed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*SVXi4VKS3iDRi4qlRwHlDw.png" /></figure><blockquote>9)You choose ‘<strong>Linux’</strong> for the operating system and select the version as <strong>Debian 12.x 64-bit.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*7kv68l1bfYPde65rLjIsbQ.png" /></figure><blockquote>10) At this stage, you can choose the name for your virtual machine and the desired path for installation.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*Nvn560RK6fU_eQT0fBZgSw.png" /></figure><blockquote>11) You are determining the allocated space on your disk for Kali Linux. I recommend allocating a minimum of 30 GB.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*JrEqeigk9Xqth9dMclsOQQ.png" /></figure><blockquote>12) And finally, depending on the hardware power of your computer, you can adjust settings in this section. I recommend allocating a minimum of 4 GB of RAM to Kali Linux.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*s4xu1d3smQoxzDpQHRfoFQ.png" /></figure><p>Here are the settings I personally use for Kali Linux</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*JE_3cAF8J64nYYO-Ua6YiA.png" /></figure><blockquote>13)After configuring the hardware settings, you should see a screen similar to the one below. Click on ‘Power on this virtual machine’ to start Kali Linux.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z_G9Q90cdknhlEwTXs2vtQ.png" /></figure><blockquote>14)On the initial screen, proceed by clicking on the ‘Graphical Install’ option.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*DIB03iUGM05STh05LQmrcA.png" /></figure><blockquote>15)Choose the desired language for Kali Linux in this section.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*4OJ0sZm65IQhjU85UlZLtg.png" /></figure><blockquote>16)In this section, you can select your location</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*08daAMv8iEMLeaGU3LGcdQ.png" /></figure><blockquote>17)And select your keyboard.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*c3CdQ-QRzc2g6aULZcetCg.png" /></figure><blockquote>18)Specify the desired hostname.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*n2v4KqhXrFKlbNB2sFTKQA.png" /></figure><blockquote>19)Specify the desired domain name you want to use.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*ODGeTk6Gk9To1qvdC87ZYw.png" /></figure><blockquote>20) Set your username and, subsequently, your password.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*2T8DlBtWNumS7QKpz8a54A.png" /></figure><blockquote>21) Now, use the entire disk for partitioning</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*5jKg0K5rwB6f9IhMwgN89Q.png" /></figure><blockquote>22) Select your virtual disk</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*3SDxuGPze1aG_k-qZAU4-g.png" /></figure><blockquote>23)And here, choose the first option.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*gQ_tZxca4tiNh7iH6a7KUw.png" /></figure><blockquote>24)Select <strong>Finish partitioning and write changes to disk</strong> and continue.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*AupQCoIe9T42hkeLBUEqKw.png" /></figure><blockquote>25)Select ‘Yes’ and continue.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*-P3tbrmA-Wvq5t4cKO8IRg.png" /></figure><blockquote>26)Now you can choose the desktop environment for your Kali Linux. I am using XFCE, so I will select that.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*B9zDvB5Zpz1Qbc1rkKg8Dg.png" /></figure><blockquote>27)At this stage, let’s proceed by installing the GRUB bootloader. Simply click ‘Yes’ and continue.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*eXYmK7b855fHxffFYmsyjQ.png" /></figure><blockquote>28)Select your disk and proceed by clicking Continue</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*ekl-J_baFl8i1_nqk-74cQ.png" /></figure><blockquote>29) And finally, finish the installation and click on continue to reboot.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*mTbUyNQFM5L5rWeew8OQJw.png" /></figure><p>If everything has gone smoothly, you will encounter a screen like this. You can log into the system using the username and password you previously specified in the earlier steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2zkIQOMaer-HHkJaY-WR3g.png" /></figure><p>And congratulations, you have successfully installed Kali Linux on VMware. I hope this article has been helpful to you. I would like to extend special thanks to the <a href="https://uniquesec.org/">Uniquesec</a> team, whose motivation played a significant role in the creation of this guide.</p><h4>Here is the UNIQUESEC accounts:</h4><blockquote>Linkedin: <a href="https://www.linkedin.com/company/uniquesec"><strong>https://www.linkedin.com/company/uniquese</strong></a><strong>c</strong></blockquote><blockquote>Website:<strong><em> </em></strong><a href="https://uniquesec.org/"><strong>https://uniquesec.org/</strong></a></blockquote><p>Stay curious, stay secure. See you in the next article!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aTsqkG9uiyt3EzXL" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21a7ea55d888" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Information Gathering in Black Box Tests]]></title>
            <link>https://medium.com/@tahahisoglu/information-gathering-in-black-box-tests-cd669f55526e?source=rss-41f5229948b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd669f55526e</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[information-gathering]]></category>
            <dc:creator><![CDATA[Taha Hisoglu]]></dc:creator>
            <pubDate>Sat, 23 Sep 2023 13:28:08 GMT</pubDate>
            <atom:updated>2023-09-23T13:28:08.189Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Information Gathering in Black Box Tests</strong></p><p><strong>Penetration Testing</strong></p><p>Hey there, before we dive into the world of passive information gathering, which is our main gig today, let me break down what penetration tests are all about.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7kPGkZgASO_pTfVYTxttQg.png" /></figure><p>Penetration testing, often lovingly referred to as “pentesting” is like the cybersecurity superhero we all need. It’s the practice of mimicking cyberattacks on a computer system, network, or application. We do this to find those sneaky vulnerabilities and weaknesses lurking in the shadows. Think of it as a friendly scrimmage before the big game against the bad guys.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*o10dFWP7fRtQM9zrTtTUow.png" /></figure><p>Now, these tests come in three flavors: black box, white box, and gray box.</p><p><strong>Black Box Testing</strong> is like going in blind, just like a hacker with limited information. We’re feeling our way through the dark.</p><p><strong>White Box Testing</strong>, on the other hand, is like having the blueprint of the place. We know all the ins and outs, almost like we’re part of the inner circle.</p><p><strong>Gray Box Testing?</strong> Well, it’s right in the middle. We know some, but not all. It’s a bit like having the key to one door in a labyrinth.</p><p>Why these different flavors, you ask? Well, it’s all about picking the right tool for the job. <strong>Black box</strong> tests mimic real-world attacks, <strong>white box</strong> tests dissect the inner workings, and<strong> gray box</strong> tests are the happy medium. It’s all about matching our tactics to the situation.</p><p>Now, let’s get to the juicy stuff: <strong>Information Gathering.</strong></p><h4><strong>Information Gathering</strong></h4><p>In the world of cybersecurity, information gathering is the Sherlock Holmes of penetration testing. It’s all about hunting down those vulnerabilities and spotting potential threats. It’s the foundation for fixing those loopholes that cyber villains might exploit.</p><p>We gather this info using tools like open-source intelligence (OSINT). It’s like our detective work to collect crucial data about the target system or network. This intel is gold because it helps us figure out where the weak spots are and how to breach them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*hX_Rq7CgkJUYF15A9L9g0A.png" /></figure><p>Alright, let’s zoom in on our first method:</p><p><strong>1- Passive Information Gathering</strong></p><p>This one’s all about being sneaky. We collect data about a target system or network without making a fuss. It’s like eavesdropping at a party without anyone noticing.</p><p>We scoop up info from sources like social media, websites, and online databases. This passive approach tells us a lot about a target’s digital footprint and where it might be vulnerable. It’s like peeking through the keyhole before barging in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*d1PlLvOykGFpNX_wsS0MmQ.png" /></figure><p>Now, onto the more adventurous part:</p><p><strong>2- Active Information Gathering</strong></p><p>Active info gathering is like a daring mission. We’re not lurking in the shadows anymore. Instead, we’re directly interacting with the target. It’s like knocking on the door to see who’s home.</p><p>This involves techniques like port scanning and vulnerability probing. We’re looking for weak spots, and this approach helps us assess how strong the defenses are.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*mUX5LucZ2sPR2JrmYTEzUA.png" /></figure><p>In this article, I will explain how pentesters achieve passive information gathering through tools and websites.</p><p><strong>Google Dork</strong></p><p>These are our secret weapons in passive info gathering. They’re specialized search queries that cybersecurity pros and pentesters use to find hidden gems on websites and services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vqlsHilgElrAYKgt" /></figure><p>We use Google Dorks to uncover vulnerabilities and weaknesses in a target’s online presence. By crafting the perfect dork, we reveal sensitive files, login pages, and more. It’s like finding treasure on a digital map.</p><p>This information is crucial for assessing a target’s security posture and can help organizations proactively address potential threats before malicious actors exploit them. In essence, Google dorks serve as a valuable tool for reconnaissance and initial data collection during security assessments.</p><p><strong>Site</strong></p><p>Think of this as our magnifying glass. The “site” operator in Google Dorks lets us zoom in on a specific website or domain. It’s like a laser-focused search, helping us gather data about that one target. No more sifting through unrelated stuff. If we use “site” in the search, it will only show us sites with the domain we specify. For example, let’s Google ‘vulnweb.com’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*BVQ9diy0vrp-1Ef0STN8Ew.png" /></figure><p>When you don’t use “site,” it’s like searching in a vast ocean of information. You’ll get tons of results, and it’s a bit like looking for a needle in a haystack. Not fun.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*o1CQ5E0Kup02TOfYQKXm_g.png" /></figure><p>On the other hand, when you use the “site” operator, you specifically instruct Google to search within a particular domain, yielding more precise and targeted results. This focused approach simplifies the information gathering process, helping you efficiently collect data related to the specific site of interest. We can use the ‘site’ operator in our search and by doing so, we only get 732 results. This can indeed save us time during the information gathering phase.</p><p><strong>inurl</strong></p><p>This one’s for the URL detectives. “Inurl” helps us pinpoint specific web addresses with certain keywords. It’s like having a radar for finding login pages or other vulnerable spots.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*Kpbtw_-J3LiTo7jI59zUZQ.png" /></figure><p>By using the “inurl” operator, individuals can filter search results to focus on URLs that match specific criteria, such as login pages, admin panels, or other potentially vulnerable areas.</p><p><strong>intitle</strong></p><p>Imagine this as our treasure map. “Intitle” narrows down search results to web pages with titles matching our criteria. It’s super handy for finding specific info within a website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*nKqpIoZQAQSD27sBvsVa1A.png" /></figure><p>For instance, a pentester might use ‘intitle:admin’ to search for web pages with ‘admin’ in their titles, which could potentially lead to discovering administrative pages or access points during the initial reconnaissance phase.</p><p><strong>filetype</strong></p><p>This is our filter. “Filetype” helps us find specific file types on a website, like those sneaky PHP files. These files might hide valuable info or reveal security weaknesses. It’s like having x-ray vision for file types.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*v--dSbPYtKHwzZZyjrDi9g.png" /></figure><p>In this example, we have listed results with the domain vulnweb.com and only php as the file type. This operator can be particularly valuable for pentesters and researchers looking to uncover PHP-based components or applications on a website.</p><p>By using “filetype:php,” they can efficiently target and retrieve PHP files, which might contain valuable information or reveal potential security vulnerabilities during the initial reconnaissance phase or analysis.</p><p><strong>cache</strong></p><p>Last but not least, the “cache” operator lets us retrieve old versions of web pages stored by Google. It’s like a time machine for websites. Useful for historical research or checking what’s changed on a site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*3AG8GYrLSib9JC2sfllRMA.png" /></figure><p>Additionally, it allows users to see how a particular web page appeared at a previous point in time, which can be valuable for historical research or investigating changes on a website.</p><p>If you’re on the lookout for a website that simplifies Google Dorks and makes passive information gathering a breeze, let me introduce you to a game-changer: <a href="https://dorks.faisalahmed.me/">https://dorks.faisalahmed.me/</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*cvwwtizBz4-jNq8LQw9MDA.png" /></figure><p>This site is your trusty sidekick in the world of cybersecurity, designed to streamline your tasks and enhance your search efficiency. Give it a try, explore its features, and let’s dive into a few examples together to streamline your information gathering process!</p><p>Let’s try .htaccess sensitive files option on the website and see what happens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*DHkD0Z4ePjNMftZZIQ4YHw.png" /></figure><p>.htaccess files are important for passive information gathering because they contain the configuration of a web server. Analyzing these files is a critical step to identify potential security vulnerabilities and determine attack vectors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*mTkIcVRS-NPJLXHCxIGp_w.png" /></figure><p>But hey, that’s not all. There’s another secret weapon in our arsenal:</p><p><strong>Google Hacking Database</strong></p><p>This website is an absolute game-changer when it comes to leveling up your passive information gathering game. The Google Hacking Database is your go-to source for a curated collection of Google Dorks and search queries that unveil vulnerabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*J32qZFtKgFEkSNkbilJ5IQ.png" /></figure><p>Think of it as your cheat sheet for uncovering exposed databases, confidential documents, login pages, and so much more. It’s a goldmine of search queries that can reveal sensitive information on websites and web applications. You can visit this link <a href="https://www.exploit-db.com/google-hacking-database">https://www.exploit-db.com/google-hacking-database</a>.</p><p>Now let’s look at other passive information gathering tools we can use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*IQAuJDzGuu8vtTYFDxBGeQ.png" /></figure><p><strong>Shodan</strong></p><p>Shodan is like the Sherlock Holmes of search engines for passive information gathering. It’s your trusty companion in this digital adventure. To harness the full power of Shodan, you can employ various search operators and filters to fine-tune your queries.</p><p>For example, you can search for specific services, devices, or vulnerabilities using operators like “port,” “hostname,” or “country.” Once you’ve cast your search net, Shodan presents you with a treasure trove of results, including details about open ports, banners, and potentially vulnerable systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nYtBrGLYAGRJRF_mJRrGdA.png" /></figure><p>These search results are pure gold. They can help pentesters identify exposed devices or services, indicating potential security risks. The banners and open port info? Well, they give you a peek into the technology stack used by your target, making it a breeze to assess vulnerabilities and security weaknesses.</p><p>But wait, there’s more! Shodan’s got operators akin to Google Dorks, and they’re incredibly handy. Check out the example below, where I’ve used one of these operators to fine-tune my search. My goal? To filter out those vulnerable webcams chilling in Italy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*CchXvkMbWGrDdGD5s8Yw7g.png" /></figure><p>Now, here’s the kicker: when we dig deeper and explore these IP addresses, we might just stumble upon a site that lets us connect directly to the camera.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*SN7WvdRmtrz1mZWGSmPQSg.png" /></figure><p>If you want to discover and examine Shodan yourself, you can browse this link <a href="https://www.shodan.io/">https://www.shodan.io/</a>.</p><p><strong>Wayback Machine</strong></p><p>Alright, let’s take a detour into the fascinating world of the Wayback Machine. It’s like a time-traveler’s dream for passive information gathering. This nifty tool is a digital archive of the World Wide Web, and it holds the key to uncovering the past.</p><p>Imagine this: you can access archived versions of websites, like a digital archaeologist, revealing historical snapshots of online content. Curious about how Starbucks’ website looked in 2007? Well, the Wayback Machine can whisk you back in time to check it out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*E73JrIML2-HvMJf971WoWg.png" /></figure><p>But it’s not just about nostalgia; it’s about gathering valuable insights. You can track a website’s evolution, spot changes in content or design over time, and even unearth hidden or deleted information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*Vs4ZzPzMXy_ZZQGlsm0P6g.png" /></figure><p>This makes it a treasure trove for researchers, digital historians, and cybersecurity experts. You can start your time-travel journey by visiting the Wayback Machine site at <a href="https://web.archive.org/">https://web.archive.org/</a>.</p><p><strong>Whois</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*TpqIXVk45NLS-WkTjmVxqQ.png" /></figure><p>Now, let’s talk about the sleuth of the internet — the Whois database. It’s like the ultimate detective’s notebook for domain name registration information. It holds secrets about domain owners, registration and expiration dates, nameservers, and more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*Ba9oxIlrbRY-mdi5t8chwQ.png" /></figure><p>If we list a few important items to look for after the Whois search when collecting passive information, these items can be as follows:</p><ol><li><strong>Domain Ownership Details:</strong> To identify the domain owner.</li><li><strong>Registration and Expiry Dates:</strong> For insights into the domain’s age and status.</li><li><strong>Name Server Information:</strong> To understand hosting infrastructure.</li><li><strong>Contact Information:</strong> For communication and verification.</li><li><strong>Registrar Details:</strong> To know the managing organization.</li></ol><p>Whois website also has a tool that we can run through the terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*aZEBZw01215_adRYCsfVpQ.png" /></figure><p><strong>Analyzing the Results</strong></p><p>Effectively analyzing the Whois results is essential for extracting meaningful insights:</p><ul><li><strong>Ownership Details:</strong> Pay close attention to the domain owner’s name and contact information, as this can provide context about the entity behind the domain.</li><li><strong>Registration Dates:</strong> Examine the registration and expiration dates to assess the domain’s age and potential longevity.</li><li><strong>Nameservers:</strong> Understand where the domain’s DNS records are hosted, which can help uncover technical details and vulnerabilities.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*NQ7GhIHZIUwlwzobHr94og.png" /></figure><p><strong>Wappalyzer</strong></p><p>Wappalyzer quickly identifies the technologies used by websites you visit. It reveals the content management systems, web servers, and more. This extension serves a multitude of purposes, from competitive analysis for businesses to assisting web developers and cybersecurity pros.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*fATI6VGr3QiEHtKjH_9dyQ.png" /></figure><p>In this example, you can see how Wappalyzer unveils the frameworks and libraries used on VulnWeb.com’s website. It’s like having x-ray vision for a website’s tech stack.</p><p><strong>SSL/TLS Certificates</strong></p><p>Now, let’s shed some light on SSL/TLS certificates, those silent guardians of website security. They’re not just about encryption; they’re also secret keepers of subdomains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*0-WfYGtA0WZpvseW0CS7gA.png" /></figure><p>Why does this matter, you ask? Well, businesses can use this golden information to boost their online presence, spot potential vulnerabilities, or even uncover sneaky unauthorized subdomains.</p><p>Our trusted resource for exploring SSL/TLS certificates and subdomains is the crt.sh website. You can visit the site from this link <a href="https://crt.sh/">https://crt.sh/</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*aPyPqmLkK8FH1HEkPkYaFQ.png" /></figure><p>Type “google.com” in the search box and click on the search button and let’s see what happens</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xUkyoVZzX-MID6GmTaaUPQ.png" /></figure><p>crt.sh will present a list of all SSL/TLS certificates issued for Google.com. You can access details such as the issuing Certificate Authority, issuance date, and which subdomains are covered by these certificates.</p><p>Another site where you can find important information for SSL/TLS certificates is SSL Labs. On the opened page, enter the domain name or IP address you want to test. Then, click on a button like “Submit” to initiate the test.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*txsvmxExS2jZxk-KYXqhoA.png" /></figure><p>I will try any domain from the Recent Worst section you see on the right side of the site.</p><p>When the test is completed, you will receive a detailed report about the security status of your server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*qQYApNO4xwfQFKRl9Wjmug.png" /></figure><p>Here are some important factors to pay attention to in this report:</p><ul><li><strong>Grade:</strong> It’s usually presented as a letter grade, indicating your server’s security level. A+ is the gold standard, representing top-tier security.</li><li><strong>Protocols:</strong> Which SSL/TLS versions does your server support? Up-to-date and secure protocols (like TLS 1.2 or TLS 1.3) are the cool kids in town.</li><li><strong>Encryption:</strong> What encryption algorithms are in play? Strong encryption algorithms are your bodyguards in the digital world.</li><li><strong>Key Lengths:</strong> The strength of SSL certificates depends on key length. Longer keys mean more security.</li><li><strong>Vulnerabilities and Threats:</strong> The report lists potential vulnerabilities and known threats. Dig into these areas and consider the suggested fixes. It’s like having a cybersecurity expert on speed dial.</li></ul><p><strong>Dmitry Tool</strong></p><p>Dmitry is an open-source information-gathering tool. This tool includes a set of modules for analyzing target domains or IP addresses. Let’s pivot to Dmitry, our open-source information-gathering Swiss Army knife.</p><p>Here’s your roadmap:</p><ol><li><strong>Install Dmitry:</strong> Start by downloading and installing Dmitry from the official GitHub repository: <a href="https://github.com/jaygreig86/dmitry">https://github.com/jaygreig86/dmitry</a>.</li><li><strong>Specify the Target:</strong> Next, specify your target domain or IP address. You can use a command like this:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*l7t8ZRLaaXGDUjtE1TW89Q.png" /></figure><p>3. <strong>Examine the Results:</strong> After the Dmitry scan, you’ll get a range of results, including:</p><ul><li><strong>Whois Information:</strong> Records about the target domain or IP address, including ownership details.</li><li><strong>Port Scanning:</strong> Info about open ports and connection points.</li><li><strong>Subdomains:</strong> A list of subdomains linked to the main target domain.</li><li><strong>IP Address Details:</strong> Insights about the target’s IP address, geographic location, and more.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*ewii58tteXA2a2IXbiS1Gg.png" /></figure><p>Pay close attention when evaluating these results:</p><ul><li><strong>Ownership Information:</strong> Whois details can reveal the target’s owner or organization.</li><li><strong>Open Ports:</strong> Identifying open ports is key to understanding the attack surface.</li><li><strong>Subdomains:</strong> They expand the attack surface further.</li><li><strong>IP Address Information:</strong> This gives you insights into the server’s location and provider.</li></ul><p><strong>theHarvester</strong></p><p>Now, let’s introduce theHarvester, another open-source reconnaissance tool for information gathering.</p><p>Here’s your playbook:</p><ol><li><strong>Installation:</strong> Begin by installing theHarvester on your system. You can usually do this by cloning the tool’s GitHub repository: <a href="https://github.com/laramies/theHarvester">https://github.com/laramies/theHarvester</a>.</li><li><strong>Specify the Target:</strong> To kick off your search, specify your target domain or IP address using a command like this:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*Ldo4Hl8P5An3nBIGT_3WXQ.png" /></figure><p>● &lt;target_domain&gt; should be replaced with the domain you want to investigate.</p><p>● &lt;limit&gt; is an optional parameter for result limits.</p><p>● &lt;data_source&gt; represents the data source (e.g., Google, Bing, etc.).</p><p>3.<strong> Review the Results:</strong> After theHarvester does its magic, you’ll get a comprehensive report. Keep an eye out for these key aspects:</p><ul><li><strong>Email Addresses:</strong> theHarvester can dig up email addresses linked to the target, which can be gold for social engineering or contact purposes.</li><li><strong>Subdomains and Hosts:</strong> Uncover any subdomains or hosts connected to the target. They might reveal additional entry points.</li><li><strong>Data Sources:</strong> Know the data sources you used for the search; different sources can yield different results.</li><li><strong>Limit Results:</strong> Consider limiting the number of results for better data management.</li><li><strong>Interesting URLs:</strong> These could contain private information or potential security weaknesses.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*2Feoeog07G3lW39OhzZFSQ.png" /></figure><p><strong>Analyzing the Results</strong></p><p>Now, let’s talk strategy for making sense of theHarvester’s results:</p><ul><li><strong>Data Verification:</strong> Cross-reference the extracted data with other sources for accuracy.</li><li><strong>Prioritization:</strong> Rank the information based on its relevance to your goals.</li><li><strong>Security Implications:</strong> Think about how the discovered data could be exploited and the security implications.</li><li><strong>Ethical Considerations:</strong> Always stay within legal and ethical boundaries when gathering information passively.</li></ul><p><strong>Closing Thoughts</strong></p><p>Of course, besides these, there are many tools and websites available for passive information gathering. In this article, I wanted to touch upon some of the prominent ones. I hope this article has been helpful to you. Now, you know how to gather information using publicly accessible resources for your chosen target. Essentially, you’ve completed the first stage in a black-box test. You can take notes of the information you gather from these websites and use it in the later stages of the testing process.</p><p>Stay curious, stay secure. See you in the next article!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*USHL5Lz2zNpZsa6w3sslOw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd669f55526e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>