{"action":"closed","issue":{"url":"https://api.github.com/repos/urbanadventurer/WhatWeb/issues/237","repository_url":"https://api.github.com/repos/urbanadventurer/WhatWeb","labels_url":"https://api.github.com/repos/urbanadventurer/WhatWeb/issues/237/labels{/name}","comments_url":"https://api.github.com/repos/urbanadventurer/WhatWeb/issues/237/comments","events_url":"https://api.github.com/repos/urbanadventurer/WhatWeb/issues/237/events","html_url":"https://github.com/urbanadventurer/WhatWeb/issues/237","id":292283573,"number":237,"title":"[Help Wanted]How can I store scan result to mysql?","user":{"login":"fiht","id":15059493,"avatar_url":"https://avatars2.githubusercontent.com/u/15059493?v=4","gravatar_id":"","url":"https://api.github.com/users/fiht","html_url":"https://github.com/fiht","followers_url":"https://api.github.com/users/fiht/followers","following_url":"https://api.github.com/users/fiht/following{/other_user}","gists_url":"https://api.github.com/users/fiht/gists{/gist_id}","starred_url":"https://api.github.com/users/fiht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fiht/subscriptions","organizations_url":"https://api.github.com/users/fiht/orgs","repos_url":"https://api.github.com/users/fiht/repos","events_url":"https://api.github.com/users/fiht/events{/privacy}","received_events_url":"https://api.github.com/users/fiht/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-01-29T04:47:23Z","updated_at":"2018-02-11T07:49:41Z","closed_at":"2018-02-11T07:49:41Z","author_association":"NONE","body":"# Question\r\nCreate the scan by run command.\r\n```\r\n./whatweb -i url_list.txt --log-sql=urls.sql\r\n```\r\nthe urls.sql looks like:\r\n```\r\nINSERT IGNORE INTO targets (status,target) VALUES ('200','http://www.baidu.com/');\r\nINSERT INTO request_configs (value) VALUES ('{\"headers\":{\"User-Agent\":\"WhatWeb/0.4.9\"}}')\r\nINSERT INTO scans (target_id, config_id, plugin_id, version, os, string, account, model, firmware, module, filepath, certainty) VALUES ( (SELECT target_id from targets WHERE target = 'http://www.baidu.com/'),(SELECT MAX(config_id) from request_configs),(SELECT plugin_id from plugins WHERE name = 'Title'), '','','百度一下，你就知道','','','','','','' );\r\nINSERT INTO scans (target_id, config_id, plugin_id, version, os, string, account, model, firmware, module, filepath, certainty) VALUES ( (SELECT target_id from targets WHERE target = 'http://www.baidu.com/'),(SELECT MAX(config_id) from request_configs),(SELECT plugin_id from plugins WHERE name = 'X-Powered-By'), '','','HPHP','','','','','','' );\r\n```\r\nthe whole file is at [http://termbin.com/4amj](http://termbin.com/4amj)\r\nCloud someone how can i get the table struct?\r\nI've tried:\r\n```\r\n./whatweb --log-sql-create 1.sql\r\n```\r\nthe 1.sql looks like:\r\n```CREATE TABLE plugins (plugin_id int NOT NULL AUTO_INCREMENT, name varchar(255) NOT NULL,PRIMARY KEY (plugin_id), UNIQUE (name));\r\nCREATE TABLE targets (target_id int NOT NULL AUTO_INCREMENT, target varchar(2048) NOT NULL, status varchar(10),PRIMARY KEY (target_id), UNIQUE (target, status) );\r\nCREATE TABLE scans (scan_id int NOT NULL AUTO_INCREMENT, config_id INT NOT NULL, plugin_id INT NOT NULL, target_id INT NOT NULL, version varchar(255), os varchar(255), string varchar(1024), account varchar(1024), model varchar(1024), firmware varchar(1024), module varchar(1024), filepath varchar(1024), certainty varchar(10) ,PRIMARY KEY (scan_id));\r\nCREATE TABLE request_configs (config_id int NOT NULL AUTO_INCREMENT, value TEXT NOT NULL, PRIMARY KEY (config_id) );\r\nINSERT INTO plugins (name) VALUES ('Custom-Plugin');\r\nINSERT INTO plugins (name) VALUES ('Grep');\r\nINSERT INTO plugins (name) VALUES ('Conexant-EmWeb');\r\nINSERT INTO plugins (name) VALUES ('Mahara');\r\nINSERT INTO plugins (name) VALUES ('eMeeting-Online-Dating-Software');\r\nINSERT INTO plugins (name) VALUES ('Trend-Micro');\r\n```\r\nWhen use this table struct, source scanlog.sql still do not working. the output like below:\r\n```\r\nmysql> source urls.sql;\r\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\r\n\r\nERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO scans (target_id, config_id, plugin_id, version, os, string, account' at line 2\r\nERROR 1048 (23000): Column 'config_id' cannot be null\r\nERROR 1048 (23000): Column 'config_id' cannot be null\r\nERROR 1048 (23000): Column 'config_id' cannot be null\r\nERROR 1048 (23000): Column 'config_id' cannot be null\r\nERROR 1048 (23000): Column 'config_id' cannot be null\r\nERROR 1048 (23000): Column 'config_id' cannot be null\r\nERROR 1048 (23000): Column 'config_id' cannot be null\r\nERROR 1048 (23000): Column 'config_id' cannot be null\r\nERROR 1048 (23000): Column 'config_id' cannot be null\r\nERROR 1048 (23000): Column 'config_id' cannot be null\r\nERROR 1048 (23000): Column 'config_id' cannot be null\r\nERROR 1048 (23000): Column 'config_id' cannot be null\r\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\r\n```\r\nMySQL Version:  5.7.19 "}}
{"actor":{"display_login":"fiht"}}