owasp

owasp etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
owasp etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

24 Temmuz 2018 Salı

TR | Netsparker ile Web Uygulama Sızma Testleri




Herkese Selamlar,

Bu post Netsparker ile yapılan bir web uygulama testini simüle edip false positive oranları, optimizasyon ve diğer uygulama tarayıcalarından farkları hakkında teknik bilgiler içerecek.

Uygulamanın demo sürümüne burdan ulaşabilirsiniz

Netsparker 

Netsparker, web sitesinin geliştirildiği dil ya da teknolojiye bakmaksızın, platformdan bağımsız bir şekilde SQL Injection ve Cross-site Scripting (XSS) gibi güvenlik açıklarını tespit eder ve çözüm önerilerini de içerecek şekilde tüm detaylarıyla size raporlar. 

Ayrıca Netsparker, kendine özgü tarama teknolojileri sayesinde güvenlik açıklarını tespit etmekle kalmayıp, bu güvenlik açıklarının gerçekten var olduğuna dair kanıt sunar. 

Böylelikle Netsparker’ın size sunduğu sonuçların doğruluğunu kontrol etmeniz gerekmez.

Ilk Tarama


Bu simülasyonda test edeceğimiz web servis http://php.testsparker.com adresinde barınmaktadır. Üzerinde Netsparker koşturmadan önce adrese gidip herhangi bir login page var mı diye göz atıyorum



Bunun sebebi Netsparker'ın unauthentication ile tarama yapmasının yanı sıra authentication yaparak uygulama içerisinde ki sayfalarda da zaafiyet araştırması yapmasını istememiz.

Uygulamayı indirip kurduktan sonra resimdeki gibi bir arayüz ile karşılaşıyoruz



Öncelikle options butonuna tıklayarak seçenekleri görüntülüyoruz.


Tarama poliçesi bölümünden Netsparker'ın sağlıklı sonuçlar verebilmesi için hedef sistem hakkında bilgiler girmemiz gerekiyor.

Bu bilgiler kısaca uygulamanın barındığı sunucunun işletim sistemi uygulamanın dili kullandığı web servis vs.

Bu noktada girilen bilgiler oldukça önemli. Netsparker'ın sistem üzerinde doğru payloadları yakalaması için optimize edilmiş bir tarama poliçesine ihtiyacımız var böylelikle uygulamadan daha sağlıklı sonuçlar alabileceğiz.

Hedef sistem hakkında istenilen bilgileri "Shodan", "Nmap" ve  "Sayfa Kaynağından" elde edebilirsiniz.

Ardından bir diğer önemli nokta olan eğer uygulama üzerinde bir erişimimiz var ise "Form" sekmesinden giriş path'ini ve credentials girmemiz.



Tüm bunlardan sonra taramayı başlatıyorum. Start Scan seçeneğinden sonra Netsparker bir pencere açıp uygulama üzerinde authentication yapıp uygulama içerisinde ki sayfalarda da testlerini yapmaya başladı



3 aşamadan oluşan tarama sırasında Netsparker arka planda crawling yaparak uygulama içerisinde ki dizin ve scriptleri buluyor. Bunun yanı sıra kendi wordlisti ile backup dizinleride keşfediyor.


Resimde sol üst köşede tarama hızı ve yollanan request sayısı hakkında  bilgi sahibi olabiliriz orta bölümde sayfaları ve yollanan payloadları , onun hemen altında iste seviyelerine göre zaafiyetleri görebiliriz.

Netsparkeri diğer uygulama güvenliği tarayıcılarından ayıran nokta false positive uyarı vermemek için zaafiyetin türüne göre dışarıya bilgi çıkarması.

Rastgele bir zaafiyeti açarak request ve responsları inceliyorum.




Açılan pencerede Netsparker bize adresi, saldırıdan etkilenen parametreyi, PoC adresini ve payload'ı veriyor.

Netsparkerın payloadını incelediğimiz zaman

'"--></style></scRipt><scRipt>netsparker(0x000438)</scRipt>

Şeklinde bir payload kullandığını görüyoruz. Burada sadece script taglarını açarak da alert verdirebilirdi fakat yukarıdaki şekilde bir payload'ı kullanmasının sebebi eğer varsa contextlerden kaçmasıdır .

Bu çoğu zaman için iyi bir payloadtır.

Bir başka zaafiyeti incelediğimiz zaman




Boolen based tabanlı sql injection bulduğunu görüyoruz. HTTP Request ve Response sekmesinden Netsparker'ın açıklık için yolladığı isteği ve dönen cevabı görebiliyoruz.

Aynı zamanda zaafiyetin response adresini Browser view sekmesinden tarayıcı tabanlı gösterebiliyoruz.




Rakiplerini geride bırakmasında en önemli rolü false positive sonuçları çok büyük ölçüde engellemiş olması.


28 Aralık 2017 Perşembe

Penetration Tests With Nessus (Chapter 1) Nessus İle Sızma Testleri




Hello  everyone. Today I will write to you about "Nessus Vulnerability Scanner"

This is the first part of my wiriting about nessus  in this section I will talk about simple scans and setup 

You can follow us on twitter @berkdusunur
Okay let's start :)

Nessus Linux Installation

You should first download the appropriate for your system.
You can view the packages in this;

