Search This Blog

Powered By Blogger

Friday, December 18, 2009

The PE Format

Warning: This document is contains purely technical information. This can be considered as iron, out of which weapons can be made :) . Additionally, this is about 48 pages long and written by me :)

Introduction:

Windows uses the Portable Executable Format to store executable files, also known as an “image” of an executable. Although the PE file contains all the information required to “run” a program, the PE file must first be parsed, processed and loaded into memory. This process involves allocation of memory, relocations, imports, etc. Thus, the PE file is simply an “image” of the executable, the executable being referred to the program in memory.

The Portable Executable Format is a highly portable format, compatible for use with many different 32 machines, on the various versions of windows. The PE format can be used identically for 64 bit machines, with very minor modifications.

This document does not act as a standard for the portable executable format, since such manuals already exist. This document also does not cover all the aspects of a portable executable. This document dives head first into the PE format, by directly observing the PE format of a simple test program. It is in the process of understanding the program itself, that the implementation of the PE will also become clear. It concentrates on the most commonly used parts in a usual portable executable, and later an analysis on changing certain values from those parts.

Aims:

The aim of the project is:

  • To develop an understanding on the structure of the Portable Executable
  • Understanding the process involved in loading of a PE image file from the hard disk to the memory
  • To emulate the working of the windows loader
  • Ability to create and alter any portable executable file to suit needs and wants.

Preparations:

The Test Program:

The program chosen for investigation is the standard “Hello World” Program. Its chosen for its simplicity, as well as:

  1. It uses library calls for outputting to a console
  2. The main standard sections in the executable are used.

The program, written in C, is:

#include

int main(void){

printf(”Hello World”);

return 0;

}

The code was compiled using Borland C++ compiler, free version 5.5.40.244. It was linked with the link32 linker also provided in the Borland compiler package.


Thus, we get a 51.00 kb .exe file which will be used to investigate into the structure of portable executables

Preparing the Hex Viewer:

All the fields in the PE file are byte aligned and thus, a hex viewer is necessary to view the file. The following is the source code for the hex viewer which produces a hexadecimal representation of the entire file:

#include

#include

#include

/*

Name: Hex Viewer

Copyright: croSSArrow

Author: Gaurav Tushar Mogre

Date: 30/09/08 18:06

Description: A Basic Hex File Viewer.

*/

using namespace std;

int main(int argc,char* argv[])

{

if(argc<2){

cerr<<”Format: hexviewer.exe n”;

return 1;

}

char fname[41];

strncpy(fname,argv[1],36);

fstream inpfile;

inpfile.open(fname,ios::in|ios::binary);

fstream outfile;

outfile.open(strcat(fname,”.hex”),ios::out|ios::binary);

while(!inpfile.eof()){

unsigned char ch;

inpfile>>ch;

if(ch<16) outfile<<”0×0″<

else outfile<<”0x”<

}

inpfile.close();

outfile.close();

cout<<”Written successfully to file: “<

return 0;

}

Thus, a file: testprogram.exe.hex is produced on running the above program, which generates the hexadecimal representation of testprogram.exe which makes it easier to analyze the file.

Bugs

We must have usually faced a problem that we cannot ‘view the hidden files’, even after selecting the option from the Folder Options Menu, and when we go back to check, we see that it has been mysteriously restored to ‘Do Not Show Hidden Files & Folders’.

It happens due to a small bug/virus which edits the Registry to create trouble for us.

Here is how we can solve it :

    ☻ [Theoretical Way]

Go to Registry Edit

[Start -> Run -> type "regedit"]

Browse to :

“HKEY_LOCAL_MACHINE\SOFTWARE\ Microsoft\Windows\CurrentVersion\ Explorer\Advanced\Folder
\Hidden\SHOWALL”

and set the value of the key “Checked Value” as 1

    ☻ [Practical Way]

Open notepad,

