Jump to content
Wubi

Token Stealing And Incognito

Recommended Posts

Posted

In metasploit framework there is an extension which is called incognito which allows us to perform activities such as token stealing and manipulation.These kind of activities are important in the privilege escalation stage of a penetration test because if we can steal the token of an administrator for example we can perform higher privilege operations on the target.

So lets say that we have successfully exploited a remote system and we have a meterpreter session.The first thing that we have to do is to load the incognito extension in metasploit which allows us to get commands that the incognito extension supports.

1.png?w=645

Then we can use the command list_tokens -u in order to obtain the list of tokens that are available of the remote system.

2.png?w=645

if we would like to impersonate a token from the above list we can use the command impersonate_token and one of the delegation tokens that are available.The image below is showing the use of this command.

3.png?w=645

We can see from the above image that the session has changed from System to Administrator.So now we can perform various tasks such as modifying files or to break other computers that exist in the same network as the administrator of this system.If we want to return back to our original token we can use the rev2self command.

4.png?w=645

Incognito has some other options as well like the add_group user which will try to add a user to global group with all tokens.Except of the token impersonation we can try to steal the token as well.The way that this method works is that it tries to steal the token from an existing process.So in order to achieve that we need first to know the PID’s of the processes of the remote system.We can use the command ps in meterpreter in order to obtain the list of the processes of our target.

5.png?w=645&h=225

In this example we will try to steal the token of the user Administrator.So we will use the command steal_token and the PID of one of the processes that this user owns.For example the 1864 is the PID of the cmd process.The image below is showing that we have successfully managed to steal the token from the administrator.

6.png?w=645

Conclusion

In this article we saw how we can impersonate users and steal tokens by using the meterpreter after we have exploited the remote system.We can also try to break other systems in the domain with a stolen token.The usage of token stealing and impersonation will help a penetration tester to escalate privileges on the local machine or even to be a domain administrator which is always one of the ultimate goals.

Sursa: Penetration Testing Lab

  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...