{"action":"created","comment":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/comments/97203608","pull_request_review_id":17811921,"id":97203608,"diff_hunk":"@@ -0,0 +1,85 @@\n+This module exploits a SQL injection vulnerability in Advantech WebAccess. The flaw can be found\n+in the ```updateSubmit_Click``` function of the ```updateTemplate``` class, which is normally used for\n+updating a *.xlsx template.\n+\n+The ```updateSubmit_Click``` function calls ```getTemplateIdByName``` from the ```DAO``` class\n+(Data Access Object), which is actually where the SQL injection bug is:\n+\n+```\n+// This line is from Page_Load\n+// As you can see, template is user-controlled\n+this.templateName = this.Request.QueryString[\"template\"];\n+\n+... skipped ...\n+\n+protected void updateSubmit_Click(object sender, EventArgs e)\n+{\n+  DAO dao = new DAO(this.mdbPath, this.logPath);\n+  int templateIdByName = dao.getTemplateIdByName(this.templateName);\n+\n+... skipped ...\n+\n+```\n+\n+The ```getTemplateIdByName``` function will execute a SQL statement with a user-supplied ```template```\n+name, like so:\n+\n+```\n+OleDbDataReader oleDbDataReader = new OleDbCommand(\"SELECT TemplateId FROM rRptTemplate WHERE TemplateName = '\" + templateName + \"'\", this.conn).ExecuteReader();\n+```\n+\n+Since there is no input validation for the ```template``` parameter, this can be exploited to\n+inject additional SQL statements, and have data stolen. This module specifically steals\n+credentials from existing project users stored in config/bwCfg.mdb.\n+\n+Although authentication is required, by default Advantech WebAccess uses a blank password for the\n+built-in ```admin``` account, which allows the SQL injection vulnerability easier to exploit.\n+\n+## Vulnerable Application\n+\n+AdvanTech WebAccess 8.1 was specifically tested during development.\n+\n+To download this software for testing:\n+\n+http://advcloudfiles.advantech.com/web/Download/webaccess/8.1/AdvantechWebAccessUSANode8.1_20151230.exe\n+","path":"documentation/modules/auxiliary/admin/scada/advantech_webaccess_updatetemplate_sqli.md","position":47,"original_position":45,"commit_id":"3414f0ac2f810ca79f34088e7c2750286d1e003c","original_commit_id":"b0fc946f7a09ff732a2201b19e2cc19a2100dc73","user":{"login":"wchen-r7","id":1170914,"avatar_url":"https://avatars.githubusercontent.com/u/1170914?v=3","gravatar_id":"","url":"https://api.github.com/users/wchen-r7","html_url":"https://github.com/wchen-r7","followers_url":"https://api.github.com/users/wchen-r7/followers","following_url":"https://api.github.com/users/wchen-r7/following{/other_user}","gists_url":"https://api.github.com/users/wchen-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/wchen-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wchen-r7/subscriptions","organizations_url":"https://api.github.com/users/wchen-r7/orgs","repos_url":"https://api.github.com/users/wchen-r7/repos","events_url":"https://api.github.com/users/wchen-r7/events{/privacy}","received_events_url":"https://api.github.com/users/wchen-r7/received_events","type":"User","site_admin":false},"body":"Hi @h00die, I double checked on my setup, and I don't think a web server is required prior to the installation. It looks like the installer should do everything for you.\r\n\r\nI installed it on Windows 7 SP1.","created_at":"2017-01-21T18:27:11Z","updated_at":"2017-01-21T18:27:11Z","html_url":"https://github.com/rapid7/metasploit-framework/pull/7859#discussion_r97203608","pull_request_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7859","_links":{"self":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/comments/97203608"},"html":{"href":"https://github.com/rapid7/metasploit-framework/pull/7859#discussion_r97203608"},"pull_request":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7859"}}},"pull_request":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7859","id":102573402,"html_url":"https://github.com/rapid7/metasploit-framework/pull/7859","diff_url":"https://github.com/rapid7/metasploit-framework/pull/7859.diff","patch_url":"https://github.com/rapid7/metasploit-framework/pull/7859.patch","issue_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/7859","number":7859,"state":"open","locked":false,"title":"CVE-2017-5154: Advantech WebAccess ExlViewer updateTemplate SQL Injection","user":{"login":"wchen-r7","id":1170914,"avatar_url":"https://avatars.githubusercontent.com/u/1170914?v=3","gravatar_id":"","url":"https://api.github.com/users/wchen-r7","html_url":"https://github.com/wchen-r7","followers_url":"https://api.github.com/users/wchen-r7/followers","following_url":"https://api.github.com/users/wchen-r7/following{/other_user}","gists_url":"https://api.github.com/users/wchen-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/wchen-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wchen-r7/subscriptions","organizations_url":"https://api.github.com/users/wchen-r7/orgs","repos_url":"https://api.github.com/users/wchen-r7/repos","events_url":"https://api.github.com/users/wchen-r7/events{/privacy}","received_events_url":"https://api.github.com/users/wchen-r7/received_events","type":"User","site_admin":false},"body":"## Description\r\n\r\nThis module exploits a SQL injection vulnerability found in Advantech WebAccess. The updateTemplate class in ExlViewer does not validate the template parameter, which can be abused to inject additional SQL statements by the user, and extract sensitive information from the database.\r\n\r\n## Download link\r\n\r\nhttp://advcloudfiles.advantech.com/web/Download/webaccess/8.1/AdvantechWebAccessUSANode8.1_20151230.exe\r\n\r\nBefore testing, you should make sure that WebAccess has:\r\n\r\n* At least one project.\r\n* At least one node\r\n* At least one project user.\r\n\r\nAll the above can be configured from the management console.\r\n\r\n## Verification\r\n\r\n- [ ] Start msfconsole\r\n- [ ] Do ```use auxiliary/admin/scada/advantech_webaccess_updatetemplate_sqli```\r\n- [ ]  Do ```set USER_FILE [path]```\r\n- [ ] Do ```set RHOST [IP]```\r\n- [ ] Do ```run```\r\n\r\n## Demo\r\n\r\n![webaccess_demo](https://cloud.githubusercontent.com/assets/1170914/22172751/34cff104-df75-11e6-9243-efd97f3762ac.gif)\r\n","created_at":"2017-01-21T06:58:52Z","updated_at":"2017-01-21T18:27:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f2ec326455c76eec4ade257fb8c8fc3c991b8ba8","assignee":{"login":"h00die","id":752491,"avatar_url":"https://avatars.githubusercontent.com/u/752491?v=3","gravatar_id":"","url":"https://api.github.com/users/h00die","html_url":"https://github.com/h00die","followers_url":"https://api.github.com/users/h00die/followers","following_url":"https://api.github.com/users/h00die/following{/other_user}","gists_url":"https://api.github.com/users/h00die/gists{/gist_id}","starred_url":"https://api.github.com/users/h00die/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h00die/subscriptions","organizations_url":"https://api.github.com/users/h00die/orgs","repos_url":"https://api.github.com/users/h00die/repos","events_url":"https://api.github.com/users/h00die/events{/privacy}","received_events_url":"https://api.github.com/users/h00die/received_events","type":"User","site_admin":false},"assignees":[{"login":"h00die","id":752491,"avatar_url":"https://avatars.githubusercontent.com/u/752491?v=3","gravatar_id":"","url":"https://api.github.com/users/h00die","html_url":"https://github.com/h00die","followers_url":"https://api.github.com/users/h00die/followers","following_url":"https://api.github.com/users/h00die/following{/other_user}","gists_url":"https://api.github.com/users/h00die/gists{/gist_id}","starred_url":"https://api.github.com/users/h00die/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h00die/subscriptions","organizations_url":"https://api.github.com/users/h00die/orgs","repos_url":"https://api.github.com/users/h00die/repos","events_url":"https://api.github.com/users/h00die/events{/privacy}","received_events_url":"https://api.github.com/users/h00die/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7859/commits","review_comments_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7859/comments","review_comment_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/7859/comments","statuses_url":"https://api.github.com/repos/rapid7/metasploit-framework/statuses/3414f0ac2f810ca79f34088e7c2750286d1e003c","head":{"label":"wchen-r7:webaccess_updatetemplate","ref":"webaccess_updatetemplate","sha":"3414f0ac2f810ca79f34088e7c2750286d1e003c","user":{"login":"wchen-r7","id":1170914,"avatar_url":"https://avatars.githubusercontent.com/u/1170914?v=3","gravatar_id":"","url":"https://api.github.com/users/wchen-r7","html_url":"https://github.com/wchen-r7","followers_url":"https://api.github.com/users/wchen-r7/followers","following_url":"https://api.github.com/users/wchen-r7/following{/other_user}","gists_url":"https://api.github.com/users/wchen-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/wchen-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wchen-r7/subscriptions","organizations_url":"https://api.github.com/users/wchen-r7/orgs","repos_url":"https://api.github.com/users/wchen-r7/repos","events_url":"https://api.github.com/users/wchen-r7/events{/privacy}","received_events_url":"https://api.github.com/users/wchen-r7/received_events","type":"User","site_admin":false},"repo":{"id":3789747,"name":"metasploit-framework","full_name":"wchen-r7/metasploit-framework","owner":{"login":"wchen-r7","id":1170914,"avatar_url":"https://avatars.githubusercontent.com/u/1170914?v=3","gravatar_id":"","url":"https://api.github.com/users/wchen-r7","html_url":"https://github.com/wchen-r7","followers_url":"https://api.github.com/users/wchen-r7/followers","following_url":"https://api.github.com/users/wchen-r7/following{/other_user}","gists_url":"https://api.github.com/users/wchen-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/wchen-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wchen-r7/subscriptions","organizations_url":"https://api.github.com/users/wchen-r7/orgs","repos_url":"https://api.github.com/users/wchen-r7/repos","events_url":"https://api.github.com/users/wchen-r7/events{/privacy}","received_events_url":"https://api.github.com/users/wchen-r7/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wchen-r7/metasploit-framework","description":"Metasploit Framework","fork":true,"url":"https://api.github.com/repos/wchen-r7/metasploit-framework","forks_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/forks","keys_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/teams","hooks_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/hooks","issue_events_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/issues/events{/number}","events_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/events","assignees_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/assignees{/user}","branches_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/branches{/branch}","tags_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/tags","blobs_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/languages","stargazers_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/stargazers","contributors_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/contributors","subscribers_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/subscribers","subscription_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/subscription","commits_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/contents/{+path}","compare_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/merges","archive_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/downloads","issues_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/issues{/number}","pulls_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/labels{/name}","releases_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/releases{/id}","deployments_url":"https://api.github.com/repos/wchen-r7/metasploit-framework/deployments","created_at":"2012-03-21T18:19:05Z","updated_at":"2016-04-25T18:12:48Z","pushed_at":"2017-01-21T18:25:25Z","git_url":"git://github.com/wchen-r7/metasploit-framework.git","ssh_url":"git@github.com:wchen-r7/metasploit-framework.git","clone_url":"https://github.com/wchen-r7/metasploit-framework.git","svn_url":"https://github.com/wchen-r7/metasploit-framework","homepage":"http://www.metasploit.com/","size":305370,"stargazers_count":7,"watchers_count":7,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":0,"forks":4,"open_issues":0,"watchers":7,"default_branch":"master"}},"base":{"label":"rapid7:master","ref":"master","sha":"201ec174716ef5443c7a1aac9bb763b0814b6c34","user":{"login":"rapid7","id":1013671,"avatar_url":"https://avatars.githubusercontent.com/u/1013671?v=3","gravatar_id":"","url":"https://api.github.com/users/rapid7","html_url":"https://github.com/rapid7","followers_url":"https://api.github.com/users/rapid7/followers","following_url":"https://api.github.com/users/rapid7/following{/other_user}","gists_url":"https://api.github.com/users/rapid7/gists{/gist_id}","starred_url":"https://api.github.com/users/rapid7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapid7/subscriptions","organizations_url":"https://api.github.com/users/rapid7/orgs","repos_url":"https://api.github.com/users/rapid7/repos","events_url":"https://api.github.com/users/rapid7/events{/privacy}","received_events_url":"https://api.github.com/users/rapid7/received_events","type":"Organization","site_admin":false},"repo":{"id":2293158,"name":"metasploit-framework","full_name":"rapid7/metasploit-framework","owner":{"login":"rapid7","id":1013671,"avatar_url":"https://avatars.githubusercontent.com/u/1013671?v=3","gravatar_id":"","url":"https://api.github.com/users/rapid7","html_url":"https://github.com/rapid7","followers_url":"https://api.github.com/users/rapid7/followers","following_url":"https://api.github.com/users/rapid7/following{/other_user}","gists_url":"https://api.github.com/users/rapid7/gists{/gist_id}","starred_url":"https://api.github.com/users/rapid7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapid7/subscriptions","organizations_url":"https://api.github.com/users/rapid7/orgs","repos_url":"https://api.github.com/users/rapid7/repos","events_url":"https://api.github.com/users/rapid7/events{/privacy}","received_events_url":"https://api.github.com/users/rapid7/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rapid7/metasploit-framework","description":"Metasploit Framework","fork":false,"url":"https://api.github.com/repos/rapid7/metasploit-framework","forks_url":"https://api.github.com/repos/rapid7/metasploit-framework/forks","keys_url":"https://api.github.com/repos/rapid7/metasploit-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rapid7/metasploit-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rapid7/metasploit-framework/teams","hooks_url":"https://api.github.com/repos/rapid7/metasploit-framework/hooks","issue_events_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/events{/number}","events_url":"https://api.github.com/repos/rapid7/metasploit-framework/events","assignees_url":"https://api.github.com/repos/rapid7/metasploit-framework/assignees{/user}","branches_url":"https://api.github.com/repos/rapid7/metasploit-framework/branches{/branch}","tags_url":"https://api.github.com/repos/rapid7/metasploit-framework/tags","blobs_url":"https://api.github.com/repos/rapid7/metasploit-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rapid7/metasploit-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rapid7/metasploit-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/rapid7/metasploit-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rapid7/metasploit-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/rapid7/metasploit-framework/languages","stargazers_url":"https://api.github.com/repos/rapid7/metasploit-framework/stargazers","contributors_url":"https://api.github.com/repos/rapid7/metasploit-framework/contributors","subscribers_url":"https://api.github.com/repos/rapid7/metasploit-framework/subscribers","subscription_url":"https://api.github.com/repos/rapid7/metasploit-framework/subscription","commits_url":"https://api.github.com/repos/rapid7/metasploit-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/rapid7/metasploit-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/rapid7/metasploit-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/rapid7/metasploit-framework/contents/{+path}","compare_url":"https://api.github.com/repos/rapid7/metasploit-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rapid7/metasploit-framework/merges","archive_url":"https://api.github.com/repos/rapid7/metasploit-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rapid7/metasploit-framework/downloads","issues_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues{/number}","pulls_url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/rapid7/metasploit-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/rapid7/metasploit-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rapid7/metasploit-framework/labels{/name}","releases_url":"https://api.github.com/repos/rapid7/metasploit-framework/releases{/id}","deployments_url":"https://api.github.com/repos/rapid7/metasploit-framework/deployments","created_at":"2011-08-30T06:13:20Z","updated_at":"2017-01-21T15:48:34Z","pushed_at":"2017-01-21T18:25:31Z","git_url":"git://github.com/rapid7/metasploit-framework.git","ssh_url":"git@github.com:rapid7/metasploit-framework.git","clone_url":"https://github.com/rapid7/metasploit-framework.git","svn_url":"https://github.com/rapid7/metasploit-framework","homepage":"http://www.metasploit.com/","size":294059,"stargazers_count":7549,"watchers_count":7549,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4769,"mirror_url":null,"open_issues_count":355,"forks":4769,"open_issues":355,"watchers":7549,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7859"},"html":{"href":"https://github.com/rapid7/metasploit-framework/pull/7859"},"issue":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/issues/7859"},"comments":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/issues/7859/comments"},"review_comments":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7859/comments"},"review_comment":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/7859/commits"},"statuses":{"href":"https://api.github.com/repos/rapid7/metasploit-framework/statuses/3414f0ac2f810ca79f34088e7c2750286d1e003c"}}}}
{"actor":{"display_login":"wchen-r7"}}