Hooligan VDS Developer
Joined: 28 Oct 2003 Posts: 480 Location: California
|
Posted: Tue May 02, 2006 11:34 pm Post subject: User privileges... |
|
|
I am trying to determine the logged in user privileges, (admin, power user, etc.). I am certain I'm doing this the hard way, but this seemed to be the most promising way I could find... Here is some test code I wrote:
Code: | loadlib netapi32.dll
loadlib advapi32.dll
loadlib kernel32.dll
%a = @fill(256,,Z)
%s = @binary(dword,256)
%%user = @lib(advapi32,GetUserNameA,bool:,@addr("%a"),@addr("%s"))
%x = @adjust(%a )
info length @len(%x)
%B = @Fill(@Prod(@Sum(@len(%x),1),2))
%R = @lib(kernel32,MultiByteToWideChar,INT:,0,0,STR:%x,-1,@ADDR("%B"),@Prod(@Sum(@len(%x),1),2))
info %B
%c = @Prod(@Sum(@len(%x),1),2)
%f = @binary(BYTE,0)
%R = @lib(netapi32,NetUserGetInfo,INT:,NIL,STR:%B,1,@addr("%f"))
rem how do I extract the data that is contained in the location that %f points to?
%g = @addr("%f")
info %g
info @len(%g)
%%start = @Sum(8,%c)
%%end = @Sum(%%start, 4)
%%privilege = @SUBSTR(@val(%g),%%start,%%end)
info %%privilege
freelib advapi32.dll
freelib kernel32.dll
freelib netapi32.dll
exit
|
Anyone have any clue what is missing? I can't seem to access the data contained in the location that %f points to...
This is making my peanut brain hurt!
Thanks in advance,
Hooligan _________________ Hooligan
Why be normal? |
|