Pages

Friday, December 18, 2009

Static DLL Injection

DEFINING DLL
According to microsoft “A DLL is a library that contains code and data that can be used by more than one program at the same time. For example, in Windows operating systems, the Comdlg32 DLL performs common dialog box related functions. Therefore, each program can use the functionality that is contained in this DLL to implement an Open dialog box. This helps promote code reuse and efficient memory usage.

By using a DLL, a program can be modularized into separate components. For example, an accounting program may be sold by module. Each module can be loaded into the main program at run time if that module is installed. Because the modules are separate, the load time of the program is faster, and a module is only loaded when that functionality is requested.

Additionally, updates are easier to apply to each module without affecting other parts of the program. For example, you may have a payroll program, and the tax rates change each year. When these changes are isolated to a DLL, you can apply an update without needing to build or install the whole program again.

The following list describes some of the files that are implemented as DLLs in Windows operating systems:
ActiveX Controls (.ocx) files
An example of an ActiveX control is a calendar control that lets you select a date from a calendar.
Control Panel (.cpl) files
An example of a .cpl file is an item that is located in Control Panel. Each item is a specialized DLL.
Device driver (.drv) files
An example of a device driver is a printer driver that controls the printing to a printer.”
let us make this some more clearer than microsoft defination ” A dynamic link library (DLL) is a collection of small programs, any of which can be called when needed by a larger program that is running in the computer. The small program that lets the larger program communicate with a specific device such as a printer or scanner is often packaged as a DLL program (usually referred to as a DLL file). DLL files that support specific device operation are known as device driver.”
DEFINING DLL INJECTION
Code and DLL injection refer to a method for attackers to manipulate programs and processes to execute another program. DLL injection provides a manner for attributing the malicious .dll to running processes. Processes are tasks that are being handled by the operating system.

There are two kinds of injection:

Static injection – Static injection occurs prior to program execution.

Dynamic injection- Dynamic injection occurs when processes are loaded into memory.
HOW TO DO A STATIC DLL INJECTION
A file is altered, by ‘injecting’ a jump at the beginning of the filespace. This jump directs to arbitrary code written by an attacker into available space of the filespace of a program.
TOOLS WE USE
Sysinternal’s Process Explorer(PE)
OllyDbg
NOW INJECTION
We will now explore static code injection. For this purpose, we will manipulate the Windows game Mineswipper so that before it runs it displays a message saying “hi HL geeks”

First, go to C:\WINDOWS\system32 and make a copy of winmine.exe into a file with a different name (for security purpose)

In order to manipulate winmine.exe, we will use OllyDbg, “a 32-bit assembler level analysing debugger for Microsoft Windows. Emphasis on binary code analysis makes it particularly useful in cases where source is unavailable.”

The first time you run OllyDbg you might get a message asking you whether you want to update on the library (.dll) files. Just say no
Click Open, and open winmine.exe. What you will get in OllyDbg is assembly code of winmine.exe
On the right part of the screen you will see the Register values. The EIP register is a pointer to the next command that will execute. In this case it should store the Module Entry Point

The memory space of winmine.exe contains a lot of useful information, but it also contains areas with no useful information whatsoever. These areas are full of noop operations (\x00’s). These areas could be modified to add code without corrupting winmine.exe.

In OllyDbg, on the left upper window (right below the menu), scroll down until you find a big group of noops put together where you have enough space to add your code. The place you find is called a ‘cave’,

Now in the ‘cave’ we found we will add a Message Box call.

The function call is:

MsgBoxA(0,”hi HL geeks”,”hi HL geeks”,0)

So this is the ASM code for doing that:

Push 0

Push “hi HL geeks”

Push “hi HL geeks”

Push 0

Call User32.MessageBoxA
In Machine Code we go to an even lower level…we must allocate space for the “hi HL geeks” string and then push the address of this allocated memory by doing a

Push

We will now add the code. Highlight a bunch (about 20) of NOOPs from the cave. Right click and select Binary->Edit. Now on the Ascii field simply type in “hi HL geeks”

You will now get some garbage on OllyDbg. Do not worry. Olly needs to reanalyze this code. Press CTRL + A to analyze the code. After this, you should see “hi HL geeks” in some address.

Now below the address where you added your string, double click on one of the “DB 00” fields. You will get an Assemble at window.

Type in:

push 0

and press Assembler. A new Assemble at will appear. Now type in:

push MYADDRESS

where MYADDRESS is the address where your string is located. In the next address you should type:

push MYADDRESS

again (because you are pushing the same string 2 times, once for the header of the box once for the message in the box). On the next address we type in:

push 0

again. Finally we have to call the actual function call, so on the next address type:

call user32.MessageBoxA

Now press the ‘*’ key in your numpad, this will take you to the top of the window (the origin). Select the first 6 instructions, highlight them and then press CTRL + C (for backup). Paste this code into notepad.

Now we will overwrite some code. Double click on the Origin instruction and type in:

JMP CODEADDRESS
where CODEADDRESS is the address where your code starts

You will notice that more than one line got edited. The edited lines will be in red. Compare the first few lines with your copy in Notepad and delete the lines that are duplicated from Notepad. The lines that are not duplicated we will need to add again somewhere.

It is important to keep this address because what the program will do is read the EIP register. This points to the line where we added the JMP. The JMP will redirect the PC to the new code. The new code will execute, and then we want to jump back to the address you just wrote down so that normal execution continues as if nothing had happened. However, before we return to normal execution, we have to add the code that we overwrote. So we add this at the end of our code before we jump back to the beginning of the code.

Go to back to the origin. Highlight the origin instruction, and right click with your mouse. Then press Follow. This will take you to the address to which the origin jumps. If you have done everything correctly so far, this should take you to the beginning of your code (The first push 0).

Now we need to add the code that was overwritten (which we copied in notepad,). Add the remaining instructions from notepad at the end (immediately after the Call MessageBoxcommand).

Note: If it says something like ‘PUSH winmine.1234567′ in notepad, just type in ‘push 1234567′).

Now at the last line of the new code insert the command

JMP SECONDADDRESS
where SECONDADDRESS is the address of the second line, or the line after the origin

Now right click and go to Copy to executable -> All Modifications.

On the window that appears select:

Copy All

A new window will appear. Click yes to save modifications. Save as a different name.

Now press Run (the play button at the top of Olly). The Message Box should have appeared and then Winmine.

It is all how it works ,if u people also intrested in dynamic dll injection then plz comment in this post

Google hacking---->>>

Use Google as a warez search engine a.k.a Get Free Stuff!
1.Go to www.google.com
2.In the Search Bar type in:“intitle:index of” and then type in the keyword for whatever you are looking for.
So for example if I want to find some linkin park songs I would type in this:
“intitle:index of” LINKINK PARK(OR SONG NAME) MP3(YES WE CAN ADD EXTENSION ALSO)
View Security Cameras Worldwide. – This will let you hack into random live scurity cameras all over the world and operate them.
1.Go to www.google.com
2.In the search bar type in:inurl:”viewerframe?mode refresh”
3.Then go to any of the search results and boom here is your camera.

Searching crack

for searching crack u can use following command
crack:name of the software whose crack u want to download
eg-.suppose i want to download crack of nfs most wanted then i type

crack:need for speed most wanted

Searching serials

just type software/game name and after that type 94fbr
eg.-windvd 8 94fbr

how it is working

actually 94fbr a key for windows 2003 which Microsoft distribute free in very big amount
so when we hit 94fbr Google relates it to serial no. and return serial no. of specify software.

POWERED BY HIT JAMMER 1.0!
Allows you to gain access to the admin panel of site running
hitjamer 1.0 script.
1.Go to google.com
2.In the search bar type in:POWERED BY HIT JAMMER 1.0!
3.Look for webpages that have POWERED BY HIT JAMMER 1.0! slogan on the bottom of the main page
4.Once you found the page that has POWERED BY HIT JAMMER 1.0! slogan on the bottom replace the url with this
one:www.nameofsite.com/admin/admin.php <— That should take you to the admin panel.
Example: If the site’s name is www.uber1337xxoxox.com/index.php/ifuckgoats/lol
then just replace it with this www.uber1337xxoxox.com/admin/admin.php
FTP HACK

This hack shows all info (including username and passwords) for websites running on ws_ftp sofware.
1.Go to google.com
2.In searchbar type in: intitle:index of ws_ftp.ini
3.Go to any result page and find a file called ws_ftp.ini (press ctrl+f for autosearch)
After you found ws_ftp, click on it and it will give you a whole bunch of private stuff.Look for something along the lines
of PWD=blahblahblah.That’s your password.It’s encrypted.So use an MD5 hash cracker or johntheripper to crack the
password.

how to search google for RAPIDSHARE links

If you wanna find some apps, files etc on rapidshare.de via google, do the following.

Paste this into the google search window (not the adress bar):

site:rapidshare.de -filetype:zip OR rar daterange:2453402-2453412

this searches the site rapidshare.de for any file that is rar or zip, and
has been indexed between 1-11 February.

dvd site:rapidshare.de -filetype:zip OR rar daterange:2453402-2453412

This is the same search but it specifically searches for “dvd” with the same
search criteria, so any app posted with the word dvd in it will be found.

SOME IMPORTANT SEARCH STRING
Try these search string in different way
intitle:”Index of” passwords modified
allinurl:auth_user_file.txt
“access denied for user” “using password”
“A syntax error has occurred” filetype:ihtml
allinurl: admin mdb
“ORA-00921: unexpected end of SQL command”
inurl:passlist.txt
“Index of /backup”
“Chatologica MetaSearch” “stack tracking:”

“parent directory ” /appz/ -xxx -html -htm -php -shtml -opendivx -md5 -md5sums

“parent directory ” DVDRip -xxx -html -htm -php -shtml -opendivx -md5 -md5sums
“parent directory “Xvid -xxx -html -htm -php -shtml -opendivx -md5 -md5sums
“parent directory ” Gamez -xxx -html -htm -php -shtml -opendivx -md5 -md5sums
“parent directory ” MP3 -xxx -html -htm -php -shtml -opendivx -md5 -md5sums
“parent directory ” Name of Singer or album -xxx -html -htm -php -shtml -opendivx -md5 -md5sums
Notice that I am only changing the word after the parent directory, change it to what you want and you will get a lot of stuff.
nurl:microsoft filetype:iso
You can change the string to watever you want, ex. microsoft to adobe, iso to zip etc…

“# -FrontPage-” inurl:service.pwd
Frontpage passwords.. very nice clean search results listing !!

“AutoCreate=TRUE password=*”
This searches the password for “Website Access Analyzer”, a Japanese software that creates webstatistics. For those who can read Japanese, check out the author’s site at: coara.or.jp/~passy/ [coara.or.jp/~passy/]

“http://*:*@www” domainname
This is a query to get inline passwords from search engines (not just Google), you must type in the query followed with the the domain name without the .com or .net

“sets mode: +k”
This search reveals channel keys (passwords) on IRC as revealed from IRC chat logs.

allinurl: admin mdb
Not all of these pages are administrator’s access databases containing usernames, passwords and other sensitive information, but many are!

allinurl:auth_user_file.txt
DCForum’s password file. This file gives a list of (crackable) passwords, usernames and email addresses for DCForum and for DCShop (a shopping cart program(!!!).

intitle:”Index of” config.php
This search brings up sites with “config.php” files. To skip the technical discussion, this configuration file contains both a username and a password for an SQL database. Most sites with forums run a PHP message base. This file gives you the keys to that forum, including FULL ADMIN access to the database.

eggdrop filetype:user user
These are eggdrop config files. Avoiding a full-blown descussion about eggdrops and IRC bots, suffice it to say that this file contains usernames and passwords for IRC users

To locate proxy servers
try these queries:
inurl:”nph-proxy.cgi” “Start browsing”
or
“this proxy is working fine!” “enter *” “URL***” * visit
These queries locate online public proxy servers that can be used for
testing purposes.
Calculator
This trick is extra cool: You can use the blank Google search box as a calculator. Just enter an equation, like 2+2, and then press Enter to have Google tell you 2+2=4. For multiplication, use the asterisk (*), like this: 2*3. For division, use the slash (/), like this: 10/3. You can also use the search box to perform unit conversions, like this: 5 kilometers in miles or how many teaspoons in a cup? For a chart listing of units of measure Google can convert, The calculator works for simple equations and for some seriously complex operations, too, like logarithms and trigonometric functions. You can find a rundown of all its capabilities at. And if you know what a physical constant is or the phrase “base of the natural system of logarithms”
Changing the Number of Results
In the middle of a Google results URL, you can sometimes find num=, which tells you the number of search results Google gives you per page of results. You can temporarily change the number of results to anything from 1 to 100 simply by altering the number in the URL and then pressing Enter. Most of the time, search results are easiest to read when you’ve got 10, 20, or 30 per page . But this trick is a quick way to amp up the number of results on a page for the rare times when you want to review a lot of them at once or compare results 1 and 100 on one page.
Unsafe searching.
The SafeSearch filter tells Google to remove potentially offensive links from your results. The problem is, sometimes the filter gets carried away and removes things you need . To make sure the filter is off, add this to the end of your URL: &safe=off. To make sure it’s on, add &safe=on.

Remove autorun.inf manually

so i will tell u how to remove autorun.inf virus which is cause of opening
of your drives in separate window when u click on the drive name in my computer

There is a Trojan/virus (either the Win32/Pacex virus or the Win32/PSW.Agent.NDP trojan) that uses those two files. Here is how you can get rid of them:

1) Open up Task Manager (Ctrl-Alt-Del)
2) If wscript.exe is running, end it.
3) If explorer.exe is running, end it.
4) Open up “File | New Task (Run)” in the Task manager
5) Run cmd
6) Run the following command del #:autorun.* /f/a/s/q with other drives in turn

where # is replaced by drive name e.g-c,d,e etc

Be careful with this command it can delete your all data one by one from your hdd if execute wrongly so place your mouse on x position of cmd prompt windows and if it starts deleting your files close it

or we can do this step by without ending explorer.exe

just hit windows+R it will show you run dialog box now type cmd there,it will give you command prompt

now navigate to #: where # replaced with your different drive name

i am taking the example of c: drive

now write c:del/a/s/q/f and give a space now press tab until you see autorun.inf press enter

now yo done do the rest steps as i said (be careful see clearly autorun.inf before deleting it and don’t delete any ntdelect there it may crash your system)

7) Go to your WindowsSystem32 directory by typing cd c:windowssystem32
8 ) Type dir /a avp*.*
9) If you see any files names avp0.dll or avpo.exe or avp0.exe, use the following commands to delete each of them:

attrib -r -s -h avpo.exe
del avpo.exe

10) Use the Task Manager’s Run command to fire up regedit
11) Navigate to HKEY_CURRENT_USER SOFTWARE Microsoft Windows CurrentVersion Run (as usual, take a backup of your registry before touching it!)
12) If there are any entries for avpo.exe, delete them.
13) Do a complete search of your registry for ntde1ect.com and delete any entries you find.
14) Restart your computer.

Resetting Root Authorization in Linux and Prevention

The root authentications can be reset to NULL value from the following method.

Do not use this information for committing cyber crimes.

AT Grub Loader.

highlight the desired kernel which you want to boot ‘fedora core fc9′

press ‘e’ to edit the run levels and other options

then the second menu arrives as ..
(hd0,1)
rhgb quiethighlight the part with quiet and then again press ‘e’

now you will get a prompt to edit the command …
add 1 as
rhgb quiet 1
space is must…
then press enter
and then press ‘b’ to boot
you will be booted and awarded with a root console….
root@machine#
root@machine#passwd
change the password of root>
Enter New password>
Retype password>
all pasword tokens authenticated….
root@machine#reboot

Explaination:

By editing the grub we edit the kelrnel line from where the OS will get booted. in doing so FC or any other distro it boots the Os kernel with the runlevel one.
In doing so it repairs the the filesystem and reinstalls the users and makes the default value of each password to NULL.
this can be prevented by editing the runlevel from restting the passwd. just add a # to the line of passwd in /boot/boot.conf under the heading of runlevel one.

then you may add the numbers such a 1, 2, 3 to have different run levels.

2 will open in text mode.
suppose you have various kernels on your system then /etc/grub.conf will show

title Fedora Core (2.6.12-1.1398_FC4)
root (hd0,0)
kernel /vmlinuz-2.6.12-1.1398_FC8 ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.12-1.1398_FC8.img
title Fedora Core (2.6.12-1.1390_FC8)
root (hd0,0)
kernel /vmlinuz-2.6.12-1.1390_FC8 ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.12-1.1390_FC8.img
title Fedora Core (2.6.12-1.1387_FC8)
root (hd0,0)
kernel /vmlinuz-2.6.12-1.1387_FC4 ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.12-1.1387_FC4.img
title Fedora Core (2.6.11-1.1369_FC8)
root (hd0,0)

you may chnge the preference and remove the hash from password protected grub and edit the password value.

Prevention:
The above method for resetting the password value can be prevented by using a password protection over grub.
This can be done via terminal,
login as Super user by su -
and then type grub-md5-crypt
you will then be prompted to type password, retype when asked. Then copy the MD5 hash which is generated for the grub.
now open /etc/grub.conf
Locate hiddenmenu
now below this write : password –md5
Now whenever you enter the grub screen it will not edit the kernel line, unless you provide the correct password.
You can also prevent the boot of certain kernel by changing the place from below of “hiddenmenu” to above of the desired kernel.
Hope you enjoyed the post.

Monday, December 14, 2009

Email Forging

1)
Open a command prompt by clicking Start, Run, and type cmd in the box and press OK. You should get a black "Command Prompt" screen.
This can be done with the Terminal.app in Macintosh OS X and the command line in most Unix and Linux based operating systems.
2)
You will need an SMTP server address to proceed. Here is how to find one:
On the command-line, type nslookup.
Then, type set type=mx.
Finally, enter the name of any website, for instance, hazemdesigns.srhost.info.
This will return the following: Non-authoritative answer:hazemdesigns.srhost.info mail exchanger = 0 ASPMX.L.GOOGLE.COM..
The aspmx.l.google.com part is what you need. This is an SMTP server address.
Type exit to exit out of nslookup.
3)
Type telnet aspmx.l.google.com 25. 25 is the port number most SMTP servers use while sending email. Learn more about telnet.
4)
When the mail server responds, you can start typing SMTP commands.
5)
Start with helo blahblah.google.com. You may have to use your ISP's domain name for it to be accepted.
6)
If it says 'at your service' or something like that, continue with the address you want the mail to come FROM. So, to forge mail from Bill Gates, type mail from: billg@microsoft.com.
7)
If it says OK, type who you want the mail to go to, i.e. your friend's address. Type rcpt to: yourfriend@isp.com
8)
If it says Recipient OK, then you can type your message:
Type data and press Enter.
On the first line type Subject: yoursubject and press Enter twice.
Continue typing your message, such as 'I'm bill gates and want to send you a billion dollars'.
Put a single period (.) on a line by itself and press Enter to send your message. The server should say 'Message accepted for delivery'.
9)
You are done. You have just forged an email, and the recipient should be receiving it shortly.
10)
You can test to see if a given SMTP server is configured for forwarding by using online tools.
11)
TIPS:--->>>

hoaxMail, provides an online GUI for forging email. However, signup is required.
ZMail, an open-source application for linux, windows, and mac, does all of this for you. All you have to do is enter the from-address, the to-address, an smtp server, and your message.
This site provides a list of SMTP servers, provided by google, that work perfectly for forging emails. No authentication is required.
if you do not see the letters you type in your terminal application use the echo command.
Practice sending the message to yourself a few times until you get the hang of it.
Send it to yourself and view all the headers to make sure nothing that easily identifies you as the sender (like your computer name) shows up.
Servers which run enhanced SMTP will also accept 'ehlo blahblah.isp.com'. You may still need to use your ISP's domain name for it to be accepted.
It is normally easier just to find one of the many free websites that will allow you to send emails to anyone from anyone.
As mentioned in the warnings, most SMTP servers have relaying disabled. Many times you can overcome this by connecting to the ISP of the target email, since the server will accept it as a "local delivery" - i.e., if the target's address is "joe@company.com" telnet to "company.com" and forge it from there. Most "@company.com" mail servers are either "company.com", "mail.company.com" or "smtp.company.com".
If you use Windows telnet client and make a spelling mistake do not use the backspace key, instead, press ^] (CTRL+RIGHT BRACKET) to terminate the connection and try again. The backspace key is transmitted incorrectly and will result in odd characters appearing in the final message.
Some individuals believe running an open relay is a free speech issue, including John Gilmore, a long time Internet "personality" and one of the founders of the The Electronic Frontier Foundation. As a result most ISPs do not accept mail from Gilmore's servers.