Web Hosting, Design, & Coding forum

General discussion

Web Malware Virus Code Decoded

Hello Guys,

Today Web virus are infecting our website by :
Js file by: <script Tags>
Html files by : <script tags> , <Iframe tag etc.
and php files by : some encoded eval code, actually these are the location where virus getting execute or php encoded is virus code which reside in our own files and spread to all folders.
I have decoded the virus encoded string and reverse the code virus and found actuall virus code, but now i need some more support and help to make proper antivirus or way to stop this virus activity by apache security or any other way.

lets see..
This is virus code always present in our php files.
Now Decoded by base64 then i got virus.. Wowwww

let guys start working on this ..... help us to secure web, below code is virus

function gtid1($s){
foreach($a[0]as $v)
if(preg_match_all('#<iframe ([^>]*?)src=[\'"]?(http:)?//([^>]*?)>#is',$s,$a))
if(preg_match('#[\. ]width\s*=\s*[\'"]?0*[0-9][\'"> ]|display\s*:\s*none#i',$v)&&!strstr($v,'?'.'>'))

function gtid12($a,$b,$c,$d){
$s[]=array($a=='default output handler'?false:$a);
echo $s[$i][1];


Please start working on this to stop virus.

Discussion is locked
You are posting a reply to: Web Malware Virus Code Decoded
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: Web Malware Virus Code Decoded
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Collapse -
Safeguard your own code...

In reply to: Web Malware Virus Code Decoded

When creating a website, application, etc, remember that ALL data received from outside your own environment may be malicious. That means never execute user-supplied code; immediately filter out/escape prohibited characters (for each respective language, in context) before manipulating, storing, or outputting user-supplied data (PHP-supplied functions, such as htmlentities(), are recommended); etc. Simply patching one exploit today does nothing to prevent a different exploit from being executed tomorrow; There is no substitute for good programming technique.


Collapse -
virus writting hardcode into files

In reply to: Safeguard your own code...

Hello John, Thanks for reply.
Yes its better way to escape strings of special charcter, but If you look into my given post virus executing our host server file and writting code into php/html/js files.
that code encoded by base64.
I have decoded and reviewed it and found that virus loaded into memory and using output buffer for storing its position.
Even i have removed all virus code from files and given 555 read and execute permission to files some time later again virus write its code into files. its wired how its writing in readonly file.
Another thing if we want to prevent execution of that function can we look for any htaccess method that can block a particular function to execute.
Like " gtid1 " and "gtid12" can stop to execute and remove from output buffer memory.

Collapse -
you are fixing wrong holes

In reply to: virus writting hardcode into files

sure, you can forbid execution of "gtid1", "gtid12" and "gtid999" funtions, but that will only save you from this particular parasite.

for better protection you should tighten filtration of all incoming data - and also check your ftp password Wink as it might have been stolen already.

Popular Forums

Computer Newbies 10,686 discussions
Computer Help 54,365 discussions
Laptops 21,181 discussions
Networking & Wireless 16,313 discussions
Phones 17,137 discussions
Security 31,287 discussions
TVs & Home Theaters 22,101 discussions
Windows 7 8,164 discussions
Windows 10 2,657 discussions


Enter to win* a free holiday tech gift!

CNET's giving five lucky winners the gift of their choice valued up to $250!