系统教程
您现在的位置是:首页>服务器系统>Ubuntu系统内容

ubuntu16.04下passivedns安装指南

时间:2018-04-09 出处:未知复制分享人气(次) 【

install passivedns on ubuntu

Passive DNS对安全研究非常重要,因为它可以在前期帮助我们构建出目标的基础设施结构,并且可以得到以下三方面的答案:
该域名曾经绑定过哪些IP
这个IP有没有其他的域名
该域名最早/最晚什么时候出现


Passive DNS同时也在SOC的时候起到很大的帮助。通过识别的恶意域名,可以找到其他被恶意破坏的机器。目前有很多网站允许我们访问它的 Passive DNS系统,例如:
Virustotal(https://www.virustotal.com/)、passivetotal(https://www.passivetotal.com)、CIRCL (https://www.circl.lu/services/passive-dns/)。有很多这样的网站,但是,自己在本地有一个当然会更方便。

https://github.com/gamelinux/passivedns


环境ubuntu16.04

sudo -i

apt-get install git-core binutils-dev libldns1 libldns-dev libpcap-dev libdate-simple-perl

git clone git://github.com/gamelinux/passivedns.git

cd passivedns/

autoreconf --install

./configure

make

cd /src

./passivedns -l /home/sky/passivedns.log

ubuntu16.04下passivedns安装指南

开始监听中...

查看下监听的记录文件

ubuntu16.04下passivedns安装指南

将记录文件内容导入mysql中


安装mysql

sudo apt-get install mysql-server mysql-client mysql-dev  #中途会让你输入一次root用户密码

sudo apt-get install php5-mysql  #安装php5-mysql 是将php和mysql连接起来


创建数据库

mysql -uroot -p123456

GRANT USAGE ON *.* TO 'pdns'@'localhost' IDENTIFIED BY 'pdns';

GRANT SELECT,CREATE,INSERT,UPDATE ON pdns.* TO 'pdns'@'localhost';

flush privileges;

CREATE DATABASE pdns;


log文件导入mysql

apt-get install perl-dev libmysqld-dev libmysqlclient-dev

PATH=/usr/bin:$PATH;export PATH

perl -MCPAN -e shell

install DBI

install DBD::mysql

cd tools

perl pdns2db.pl --file /var/log/passivedns.log      如果直接运行会报错,需要先安装perl的DBI和DBD::mysql这2个模块,才能使用


然后echo “select * from pdns limit 10;” | mysql -updns -ppdns -hlocalhost pdns

结果如图:

ubuntu16.04下passivedns安装指南

只要你浏览网页,他都会自己记录,然后手工导入mysql中,这样自已可能搭建像360天眼的passivedns

当然也可以用其他网站已经提供好的如http://passivedns.mnemonic.no/search/能查询到最早2012年的。

    最新资讯
    热门内容
    小米移动电源能为iPad mini充几次电