XF 2.1 Server error log referencing old files? showthread.php, external.php

brunoa

Member
Hi, my server admin noticed some weird errors appearing in the server error log. I'm ignorant about this, but it seems like something is requesting a file and function from an old version of XF. We're using XF 2.1.0 but some old files where left in the directory after upgrading last year.

These are the errors (I've edit unnecessary server details). They're happening regularly, a few times every minute. My forum is very active.

Any clues about what's going on?

[Fri Jun 26 20:16:13.055528 2020] [php7:error] [pid 2366] [client XXXXX] PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /...myforumdirectory.../showthread.php:2\nStack trace:\n#0 {main}\n thrown in /...myforumdirectory.../showthread.php on line 2

If I remove the showthread file, the error changes to:

[Fri Jun 26 19:15:17.616593 2020] [php7:error] [pid 31682] [client XXXXX] script 'myforumdirectory/showthread.php' not found or unable to stat
[Fri Jun 26 19:18:11.607854 2020] [php7:error] [pid 31073] [client XXXXX] script 'myforumdirectory*/showthread.php' not found or unable to stat

This one related to external.php also appeared:

Fri Jun 26 20:13:11.900915 2020] [php7:error] [pid 2622] [client XXX] script 'myforumdirectory/external.php' not found or unable to stat
 
Solution
Do you have vBulletin redirects? If not that would explain it I think

See here:

brunoa

Member
those look like vBulletin files. probably spiders are trying to crawl old vB urls
but I might be totally wrong )
vBulletin? In this case the junk is older than I thought. We upgraded from vBulletin to XF in 2012, lol.

Well, if it's vBulletin it confirms my theory, but I still have no idea about where these request could be coming from. Seems to be requests from a machine judging by the frequency they appear in the error log.

Thanks!
 

Mr Lucky

Well-known member
Do you have vBulletin redirects? If not that would explain it I think

See here:

 
Last edited:
Solution

brunoa

Member
Do you have vBulletin redirects? If not that would explain it I think

See here:

Thanks for the reply. Was investigating but couldn't find any redirect on the server side or from XF itself. Actually, the showthread.php file doesn't seem related to vB but a script written by someone who speaks Portuguese (our site is in Brazil), judging by the choice of names for the functions.

I still have no idea what could be calling these functions though. At first, I suspected it could be something to generate a feed of our forum threads for our site, but there's no cron entry for this. For now, I renamed mysql to mysqli to avoid the fatal error, but something somewhere is still activating this script and I have no clue about where to look now, lol.

This is the file (edited the server info):

<?php
$conexao_xf = mysql_connect('FORUM SERVER', 'XXXX', 'XXXXX') or die("erro na conexao");
$banco_xf = mysql_select_db('XXXXX', $conexao_xf);
$query1 = 'SELECT new_id FROM archived_import_log3 WHERE content_type="thread" AND old_id="'.$_GET['t'].'"';
$resultado1 = mysqli_query($query1, $conexao_xf);
$item1 = mysqli_fetch_array($resultado1);
?>
<script language='JavaScript'>location.href='index.php?threads/.<?=$item1['new_id']?>/'</script>
 
Top