Introduction
IVRE (also known as DRUNK) is an open-source web detection framework tool that uses Nmap, Zmap for active network detection, Bro and P0f for passive network traffic analysis, the results of which are stored in a database to facilitate data queries and aggregated statistics.
IVRE official website:https://ivre.rocks
GitHub:https://github.com/cea-sec/ivre
Install
Install with pip
pip3 install ivre
Start python3 here.
Install mongodb
The database must be installed, and the following links can be consulted for the way in which the mongodb is installed on ubunt:
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
The process is likely to be as follows:
Import the public key used by the package management system.¶
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
Create a list file for MongoDB.
echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
The operating system is ubuntu 16.04LTS.
Reload local package database
sudo apt-get update
Install the MongoDB packages.
sudo apt-get install -y mongodb-org
start mongodb
sudo service mongod start
configure
Specific configuration methods can be found in the following links:
https://github.com/cea-sec/ivre/blob/master/doc/INSTALL.md
The following could be added to the list of changes:
GEOIP_PATH = "/usr/local/share/ivre/geoip/"
DB Creation
The following steps will suffice:
$ ivre scancli --init
This will remove any scan result in your database. Process ? [y/N] y
$ ivre ipinfo --init
This will remove any passive information in your database. Process ? [y/N] y
$ ivre ipdata --init
This will remove any country/AS information in your database. Process ? [y/N] y
# ivre runscansagentdb --init
This will remove any agent and/or scan in your database and files. Process ? [y/N] y
Pay attention to configuration of the GEOIP_PATH above, otherwise the last two commands will fail.
Get IP Data
# ivre ipdata --download
$ ivre ipdata --import-all --no-update-passive-db
It’s already available in theory. To get visualized, web server is configured below.
web server
The ivre version of the docker version has been configured for web server, which can be used directly. This is because it uses the ubuntu configuration and needs to modify the profile itself. The local nginx serves as a web server.
Modify Profile
Copy the following configuration file to/etc/nginx/sites-enabled to restart nginx, noting that it cannot be repeated with other server ports.
https://github.com/cea-sec/ivre/blob/master/docker/web/nginx-default-site
This will make it possible to open the page, but no dynamic data can be seen.
Configure Fastcgi
Install fastcig
apt install fcgiwrap
config fastcgi
cp /usr/share/doc/fcgiwrap/examples/nginx.conf /etc/nginx/fcgiwrap.conf
This is basically an active scan of ivre. You can see the results from local pages as follows:
$ ivre runscans --routable --limit 1000
Upon completion, the following orders shall be executed:
$ ivre scan2db -c ROUTABLE,ROUTABLE-CAMPAIGN-001 -s MySource -r \
> scans/ROUTABLE/up
The results are as follows:

ivre.jpg
Problems encountered during installation.
Installation on MacOS
There are some differences between MacOS and ubuntu’s installation.
Mongodb and nginx can be installed through the brew, and nginx’s configuration file is then installed under/usr/local/share/etc/nginx directories. This is known for familiarizing with MacOS.
Let’s focus on the installation of fcgiwrap.
Use fcgiwrap under MacOS
First, we need to install Fastcgi and fcgiwrap. This can be installed through brew.
brew install fcgiwrap.
This is not directly available when installed, and some configurations are required, which can be consulted on the following pages:
https://www.nginx.com/resources/wiki/start/topics/examples/fcgiwrap/
Here’s a little bit of step:
Create a perl script first, as follows:
#!/usr/bin/perl
use strict;
use warnings FATAL => qw( all );
use IO::Socket::UNIX;
my $bin_path = '/usr/local/bin/fcgiwrap';
my $socket_path = $ARGV[0] || '/tmp/cgi.sock';
my $num_children = $ARGV[1] || 1;
close STDIN;
unlink $socket_path;
my $socket = IO::Socket::UNIX->new(
Local => $socket_path,
Listen => 100,
);
die "Cannot create socket at $socket_path: $!\n" unless $socket;
for (1 .. $num_children) {
my $pid = fork;
die "Cannot fork: $!" unless defined $pid;
next if $pid;
exec $bin_path;
die "Failed to exec $bin_path: $!\n";
}
Note: Here.my $bin_path = '/usr/local/bin/fcgiwrap'; To replace the location of the actual fcgiwrap application.my $socket_path = $ARGV[0] || '/tmp/cgi.sock';/tm/cgi.sock is to be aligned with the previously configured fastcgi socket.
This is how you get a cgi.sock file added to the /tmp directory when you finish the script above. This is an unixsocket.
It may still not be possible to access at this time, and opening nginx’s log will reveal that cgi.sock has no rights, simply by modifying the cgi.sock’s authority to 777 and then OK.
Python version number problem
The geoiputils.py in ivre uses the character strip(b’/n’), resulting in an error running in python3. Using python2.7 is OK.
The problem of using nginx
This requires the installation of a fastcgi, otherwise it is not possible to access the scanned results stored in the database.
Follow-up plans
ivre is actually a frame for scanning and visualizing some of the scans. Because there are no Neo4j, Flow visual displays that can be done at this time.
- 1 Nero4j and bro are loaded to monitor the flow of this machine through passive mode.
- 2 Experiment with additional ivre active scanning.
By Endzzz
Links:https://www.jianshu.com/p/99277f35632e
Source: Brief Book
Copyright is owned by the author.
未经允许不得转载:萌萌Apprentissage » ivre hacker search engine
learn NMAP