Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: can't set attribute (on option attribute) #11

Open
Mikaayenson opened this issue Jul 16, 2017 · 4 comments
Open

AttributeError: can't set attribute (on option attribute) #11

Mikaayenson opened this issue Jul 16, 2017 · 4 comments

Comments

@Mikaayenson
Copy link

Mikaayenson commented Jul 16, 2017

>>> from metasploit.msfrpc import MsfRpcClient
>>> client = MsfRpcClient('1oP619Xd', server='10.0.0.42', port=55553, ssl=False)
>>> client.modules.use('exploit', 'exploit/windows/smb/ms08_067_netapi')
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    client.modules.use('exploit', 'osx/browser/software_update')
  File "/Library/Python/2.7/site-packages/metasploit/msfrpc.py", line 1661, in use
    return ExploitModule(self.rpc, mname)
  File "/Library/Python/2.7/site-packages/metasploit/msfrpc.py", line 1486, in __init__
    super(ExploitModule, self).__init__(rpc, 'exploit', exploit)
  File "/Library/Python/2.7/site-packages/metasploit/msfrpc.py", line 1327, in __init__
    setattr(self, k, self._info.get(k))
AttributeError: can't set attribute
@Mikaayenson Mikaayenson changed the title AttributeError: can't set attribute AttributeError: can't set attribute (on option attribute) Jul 16, 2017
@Mikaayenson
Copy link
Author

I believe this is because ModuleInfo now includes an attribute called options and we have a property options. https://github.com/allfro/pymetasploit/blob/master/src/metasploit/msfrpc.py#L1330

@utkusen
Copy link

utkusen commented Aug 28, 2017

Your commit fixes the "AttributeError: can't set attribute" problem. Thank you so much. However I got another error with your fork. I always get "Connection refused" error when it tries to connect msfrpc. That's why I merged only commit e493c36 for myself and it works now.

@Mikaayenson
Copy link
Author

How are you loading msfrpc?

@utkusen
Copy link

utkusen commented Aug 29, 2017

from metasploit.msfrpc import MsfRpcClient
client = MsfRpcClient('passss')

roumy added a commit to roumy/pymetasploit that referenced this issue Aug 17, 2018
mcjon3z added a commit to isaudits/msfrpc_console that referenced this issue Nov 3, 2018
7ebfeb5 remove github desktop garbage
3aef4ce remove ds
12916fe removing github desktop garbage
337b7ef Merge branch 'pr/3'
8ced22c Merge pull request #2 from Mikaayenson/pull_request_module_info_fix
02673ad remove ds store files
e493c36 Don't try to set property attributes. Bug Fix: allfro/pymetasploit#11
5aca68c fixed whitespace mismatch
71f70bb deleted bak files
9616b58 Merge remote-tracking branch 'remotes/nnamon/master'
4b8f745 Merge remote-tracking branch 'remotes/ploq/master'
28b199f Merge remote-tracking branch 'remotes/72616e646f6d/master'
693fc68 Merge remote-tracking branch 'remotes/fallenbeck/master'
c8b6909 Merge remote-tracking branch 'remotes/kyle-fd/master'
0a9b41e Removed check for DisablePayloadHandler in msfrpc.
deeee19 changed httplib to http.client for python3
4aac15d Removed print
9e65d75 Python 3 compatibility
bb87472 Update msfrpc.py
d021b55 Create msfrpcdHandler.py
f2a77fd fix bad chars in prompt
2741a93 Updated standard port

git-subtree-dir: modules/pymetasploit
git-subtree-split: 7ebfeb5a1d5ca0a7b58b09debc487c92f55033b6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants