Skip to content

Commit

Permalink
switch from pcap to ruby-pcap dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyril Wack committed May 30, 2014
1 parent 015cee4 commit 09dc324
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 30 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,4 +1,5 @@
*.gem
*.jpg
*.rbc
.bundle
.config
Expand Down
2 changes: 1 addition & 1 deletion .rbenv-version
@@ -1 +1 @@
1.9.3-p194
2.1.2
3 changes: 0 additions & 3 deletions Gemfile
@@ -1,5 +1,2 @@
source 'https://rubygems.org'

gemspec

gem 'pcap', '~> 0.7.0'
23 changes: 20 additions & 3 deletions README.md
Expand Up @@ -2,7 +2,11 @@

<span lang="ja"><ruby>青<rt>ao</rt>行燈<rt>andon</rt></ruby></span> is a minimalist network intrusion detection system (NIDS).

![Blue andon creature](https://raw.github.com/cyril/aoandon/master/blue-andon-creature.jpg)
![Blue andon creature](https://raw.githubusercontent.com/cyril/aoandon.rb/master/blue-andon-creature.jpg)

## Status

* [![Gem Version](https://badge.fury.io/rb/aoandon.svg)](//badge.fury.io/rb/aoandon)

## Installation

Expand All @@ -22,7 +26,20 @@ Or install it yourself as:

$ ifconfig
$ aoandon -h
$ sudo aoandon -i eth0 -v
Usage: bin/aoandon [options]
-f, --file <path> Load the rules contained in file <path>.
-h, --help Help.
-i, --interface <if> Sniff on network interface <if>.
-v, --verbose Produce more verbose output.
-V, --version Show the version number and exit.
$ sudo aoandon -i en0 -v
Starting Aoandon NIDS on interface en0...
Log file: /var/log/aoandon.yml
Ruleset: /Users/bob/code/aoandon.rb/config/rules.yml
Modules: Less1024
You can stop Aoandon NIDS by pressing Ctrl-C.
2014-05-30T11:46:44+02:00 | SYNTAX | info | Suspected packet! | 42.0.0.1:8080 > 192.168.1.88:64563 .AP...
2014-05-30T11:46:44+02:00 | SYNTAX | info | Suspected packet! | 192.168.1.88:64563 > 42.0.0.1:8080 .A....

## Usage

Expand Down Expand Up @@ -299,4 +316,4 @@ end
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
5. Create a new Pull Request
6 changes: 6 additions & 0 deletions Rakefile
@@ -1 +1,7 @@
require 'bundler/gem_tasks'
require 'rake/testtask'

Rake::TestTask.new do |t|
end

task default: :test
1 change: 1 addition & 0 deletions VERSION.semver
@@ -0,0 +1 @@
0.0.4
38 changes: 19 additions & 19 deletions aoandon.gemspec
@@ -1,21 +1,21 @@
# -*- encoding: utf-8 -*-
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'aoandon/version'
Gem::Specification.new do |spec|
spec.name = 'aoandon'
spec.version = File.read('VERSION.semver')
spec.authors = ['Cyril Wack']
spec.email = ['contact@cyril.io']
spec.homepage = 'https://github.com/cyril/aoandon.rb'
spec.summary = %q{Minimalist network intrusion detection system (NIDS).}
spec.description = %q{Aoandon (青行燈) is a minimalist network intrusion detection system (NIDS).}
spec.license = 'MIT'

Gem::Specification.new do |gem|
gem.name = 'aoandon'
gem.version = Aoandon::VERSION
gem.authors = ['Cyril Wack']
gem.email = ['contact@cyril.io']
gem.description = %q{Aoandon (青行燈) is a minimalist network intrusion detection system (NIDS).}
gem.summary = %q{Minimalist network intrusion detection system (NIDS).}
gem.homepage = 'https://github.com/cyril/aoandon.rb'
gem.license = 'MIT'
gem.bindir = 'bin'
gem.add_dependency 'pcap'
gem.files = `git ls-files`.split($/).reject {|f| f == 'blue-andon-creature.jpg' }
gem.executables = gem.files.grep(%r{^bin/}).map {|f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ['lib', 'config']
spec.files = `git ls-files -z`.split("\x0")
spec.executables = spec.files.grep(%r{^bin/}) {|f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^test/})
spec.require_paths = ['lib']

spec.add_dependency 'ruby-pcap', '~> 0.7'

spec.add_development_dependency 'bundler', '~> 1.6'
spec.add_development_dependency 'minitest', '~> 5'
spec.add_development_dependency 'rake', '~> 10'
end
23 changes: 23 additions & 0 deletions bin/aoandon 100644 → 100755
Expand Up @@ -8,3 +8,26 @@ require 'yaml'
require_relative '../lib/aoandon'

Aoandon::Nids.new.run



=begin
#!/usr/bin/env ruby
require 'h'
h = H::Generator.new
result = if ARGV.first
if ARGV[1]
h.input ARGV[0].to_s, ARGV[1].to_i
else
h.input ARGV[0].to_s
end
else
h.prompt
end
puts result
=end
1 change: 0 additions & 1 deletion lib/aoandon.rb
Expand Up @@ -4,7 +4,6 @@
require_relative 'aoandon/error/not_implemented_error'
require_relative 'aoandon/log'
require_relative 'aoandon/static_rule'
require_relative 'aoandon/version'

Dir['lib/aoandon/dynamic_rule/*.rb'].each do |src|
load src
Expand Down
3 changes: 0 additions & 3 deletions lib/aoandon/version.rb

This file was deleted.

0 comments on commit 09dc324

Please sign in to comment.