copy paste the following [between start and stop]:
// START
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\ Microsoft\Windows\CurrentVersion\ Explorer\Advanced\
Folder\Hidden]

“Text”=”@shell32.dll,-30499″

“Type”=”group”

“Bitmap”=hex(2):25,00,53,00,79,00,73,00, 74,00,65,00,6d,00,52,00,6f,00,6f,00,74,\

00,25,00,5c,00,73,00,79,00,73,00,74,00, 65,00,6d,00,33,00,32,00,5c,00,53,00,\

48,00,45,00,4c,00,4c,00,33,00,32,00,2e, 00,64,00,6c,00,6c,00,2c,00,34,00,00,\

00

“HelpID”=”shell.hlp#51131″

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ Windows\CurrentVersion\Explorer\Advanced\Folder
\Hidden\NOHIDDEN]

“RegPath”=”Software\\Microsoft\\Windows\\ CurrentVersion\\Explorer\\Advanced”

“Text”=”@shell32.dll,-30501″

“Type”=”radio”

“CheckedValue”=dword:00000002

“ValueName”=”Hidden”

“DefaultValue”=dword:00000002

“HKeyRoot”=dword:80000001

“HelpID”=”shell.hlp#51104″

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ Windows\CurrentVersion\Explorer\Advanced\Folder
\Hidden\SHOWALL]

“RegPath”=”Software\\Microsoft\\Windows\\ CurrentVersion\\Explorer\\Advanced”

“Text”=”@shell32.dll,-30500″

“Type”=”radio”

“CheckedValue”=dword:00000001

“ValueName”=”Hidden”

“DefaultValue”=dword:00000002

“HKeyRoot”=dword:80000001

“HelpID”=”shell.hlp#51105″

// STOP

Save it as whatever_u_want.reg

Double Click on that file to solve the problem,

it can be carried, mailed or kept as back-up too.

(Please remove the space in between registry entries)

BIOS Password Hack

Standard BIOS backdoor passwords

The first, less invasive, attempt to bypass a BIOS password is to try on of these standard
manufacturer’s backdoor passwords:
AWARD BIOS
AWARD SW, AWARD_SW, Award SW, AWARD PW, _award, awkward, J64, j256,
j262, j332, j322, 01322222, 589589, 589721, 595595, 598598, HLT, SER,
SKY_FOX, aLLy, aLLY, Condo, CONCAT, TTPTHA, aPAf, HLT, KDD, ZBAAACA,
ZAAADA, ZJAAADC, djonet,
AMI BIOS
AMI, A.M.I., AMI SW, AMI_SW, BIOS, PASSWORD, HEWITT RAND, Oder

Other passwords you may try (for AMI/AWARD or other BIOSes)

LKWPETER, lkwpeter, BIOSTAR, biostar, BIOSSTAR, biosstar, ALFAROME, Syxz, Wodj,phonix,toshiba

remember that passwords are Case Sensitive.

hacking BIOS via software

If you have access to the computer when it’s turned on, you could try one of those
programs that remove the password from the BIOS, by invalidating its memory.


However, it might happen you don’t have one of those programs when you have access
to the computer, so you’d better learn how to do manually what they do. You can reset
the BIOS to its default values using the MS-DOS tool DEBUG (type DEBUG at the
command prompt. You’d better do it in pure MS-DOS mode, not from a MS-DOS shell
window in Windows). Once you are in the debug environment enter the following
commands:
AMI/AWARD BIOS
O 70 17
O 71 17
Q

Thursday, December 17, 2009

Hacking Yahoo Messenger

This tutorial will tell you how to hack yahoo messenger while you are engaged in chatting with some person.While you are chatting through yahoo messenger, Yahoo will hide the IP addresses of all the computers that are connected through the yahoo messenger application to the chat room.So it is not possible to directly find out the IP of the person you want to hack.Then how to get the IP address? Yes it is still possible to hack the IP address during the Yahoo messenger chat.The procedure to Hack Yahoo messenger is discussed in detail below.

