Showing posts with label cool security tricks. Show all posts
Showing posts with label cool security tricks. Show all posts

Sunday, 1 December 2013

NEW JAVA-SCRIPT NAME,E-MAIL & NUMBER VALIDATION

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
    <script language="javascript">
        var flag = 0;
    function username()
        {
            document.form1.usern.value = document.form1.fname.value + "  "
                                +document.form1.lname.value;
        }
        function validation()
            {
                if(document.form1.fname.value=="") FOR NULL VALUE
                    {
                        alert("Plz Enter First Name");
                        document.form1.fname.focus();
                        return false;
                    }
                if(document.form1.fname.value.length <=5 || document.form1.fname.value.length>=10) FOR LENGTH YOU WANT TO ENTER 
                    {
                        alert("Plz Enter Min 6 Character");
                        document.form1.fname.focus();
                        return false;
                    }
                if(document.form1.lname.value=="")
                    {
                        alert("Plz Enter Last Name");
                        document.form1.lname.focus();
                        return false;
                    }
                if(document.form1.pass.value=="" || document.form1.pass.value.length<=5)
                    {
                        alert("Plz Enter Min 6 Numbers");
                        document.form1.pass.focus();
                        return false;
                    }
                if(isNaN(document.form1.pass.value))
                    {
                        alert("Plz Enter Numbers Only");
                        document.form1.pass.focus();
                        return false;
                    }
                if(isNaN(document.form1.pass.value)) FOR NUMBERS ONLY
                    {
                        alert("Plz Enter Numbers Only");
                        document.form1.pass.focus();
                        return false;
                    }
                if(document.form1.repass.value!=document.form1.pass.value)
                    {
                        alert("Password Not Matched");
                        document.form1.repass.focus();
                        return false;
                    }
                for(var i=0;i<2;i++)
                    {
                        if(document.form1.r1[i].checked)
                            {
                                flag=1;
                            }
                    }
                if(flag==0)
                    {
                        alert("Plz select Gender");
                        document.form1.r1[0].focus();
                        return false;
                    }

                    var x=document.forms["form1"]["email"].value;
                    var atpos=x.indexOf("@");
                    var dotpos=x.lastIndexOf(".");
                    if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) FOR E-MAIL
                        {
                            alert("Please enter an exact email address." + document.form1.email.value + "  is invalid.");
                            document.form1.email.focus();
                            return false;
                        }
                if(isNaN(document.form1.cont.value))
                    {
                        alert("Plz Enter Numbers Only");
                        document.form1.pass.focus();
                        return false;
                    }
                if(document.form1.cont.value.length <=9 || document.form1.cont.value=="" || document.form1.cont.value.length >10)
                    {
                        alert("Mobile Number Must be 10 Digit");
                        document.form1.cont.focus();
                        return false;
                    }
            }
    </script>
</head>

<body>
<form id="form1" name="form1" method="post" action="">
  <table width="500" border="0" cellspacing="5" cellpadding="5" align="center">
    <tr>
            <th colspan="2">Sign Up</th>
    </tr>
    <tr>
      <td>First Name</td>
      <td><input type="text" name="fname" id="fname" /></td>
    </tr>
    <tr>
      <td>Last Name</td>
      <td><input type="text" name="lname" id="lname" /></td>
    </tr>
    <tr>
      <td>User Name</td>
      <td><input type="text" name="usern" id="usern" onblur="username()" /></td>
    </tr>
    <tr>
      <td>Password</td>
      <td><input type="password" name="pass" id="pass" /></td>
    </tr>
    <tr>
      <td>Re-Enter Password</td>
      <td><input type="password" name="repass" id="repass" /></td>
    </tr>
    <tr>
      <td>Sex</td>
      <td><input type="radio" name="r1" id="r1" value="Male" />
      Male
        <input type="radio" name="r1" id="r1" value="Female" />
      Female</td>
    </tr>
    <tr>
      <td>E-Mail</td>
      <td><input type="text" name="email" id="email" /></td>
    </tr>
    <tr>
      <td>Contact No.</td>
      <td><input type="text" name="cont" id="cont" /></td>
    </tr>
    <tr>
        <td><input type="submit" name="button" id="button" value="Submit" onclick="return validation()"/></td>
        <td><input type="reset" name="button2" id="button2" value="Reset" /></td>
    </tr>
  </table>
</form>
</body>
</html>

Saturday, 23 November 2013

LOGIN WITHOUT PASSWORD IN LINUX



                                    LOGIN WITHOUT PASSWORD



We normally login as

Login :root
Passwd ----------

]#


But to login without password
[there is a file in a [/etc/passwd] this file conatain all the password informations for all the users. Open the file that contain a [X] follow by the user name like [root:x:0:0: ] simply delete the [X] carefully and it will not ask for the password but when we reassign the password for the user this [x] will come back again to its position.

So by deletion the [X] for the particular user you can loginby that user without enter a password.


Now how to do_________________________________________________________

#vi /etc/passwd

   root:x:0:0:root:/root:/bin:.bash


Delete this x only and the following appears

root::0:0:root:/root:/bin:.bash



:wq! __________ save n exit

Now you can login the root without a password

Login : root

]#


Now if you make more users then to check there entries in the [passwd] file
Press [shift+g] to go to bottom.

Friday, 22 November 2013

JAVA SCRIPT VALIDATION & COMPARE USERNAME & PASSWORD by jaggikhanna


JAVA SCRIPT SPECIAL CHARCTER VALIDATION, COMPARE USERNAME & PASSWORD by jaggikhanna

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
    <script language="javascript">
        function validation()
            {
                if(document.form1.user.value=="")/*For blank*/
                    {
                        alert("Plz Enter A User Name");
                        document.form1.user.focus();
                        return false();
                    }
                var iChars = "!@#$%^&*()+=-[]/';,./{}|\":<>?";         /*For sapcile charter*/
                for (var i = 0; i < document.form1.user.value.length; i++)                                       
                    {
                        if (iChars.indexOf(document.form1.user.value.charAt(i)) != -1)
                            {
                                alert ("Your username has special characters. \nThese are not allowed.\n Please remove them and try again.");
                                return false;
                            }
                    }

                if(isNaN(document.form1.pass.value))
                    {
                        alert("Plz Enter Numbers Only");
                        document.form1.pass.focus();
                        return false;
                    }
                if(document.form1.user.value=="jaggikhanna" && document.form1.pass.value=="123456")          FOR USERNAME & PASSWORD COMPARE
                    {
                        window.open("FILE YOU WANT TO OPEN")
                    }
                else
                    {
                        alert("Invalid Username Or Password");
                        document.form1.user.focus();
                        document.form1.user.onreset();
                        return false;
                    }
            }
    </script>
</head>

<body>
    <form id="form1" name="form1" method="post" action="">
         <table width="400" border="0" cellspacing="5" cellpadding="5" align="center">
          <tr>
            <th colspan="2">Login</th>
         </tr>
          <tr>
            <td>User Name</td>
            <td><input type="text" name="user" id="user" /></td>
          </tr>
          <tr>
            <td>Password</td>
            <td><input type="password" name="pass" id="pass" /></td>
          </tr>
          <tr>
            <td><input type="submit" name="button" id="button" value="Submit" onclick="return validation()" /></td>
            <td><input type="reset" name="button2" id="button2" value="Reset" /></td>
          </tr>
        </table>
    </form>
</body>
</html>

HOW TO CONFIGUR SAMBA SERVER IN RHEL6



HOW TO CONFIGUR SAMBA SERVER IN RHEL6

SAMBA SERVER :-
                                  To communicate with the Windows system .
# rpm –qa samba *
# cd / etc / samba / smb.conf
# cp smb.conf smb.conf.old
# vi smb.conf
Change in the line number 18  : workgroup = abc
In line number 53 : security = user
Last lines : (xyz)  Path = / root / abc
Writable = Yes
Browsable = Yes , Read only = No
Guest = OK
#useradd abc
#passwd ……
#samba add user root : root
#passwd ……..
#service smb restart
#service network restart
#chk config IP tables off
#test parm (to see the contents of Samba)