| 01.default.rb - warvox - VoIP based wardialing tool, forked from rapid7/warvox. | |
| git clone git://jay.scot/warvox | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| 01.default.rb (1691B) | |
| --- | |
| 1 # | |
| 2 # WarVOX Classifiers | |
| 3 # | |
| 4 | |
| 5 # | |
| 6 # These lightweight signatures are used to determine the | |
| 7 # line type, which is the top-level classification that | |
| 8 # differentiates between modem, fax, voice, and other | |
| 9 # common results. | |
| 10 # | |
| 11 | |
| 12 | |
| 13 # | |
| 14 # If you want to force your checks to run first, add your | |
| 15 # logic to a file starting with "00." and place it in | |
| 16 # this directory. Signature files are processed numerically | |
| 17 # from lowest to highest (like RC scripts) | |
| 18 # | |
| 19 | |
| 20 | |
| 21 # | |
| 22 # Initialize some local variables out of data | |
| 23 # | |
| 24 freq = data[:freq] | |
| 25 fcnt = data[:fcnt] | |
| 26 maxf = data[:maxf] | |
| 27 | |
| 28 # | |
| 29 # Look for modems by detecting a 2100hz answer + 2250hz tone | |
| 30 # | |
| 31 if( (fcnt[2100] > 1.0 or fcnt[2230] > 1.0) and fcnt[2250] > 0.5) | |
| 32 @line_type = 'modem' | |
| 33 raise Completed | |
| 34 end | |
| 35 | |
| 36 # | |
| 37 # Look for modems by detecting a peak frequency of 2250hz | |
| 38 # | |
| 39 if(fcnt[2100] > 1.0 and (maxf > 2245.0 and maxf < 2255.0)) | |
| 40 @line_type = 'modem' | |
| 41 raise Completed | |
| 42 end | |
| 43 | |
| 44 # | |
| 45 # Look for modems by detecting a peak frequency of 3000hz | |
| 46 # | |
| 47 if(fcnt[2100] > 1.0 and (maxf > 2995.0 and maxf < 3005.0)) | |
| 48 @line_type = 'modem' | |
| 49 raise Completed | |
| 50 end | |
| 51 | |
| 52 # | |
| 53 # Look for faxes by checking for a handful of tones (min two) | |
| 54 # | |
| 55 fax_sum = 0 | |
| 56 [ | |
| 57 fcnt[1625], fcnt[1660], fcnt[1825], fcnt[2100], | |
| 58 fcnt[600], fcnt[1855], fcnt[1100], fcnt[2250], | |
| 59 fcnt[2230], fcnt[2220], fcnt[1800], fcnt[2095], | |
| 60 fcnt[2105] | |
| 61 ].map{|x| fax_sum += [x,1.0].min } | |
| 62 if(fax_sum >= 2.0) | |
| 63 @line_type = 'fax' | |
| 64 raise Completed | |
| 65 end | |
| 66 | |
| 67 # | |
| 68 # Dial tone detection (440hz + 350hz) | |
| 69 # | |
| 70 if(fcnt[440] > 1.0 and fcnt[350] > 1.0) | |
| 71 @line_type = 'dialtone' | |
| 72 raise Completed | |
| 73 end | |
| 74 | |
| 75 # | |
| 76 # To use additional heuristics, add new scripts to this directory | |
| 77 # named XX.myscript.rb, where XX is a two digit number less than | |
| 78 # 99 and greater than 01. | |
| 79 # | |
| 80 # |