Topics

Blogger Tips and TricksLatest Tips And TricksBlogger Tricks

Thursday, February 3, 2011

What are DNS resolvers?

The client-side of the DNS is called a DNS resolver. It is responsible for initiating and sequencing the queries that ultimately lead to a full resolution (translation) of the resource sought, e.g., translation of a domain name into an IP address.

A DNS query may be either a non-recursive query or a recursive query:

    * A non-recursive query is one in which the DNS server provides a record for a domain for which it is authoritative itself, or it provides a partial result without querying other servers.
    * A recursive query is one for which the DNS server will fully answer the query (or give an error) by querying other name servers as needed. DNS servers are not required to support recursive queries.

The resolver, or another DNS server acting recursively on behalf of the resolver, negotiates use of recursive service using bits in the query headers.

Resolving usually entails iterating through several name servers to find the needed information. However, some resolvers function simplistically and can communicate only with a single name server. These simple resolvers (called "stub resolvers") rely on a recursive name server to perform the work of finding information for them Source wikipedia.

What are my DNS Records?

The Internet maintains two principal namespaces, the domain name hierarchy and the Internet Protocol (IP) address system. The Domain Name System maintains the domain namespace and provides translation services between these two namespaces. Internet name servers and a communication protocols implement the Domain Name System. A DNS name server is a server that stores the DNS records for a domain name, such as address (A) records, name server (NS) records, and mail exchanger (MX) records (see also List of DNS record types); a DNS name server responds with answers to queries against its database. Source Wikipedia

How to Fix Server Application Unavailable’ Error

Microsoft identified an issue with the MS03-32 Security Update for Internet Explorer security patch and ASP.NET 1.0 running on Windows XP. This patch can be installed manually or by obtaining recent critical updates from the Windows Update site.
The symptom of this issue is that after installing the patch on a Windows XP machine, all requests to ASP.NET applications running on the local IIS 5.1 web server result in an error message saying “Server Application Unavailable”. Requests to remote web servers are unaffected.
This issue only impacts installations running ASP.NET 1.0 on Windows XP. It does not impact machines running Windows 2000 or Windows Server 2003. It also does not impact machines running Windows XP with ASP.NET 1.1 installed.
Please note that this issue is not a security bug with ASP.NET. It does not open up or allow any malicious attacks against an ASP.NET application or server. Instead, it is purely a functional bug caused by the patch itself.
We are working hard on a permanent solution for this issue. In the meantime, you can execute the following batch file as a workaround for the issue. The batch file does the following:
  1. Stops the IIS and ASP.NET state services
  2. Deletes and recreates the ASPNET account with a known temporary password
  3. Uses the Windows runas command to launch an executable that creates an ASPNET user profile
  4. Re-registers ASP.NET. This creates a new random password for the account and applies default ASP.NET access control settings for it
  5. Restarts the IIS service
The batch file contains a hardcoded temporary password of “1pass@word” which you will be prompted to enter for the runas command when the batch file is run.  After the runas command completes, the ASPNET account password is recreated with a strong random value.  Note that the batch file may fail if the hardcoded password does not meet the password complexity requirements in your environment.  If that's the case, you can change it to another value that is appropriate for your environment.
Important note: If you have added custom access control settings or database account permissions for the ASPNET account, they will need to be recreated after this batch file completes.  This is because when the account is recreated, it will get a new security identifier (SID).
Important note: If you are running the ASP.NET worker process with a custom account other than the ASPNET account, then you should not run this batch file.  Instead, you should log in interactively or use the runas command with that account which will create a user profile for that account.
The batch file is included in the self-extracting archive below. To use it:
  1. You must be running as an account with Administrator privileges
  2. Download and open the self-extracting executable file
  3. Extract the contents to c:\
  4. Select Run... from the start menu, and enter cmd.exe
  5. In the open command windows, type c:\fixup.cmd.
  6. When prompted, enter 1pass@word as the password.
  7. If you have previously custom access control settings or database account permissions for the ASPNET account, you'll need to re-apply these settings now.
Many apologies for the inconvenience that this has caused. We’ll post additional information as it becomes available.
The matrix below details platforms and versions impacted by this issue.
.NET Framework Platform Affected
Version 1.0 Windows 2000 Professional No
Version 1.0 Windows 2000 Server No
Version 1.0 Windows XP Professional Yes
Version 1.0 Windows Server 2003 No
Version 1.0 Windows XP Home with Cassini No
Version 1.1 Windows 2000 Professional No
Version 1.1 Windows 2000 Server No
Version 1.1 Windows XP Professional No
Version 1.1 Windows Server 2003 No
Version 1.1 Windows XP Home with Cassini No
Thanks,
The ASP.NET Team Source ASP.NET

