For more details: http://blog.svnlabs.com/tag/rtmpchecker/
Category Archives: Linux
How to clean malware from website?
Malware, short for malicious software, is a software designed to secretly access a computer system without the owner’s informed consent. The expression is a general term used by computer professionals to mean a variety of forms of hostile, intrusive, or annoying software or program code.

You have seen above warning many times when you want to browse website using web browsers. This is the warning from search engine bots like Google for website is affected from malwares or viruses. If you still want to access website, it can affect your system or system resources.
Most of times websites are hacked or unauthorized accessed from hackers or cross-site scripting (XSS) or cross-site request forgeries (CSRF).
There may be lot of “holes” in website security that invite hackers to play their game.
The possible HOLES may be:
1. File/Folder permissions
2. Poor authentication for application
3. Cross-Site Scripting
4. Cross-Site Request Forgeries
5. Anti-Virus Software
6. File formats
7. Network “Firewalls/Filters”
8. Shell access & Logs
Please check some link to make web application secure and safe ![]()
* http://advosys.ca/papers/web/61-web-security.html
* http://www.claymania.com/safe-hex.html
* http://shiflett.org/articles/foiling-cross-site-attacks
* http://www.ehow.com/how_6804695_remove-malware-website.html
* http://smackdown.blogsblogsblogs.com/2008/06/24/how-to-completely-clean-your-hacked-wordpress-installation/
You can review online Virus & Threat Scanner for cleaning malwares & viruses. These softwares are designed to run on your web server and scan your public web files for malicious code.
Google Safe Browsing Tool
http://www.google.com/safebrowsing/diagnostic?site=yoursite.com
Norton Safe Web
You can search for more tools like…
“Security Pro | SiteMonitor | IP trap | htaccess | AntiXSS | Check Permissions | KISS FileSafe“
If you are running PHP website under Apache & MySQL, make sure file and folder should not be access public. You have to check PHP function’s security for more secure access.
PHP Functions may be used in hacking:
1. file_get_contents()
2. base64_decode()
3. eval()
4. exec()
5. preg_match()
6. gzuncompress()
7. urldecode()
8. error_reporting()
9. shell_exec()
10. setcookie()
11. chmod()
12. is_writable()
13. move_uploaded_file() and copy()
The above functions can be used by hackers to write malicious code to your files. The malicious code executed using eval() that will execute every run of website. So, disable eval(), file_put_contents(), file_get_contents(), exec() etc. You can check safe_mode in php.ini for disabling shell access
Most of the time websites are hacked using file_get_contents(), eval(base64_decode()), urldecode(), include() or iframes.
You can search infected file on web server “/var/www/” using below command:
# grep -iR ‘eval(base64_decode(‘ /web-root
# grep -iR ‘ # grep -iR ‘urldecode(‘ /web-root
# grep -iR ‘file_get_contents(‘ /web-root
# grep -iR ‘exec(‘ /web-root
As soon as infection found, you have to backup all application running on web server, now you have to remove infected files manually or using scanner.
Now all up to you how you can manage your web server more securely…
I’ve found that luck is quite predictable. If you want more luck, take more chances. Be more active. Show up more often.
Recursive Replace in Files Folders
Hello Friends,
Some time we want to change branding of web based softwares. Open source web based software have GNU License. We can modify the code and launch versions. We can use PERL (Perl is a highly capable, feature-rich programming language with over 22 years of development.)
Here are some basic steps to Recursive Replace Rename Files, Variables, Folder Name etc.
Let you have a project in folder "/root/svnlabs"
To replace search string in all filename and foldernames recursively # chmod a+x ./RecursiveRegexpRename.pl # perl RecursiveRegexpRename.pl -m g 'search_text' 'replace_text' # chmod a+x ./SearchAndReplaceInMultipleFiles.pl # perl SearchAndReplaceInMultipleFiles.pl -m g 'Search' 'Replace' # grep -iRl 'Search' /root/svnlabs (Now search in your project) If you would hit the mark, you must aim a little above it![]()
Block badAgents on site
PHP is very powerful language to block bad agents. Below is the code to avoid webspider using PHP in_array().
$badAgents = array(‘Acunetix Web Vulnerability Scanner’, ‘Bot\ mailto:craftbot@yahoo.com’, ‘ChinaClaw’, ‘Custo’, ‘DISCo’, ‘Download\ Demon’, ‘eCatch’, ‘EirGrabber’, ‘EmailSiphon’, ‘EmailWolf’, ‘Express\ WebPictures’, ‘ExtractorPro’, ‘EyeNetIE’, ‘FlashGet’, ‘GetRight’, ‘GetWeb!’, ‘Go!Zilla’, ‘Go-Ahead-Got-It’, ‘GrabNet’, ‘Grafula’, ‘HMView’, ‘HTTrack’, ‘Image\ Stripper’, ‘Image\ Sucker’, ‘Indy\ Library’, ‘InterGET’, ‘Internet\ Ninja’, ‘JetCar’, ‘JOC\ Web\ Spider’, ‘larbin’, ‘LeechFTP’, ‘Mass\ Downloader’, ‘MIDown\ tool’, ‘Mister\ PiX’, ‘Navroad’, ‘NearSite’, ‘NetAnts’, ‘NetSpider’, ‘Net\ Vampire’, ‘NetZIP’, ‘Octopus’, ‘Offline\ Explorer’, ‘Offline\ Navigator’, ‘PageGrabber’, ‘Papa\ Foto’, ‘pavuk’, ‘pcBrowser’, ‘RealDownload’, ‘ReGet’, ‘SiteSnagger’, ‘SmartDownload’, ‘SuperBot’, ‘SuperHTTP’, ‘Surfbot’, ‘tAkeOut’, ‘Teleport\ Pro’, ‘VoidEYE’, ‘Web\ Image\ Collector’, ‘Web\ Sucker’, ‘WebAuto’, ‘WebCopier’, ‘WebFetch’, ‘WebGo\ IS’, ‘WebLeacher’, ‘WebReaper’, ‘WebSauger’, ‘Website\ eXtractor’, ‘Website\ Quester’, ‘WebStripper’, ‘WebWhacker’, ‘WebZIP’, ‘Wget’, ‘Widow’, ‘WWWOFFLE’, ‘Xaldon\ WebSpider’, ‘Zeus’);
if(in_array($_SERVER['HTTP_USER_AGENT'],$badAgents)) {
exit();
}
?>
UTF-8 FTP Tools
FTP Tools / Clients are most useful for transferring files and data to server.
There are many FTP clients used in File Transfer, please use wikipedia.org for more details…
http://en.wikipedia.org/wiki/Comparison_of_FTP_client_software
Some time file transfer is not secure and reliable using various tools, file become corrupted or some special characters added to files.
You have to use UTF8 encoding while files transfer. Only some FTP tools use UTF8 encoding while uploading and downloading files.
To remove special chars from live sites, you have to use UTF8 based FTP tools.
http://www.pureftpd.org/project/pure-ftpd
http://winscp.net/forum/viewtopic.php?t=7078

