Kasım 2017

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

26 Kasım 2017 Pazar

MuCyber 2017 CTF Çözümleri



Herkese selamlar çok çok değerli blog takipçilerim :)

25-26 Kasım Tarihleri arasında MUCyber Tarafından düzenlenen CTF yarışmasının çözümlerini hatırladığım kadarıyla aşşağıda paylaşacağım

Öncelikle 1000 puanlık olan Nişasta sorusundan başlamak istiyorum


Joy kategorisinde olan bu soruda bize  8 adet tarih verilmişti. Öncelikle bu tarihlerde gerçekleşen önemli olaylara baktım. Ardından ipucuda paylaşıldıktan sonra (2011 Erzurum)

Bu sorunun üniversiteler arası kış olimpiyatları ile alakalı olduğuna karar verdim bu tarihleri kontrol ettiğim zaman çoğunda yaz ve kış olmak üzere olimpiyat düzenlenmişti 

Bu şehirlerin baş harfleri ile anlamlı birşeyler bulmaya çalışırken "dekstrin" adında Nişastanın içerisinde bulunan maddelerden birini buldum 


Flag değeri ise mucyb3r_{dekstrin} di



14 Kasım 2017 Salı

What İs Honeypot ? - Trap Systems - Hacker Hunt (Honeypot - Hacker Avı )




What İs Honeypot ? - Trap Systems - Hacker Hunt (Honeypot - Hacker Avı )



Trap computer systems that detect attacks that may come in advance, mislead the attacker against unauthorized access, and time out the attacker

(Gelebilecek saldırıları önceden tespit edip yetkisiz erişimlere karşı saldırganı yanıltan saptıran ve saldırgana vakit kaybettiren tuzak bilgisayar sistemleridir)


It is usually the fragments of a trap that mimic the real system that appears to be part of a computer application or a service that contains a vulnerability
(Genellikle zaafiyet içeren bir bilgisayarın uygulamanın veya bir servisin parçası gibi görünen gerçek sistemin taklidini yapan tuzak parçalarıdır )



Access to honeypots is considered an enemy because there is no reason for the end user to communicate with the imitated trap system. After the Honeypot is examined, the necessary defenses are made

(Son kullanıcının taklit edilen tuzak sistem ile iletişime geçmesi için herhangi bir sebebi bulunmadığı için honeypotlara yapılan erişimler düşman olarak kabul edilir. Honeypot incelendikten sonra gerekli defans yapılır)

What Does Honeypot Do? (Honeypot Ne İşe Yarar?)

Protecting real systems helps to collect data so that the necessary defensive security can be established. It is important in terms of attracting the attacker's attention and saving time.
(Gerçek sistemlerin korunması ve gerekli defansif güvenliğin oluşturulabilmesi için veri toplanmasına yarar. Saldırganın dikkatinin başka yöne çekilip zaman kazanılması için büyük önem taşır)



The Advantages Of Using Honeypots (Honeypot Sistemlerin Avantajları) 

Actual Data Collection (Gerçek Veri Toplama) 

The data collected reflects the truts of more

False Alerts (Yanlış Uyarılar)

Intrusion detection systems and fırewalls mostly gives false alerts. Collects data from honeypot systems but completely accurate 
(Saldırı tespit sistemleri ve güvenlik duvarları genellikle yanlış uyarılar verir fakat honeypot sistemler herzaman doğru veriler getirir)

Usually Free Software (Genellikle Ücretsiz Yazılımlar)

Honeypot systems are usually free and open software. The cost is there most of the time 
(Honeypot Sistemler genellikle ücretsiz ve özgür yazılımlardır. Bu da çoğu zaman maliyeti düşürür)

Basic Systems (Basit Sistemler)

Realistic systems on the user side, and indispensible security
(Gerçekçi sistemleri kullanıcı taraflı arayüz ve güvenlik için vazgeçilmezdir)

Kippo SSH Hacker Hunt Fake Service
https://github.com/desaster/kippo/wiki/Running-Kippo

FTP Hacker Hunt Fake Service
https://github.com/alexbredo/honeypot-ftp

MySQL Hacker Hunt Fake Service
https://github.com/schmalle/MysqlPot


Thank You For Reading




8 Kasım 2017 Çarşamba

DNS Amplification DDoS Attack



WHAT İS DNS ?

The Domain Name System (DNS) is a hierarchical decentralized naming system for computers, services, or other resources connected to the Internet or a private network. It associates various information with domain namesassigned to each of the participating entities. Most prominently, it translates more readily memorized domain names to the numerical IP addresses needed for locating and identifying computer services and devices with the underlying network protocols. By providing a worldwide, distributed directory service, the Domain Name System is an essential component of the functionality on the Internet, that has been in use since 1985

(Wikipedia)




When I want to go to berkdusunur.net with Browser, the browser first asks me if i can translate berkdusunur.net address to me


