{"action":"created","issue":{"url":"https://api.github.com/repos/allfro/pymetasploit/issues/9","repository_url":"https://api.github.com/repos/allfro/pymetasploit","labels_url":"https://api.github.com/repos/allfro/pymetasploit/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/allfro/pymetasploit/issues/9/comments","events_url":"https://api.github.com/repos/allfro/pymetasploit/issues/9/events","html_url":"https://github.com/allfro/pymetasploit/issues/9","id":198956829,"node_id":"MDU6SXNzdWUxOTg5NTY4Mjk=","number":9,"title":"Fixes to be applied when using Python 3","user":{"login":"strangeloveBsc","id":3050149,"node_id":"MDQ6VXNlcjMwNTAxNDk=","avatar_url":"https://avatars2.githubusercontent.com/u/3050149?v=4","gravatar_id":"","url":"https://api.github.com/users/strangeloveBsc","html_url":"https://github.com/strangeloveBsc","followers_url":"https://api.github.com/users/strangeloveBsc/followers","following_url":"https://api.github.com/users/strangeloveBsc/following{/other_user}","gists_url":"https://api.github.com/users/strangeloveBsc/gists{/gist_id}","starred_url":"https://api.github.com/users/strangeloveBsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strangeloveBsc/subscriptions","organizations_url":"https://api.github.com/users/strangeloveBsc/orgs","repos_url":"https://api.github.com/users/strangeloveBsc/repos","events_url":"https://api.github.com/users/strangeloveBsc/events{/privacy}","received_events_url":"https://api.github.com/users/strangeloveBsc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-01-05T13:34:01Z","updated_at":"2018-08-06T02:06:11Z","closed_at":null,"author_association":"NONE","body":"httplib does not exist in python3, httplib2 does not have a HTTPConnection class but uses HTTPConnectionWithTimeout. \r\nSo one option would be refactoring some code to use httplib2 or use http.client instead (so does httplib2)\r\nor changing msfrpc.py line 3 to:\r\n`from http.client import HTTPConnection, HTTPSConnection`\r\n\r\nUsing http.client throws a failing certificate-validation in the way which I managed to circumvent using some ugly monkeypatching. \r\n\r\nLast issue so far:\r\n\r\n```\r\nclient = MsfRpcClient(\"actual_password\")\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python3.5/dist-packages/metasploit/msfrpc.py\", line 316, in login\r\n    if r['result'] == 'success':\r\nKeyError: 'result'\r\n\r\n```\r\nWill fail now since Python3 discriminates between strings and Bytes. \r\nFixed by using:\r\ntry:\r\n```\r\n\r\nif r[b'result'] == b'success':\r\n    self.sessionid = r[b'token']\r\n    except KeyError:\r\n        raise MsfRpcError('Login failed.')\r\n\r\n```\r\n**EDIT:** The String / Byte thingie will repeat quite a few times. Maybe I'll send you a pull request after I'm done…\r\n"},"comment":{"url":"https://api.github.com/repos/allfro/pymetasploit/issues/comments/410569102","html_url":"https://github.com/allfro/pymetasploit/issues/9#issuecomment-410569102","issue_url":"https://api.github.com/repos/allfro/pymetasploit/issues/9","id":410569102,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMDU2OTEwMg==","user":{"login":"26huitailang","id":10754001,"node_id":"MDQ6VXNlcjEwNzU0MDAx","avatar_url":"https://avatars3.githubusercontent.com/u/10754001?v=4","gravatar_id":"","url":"https://api.github.com/users/26huitailang","html_url":"https://github.com/26huitailang","followers_url":"https://api.github.com/users/26huitailang/followers","following_url":"https://api.github.com/users/26huitailang/following{/other_user}","gists_url":"https://api.github.com/users/26huitailang/gists{/gist_id}","starred_url":"https://api.github.com/users/26huitailang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/26huitailang/subscriptions","organizations_url":"https://api.github.com/users/26huitailang/orgs","repos_url":"https://api.github.com/users/26huitailang/repos","events_url":"https://api.github.com/users/26huitailang/events{/privacy}","received_events_url":"https://api.github.com/users/26huitailang/received_events","type":"User","site_admin":false},"created_at":"2018-08-06T02:06:11Z","updated_at":"2018-08-06T02:06:11Z","author_association":"NONE","body":"@CoffeeorteaH Sorry, I don't use the shell part. I just use the exploit and payload part. I put the source code in my project directly as a package. When there is sth wrong, you can fix or locate the problem as quickly as possible."}}
{"actor":{"display_login":"26huitailang"}}