ysoren 发表于 2018-10-4 12:23:07

linux mysql结合wyportmap使用

# rpm -qa | grep mysql  // 这个命令就会查看该操作系统上是否已经安装了mysql数据库  
有的话,我们就通过 rpm -e 命令 或者 rpm -e --nodeps 命令来卸载掉
  
# rpm -e mysql  // 普通删除模式# rpm -e --nodeps mysql  // 强力删除模式,如果使用上面命令删除时,提示有依赖的其它文件,则用该命令可以对其进行强力删除
  

  
安装mysql
  

  
# yum list | grep mysql
  
然后我们可以通过输入 yum install -y mysql-server mysql mysql-devel 命令将mysql mysql-server mysql-devel都安装好(注意:安装mysql时我们并不是安装了mysql客户端就相当于安装好了mysql数据库了,我们还需要安装mysql-server服务端才行)
  
# yum install -y mysql-server mysql mysql-deve
  
#/usr/bin/mysqladmin -u root password 'new-password'  // 为root账号设置密码
  
所以我们可以通过 该命令来给我们的root账号设置密码(注意:这个root账号是mysql的root账号,非Linux的root账号)
  
# mysqladmin -u root password 'root'  // 通过该命令给root账号设置密码为 roog
  

  
下载wyportmap
  

  
git clone https://github.com/ring04h/wyportmap.git
  

  
使用方法
  

  
usage: wyportmap.py targets taskid
  

  
修改wyportmap.py
  

  
#vi wyportmap.py
  
global_dbcoon = 'mysql+mysqldb://root:123456@127.0.0.1:3306/wscan'
  
#global_dbcoon = 'mysql+mysqldb://用户名:密码@数据库服务器IP:数据库端口/数据库名称'
  

  
进入数据库查询
  

  
mysql -u root -p
  
mysql> use wscan;
  
Database changed
  
mysql> show tables;
  
Empty set (0.00 sec)
  
mysql> show tables;
  
+-----------------+
  
| Tables_in_wscan |
  
+-----------------+
  
| result_ip       |
  
| result_ports    |
  
+-----------------+
  

  
查询用到的命令
  

  
desc result_ip;
  
select * from result_ip;
  
desc result_ports;
  
select * from result_ports;


页: [1]
查看完整版本: linux mysql结合wyportmap使用