#Create a fake dll with fake functions in memory

97 messages · Page 1 of 1 (latest)

worthy ledge
#

Don't be a skid

wild karma
#

what's the use case here

wispy kiln
worthy ledge
# wispy kiln in what way is that being a skid?

there are very few cases where someone who doesn't already know how to do this would want to do this, and the vast majority of those cases are cheats for videogames. being intentionally vague about your usecase doesn't help

wispy kiln
# wild karma what's the use case here

I have a secondary dll i want to load that in turn loads another dll. but that other dll has very basic functionality and i just want to skip that loading step

wispy kiln
#

and im affecting my own process, not another

worthy ledge
#

and it's for educational purposes, too?

wispy kiln
worthy ledge
#

"these types of things" ?

wispy kiln
worthy ledge
#

what's the actual usecase for doing this

worthy ledge
#

no, that's wishy-washy "I want to load a DLL"

#

What's the actual usecase

wispy kiln
# worthy ledge What's the actual usecase

that is the usecase, im loading a dll, that dll trys to load another dll (ill call it dll2). i want to skip the loading part of dll2 and instead try to do it in memory

worthy ledge
#

ok good luck then

#

and by that I mean bad luck cause you shouldn't be a skid

wispy kiln
worthy ledge
#

the thing you're asking to do is something that's 99% asked by skids, and you're being unusually defensive about why you're trying to do it

#

not a good look

wispy kiln
wild karma
#

Give me like half an hour and I'll check

worthy ledge
wispy kiln
# worthy ledge the details help us be sure we aren't helping skids

im loading the firefox's nss3.dll, the nss3.dll in turn loads the mozglue.dll, the only thing it uses the mozglue dll for is very basic, already implemented in the kernel functions (very basic functions like _strdup, realloc, malloc, and some more). I dont want to load the mozglue dll, i want to attempt to load nss3.dll without loading in mozglue (but instead fake loading it in and redirecting functions to the kernel32). I dont know enough about windows internals to trick my own process into thinking a dll is loaded in. thats why im asking for help. yes i know i can load the mozglue.dll in, i know it would be easier. but again, this is for my own learning, and i want to understand how someone would do it (fake a dll being loaded in).

worthy ledge
#

Why nss3 specifically

wispy kiln
worthy ledge
#

and you want to do that why

#

as opposed to doing that normally through the firefox client

wispy kiln
worthy ledge
#

you do understand why being so defensive about a program to decrypt private user info looks pretty sus, right?

wispy kiln
worthy ledge
#

there are plenty of other things you could be doing to learn and experiment with dll loading

worthy ledge
wispy kiln
wispy kiln
# worthy ledge it took a *lot* to get it out

because it doest need to? the basic premise is tricking the process that a dll is already loaded. as i said above, the details in what dll's and what the dll does, is irrelvant other than your own curiosities

worthy ledge
#

The only place I'd be comfortable linking you to is the winapi docs page on LoadLibrary

worthy ledge
#

No thanks, and I recommend nobody else touch this

wispy kiln
wild karma
wispy kiln
# wild karma ye defo malware I'm going back to bed

malware is a great way to learn about how these types of things work. i never use anything i make, but its nice knowledge. and it makes for cool projects (at least i personally like the projects ive made (on my github)). well gn, i guess this is going to go nowhere

wild karma
#

Please don't write your malware in C#, that's absolute ass shit

#

Just compile your funny new C++ project as a DLL and export the same functions boom done have fun

wispy kiln
wild karma
#

WHAT

#

C# making smaller binaries than C++?

wispy kiln
wild karma
#

What do you want to do

#

And how'd you compile your C++ program lmao

#

There's a reason why people in embedded development don't use C# 🗿

wispy kiln
#

if your going to do a printf, then yea c++ its going to be smaller

wispy kiln
#

its just a hobby

wispy kiln
wild karma
#

You will need to load it in?

#

wat

wispy kiln
wild karma
#

But the way you're approaching this isn't exactly what most red teams would do tbf

wispy kiln
wild karma
#

(Or APTs)

wispy kiln
#

im not some hacker, i just have ideas and they seem interesting (to me)

wild karma
#

Yeah and I'm saying there are probably better ways to achieve the same goal

wispy kiln
#

of course i could just compile the modifed dll, and load it in using loadlibrary

#

but then thats not my goal

wild karma
#

I mean what you would do in reality is just copy the files over to some other machine (aka your c2) and then probably brute force the password on some funny GPU cluster

wild karma
wispy kiln
wild karma
wispy kiln
#

of course nss3 calls functions from mozglue so i would need to make the getProcAddress point to a different address

wild karma
#

I think what you're looking for is hooking

#

So you could hook into the mozglue functions and execute your code before they run

wispy kiln
#

im not capturing or modifying the input or output

wild karma
#

Yeah, hooking would be the alternative

wispy kiln
wild karma
#

You'd stop execution on FF some time before mozglue is loaded, load your mozglue wrapper (proxying through all calls to the actual mozglue except for the one you want to change), resume execution

south remnant
#

this is so confusing

#

is nss3 calling loadlibrary for mozglue, or is it apart of it's link table thing

#

sorry import table

#

i think that's what it is

#

been so long since looking at PE

wispy kiln
modern swift
#

quit being silly, don’t make malware

wild karma
#

Any respectable HF malware vendor would just copy paste and be done

modern swift
#

maybe

#

but also it’s sus

wispy kiln
#

fThis thread is riveting

#

Take it from experience, do not do ethical hacking or pentesting without an above board sponsorship.

#

Especially if you live in an under educated area, you don't want a Andy Griffith motherf**ker interpreting what you are doing.

#

Damn script kiddies

wispy kiln
wispy kiln
#

Script kiddies lol

#

Aint seen that term since...2019