LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-26-2013, 04:17 PM   #1
mia_tech
Member
 
Registered: Dec 2007
Location: FL, USA
Distribution: CentOS 5.3, Ubuntu 9.04
Posts: 245

Rep: Reputation: 16
how could I search my wordpress sql dump for ifames, xss, or malware


guys, after doing a sql dump of my wordpress db, I used
Code:
grep --color=auto -i iframe database.sql
to search for the insertion of iframes, but the whole database gets printed out, how could I use bash to search for iframes, xss, or malware in a sql dump database.

thanks
 
Old 12-27-2013, 04:34 AM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
I open mine in my favorite text editor and turn on word wrap and do an editor search for "iframe"
One possible reason your whole .sql gets printed is the "insert into" statement for any particular table is one-long (really long) single statement.

Using a text editor you can break it up visually (by using word wrap) and the search function.

https://www.linuxquestions.org/quest...5/#post5086418
are some great links for some online site scans.

What you should be asking is how did these iframes get there? If you know that, then you can prevent further tainting of your data.

have a read of this site, and particularly this article.

http://wordpress.org/support/topic/wordpress-hacked-5

Last edited by Habitual; 12-27-2013 at 06:17 AM.
 
Old 12-27-2013, 04:41 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
http://musicacivica.it/counter.php?id=3380767 found at http://sitecheck.sucuri.net/results/pctechtips.org
 
Old 12-27-2013, 08:55 AM   #4
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875
You get the whole database because grep returns the matching line which is the only line. If there's a row delimiter you could convert it to newlines before grep with something like sed. Or programmatically parse the database. Or other means depending on the size of the source material.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LXer: False Alarm: XSS Vulnerability in WordPress 3.2.1 LXer Syndicated Linux News 0 08-15-2011 12:50 PM
LXer: XSS Injection Vulnerability in WordPress 3.2.1 LXer Syndicated Linux News 0 08-14-2011 11:40 PM
LXer: Security gone awry: IE 8 XSS filter exposes sites to XSS attack LXer Syndicated Linux News 0 04-20-2010 06:42 AM
my sql to use less proecesses during a dump? z01krh Linux - Newbie 1 08-21-2009 02:25 PM
SQL: old sql dump not loading into new db BrianK Linux - Software 1 07-25-2006 11:55 PM

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

All times are GMT -5. The time now is 06:20 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