Wednesday, February 2, 2011

how to stop php nobody spammers

Today I will guide you how to  stop php nobody spammers , Its a very very host issue faced by Web hosting Linux System Administrator

PHP and Apache has a history of not being able to track which users are sending out mail through the PHP mail function from the nobody user causing leaks in formmail scripts and malicious users to spam from your server without you knowing who or where.

Stop PHP nobody Spammers

Update: May 25, 2005:
- Added Logrotation details
- Added Sample Log Output

PHP and Apache has a history of not being able to track which users are sending out mail through the PHP mail function from the nobody user causing leaks in formmail scripts and malicious users to spam from your server without you knowing who or where.

Watching your exim_mainlog doesn't exactly help, you see th email going out but you can't track from which user or script is sending it. This is a quick and dirty way to get around the nobody spam problem on your Linux server.

If you check out your PHP.ini file you'll notice that your mail program is set to: /usr/sbin/sendmail and 99.99% of PHP scripts will just use the built in mail(); function for PHP - so everything will go through /usr/sbin/sendmail =)

Requirements:
We assume you're using Apache 1.3x, PHP 4.3x and Exim. This may work on other systems but we're only tested it on a Cpanel/WHM Red Hat Enterprise system.

Time:
10 Minutes, Root access required.

Step 1)
Login to your server and su - to root.

Step 2)
Turn off exim while we do this so it doesn't freak out.
/etc/init.d/exim stop

Step 3)
Backup your original /usr/sbin/sendmail file. On systems using Exim MTA, the sendmail file is just basically a pointer to Exim itself.
mv /usr/sbin/sendmail /usr/sbin/sendmail.hidden

Step 4)
Create the spam monitoring script for the new sendmail.
pico /usr/sbin/sendmail

Paste in the following:


#!/usr/local/bin/perl

# use strict;
 use Env;
 my $date = `date`;
 chomp $date;
 open (INFO, ">>/var/log/spam_log") || die "Failed to open file ::$!";
 my $uid = $>;
 my @info = getpwuid($uid);
 if($REMOTE_ADDR) {
         print INFO "$date - $REMOTE_ADDR ran $SCRIPT_NAME at $SERVER_NAME n";
 }
 else {

        print INFO "$date - $PWD -  @infon";

 }
 my $mailprog = '/usr/sbin/sendmail.hidden';
 foreach  (@ARGV) {
         $arg="$arg" . " $_";
 }

 open (MAIL,"|$mailprog $arg") || die "cannot open $mailprog: $!n";
 while (<STDIN> ) {
         print MAIL;
 }
 close (INFO);
 close (MAIL);


Step 5)
Change the new sendmail permissions
chmod +x /usr/sbin/sendmail

Step 6)
Create a new log file to keep a history of all mail going out of the server using web scripts
touch /var/log/spam_log

chmod 0777 /var/log/spam_log

Step 7)
Start Exim up again.
/etc/init.d/exim start

Step 8)
Monitor your spam_log file for spam, try using any formmail or script that uses a mail function - a message board, a contact script.
tail - f /var/log/spam_log

Sample Log Output

Mon Apr 11 07:12:21 EDT 2005 - /home/username/public_html/directory/subdirectory -  nobody x 99 99   Nobody / /sbin/nologin

Log Rotation Details
Your spam_log file isn't set to be rotated so it might get to be very large quickly. Keep an eye on it and consider adding it to your logrotation.

pico /etc/logrotate.conf

FIND:
# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
    monthly
    create 0664 root utmp
    rotate 1
}

ADD BELOW:

# SPAM LOG rotation
/var/log/spam_log {
    monthly
    create 0777 root root
    rotate 1
}



Notes:
You may also want to chattr + i /usr/sbin/sendmail so it doesn't get overwritten.

Enjoy knowing you can see nobody is actually somebody =)

Thanks to MattF and others who worked on this.

cheap web hosting in canada price detail of toonie web hosting

Toonie web hosting  the customer, the highest quality Web Hosting at unbelievable low costs. All of our cheap web hosting accounts are fast, reliable, and secure. Connected to our redundant multi network infrastructure and great technical support. Why should YOU pay more for web hosting when you just don't have to! With ToonieHosting.ca, YOU only pay for what you need. Many clients have asked for a web hosting package that will give them what they really need without all the FLASHY glitz and extras which they do not need. Well we listened to YOU, the customer, and here it is. Don't see something you need, please Contact Us and we will see what we can do to get it online for you. Quite a few hosting companies out there advertise UNLIMITED bandwidth and web space but if you read the Terms of Service, you will see they truly limit your site and will suspend you account if your popular. Here at tooniehosting.ca, we don't!
Cost per Month (CAD)     $1.00     $2.00     $5.00     $10.00
    Disk Storage     200 MB     500 MB     1000 MB     2500 MB