The system looks in the / etc / hosts directory. If there is an ip address on the berkdusunur.net domain it will use it.
Otherwise it goes to the DNS resolver provided by DHCP. If not, it goes to the root server.
The root servers in Turkey are called ODTU. From there it is directed to the domain name.




DNS INQUIRIES

By leaving the DNS recursion query on, you allow an attacker to use your DNS on your behalf.

DNS Amplification attacks, a professional attack technique, attack by sending packets to you via a DNS server that is in your domain


(If 1 DNS packet is 50 bytes, this packet will be returned in response to 10x ie 500 bytes).

Thus, the attacker will not only use your bandwidth, but at the same time will also provide his / her own privacy, creating the perception that the attacker is like you.


How do we know if our DNS server is open for the recursion query?


You can learn in two shapes

1. If you want to check the settings of your DNS server

2. From the outside DNS server will do DNS Recursion query.




NMAP RECURSIVE INQUIRY

Using a script located in Nmap it helps to detect the weakness of the dns server 1 to get 10


Let's first scan the DNS server list that we found using this script of NMAP.




Command

nmap -sU -p 53 --script=dns-recursion -iL /home/ceh/Masaüstü/recursive-amp4.txt 



TSUNAMI - DNS AMPLIFICATION ATTACK

Tsunami is making DNS requests to the servers in the DNS list that I specify.In the answer, the changed source leads to ip address as well as to the victim
I have displayed help parameters
After downloading the tool and installing the necessary packages







Attacks

./tsunami -s 192.168.1.80 -p 100 -f recursive_dns.txt

-s = destination address
-p = request to be made by each DNS server (default 1)
-f = command to open the server list

After launching the attack, we listen to the packages coming through the wireshark in the virtual system that we attacked



give me one take ten :) 


www.berkdusunur.net
berkdusunurx@gmail.com

Wi-Fi DE-authentication Attack (Ağdan Düşürme Saldırıları)





     This article is broadcasting in turkish and english



Disconnecting can be done by sending De-authentication packets to a device connected to a network.

Bir ağa bağlı cihaza De-authentication paketleri göndererek bağlantı kesilebilir.


ATTACK | SALDIRI


Let's first find the networks that broadcast on the web

Öncelikle çevremizde yayın yapan ağları bulalım

Command airodump-ng wlan0  " 



My Target turktelekom_bd63

Benim Hedefim turktelekom_bd63


Let's first expthat broadcast in this address lore the mac addresses
(Bu acces pointe bağlı cihazların MAC adreslerini bulalım)

Command
airodump-ng -c 1 --bssid 98:DE:D0:47:B5:76 wlan0



sddsds
Target Mac Address 3C:A0:67:61:16:B7 

Destination MAC address belongs to Windows device


Hedef MAC adresi 3C:A0:67:61:16:B7

Hedef MAC adresi Windows cihaza ait 


Deauthentication Attacks

Command

aireplay-ng --deauth 2000 -a 98:DE:D0:47:B5:76 -c 3C:A0:67:61:16:B7 wlan0

--deauth number of packages
-a BSSID

-c Client  MAC

İnterface wlan0mon



At the same time, we can create  a loop with the parameter -0 0 

Aynı zamanda -0 0 parametresi ile döngü oluşturabiliriz.


Also, without using the -c parameter we can make a drop-off attack for all devices, not just for a device
Ayrıca -c parametresini kullanmadan yanlızca bir cihaza yönelik değil,tüm cihazlara yönelik bir ağdan düşürme saldırısı yapabiliriz.



İn monitor mode, let's look at the status of MAC addresses at these acces points

Monitor modda bu acces point deki MAC adreslerinin durumlarına bakalım. 




As you can see, the device with the target MAC address is trying to be dropped from the network.
       Görüldüğü gibi hedef MAC adresine sahip cihaz ağdan düşürülmeye                                                             çalışılıyor.


This assures that we have a handshake package that we will use to grab the handshake once the device is reconnected and to infiltrate the acces pointe.
        Bu saldırı cihaz tekrar bağlanınca handshake yakalayıp acces pointe sızmak için kullanacağımız bir handshake paketine sahip olmamızı sağlar.


Thank you for reading
www.berkdusunur.net
berkdusunurx@gmail.com

NTP AMPLIFICATION DDoS ATTACK


    

     NTP AMPLIFICATION DDoS ATTACK




DDoS Saldırıları

Standart DDoS saldırılarında amaç olabildiğince çok fazla sayıda sistem üzerinden hedef sistemlere belirli sayıda paket gönderimi yaparak devre dışı kalmasını sağlamaktır.

Amplification tipi saldırılarında ise trafik kapasitesi yüksek aracı sistemler kullanarak saldırgan sahip olduğu bandwidth miktarından çok daha fazlasını hedef sisteme yönlendirir.

2014 yılında NTP servisindeki monlist özelliğini istismar eden Amplification DDoS saldırısı 400 Gbps (2013 yılı Türkiye internet çıkışına yakın) civarında idi ve bu rakam dünyadaki en ciddi ddos saldırısı olarak tarihe geçmiştir.

