Posts Tagged: hidden iframes


12
Apr 09

Server side code cleaner in ASP.Net for iframe injection attack

My friend Niyaz was bugging me for a while now, asking me to write an asp.net code for removing malicious code from server side scripts hosted in web servers. The idea is to write an aspx page which when invoked will remove all the malicious code from all infected files in the server. This is much faster than removing the code from files via FTP or of course manually editing them. So here is the code: (CleanFiles.aspx.txt)  – rename it to CleanFiles.aspx

Make sure that your asp.net web application has enough privileges to modify the files on the web server.

And remember this code takes Location, Type of files you want to clean, a regular expression for matching and a replace string so that you can use this for any kind of cleaning activities. I will keep you posted on enhancements on the code. And let me know if you need any…