While you are chatting via yahoo messenger the communication between you and the person you want to hack, takes place indirectly via Yahoo server and not directly.It is not possible to hack Yahoo messenger directly to get the IP address.So to hack his IP, you must establish a direct communication with him.So,how to do this? It’s easy.Just start chatting with some one via Yahoo messenger.During the process of chatting send him a big file.Now the file transfer takes place directly between your computer and the victim’s computer(via yahoo messenger application).So now, you are ready to go. Here’s the step-by-step process to hack Yahoo messenger and get the IP address of the person .

  • Goto the COMMAND PROMPT (START>>>RUN>>>Type CMD).
  • Here Type “netstat -n” (without quotes).

NOTE: If you are new to “netstat” and other IP related commands refer this tutorial:Windows XP IP Utilities

  • The pic given below shows netstat results of my computer.I was not chatting when i took this pic and hence it looks modified.

  • Here local address is your own IP and the foreign address is the IP address of the recipient with whom you are connected via yahoo messenger (There may be multiple recipients and hence multiple foreign addresses).
  • Now send him the file.
  • Check the output by typing the command “netstat -n” (without quotes).
  • Assume the output is something like this.

TCP 127.0.0.10:5101 124.55.23.11:1246 ESTABLISHED

Here 124.55.23.11 is the IP address of the person with whom you are chatting and 1246 is the port number where connection is established.That’s It! You have now hacked Yahoo messenger to get his IP address.

Once you hack Yahoo messenger and get his IP address you can use any of the Remote Administration tools or perform NETBIOS HACKING.Refer this tutorial on Netbios Hacking.

NOTE: Some times there are chances where in the file transfer gets encrypted (takes place via yahoo server itself).So in this case the above hack may fail to work.

Popularity: 18% [?]

How to Become a Hacker?

Most of us are very curious to learn Hacking and want to become a Hacker, but don’t know where to start. If you are in the same situation, then this is the right place for you.

Every day I get a lot of emails where people ask me- How to Become a Hacker?. In fact this question is not easy to answer because, hacking is not an art that can be mastered overnight. It requires knowledge, skills, creativity, dedication and of course TIME. Everyone can become a Hacker provided they learn it from the basics. So if you wanna become a hacker, then all you need is a good source that will teach you hacking from the basics.

What skill do I need to Become a Hacker?

There is no magic to become a Hacker, but like anything else that is worthwhile it takes dedication, a willingness to learn. It is most important to have a good knowledge of topics such as Operating system and it’s working, Computer networks, Computer security and of course Programming. It’s not possible to become a hacker overnight. All you need is a good source (book) to start learn Hacking from the basics.

What is the best way to Become a Hacker?

The best way to become a Hacker is to start from the basics. You have to master the basics to build a strong foundation. And once this is done you’ll be in a position to explore new ideas and start thinking like a Hacker.

There exists tons of books on the market that teach you Hacking but unfortunately, it requires a set of pre-established skills and knowledge to understand the concepts explained in the book. Also these books are not meant the for beginners who doesn’t know anything about hacking. I have found an excellent Hacking Book for Beginners. This book is the first step to fulfil your dream to become a Hacker. Yes, this is the right book for the beginners who are interested to learn hacking from the basics. The good thing about this book is, any one can understand the concepts presented in the book without the need for any prior knowledge. The book is called

The Hacker’s Underground Handbook

NOTE: I have found that some of my readers have mistaken the book to be the Hacker’s Handbookwhich is widely available on the internet. But this book is called The Hacker’s Underground Handbook. The Hacker’s Underground Handbook is unique and is not available anywhere on the internet. So please don’t be confused. The Hacker’s Underground Handook and Hacker’s Handbook are different.

This book will take you from the core to the top. It will tell you how to hack in simple steps. Everything is presented in a simple and effective manner. It’s a greak book for the beginner who want to become a Hacker. This book will install a Hacker’s Mindset on you.

The following skills are uncovered in this book