NTP Nedir? Ne İşe Yarar?

NTP, zaman senkronize protokolüdür saati sorduğumuzda bize söyleyen bir servis.
Bu servis yardımı ile bilgisayarlar saatlerini eş zamanlayarak oluşabilecek zaman kayma problemlerini düzeltebilmekteler.

UDP/123 portundan çalışır.

Servis, sadece tanıdıklara saati söyleyebilecek şekilde ayarlanabilecek iken, sistem yöneticilerinin servisi standart ayarlarla kurması nedeniyle, dünya üzerinde her sorana saati söyleyebiliyorlar.

Bir NTP sunucusunun durumunu öğrenmek için aşağıdaki komut yeterli olacaktır.

“ ntpq –pn ”



Zaafiyet Neresinde ?
NTP Monlist Özelliği ve İstismarı
NTP sunucular, kendine daha önce sorgu yapan ip adreslerini bellekte tutar ve bunu aşşagıdaki sorgu ile öğrenmemize fırsat tanır.

ntpdc -n -c monlist xxx.xxx.xx.xx|more ”

NTP, UDP tabanlı olduğu için gönderilecek isteklerde kaynak ip adresi olarak ddos saldırısı gerçekleştirilmek istenen hedef verilirse saldırgan 10 Mbps ile 300 Mbps trafik üretebilir.
Bunun gibi 100lerce açık NTP sunucusu bularak yoğun bir trafik çıkartılıyor. Bu yükü’de hedef makineye yönlendiriyor.



Monlist Özelliği Aktif Sistemlerin Tespiti

Nmap’in “ntp monlist” scripti kullanarak bir ağdaki monlist özelliği aktif olan NTP sunucuları tespit edilebilir.



Komut

nmap -sU -pU:123 -Pn -n –script=ntp-monlist xxx.xxx.xx.xx





NTP DDoS SCRİPT


NTPDOS belirttiğimiz dizin altındaki zaafiyetli ntp servislerini kullanarak bu servisler üzerinden DDoS saldırısı yapıyor

Github depolarından “git clone https://github.com/vpnguy/ntpdos.gitkomudu ile çekiyoruz

Yardım parametlerini görüntülediğimizde aşşagıdaki gibi bir çıktı veriyor.

Gerekli parametreleri girdiğimiz takdirde NTP servisleri üzerinden servis dışı bırakma saldırısı yapıyor.


NTPDOS ARACI İLE NTP SALDIRILARI NASIL YAPILIR?

Ntpdos isimli toolumuz, gerekli kullanım yönergeleri izlendiğinde istediğimiz şekilde yani ntp üzerinden DDoS atakları gerçekleştirebiliyoruz.

İlk olarak yukarıda anlattığımız gibi monlist özelliği aktif olan ntp sunucularımızı buluyor ve bir dosyaya liste halinde kaydediyoruz.

Gerekli serverları bulmak için bir başka yöntem olarak shodan.io adlı search enginede “ntp port:123” aratarak çıkan serverları da bir liste halinde kaydedersek aynı şekilde bir serverlist elde etmiş oluruz.


Daha sonra ntpdos.py dosyamızı ihtiyacımız olan parametrelerle çalıştırıyoruz.

 

Sırasıyla Komutlar

- hedef ip
- ntp serverların listesinin bulunduğu dosya yolu
- thread sayısı (kaydettiğimiz server sayısından fazla olmamalı)


Şimdi örnek olması açısından biz bir saldırı gerçekleştirelim ve çalışıp çalışmadığını görelim:


 

Ctrl ­+ C komudu ile saldırıyı durdurduk

Neler Yaptık ?
Saldırmak istediğimiz ip adresini ilk parametre olarak ekledik. Daha sonra server listemizin yerini full path olarak belirttik.

En son olarak thread sayısını yani kaç parça kullanacağımızı, kaç serverı atak yaparken kullanacağımızı seçtik, enterladık.

Saldırımız sending yazısından itibaren başladı. Durdurmadığımız sürece saldırı işlemi devam edecektir.

Peki sadece ntpdos mu var?

Elbette hayır. Ntpdos ne kadar rahat kullanıma sahip olsa da alternatif olarak kullanabileceğimiz 2 adet daha araç bulunmakta:
-Saddam
-Ntpdoser


Saddam :
Saddam; Python 2.7 ile yazılmış, sadece ntp amplification değil aynı zamanda dns snmp ssdp amplification atakları da yapılabilen bir araçtır.


Ezber Değil Mantık!
Yaptığımız saldırıda tam olarak istekte bulunduğumuz ntp servislerinin bize döndürdükleri cevabı biz değil hedefe yönelttik.
Böylelikle NTP servislerinin monlist zafiyetini kullanarak hedefimizin bandwitchini doldurmaya yönelik bir DDoS saldırısı gerçekleştirdik

Not:
NTP Monlist özelliği, NTP 4.2.7 ve üzeri sürümlerde getirilen yama ile devredışı bırakılmıştır.