
Formazione sullo sfruttamento -- CVE-2013-2028: Buffer overflow basato su stack in Nginx
Questo repository contiene il codice sorgente di nginx 1.4.0 e binari precompilati (con e senza stack cookies). C'è anche un Vagrantfile per una configurazione rapida.
Annuncio e patch: http://mailman.nginx.org/pipermail/nginx-announce/2013/000112.html Analisi del bug: http://www.vnsecurity.net/research/2013/05/21/analysis-of-nginx-cve-2013-2028.html
vagrant up
vagrant ssh
sudo /vagrant/bin/nginx1
Nginx è esposto sulla porta 80 all'interno della VM e sulla porta 8080 all'esterno (sull'host).
# Dentro la VM
curl 127.0.0.1
# Fuori dalla VM
curl 127.0.0.1:8080
sudo gdb /vagrant/bin/nginx1
gdb> set follow-fork-mode child
gdb> r
Non è necessario farlo per sviluppare il tuo exploit, è più che altro per documentazione.
# Clona il repository
hg clone http://hg.nginx.org/nginx
# Vedi i tag
hg tags
# Checkout 1.4.0
hg up 7809529022b8
Senza stack cookies:
./auto/configure --without-http_rewrite_module --without-http_gzip_module
vim objs/Makefile
# Aggiungi '-fno-stack-protector' ai CFLAGS
make -j4
sudo make install
Con stack cookies:
./auto/configure --without-http_rewrite_module --without-http_gzip_module
make -j4
sudo make install
# Webroot in /usr/local/nginx/html/
sudo ./objs/nginx