FileZilla now have UTF8 support. So, next time while you are creating webpages in different languages; you can use UTF-8 based FTP tools to avoid characters problems
Open source – Port25
If you have trouble getting the PHP’s mail() function to work on your server.
If the function returned true, but never send the emails to target account.
Some ISP’s block port 25 (mail port), so you can’t send directly but you can send indirectly using your ISP’s mail server.
Many email providers keep lists of IP addresses and block incoming mail, or move it immediately to a junk/spam folder.
There are some Open Source solutions to filter your mail problems..
You can check Open Source MTA here http://en.wikipedia.org/wiki/Comparison_of_mail_servers
Here list some MTAs as
- postfix
- qmail
- exim
- sendmail
Above MTA don’t handle integrated reporting, bounce management, and spam management, reporting.
PowerMTA: PowerMTA (this is not open source) provides the unique features and capabilities required by email service providers and enterprises to maximize the effectiveness of email marketing and customer communications, handle integrated reporting, bounce management, and spam management, reporting etc.
http://www.port25.com/products/prod_features.html
Install geoip on xampp
Geocoding (finding latitude/longitude for street addresses), Geotagging (tagging media with latitude/longitude coordinates), and Geolocation (finding latitude/longitude of computer with IP X-Forwarded-For). There are some options to install on linux environment:
# wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
# gunzip GeoLiteCity.dat.gz
# sudo mkdir -v /usr/share/GeoIP
# sudo mv -v GeoLiteCity.dat /usr/share/GeoIP/GeoIPCity.dat
Install geoip with php5
# sudo apt-get install php5-geoip (ubuntu)
# sudo yum install php5-geoip (centOS)
# sudo pecl install geoip (with PECL)
In Windows environment we have to add extension “php_geoip.dll” with PHP
Download extension from here : http://blog.svnlabs.com/php-5.2.1_geoip-w32.zip
Copy “php_geoip.dll” to xampp “php/ext” .. add a line in php.ini
“extension=php_geoip.dll” and restart xampp
This extension will work on development system using Windows, Apache 2.2.3 and PHP 5.2.10. check “geoip” with phpinfo() module is loaded.
We can

<?php
$record = geoip_record_by_name('www.svnlabs.com');
if ($record) {
print_r($record);
}
?>
Array
(
[country_code] => US
[region] => CA
[city] => Marina...
[postal_code] =>
[latitude] => 23.9776792798
[longitude] => -128.435796741
[dma_code] => 867
[area_code] => 400
)
<?php
$result = geoip_record_by_name('78.aaa.yyy.xxx');
var_dump($result);
?>
There is alternative PHP version of the GeoIP API from MaxMind,
but this solution is quite slow on servers. MaxMind uses MaxMind database to display geo locations.




