The Incognito

                               THE INCOGNITO




No nope we aren't talking about this thing here





We are talking about a metasploit module which looks something like this





Well specificially its about the what the impersonation and deligation tokens are


le what haters think :




Incognito token is a very powerfull extenstion which helps us to steal windows tokens and impersonate them , but have you ever thought what are these tokens actually and why do windows use them ? well then I am glad that we are on the same page ! and here I am making clear things to you.

So lets get started already !

When a user logs into a system there are a lot of processes created on his behalf , for instance explorer.exe which helps in running the desktop in Windows xp machines especially. So what windows does is that it goes ahead and gives a primary token to the user process

Some of the things the primary token  : 

SID

Groups

Privilages and Much more stuff

SID is know as security identifier which helps in unique identification of a particular user

Groups is something that is self explanatory , its just the info of the groups the user is part of

Privilages is something a user who is logged in is allowed to do

And if the same user process as multiple threads which we find it most common , then same primary token associated with the user process is shared with the thread.

Ok now that the big deal about these primary tokens ?

Well this acts as an authorization evidence , So whenever a user process or its threads wants to access a resource which requries certain level of privilage , then the primary token of the user process is taken and it compared against the privilage of the requested resource . If the token has sufficient privilages , then it gains access to the resource , and else no good.

So having an idea about tokens let's dig deeper shall we ?!

Impersonation tokens :

For instance let's say that there is an FTP server running on a system and this server process has a primary token associated with it based on the user who ran the ftp processes and now let's say that each one of the threads (which also possess same primiary of the ftp process) of the ftp server processes is being used to serve a client who connects to the server. So till here everthing is well and good and here we come to the main part, when a remote user (lets say user1) logs in  , the thread should be able to access all the files and folder that user1 has access to shouldn't it ?! but how will it be able to access them if it possess the primiary token of the user who ran the process ? as the user who ran the process may or may not have that level of privilage and so the thread gotta somehow possess the identify of user user1 to meet the privilages and this is where Impersonation of tokens comes into play. The ftp process thread goes ahead and creates an impersonation token for user1 , and using this impersonation token the thread will be able to access the things which user1 would actually be able to access . And when the user1 is done with the requests and logs off , the thread forsakes the token and possess its own primary token.

So in a nutshell an impersonation token is a mechinism where a process or a thread temporarily can assume the identity of some other user .

Levels of Impersonation Tokens : 

1)  Impersonation : 

Well as we have already this will let the server to act on behalf of the client who authenticates to it , but only on the local machine on which the server is running

2) Deligation :

Here the impersonation can even extend to remote systems


                                               That's all it is to it , good bye and imma see you again ;)

Comments

Popular posts from this blog

Learning Nmap Host Discovery with iptables and Wireshark Analysis

Persistence Techniques with Metasploit - Part 6

Generating Payloads using Msfvenom - Metasploit Part 5