?     Monthly Bandwidth Allowance     4 GB     10 GB     40 GB     60 GB
Domains and Subdomains     Loonie     Toonie     Five Buck     Ten Buck
?     International Domains     Yes     Yes     Yes     Yes
?     Add-on Domains     0     0     3     10
?     Sub-Domains     0     5     25     60
Email Features     Loonie     Toonie     Five Buck     Ten Buck
?     POP3 E-mail Accounts     5     20     50     100
?     Web-Based E-mail Interface     No     Yes     Yes     Yes
?     Unlimited E-mail Aliasing     Unlimited     Unlimited     Unlimited     Unlimited
?     Unlimited E-mail Forwarding     Yes     Yes     Yes     Yes
    Unlimited E-mail Autoresponders     No     Yes     Yes     Yes
?     Catch-all E-mail Enabled     Yes     Yes     Yes     Yes
Supported Software     Loonie     Toonie     Five Buck     Ten Buck
    Flash Support     Yes     Yes     Yes     Yes
    Java Support     Yes     Yes     Yes     Yes
    Support for JavaScript     Yes     Yes     Yes     Yes
    Support for Imagemaps     Yes     Yes     Yes     Yes
    Wireless Application Protocol (WAP)     Yes     Yes     Yes     Yes
    Adobe Pagemill     Yes     Yes     Yes     Yes
    Macromedia Dreamweaver     Yes     Yes     Yes     Yes
    Microsoft Office     Yes     Yes     Yes     Yes
    Microsoft Publisher     Yes     Yes     Yes     Yes
    PHP 5.*     PHP 4     Yes     Yes     Yes
?     WordPress.org     Yes     Yes     Yes     Yes
?     drupal.org     Yes     Yes     Yes     Yes
Advanced Features     Loonie     Toonie     Five Buck     Ten Buck
    CGI-BIN Directory     Yes     Yes     Yes     Yes
    Perl 5.8.8 plus modules     Yes     Yes     Yes     Yes
    .htaccess     Yes     Yes     Yes     Yes
    PHP 5     Yes     Yes     Yes     Yes
    Custom Error Pages     Yes     Yes     Yes     Yes
    Password Protected Directories     Yes     Yes     Yes     Yes
    Server Side Includes     Yes     Yes     Yes     Yes
    MySQL Database(s)     1     5     Unlimited     Unlimited
    phpMyAdmin (Web Based MySQL)     Yes     Yes     Yes     Yes
    URL Redirection     Yes     Yes     Yes     Yes
?     DNS Management     Yes     Yes     Yes     Yes
?     Route Email to Gmail     Yes     Yes     Yes     Yes
Website Management     Loonie     Toonie     Five Buck     Ten Buck
?     Parallels Pro Control Panel     Yes     Yes     Yes     Yes
?     Web Based File Manager     Yes     Yes     Yes     Yes
    Unlimited FTP access     Yes     Yes     Yes     Yes
?     User Agent and Referrer Logs     Yes     Yes     Yes     Yes
    Error Logs     Yes     Yes     Yes     Yes
    Access to Raw Log Files     Yes     Yes     Yes     Yes
?     Disk Usage Details     Yes     Yes     Yes     Yes
    Bandwidth Usage Details     Yes     Yes     Yes     Yes
    Detailed Graphical Site Statistics     No     Yes     Yes     Yes
Network Features     Loonie     Toonie     Five Buck     Ten Buck
    Linux Operating System     Yes     Yes     Yes     Yes
    Apache Web Server     Yes     Yes     Yes     Yes
    Multi-homed network connectivity     Yes     Yes     Yes     Yes
    Environmental conditioning for hardware reliability     Yes     Yes     Yes     Yes
    Full power conditioning and backup     Yes     Yes     Yes     Yes
    Firewalls and other security measures for virtual security     Yes     Yes     Yes     Yes
    Controlled access for physical security     Yes     Yes     Yes     Yes
    24/7/365 monitoring for peace of mind     Yes     Yes     Yes     Yes
?     Daily backups for data recovery     Yes     Yes     Yes     Yes
Technical Support     Loonie     Toonie     Five Buck     Ten Buck
?     Unlimited 24/7 technical support     Yes     Yes     Yes     Yes
Payment Terms     Loonie     Toonie     Five Buck     Ten Buck
One-time setup fee     $0     $0     $0     $0
Monthly fee (prepaid 12 months)     $1.00/mo.     $2.00/mo.     $5.00/mo.     $10.00/mo.
Bandwidth Overage (per GB)     $1     $1     $1     $1
30-day Money Back Guarantee     Yes     Yes     Yes     Yes