Michael Bevilacqua on 1 Jul 2009 15:12:19 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] add symlink to directory with find -name -exec {} \;


On Wed, Jul 1, 2009 at 4:39 PM, Michael Lazin <microlaser@gmail.com> wrote:
Hi, occasionally I find a vulnerable script that I disable with something like find -name script_name -exec chmod 200 {} \;

I was thinking it would be more friendly to the user to add a symlink to the affected directory to a php.ini with allow_url_fopen and register_globals off.  Can anyone think of a simple way to add a symlink to a directory a vulnerable file is in with find?

Not sure if this is what you are after. But this will find the script, chmod it, then link it to your home directory.  You can replace ~ with the user's home directory in this example.

find . -name script.txt -exec sh -c "chmod 200 {} && ln -s {} ~" \;


Hope this helps.


--
Michael D. Bevilacqua
michael@bevilacqua.us

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug