Technical Knowledge

technical knowledge is that type of blogger in which you can find all the soluctions of your problems which you cannot solve you can see the video given on this blog and solve your problem by yourself.

Like us on Facebook

Technical Knowledge
Showing posts with label Password. Show all posts
Showing posts with label Password. Show all posts

Sunday, March 29, 2015

Starting second activity based on login and password details: Android tutorial

Program description:

Starting second activity based on the login and password credentials given in first activity.

First activity will have 2 edit texts and 1 button. User will be prompted to enter user name in edit text1, and enter password in edit text2.

if user id is "techpalle" and password is"1234", then it will start second activity and pass the uid entered by user to second screen using explicit intent.

If user enters user id, and password wrong, then a toast message will be displayed, content of edit text 1 and edit text 2 will be cleared and automatically control will be moved to edit text1 to make user comfortable.


Once second activity is started, it takes the data passed from first activity and displays in a text view. This data passing between activities will be done by using putExtra() method.


Note: If user fails to enter user name or password correctly for 3 times, then main activity will be closed by using finish() method.


First Activity                                       First Activity (when pw is wrong)

 

First Activity (when pw is correct)          Second Activity

 


First Activity 
package com.techpalle.b15_assignment;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends Activity {
EditText e,f;
Button b;
TextView tv;
Integer cnt = 0;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
e = (EditText) findViewById(R.id.editText1);
f = (EditText) findViewById(R.id.editText2);
b = (Button) findViewById(R.id.button1);
tv = (TextView) findViewById(R.id.textView1);
tv.setText(tv.getText().toString()+ cnt.toString());

b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
String uid = e.getText().toString();
String pw = f.getText().toString();
boolean bu = uid.equals("techpalle");
boolean bp = pw.equals("1234");

if(bu && bp){
Intent in = new Intent(getApplicationContext(),
SecondScreen.class);
in.putExtra("uid", uid);
cnt = 0;
startActivity(in);
}else if(bu == false && bp == false){
Toast.makeText(getApplicationContext(),
"uid & pw wrong..try again", 0).show();
cnt++;
tv.setText("No of tries: "+cnt);
e.setText("");
f.setText("");
e.requestFocus();
}else if(bu == false){
Toast.makeText(getApplicationContext(),
"uid wrong..try again", 0).show();
cnt++;
e.setText("");
e.requestFocus();
tv.setText("No of tries: "+cnt);
}else{
Toast.makeText(getApplicationContext(),
"pw wrong..try again", 0).show();
cnt++;
f.setText("");
f.requestFocus();
tv.setText("No of tries: "+cnt);
}

if(cnt == 3){
Toast.makeText(getApplicationContext(),
"Tries over..", 0).show();
finish();
}
}
});
}

}


xml layout file for First Activity 
File name: activity_main.xml
  xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginTop="22dp"
android:ems="10" >


android:id="@+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/editText1"
android:layout_below="@+id/editText1"
android:layout_marginLeft="14dp"
android:layout_marginTop="16dp"
android:ems="10" />



Second screen
package com.techpalle.b15_assignment;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

public class SecondScreen extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.second);
Intent in = getIntent();
Bundle b = in.getExtras();
String uid = b.getString("uid");
TextView tv = (TextView) findViewById(R.id.textView1);
tv.setText("Welcome.."+uid);
}
}
xml layout file for Second Activity 
File name: second.xml
  
android:layout_width="match_parent"
android:layout_height="match_parent" >
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="48dp"
android:text=""
android:textAppearance="?android:attr/textAppearanceLarge" />



Download complete code : Click to download

Tags: Login page android, start activity on login, pass user id and password , android tutorial

Monday, March 23, 2015

How to hack windows Password free and easy


This is one of my best tutorials coz il be talking about what i experienced as a  problem before and thats how to eeasily hack any windows password

Requirements:

  • BackTrack Linux 4 or 5. Download it from http://backtrack-linux.org
  • One pen drive(above 4gb)
  • Xp Free Fast RainBow table [tables_xp_free_fast.zip]. Download it from here:http://ophcrack.sourceforge.net/tables.php 
*Install the Backtrack Linux in the pen drive with small amount of persistent memory.

Step 1: Booting From Back Track
Insert the pen drive in target computer[when turned off].  We are going to boot the operating system from pen drive, so insert when the system is turned off.
Now Turn on the system.
Press F10 [boot menu, differs for system]  before booting and select boot from Pen drive. 
Now it will boot the Backtrack.
Select "Graphical User Interface "
Now wait for a while ( it will execute some commands}
Now you can see the "root:"
type "startx" and hit enter.  It will bring you to the GUI view of Backtrack.

Step 2:Copy the SAM and System files
Click the  Start button(dragon symbol)
Select System Menu
Select Storage Media(if you see nothing, close the window open it again).

You can see the list of Hard disk and Your pen drive.
Open the windows installed Hard disk and Navigate to this path:
WINDOWS/system32/config/

There you can see two files named as "SAM" and "System". 

Copy the both SAM and system files .
[ Just proceed to next step without closing the window]

Create a new folder in the desktop and paste the files inside.

Step 4: Run OphCrack Tool in Backtrack
Open the ophcrack GUI(start->Backtrack->Privilege Escalation->Password Attack->offline Attacks-ophCrack GUI).

Step 5: Loading the folder that contains sam and system files

Click the Load and select "Encrypted SAM" in ophcrack tool.
Now it will ask you to select directory that contains SAM folder. Select the directory where you saved the SAM file.

Now it will load and display the list of user accounts in the windows.

Step 6: Target the Admin Account
Here i am going to hack the one of the administrator account of my computer. So remove all other accounts except the target admin account.

Step 7: The Rainbow Table

Extract the "tables_xp_free_fast.zip" file in the desktop.

Click the Table button in ophcrack tool. Now it will ask you to selec the table.  Select the "XP free fast" and click the install button. Now browse to the Rain bow table directory "tables_xp_free_fast"
Now click ok.

Step 8: Cracking Begins
Click the Crack button.
Wait for a while [ophcrack is the fastest cracking tool. so it won't take too much time]

Step 9: Password is cracked
Yes..!! we got the password.