Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 6b12b667ca0b3d8c376650e734706919ea72da96 1 parent 736e706
@txus authored
Showing with 4 additions and 2 deletions.
  1. +2 −0  Readme.md
  2. +2 −2 lib/micetrap/services/base.rb
View
2  Readme.md
@@ -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:
View
4 lib/micetrap/services/base.rb
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.