https://www.tenable.com/products/nessus/select-your-operating-system 

I downloaded the debian package.  Let's go to setup :)


dpkg  -i Nessus-7.0.0-debian6_amd64.deb 





We got the activation code after opening Tenable membership. I then connected with the 8834 port scanner and entered the necessary information




Meanwhile I downloaded the "metasploitable 2" virtual machine.  Then started broadcasting with VirtualBox

FOr a short time IP Address for vulnerability researcher
Now right click on the new scan option


I will choose a simple network scan to be an example

after...


We enter the target name and ip address 212.83.175.136


This part asks if you want to do the scanning at the widespread ports or not


This section asks how to perform a scan on the web application.

We started scanning


Continues to scan I will have a coffee :) Nessus gives  more healthier result than its competitors.

I am using nessus with remote server because  I do not have to wait for slow scans


Many security vulnerabilities have been achieved.


In the second part we will explain how to exploit these vulnerabilities.

Thank you for reading.

E-Mail for your questions berkdusunurx@gmail.com

28 Kasım 2017 Salı

Web Application Penetration Testing With WFuzz (Wfuzz İle Web Uygulama Güvenliği Testleri)







What İs WFuzz?


WFuzz is a powerful tool for general web security testing where we can perform security tests on web applications, perform XSS and SQL injection tests on our web pages with their own wordlists, and perform page and page directory browsing (BruteForce). In addition to these, Encode (Encryption) is also capable of doing.


How To İnstall Wfuzz?


We download the wfuzz-2.1.3.tar.gz file located in the Downloads section at https://github.com/xmendez/wfuzz/releases/tag/v2.1.3 and open the console. We go to the Downloads folder and open our file and go there:

1) $ cd Downloads
2) $ tar -xvf wfuzz-2.1.3.tar.gz
3) $ cd wfuzz-2.1.3

Wfuzz Parameters

-c = Http allows status codes to output in color.
-z = We will not use wordlist when we are doing Fuzz operation.
-hc xxx = xxx The status code can not be shown on the status code screen.

The number of answers like 404 (Page Not Found) is quite high because some sites have a long scan. So it might make sense to use it.

-d: post request

FUZZ: I want to make a fuzz section

The most commonly used HTTP Status Codes are as follows;

     • 100 = Continue
     • 200 = OK (Successful)
     • 201 = Created.
     • 202 = Accepted.
     • 204 = No Content
     • 301 = Permanently Redirected or Moved
     • 302 = Temporarily Redirected or Moved
     • 400 = Bad Request
     • 401 = Authorization Required.
     • 403 = Prohibited
     • 404 = Not Found
     • 500 = Critical Server Error


    Wfuzz is more than a web content browser:

 • Wfuzz can help you secure your web applications by finding and exploiting web application security vulnerabilities. Wfuzz's web application is supported by security vulnerable browser plugins.

• Wfuzz is a completely modular framework and makes it even easier for the newest Python developers to contribute. The building inserts are simple and take a little more than a few minutes.
     
 • Offers a simple language interface to previous HTTP requests / responses using other tools such as Wfuzz, Wfuzz or Burp. This allows you to do manual and semi-automated tests with the full content and understanding of your actions and context without relying on a web application browser based on the application.

OK. It's so good here. Let's go to practice :)

• Now, when I do content management, we scan the admin panes
   


       wfuzz -c -z file, / usr / share / wfuzz / worldlist / general / admin-panels.txt - hc 404 http://harranbilisim.com/FUZZ
 


       The first time I use this command directory, the -c parameter,
       We wanted it to be colored so the codes could be recognized.
        We will use it with -z file
     
       We made the WordList selection.
       The 404 status code for 137 keywords scanned with -hc 404
       We got a big part back.
       Then we used http://www.agamakala.com/FUZZ.
     
       If you want to make an experiment by putting each keyword in the Wordlist
       we are writing the key word "FUZZ" in capital letters.




   200 returning answers admin user login page 

   Ok we found the panel with the necessary parameters
    Okay Now Scan Sql Vulnerability

wfuzz -c -z file,/usr/share/wfuzz/worldlist/Injections/SQL.txt – hc 404 www.blablablabla.com/index.php?id=51/FUZZ


   Many successful responses have returned

We Can XSS Scanning
wfuzz -c -z file,XSS.txt --hc 404 http://blablablabla.bla/inc/takvim/index.php?month=3&year=2017/FUZZ

   
   Many successful answers have returned now let's check manually


Finding Sensitive Files

WFUZZ with the apache.txt file located under usr / share / wfuzz / wordlist / vulns directory

.htaccess
.htpasswd
.meta
.webm
access_log
cgi
cgi-bin
cgi-pub
cgi-script

Let's test it looking for sensitive files like

wfuzz -c -z file, apache.txt -hc 404 http://blablabla.bla/FUZZ



   We can download the logs and htaccess file and view the contents.

   We are still trying to read server-side etc / passwd with dirTraversal-nix.txt file located under the         
same directory


Did not get any successful results
looking for a windows server-side sensitive file with dirTraversal-win.txt in the same directory

I can with stress testing / usr / share / wfuzz / wordlist / stress / test_ext


Thank you for reading. You can follow me on twitter https://twitter.com/berkdusunur