1. You will learn all the hackers underground tricks and learn to apply them in real world situations.

2. You will be put into a hackers mindset and learn to think like a Hacker.

3. By learning how a hacker thinks and acts, you will be able to protect yourself from future hack attacks.

4. You will acquire knowledge nonexistent to 99.9% of the people in the world!

5. This Underground handbook may get you interested in pursuing a career as an Ethical Hacker.

This book is of great value for all those who have a dream to become a Hacker.

So, what are you waiting for? Go Download your copy of the book which from the following link

The Hacker’s Underground Handbook

What tools are required in my journey as a Hacker?

As a Hacker the number of tools that you require is almost endless. However at this point of time I recommend you to use the following 2 tools.

1. First of all it is mandatory for you to hide your real IP address while experimenting the tricks and tactics given in this book. To become a hacker this is your first step. So I recommend the following tool to mask your real IP.

Hide the IP

2. The another tool that I recommend is Anti-Hacker Toolkit. This kit can become handy for you to catch hackers who are trying to break into your computer without your knowledge. Also using this tool kit you can monitor all the incoming connections to your computer, detect keyloggers and scan for suspicious programs. For more info on this visit the following link

Anti-Hacker Toolkit

Wait… This is not the end. Rather it is just the beginning of your journey to become a hacker. To become a hacker all you need is dedication and hard work. I wish you all the best for your future success!

Gmail leaves beta, launches "Back to Beta" Labs feature

Gmail leaves beta, launches "Back to Beta" Labs feature

Tuesday, July 07, 2009 8:02 AM



We get asked all the time why Google keeps its products in beta for so long. And Gmail, five years after launch, is consistently a subject of this questioning, even of jokes.

Some people thought that once we opened sign-ups, Gmail should have come out of beta.

Others said that once we integrated chat, developed new anti-spam technology, expanded to 53 languages, shipped a mobile app, added group chat, launched an iPhone UI, added a vacation autoresponder, launched Gmail Labs, subsequently modified the vacation autoresponder with a Gmail Lab, launched 48 other Labs, launched video chat, enabled open protocols and APIs (POP, auto-forwarding, IMAP, and the Contacts Data API), let you POP mail in from other accounts, added a delete button, rearchitected our entire javascript code base, and added key functionality to get large companies, startups, universities, and many other organizations (in addition to Google itself) running on Gmail, we should have come out of beta.

Some people think we should wait until we launch <>.

Others say that, over the last five years, a beta culture has grown around web apps, such that the very meaning of "beta" is debatable. And rather than the packaged, stagnant software of decades past, we're moving to a world of rapid developmental cycles where products like Gmail continue to change indefinitely.

The end result (many visible and invisible changes later) is that today, beta is a thing of the past. Not just for Gmail, but for all of Google Apps — Gmail, Calendar, Docs, and Talk.

However, we realize that after five years, this leaves some of you wrestling with some tough questions. How will you ever get used to using Gmail without that familiar grey "BETA" text greeting you when you log in everyday? What example will you cite the next time you make an internet joke about perpetual betas? Don't despair... for those of you long-time Gmail-ers who might feel some separation anxiety, we've got a solution. Just go to Settings, click on Labs, turn on "Back to Beta," and it'll be like Gmail never left beta at all.

Back to Beta

Tip: Recover your password via text message

Thursday, July 09, 2009 12:24 PM



Even the best of us forget our passwords from time to time. In fact, recovering passwords is one of the top reasons people visit the Gmail Help Center. To help with these situations, we recently added the ability to recover your password via text message.

To turn this on for your account, just sign in, select 'Change Password Recovery Options,' enter your cell phone number and click 'Save.'

Next time you forget your password, enter your username on the password-assistance page, and Google will text you a recovery code. No need to check another email account or even leave the page.

In general, it's a good idea to add as many password recovery options to your Google Account as possible, like a secondary email address and security question. And don't forget to keep them up-to-date.