LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-23-2013, 06:16 PM   #1
mia_tech
Member
 
Registered: Dec 2007
Location: FL, USA
Distribution: CentOS 5.3, Ubuntu 9.04
Posts: 245

Rep: Reputation: 16
searching for iframe tags in a directory and subdirectories


guys, I have detected some malware on my site, so I made a local backup and I'm trying to use a command that search all php files for iframe tags containing especific links which have been reported to me....
I'm using

find . -name "*.php" -exec linkName '{}' ';'

however, this one outputs the iframe line, but not the filename or path... could someone shed some light on this... open to suggestions

thanks
 
Old 12-23-2013, 06:25 PM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Try
Code:
find `pwd` -iname "*.php" -exec grep <string> -Rl
 
Old 12-23-2013, 09:28 PM   #3
mia_tech
Member
 
Registered: Dec 2007
Location: FL, USA
Distribution: CentOS 5.3, Ubuntu 9.04
Posts: 245

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by Habitual View Post
Try
Code:
find `pwd` -iname "*.php" -exec grep <string> -Rl
I couldn't make your example print the path though...
 
Old 12-24-2013, 12:10 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
quick n dirty
Code:
grep -ir <string> *
 
Old 12-24-2013, 09:22 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by mia_tech View Post
I couldn't make your example print the path though...
you may have a find alias defined that pre-empts this command, so use
Quote:
Originally Posted by chrism01 View Post
quick n dirty
Code:
grep -ir <string> *
have a look at
http://blog.unmaskparasites.com/2009...idden-iframes/

or a search engine using
"find hidden iframes using grep"

https://www.linuxquestions.org/quest...5/#post5086418
You may not be using Wordpress but the scan links in that may show you more than you can find on your own.

Last edited by Habitual; 12-24-2013 at 09:23 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shotwell: Searching for an image with multiple tags leupi Linux - Software 5 08-17-2011 08:13 PM
[SOLVED] Find not searching subdirectories JosephS Linux - Software 6 07-12-2010 10:16 PM
searching with tags in digiKam leupi Linux - Software 3 12-28-2009 12:44 PM
A virus changed all my index files with iframe, how to remove that iframe line? Farman Linux - Security 10 07-16-2009 08:40 AM
searching a file in subdirectories with ls visitnag Linux - Newbie 4 04-23-2009 11:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration