| View previous topic :: View next topic |
| Author |
Message |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Thu Feb 12, 2009 4:55 pm Post subject: Exe Injection Problem... |
|
|
When using exe injection, you cant display any windows. When you try to display windows it crash the program why?
And FYI exe injection is where you copy your own exe into the address space of another exe then executing a function in that copyed space so that it stays alive then you can delete and close the injecting exe.
|
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Thu Feb 12, 2009 5:46 pm Post subject: |
|
|
Just feed it a module base. The reason it doesn't work, IIRC, is that you don't have any specific module associated with the exe, it's just a chunk of code. I remember coding a exe injector a while back, was good fun.
Whose code did you take to do this?
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Thu Feb 12, 2009 6:07 pm Post subject: |
|
|
| What do you mean whos code?
|
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Thu Feb 12, 2009 6:10 pm Post subject: |
|
|
| dnsi0 wrote: | | What do you mean whos code? |
Haha, so you mean you are trying to inject an exe like a dll, or are you WPM'ing the function? Either way; good luck. Both will fail.
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Thu Feb 12, 2009 6:18 pm Post subject: |
|
|
| You can inject an exe into another exe?
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Thu Feb 12, 2009 6:38 pm Post subject: |
|
|
| _void_ wrote: | | You can inject an exe into another exe? |
Ofcourse you can XD
And Flyte:
I just set the image base to a unused portion.
WHen I click inject, it finds the image size. Allocs a new section and writes it there. Then it executes a thread there. Everything else works EXCEPT displaying forms.
|
|
| Back to top |
|
 |
nwongfeiying Grandmaster Cheater
Reputation: 2
Joined: 25 Jun 2007 Posts: 695
|
Posted: Thu Feb 12, 2009 6:58 pm Post subject: |
|
|
| Flyte wrote: | | dnsi0 wrote: | | What do you mean whos code? |
Haha, so you mean you are trying to inject an exe like a dll, or are you WPM'ing the function? Either way; good luck. Both will fail. |
I've always used WPM for .DLL's. How do I do it like you mentioned (first part before the word "or")?
|
|
| Back to top |
|
 |
nog_lorp Grandmaster Cheater
Reputation: 0
Joined: 26 Feb 2006 Posts: 743
|
Posted: Thu Feb 12, 2009 7:23 pm Post subject: |
|
|
void: you can call LoadLibrary() to load an executable, and then GetProcAddress() to get its exports and call them, just like a DLL.
_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish |
|
| Back to top |
|
 |
BanMe Master Cheater
Reputation: 0
Joined: 29 Nov 2005 Posts: 375 Location: Farmington NH, USA
|
Posted: Thu Feb 12, 2009 10:15 pm Post subject: |
|
|
your saying a exe has a EXPORT_TABLE o0..
you could parse the PE like a dll and locate the exports o0 without Function calls like GetProcAddress and LoadLibrary(which are shimmed by everything btw)..
_________________
don't +rep me..i do not wish to have "status" or "recognition" from you or anyone.. thank you. |
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Thu Feb 12, 2009 11:04 pm Post subject: |
|
|
It's been a while since I made mine, but you need to do the following:
1) Create the exe you wish to inject with a .alloc section.
2) Load up the image in your address space.
3) Free enough memory in the targets address space for the parsed image (you can find it by looking at the sections).
4) Rebase the exe according to the alloc'd address in your target (do this in your process), then copy the whole chunk over along with a little execution stub.
5) CreateRemoteThread() the execution stub.
6) ?????
7) Profit
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Thu Feb 12, 2009 11:39 pm Post subject: |
|
|
Out of curiosity, why would you want to inject your EXE into another process?
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Fri Feb 13, 2009 7:32 am Post subject: |
|
|
| Flyte wrote: | | 4) Rebase the exe according to the alloc'd address in your target (do this in your process), then copy the whole chunk over along with a little execution stub. |
Most exe's won't have relocation data packed with them like dll's. (Is it even possible in exe's?) So how would you fix all the jumps and calls which need relocation?
|
|
| Back to top |
|
 |
angerist Grandmaster Cheater Supreme
Reputation: 0
Joined: 18 Jun 2007 Posts: 1011 Location: Australia.
|
Posted: Fri Feb 13, 2009 8:27 am Post subject: |
|
|
| dnsi0 wrote: | | _void_ wrote: | | You can inject an exe into another exe? |
Ofcourse you can XD
And Flyte:
I just set the image base to a unused portion.
WHen I click inject, it finds the image size. Allocs a new section and writes it there. Then it executes a thread there. Everything else works EXCEPT displaying forms. |
Don't you mean inject a dll with a console into a process? You cant inject an .exe into another .exe. I think you can convert an .exe into a byte and save it to memory and inject it to another process
^^This probably wont make sense. (It's 4:30a.m)^^
_________________
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Fri Feb 13, 2009 8:41 am Post subject: |
|
|
| Flyte wrote: | It's been a while since I made mine, but you need to do the following:
1) Create the exe you wish to inject with a .alloc section.
2) Load up the image in your address space.
3) Free enough memory in the targets address space for the parsed image (you can find it by looking at the sections).
4) Rebase the exe according to the alloc'd address in your target (do this in your process), then copy the whole chunk over along with a little execution stub.
5) CreateRemoteThread() the execution stub.
6) ?????
7) Profit |
Thats exactly what I did Flyte... Except I just made the image base higher on compilation so I don't have to rebase and fix all the crap.
|
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Fri Feb 13, 2009 9:19 am Post subject: |
|
|
| dnsi0 wrote: | | Thats exactly what I did Flyte... Except I just made the image base higher on compilation so I don't have to rebase and fix all the crap. |
Correction, that's what the code you took does. I've already a pretty good idea what it is and who made it (it's where I got the idea from originally).
| tombana wrote: | | Flyte wrote: | | 4) Rebase the exe according to the alloc'd address in your target (do this in your process), then copy the whole chunk over along with a little execution stub. |
Most exe's won't have relocation data packed with them like dll's. (Is it even possible in exe's?) So how would you fix all the jumps and calls which need relocation? |
It's a linker option.
|
|
| Back to top |
|
 |
|