My Articlescript Site Was Hacked!

Discussion in 'HTML & Website Design' started by bschneider5, Nov 18, 2006.

  1. #1
    My site www.blog-hints.com was hacked, and I was able to repair some of the damage but I can't find the code for the remaining stuff (it's obvious)

    Here is the code, I can't tell what isn't normal. Any input would be appreciated!

    {if $smarty.get.act neq 'print'}
    {include file="header.tpl"}
    
    <br>
    
    <table class="my" cellspacing="1" cellpadding="0" height="100%" width="100%">
    <tr>
        <td width="170">
            <table class="my" height="100%" width="100%" cellspacing="0" cellpadding="0" style="border: 1px solid silver; border-top: 0; border-bottom: 0; border-left: 0;">    
                <tr class="search">
                    <td class="search" height="20">
                    <form action="{$smarty.server.SCRIPT_NAME}" method="get">
                        <span><strong>Search Blog Hints</strong></span><input name="action" value="search" type="hidden">
                        <div style="vertical-align: bottom;"><input type="text" name="key" class="text" style="width: 100px;" maxlength="64" value="{$key}">&nbsp;&nbsp;
                        <img src="{$smarty.const.DOC_ROOT}/images/search.gif" style="cursor: hand; border: 0px;" onClick="submit();"></div>
                    </form>
                    </td>
                </tr>
                {if $smarty.const.ENABLE_LEFT_CATEGORIES_MENU}
                <tr class="me">
                <th height="20" class="my" style="padding: 2px;">Blog Resources</th>
                </tr>
                <tr>
                   <td class="br" valign="top" style="padding-left: 0px;">
                <span><img src="{$smarty.const.DOC_ROOT}/images/M_black.gif" border="0"></span>
                        <span style="height: 15px;"><a href="http://www.bloglisting.net">&nbsp;Blog Directory</a></span><br>
                        <span><img src="{$smarty.const.DOC_ROOT}/images/M_black.gif" border="0"></span>
                        <span style="height: 15px;"><a href="http://www.bloglisting.net">&nbsp;Blog Forums</a></span><br>
                <span><img src="{$smarty.const.DOC_ROOT}/images/M_black.gif" border="0"></span>
                        <span style="height: 15px;"><a href="http://www.bloglisting.net">&nbsp;Blog</a></span>
                
                   </td>
                <tr>
                    <th height="20" class="my" style="padding: 2px;">Article Categories</th>
                </tr>    
                
                <tr>
                    <td class="cat" valign="top" style="padding-left: 0px;">
                    
                        <span><img src="{$smarty.const.DOC_ROOT}/images/M_red.gif" border="0"></span>
                        <span style="height: 15px;"><a href="../users">&nbsp;Submit Your Article</a></span>
                        <!--- <span><img src="{$smarty.const.DOC_ROOT}/images/M_purple.gif" border="0"></span>
                        <span style="height: 15px;"><a href="{$smarty.const.DOC_ROOT}/">&nbsp;Last Articles</a></span>
                         -->
                        {foreach item=item from=$categories}
                            <!--- <br>{$item[2]}<span><img src="{$smarty.const.DOC_ROOT}/images/M_purple.gif" border="0">&nbsp;</span>
                            <span style="height: 15px;">
                            <a href="{if $smarty.const.ENABLE_REWRITE eq 1}{$smarty.const.DOC_ROOT}{$item[1]}/page_1/
                            {else}index.php?page=1&category={$item[0]}{/if}">{$item[3]}</a></span>
                        {/foreach} --->
                    </td>
                    
                </tr>
                <tr class="me">
                <th height="20" class="my" style="padding: 2px;">Site Sponsors</th>
                </tr>
                <tr>
                   <td class="br" valign="top" style="padding-left: 0px;">
                
    <br>
                
                   </td>
                   <tr class="me">
                <th height="20" class="my" style="padding: 2px;">Featured Blogs</th>
                </tr>
                   <td class="blog" valign="top" style="padding-left: 0px;">
                <span><img src="{$smarty.const.DOC_ROOT}/images/M_bluedark.gif" border="0"></span>
                        <span style="height: 15px;"><a href="http://www.bloglisting.net">&nbsp;Bradsblog</a></span><br>
                        <span><img src="{$smarty.const.DOC_ROOT}/images/M_bluedark.gif" border="0"></span>
                        <span style="height: 15px;"><a href="http://www.bloglisting.net">&nbsp;Blog #2</a></span><br>
                <span><img src="{$smarty.const.DOC_ROOT}/images/M_bluedark.gif" border="0"></span>
                        <span style="height: 15px;"><a href="http://www.bloglisting.net">&nbsp;Blog #3</a></span>
                
                   </td>
                <tr>
            
    
                {/if}
                
                <tr class="me">
                <th height="20" class="my" style="padding: 2px;">Subscribe</th>
                </tr>
                    <td class="blog" align="center" valign="bottom" style="padding-bottom: 25px;">
                        {if $page neq 'article' and $page neq 'searchresult'}<a href="{$smarty.const.DOC_ROOT}/rss.php{if $category}?category={$category}{/if}">
                            <img src="{$smarty.const.DOC_ROOT}/images/xml.gif" border="0"></a><br><br>{/if}
            
                    </td>
                </tr>
                            
            </table>
        </td>
        <!------End sidebar area--->
        <td>
            <table class="my" height="100%" width="100%" cellspacing="0" cellpadding="0">
    
                {if $smarty.const.SHOW_CATEGORIES_PATH}
                <tr>
                    <td class="title" width="535" style="padding-left: 20px; height: 20px;">
                    <a href="{$smarty.const.DOC_ROOT}/">test</a>
                    </td>
                </tr>
                <tr>
                    <td class="title" width="535" style="padding-left: 20px; height: 20px;">
                    <a href="{$smarty.const.DOC_ROOT}/">Articles</a> {$folder_path}
                    </td>
                </tr>    
                
                {/if}
                {if  $page neq 'article' and $smarty.const.ENABLE_MAIN_CATEGORIES_MENU}
                <tr>
                    <th class="title" width="535" height="20" style="padding-top: 15px;">Categories</th>
                </tr>    
                <tr>
                    <td valign="top" width="535" height="20" style="padding-left: 20px; padding-top: 10px;">
                        {*foreach item=item from=$cats}
                            <a href="{if $smarty.const.ENABLE_REWRITE eq 1}{$smarty.const.DOC_ROOT}{$item[1]}/page_1/
                            {else}index.php?page=1&category={$item[0]}{/if}">{$item[3]}</a><br>
                        {/foreach*}    
                        {* Calculate the number of categories per row *}
                        {php}
                            $this->assign('cats_per_col', 6);
                        {/php}
                        <table height="100%" width="100%" cellspacing="0" cellpadding="0">
                        <tr>
                        {foreach name=cats item=item from=$cats}
                            {if $smarty.foreach.cats.iteration mod $cats_per_col eq 1}<td valign="top">{/if}
                            <a href="{if $smarty.const.ENABLE_REWRITE eq 1}{$smarty.const.DOC_ROOT}{$item[1]}/page_1/
                            {else}index.php?page=1&category={$item[0]}{/if}">{$item[3]}</a>
                            <br>
                            {if $smarty.foreach.cats.iteration mod $cats_per_col eq 0}</td>{/if}
                        {/foreach}        
                        </tr>
                        </table>
                    </td>
                </tr>
                {/if}
                <tr>
                <!---This starts the code for the "last articles page, which is the root--->
                {if $page eq last}
                
                <td><div class="open">When a blogger starts a blog for the first time, they normally get obsessed with it. 
                Many crave to learn more about what others were doing so that they can improve their own. 
                <p>
                This site contains many blog related articles that I hope you find useful. </p>
                <p>If you feel you can contribute by <a href="../users">submitting an article</a>, I'm sure many other bloggers would appreciate it and if accepted, will contain a live link to your blog or website.
                </p><p>
                If you find this site useful, please blog about it!</p><br>
                </div></td>
            
                
    </td>
                
    </tr>
    
                {/if}
                
                                <th class="title" width="535" height="20" style="padding-top: 15px;">
                     
                    
                    
                    {if $page eq 'article'}{$article[0]}
                    {elseif $page eq 'articles'}{$title}
                    {elseif $page eq 'last'}Here are the Last Articles
                    {elseif $page eq 'searchresult'}{$title}
                    {/if}
                    </th>
                </tr>    
                
                <tr>
            
                    <td class="my" valign="top" width="570" style="padding-left: 20px;">
                    {if $page eq 'articles'}
                        {foreach item=item from=$articles}
                            <br><a href="{if $smarty.const.ENABLE_REWRITE eq 1}{$item[0]}{$smarty.const.SUFIX}
                            {else}index.php?article={$item[0]}{/if}">{$item[1]}</a><br> {$item[2]} <br><br>
                        {/foreach}
                    {elseif $page eq 'searchresult'}
                        {foreach item=item from=$articles}
                            <br><a href="{if $smarty.const.ENABLE_REWRITE eq 1}{$item[1]}{$smarty.const.SUFIX}
                            {else}index.php?article={$item[0]}{/if}">{$item[2]}</a><br> {$item[3]} <br><br>
                        {/foreach}
                        {$worning}
                    {elseif $page eq 'article'}
                    <br>
            
                        <br>
                        {if $smarty.const.SHOW_AUTHORS_NAME}<div class="author"><b>Author:</b> {$article[2]}</div>{/if}
                        {if $smarty.const.SHOW_AUTHORS_WEBSITE}<div class="author"><b>Author's Website:</b> {$article[5]}</div>{/if}
                        {if $smarty.const.SHOW_DATE_ADDED}<div class="author"><b>Added:</b> {$article[3]}</div>{/if}
                        <br>
                        <div style="float:left; margin: 5px 5px 5px 5px;">
    <script language="JavaScript" type="text/javascript">
    <!--
    ctxt_ad_partner = "9969738870";
    ctxt_ad_section = "";
    ctxt_ad_bg = "";
    ctxt_ad_width = 250;
    ctxt_ad_height = 250;
    ctxt_ad_bc = "FFFFFF";
    ctxt_ad_cc = "FFFFFF";
    ctxt_ad_lc = "0000FF";
    ctxt_ad_tc = "000000";
    ctxt_ad_uc = "999999";
    // -->
    </script>
    <script language="JavaScript" src="http://ypn-js.overture.com/partner/js/ypn.js">
    </script> </div>{$article[1]}
                        <br>
                            
                        <br><div class="author">
                        <span><img src="{$smarty.const.DOC_ROOT}/images/printer.gif" border="0"></span>
                        <span style="height: 15px;"><a href="{if $smarty.const.ENABLE_REWRITE eq 1}{$smarty.const.DOC_ROOT}/print/{$article[4]}{$smarty.const.SUFIX}{else}{$smarty.server.REQUEST_URI}&act=print{/if}">&nbsp;Print Article</a></span>
                        {if $smarty.const.ENABLE_COMMENTS}&nbsp;&nbsp;&nbsp;
                        <span><img src="{$smarty.const.DOC_ROOT}/images/comment.gif" border="0"></span>
                        <span style="height: 15px;">&nbsp;<a href="{$smarty.const.DOC_ROOT}/comment.php?article={$article_id}">Add Comment</a></span>
                        {/if}
                        </div>
                        {if $smarty.const.ENABLE_COMMENTS}
                            <br>
                            <center><b>Comments</b></center><br>
                            {foreach item=item from=$comments}
                            <div class="author"><b>{$item[0]}</b></div>
                            <div class="author"><i>{$item[1]}</i></div>
                            {$item[2]}<br><br>
                            {/foreach}
                        {/if}
                    {elseif $page eq 'last'}
                        {foreach item=item from=$articles}
                            <br><a href="{if $smarty.const.ENABLE_REWRITE eq 1}{$item[0]}{$smarty.const.SUFIX}
                            {else}index.php?article={$item[0]}{/if}">{$item[1]}</a><br> {$item[2]} <br><br>
                        {/foreach}
                    {/if}
                    {if $pages and $page neq 'article'}
                    <br><br>
                        <table cellspacing="3" align="center">
                        <tr>
                            <td align="center" valign="middel">{$pages}</td>
                        </tr>
                        </table>
                    {/if}
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    </table>
    
    {include file="footer.tpl"}
    {else}
    
        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
        <html>
        <head>
            <title>{$title} :: {$smarty.const.SITE_TITLE}</title>
            <link rel="stylesheet" href="{$smarty.const.DOC_ROOT}/main.css" type="text/css">
            <link href="../main.css" rel="stylesheet" type="text/css">
        </head>
        <body bgcolor="#EEEEFF">
            <center><h2>{$article[0]}</h2></center>
            
            {if $smarty.const.SHOW_AUTHORS_NAME}<div class="author"><b>Author:</b> {$article[2]}</div>{/if}
            {if $smarty.const.SHOW_AUTHORS_WEBSITE}<div class="author"><b>Author's Website:</b> {$article[5]}</div>{/if}
            {if $smarty.const.SHOW_DATE_ADDED}<div class="author"><b>Added:</b> {$article[3]}</div>{/if}
            <br>
            <script type="text/javascript"><!--
    google_ad_client = "pub-1725522918851661";
    google_ad_width = 468;
    google_ad_height = 60;
    google_ad_format = "468x60_as";
    google_ad_type = "text_image";
    google_ad_channel ="5971287138";
    google_color_border = "336699";
    google_color_bg = "FFFFFF";
    google_color_link = "0000FF";
    google_color_text = "000000";
    google_color_url = "008000";
    //--></script>
    <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
            {$article[1]}
        </body>
        </html>
    
    {/if}
    
    Code (markup):
     
    bschneider5, Nov 18, 2006 IP
  2. webfinity

    webfinity Peon

    Messages:
    71
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It looks like the hack affected your database or includes.
     
    webfinity, Nov 18, 2006 IP
  3. bschneider5

    bschneider5 Active Member

    Messages:
    1,009
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    88
    #3
    Thanks, I restored an old database and am OK not. Thanks!
     
    bschneider5, Nov 18, 2006 IP
  4. ophir.oren

    ophir.oren Peon

    Messages:
    141
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    have you checked out the server logs? look for any errors there that my suggest someone that is trying to find a hole
     
    ophir.oren, Nov 19, 2006 IP
  5. thuonghieu

    thuonghieu Peon

    Messages:
    105
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Maybe Inclusion shell
     
    thuonghieu, Nov 22, 2006 IP