Permalink
Browse files

Notify what port is being used even if it is a default one

  • Loading branch information...
1 parent 736e706 commit 6b12b667ca0b3d8c376650e734706919ea72da96 @txus committed Jan 6, 2011
Showing with 4 additions and 2 deletions.
  1. +2 −0 Readme.md
  2. +2 −2 lib/micetrap/services/base.rb
View
@@ -35,6 +35,8 @@ which may give you advantage at tricking a smart attacker.
sudo gem install micetrap
+Micetrap currently runs on Ruby versions 1.8.7 and 1.9.2.
+
##Usage
Just fire up the server with some fake service, such an ftp server:
@@ -11,9 +11,9 @@ def initialize
end
def fire port = nil
- port = port.to_i if port
+ port = port ? port.to_i : default_ports.sample
begin
- server = TCPServer.open(port || default_ports.sample || 0)
+ server = TCPServer.open(port || 0)
rescue Errno::EACCES
puts "Looks like you are trying to use a system port, for which you need root privileges.\nRun micetrap with another port if you don't want to sudo!\n"
exit(1)

0 comments on commit 6b12b66

Please sign in to comment.