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. :)

9 comments:

Anonymous said...

Jobs, -- the man who revolutionized the personal computer and is resuscitating Apple Computer as interim CEO -- clearly relishes his second career as movie mogul. And he is profiting from it -- his 70 percent stake in the company is worth $1.59 billion. [url=http://www.monclerjacketsonlinevip.com]moncler outlet store[/url] Comments ( ) E-mail story Print story E-mail this article To: Invalid E-mail address Add a personal message: (80 [url=http://www.longchampsaleoutletus.com]longchamp bags on sale[/url]
Her own harshest critic: The pensioner was not too happy after her friend showed her a snap she had taken [url=http://www.monclerjacketsonlinevip.com]moncler outlet store[/url] Sherry and I committed to each other- to go 30-days with NO LOOSE ENDS. We took our measurements. We are taking pictures this week. We are tracking EVERY WORKOUT AND EVERY MEAL. We will go 30-days SPOT ON (we are both following the 4-Hour Body diet philosophy) and then analyze our results. [url=http://www.canadagooseoutletcavip.com]canada goose jackets on sale[/url]
meat is thrown into warm tacos, with a splodge of red salsa, a dollop of [url=http://www.uggsonclearancevip.com]uggs clearance[/url] In 2001, you could buy an ounce of gold for $250. Today, gold sells for more than $1,400 an ounce. Thats more than 460% gain. [url=http://www.toryburchoutletonlinevip.com]tory burch outlet[/url]
Pulsing tinnitus can certainly be linked to vascular as well as kinetic abnormalities in addition being an artery deformation. Therefore, making it even more important for the doctor to accurately diagnosing what causes it prior to an operation. For more information concerning pulsating ringing in the ears, refer to Remove Tinnitus that may be slowly but surely increasing cult rank popularity on the World Wide Web for being rapid, effective, reasonable and a long lasting solution to solving tinnitus permanently. Puma ditches shoe boxes in eco initiative [url=http://www.cheapbootsgenuine.co.uk]genuine ugg boots[/url] 7. Easy gain access to for the earphones is, naturally, a must. [url=http://www.timberlandsalevip.co.uk]black timberland boots[/url]


[url=http://www.kaoporn.com/forum.php?mod=viewthread&tid=14803&extra=]ugg boots 10 9 1 10.88 shoe store[/url]
[url=http://kuwaitvip.com/minibb/index.php?action=vthread&forum=1&topic=10713&page=6445#msg436343]ugg boots 10 5 2 20 zenetti rims[/url]
[url=http://wymiana.xlx.pl/viewtopic.php?p=45414#45414]ugg boots 10 8 mac update 10.5[/url]
[url=http://host766125.w186-e0.ezwebtest.com/forum.php?mod=viewthread&tid=59155&extra=]ugg boots 10 7 6 130 river landing charleston sc[/url]
[url=http://www.luisdbermudez.com/alvarochoa/index.php/blog/item/23-como-curar-la-incontinencia-femenina/23-como-curar-la-incontinencia-femenina]ugg boots 10 4 7 0 113 bus schedule[/url]

Anonymous said...

Neat blog! Is your theme custom made or did you download it from somewhere?
A theme like yours with a few simple tweeks would really make
my blog stand out. Please let me know where you got your theme.
Cheers

Feel free to surf to my page home renovations before and after (www.homeimprovementdaily.com)

Anonymous said...

I do consider all of the concepts you have introduced on your post.
They're really convincing and will definitely work. Nonetheless, the posts are very brief for starters.
May you please extend them a bit from subsequent time?

Thank you for the post.

Stop by my web blog ... novomatic slots online

Anonymous said...

A full combat sport like Mixed Martial arts allows various kinds
of techniques that include grappling and striking. Buying Equipments:
Boxing, Judo, Karate and all other forms of martial arts
equipment are generally available at many shops but options might be restricted.

The majority of grading systems will ensure that
you receive your new belt or sash and so
have great value.

Unknown said...

Nice post it is just awesome.. visit my blog: installment loan

Unknown said...

كثيرون يحصلون على بعض المعلومات عن تكاليف التنظيف داخل الكويت وتكاليف تنظيف التصاميم وتكاليف عالية وعالية؟ حقيقة الأمر هي أن تقييم أعمال التنظيف ليس عرضة للتقييم. في أي حال ، فإن نموذج الغرفة هو التشغيل والتدبير المستخدم لمعرفة التكلفة.
افضل شركة تنظيف منازل
افضل شركة تنظيف خزانات بالكويت
شركة تنظيف منازل بالكويت
شركة تنظيف موكيت بالكويت


Unknown said...


شركة تسليك مجاري بالرياض
تعتبر اعمال التسليك وشفط البيارات من اهم الاعمال التى يجب الاهتمام بها لتحافظ على امان وسلامة اسرتك واثاث بيتك من الاتساخ والجراسيم فأعمال التسليك من الاعمال الشاقة والتى تحتاج الى الجهد والتعب والعناء فنحن افضل شركة تسليك مجاري بالرياض نقوم باعمال التسليك عمن طريق فريق عمل مدرب وذو خبرة وكفائة عالية فى مجال التسليك بالرياض
ف شركة تسليك مجاري بالرياض
لديها افضل المعدات واحدث الادوات التى تستخدم فى مجال التسليك والشفط بالرياض كل ما عليك فقط هو الاتصال بأفضل شركة تسليك مجاري بالرياض

Unknown said...

cheap replica handbags best replica bags online replica designer bags

Unknown said...

investigate this site Valentino Dolabuy click here for more YSL Dolabuy you could look here high quality replica bags

Powered By Blogger

Music...