metasploit-framework icon indicating copy to clipboard operation
metasploit-framework copied to clipboard

post/multi/gather/chrome_cookies: Post failed: NoMethodError undefined method `type' for nil:NilClass

Open maamirh opened this issue 3 years ago • 5 comments

I am getting this type of error when I am executing the run command. Kindly resolve this issue.

image

maamirh avatar Oct 17 '20 20:10 maamirh

When creating an issue, please ensure that the default issue template has been updated with the required details.

Closing this issue. If you believe this issue has been closed in error, please provide any relevant output and logs which may be useful in diagnosing the issue.

label-actions[bot] avatar Oct 17 '20 23:10 label-actions[bot]

I was not able to replicate this issue. It looks like something's gone wrong with the session, and it's continued to run the module unexpectedly - but from this image alone it's not possible to see what's gone wrong.

adfoster-r7 avatar Oct 17 '20 23:10 adfoster-r7

I was able to replicate this by opening a valid session, setting the options for this module, then manually killing my session.

It looks like metasploit catches the session's option validation failure, attempts to clean up, and the cleanup assumes that it is interacting with a valid session - subsequently dying:

image

In this case specifically, the Chrome cookie's cleanup code attempts to interact with the dead session and dies:

https://github.com/rapid7/metasploit-framework/blob/4fb0c4ac8ab89575c4358d2369d3650bc3e1c10d/modules/post/multi/gather/chrome_cookies.rb#L154-L158

adfoster-r7 avatar Oct 17 '20 23:10 adfoster-r7

1- This is the first image in which I set LHOST and LPORT and I did port forward in my router too. image

2- I make payload by setting options that you can see in the image and run payload in my next machine and the session is being open and then happening further which you can see. image

3- I opened another terminal and followed the given guide which you provide and getting this error.

image

maamirh avatar Oct 18 '20 08:10 maamirh

I use this command and cookies are being saved now but problem is that when importing cookies using the EditThisCookie extension then sessions are not being generated and Gmail is showing logout. I think Gmail has changed something.

image

maamirh avatar Oct 18 '20 11:10 maamirh