Author: Sh@dow 之前按照国外的方法,虽然能够成功的运行autopwn,但是设置起来灰常麻烦,现在按照自己总结的简单的方法,贴出来详细的设置步骤。首先我们找到创建数据表的sql文件root@ubuntu:/pentest/exploits/framework3/data# cd sqlroot@ubuntu:/pentest/exploits/framework3/data/sql# lsmysql.sql postgres.sql sqlite.sql在这里有三个,分别是mysql,postgres,sqlite,这里我们只讲解mysql数据库版的设置,首先查看mysql.sql的内容root@ubuntu:/pentest/exploits/framework3/data/sql# cat mysql.sql create table hosts (id SERIAL PRIMARY KEY,created TIMESTAMP,address VARCHAR(16) UNIQUE,comm VARCHAR(255),name VARCHAR(255),state VARCHAR(255),info VARCHAR(1024),os_name VARCHAR(255),os_flavor VARCHAR(255),os_sp VARCHAR(255),os_lang VARCHAR(255),arch VARCHAR(255));create table services (id SERIAL PRIMARY KEY,host_id INTEGER,created TIMESTAMP,port INTEGER NOT NULL,proto VARCHAR(16) NOT NULL,state VARCHAR(255),name VARCHAR(255),info VARCHAR(1024));create table vulns (id SERIAL PRIMARY KEY,service_id INTEGER,created TIMESTAMP,name VARCHAR(255),data TEXT);create table refs (id SERIAL PRIMARY KEY,ref_id INTEGER,created TIMESTAMP,name VARCHAR(512));create table vulns_refs (ref_id INTEGER,vuln_id INTEGER);create table notes (id SERIAL PRIMARY KEY,host_id INTEGER,created TIMESTAMP,ntype VARCHAR(512),data TEXT);ok,接下来,我们我们连接到mysql数据库root@ubuntu:/pentest/exploits/framework3/data/sql# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 35Server version: 5.0.67-0ubuntu6 (Ubuntu)Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> show databases;+--------------------+| Database |+--------------------+| information_schema | | metasploit | | mysql | +--------------------+3 rows in set (0.00 sec)因为之前我们已经创建了名称为metasploit的空数据库,现在我们创建表,当然,你可以直接复制mysql.sql内容到mysql管理器里面。 mysql> use metasploit;Database changedmysql> create table hosts ( -> id SERIAL PRIMARY KEY, -> created TIMESTAMP, -> address VARCHAR(16) UNIQUE, -> comm VARCHAR(255), -> name VARCHAR(255), -> state VARCHAR(255), -> info VARCHAR(1024),