Showing posts with label hack. Show all posts
Showing posts with label hack. Show all posts

Friday, September 12, 2014

Java Hack --- external private method access

Using reflection, you can access the private methods out side the scope of the class and get the method values.
 Reference: Java World


Our victim class:
********************************

public class Victim
{
 private String getPassword() 
 {
  return "Password";
 }
 
 private int getAge() 
 {
  return 15;
 }
 
 private String getMyName()
 {
  return "Noob";
 }
 
}
 
********************************

Now lets get busy hacking the victim.
 
-------------------------------------------
import java.lang.reflect.Method;

public class HackVictim 
{
 public static void main(String[] args) 
 {
  try
  {
   Class cls = Class.forName("package.name.Victim");
   Object obj = cls.newInstance();
   Method[] methods =  cls.getDeclaredMethods();
   for( int i = 0 ; i < methods.length ; i++ )
   {
    System.out.println("Method Name--->>>"+methods[i].getName());
    System.out.println("Method Return Type--->>>"+methods[i].getReturnType());
    methods[i].setAccessible(true);
    System.out.println("Method Value--->>>"+methods[i].invoke(obj));
   }
  }
  catch( Exception e )
  {
   e.printStackTrace();
  }
 }
}
---------------------------------------------
You are all set. :)

Thursday, August 30, 2007

Funny Hacks : Windows Registry

Registry Hacking... just for fun... windows only...:)

Display legal notice on startup:
Wanna tell your friends about the do's and dont's in your computer when they login in your absence. Well you can do it pretty easily by displaying a legal notice at system start up.
REGEDIT[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system]
"legalnoticecaption"="enter your notice caption"
"legalnoticetext"="enter your legal notice text"

Automatic Administrator Login:
Well here's the trick which you can use to prove that Windows XP is not at all secure as multi-user operating system. Hacking the system registry from any account having access to system registry puts you in to the administrator account.
REGEDIT
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"AutoAdminLogon"="1"

No Shutdown:
Wanna play with your friends by removing the shutdown option from start menu in their computer.Just hack it down !!!RegeditHKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
"NoClose"="DWORD:1"

Arun...
PS: I like windows but i love Linux...
Powered By Blogger

Music...