Browse Source

updated code for 2018 osx

pull/3/head
dennisdebel 7 years ago
parent
commit
2dab39717d
  1. 1
      Border-Check/bc.status
  2. 1
      Border-Check/config.py
  3. 1
      Border-Check/data.xml
  4. 1
      Border-Check/hostname.submit
  5. 9
      Border-Check/main.py
  6. BIN
      Border-Check/main.pyc
  7. BIN
      Border-Check/maps/GeoIPASNum.dat
  8. BIN
      Border-Check/maps/GeoIPASNum.dat.gz
  9. BIN
      Border-Check/maps/GeoLiteCity.dat
  10. BIN
      Border-Check/maps/GeoLiteCity.dat.gz
  11. BIN
      Border-Check/options.pyc
  12. BIN
      Border-Check/web/__init__.pyc
  13. 2
      Border-Check/web/js/bc.js
  14. BIN
      Border-Check/webserver.pyc
  15. BIN
      Border-Check/xml_exporter.pyc
  16. 37
      README.md

1
Border-Check/bc.status

@ -0,0 +1 @@
old

1
Border-Check/config.py

@ -0,0 +1 @@
then:darwin:F:/Users/then/Library/Application Support/Firefox/Profiles/uqk7h53s.default-1448018543872/places.sqlite

1
Border-Check/data.xml

@ -0,0 +1 @@
<travel>nu.nl<hop>0<host>52.85.201.233</host><hop_ip>194.134.5.68</hop_ip><longitude>4.8995</longitude><latitude>52.3824</latitude><city /><country>Netherlands</country><server_name>bng1-adt67.nl.euro.net</server_name><asn>AS5390 Euronet Communications B.V.</asn><timestamp>1.2</timestamp><country_code>nl</country_code><meta>Connect here XML metadata</meta></hop><hop>1<host>52.85.201.233</host><hop_ip>194.134.161.128</hop_ip><longitude>4.9167</longitude><latitude>52.35</latitude><city>Amsterdam</city><country>Netherlands</country><server_name>No hostname</server_name><asn>AS5390 Euronet Communications B.V.</asn><timestamp>10.6</timestamp><country_code>nl</country_code><meta>Connect here XML metadata</meta></hop><hop>2<host>52.85.201.233</host><hop_ip>194.134.161.225</hop_ip><longitude>4.9167</longitude><latitude>52.35</latitude><city>Amsterdam</city><country>Netherlands</country><server_name>ae0-sdr1-asd8.nl.euro.net</server_name><asn>AS5390 Euronet Communications B.V.</asn><timestamp>9.7</timestamp><country_code>nl</country_code><meta>Connect here XML metadata</meta></hop><hop>3<host>52.85.201.233</host><hop_ip>217.170.18.122</hop_ip><longitude>4.8995</longitude><latitude>52.3824</latitude><city /><country>Netherlands</country><server_name>online-globalswitch.telecity3f.jointtransit.nl</server_name><asn>AS24785 Broadband Hosting B.V</asn><timestamp>9.7</timestamp><country_code>nl</country_code><meta>Connect here XML metadata</meta></hop><hop>4<host>52.85.201.233</host><hop_ip>149.14.141.249</hop_ip><longitude>-0.3667</longitude><latitude>51.5</latitude><city>Southall</city><country>United Kingdom</country><server_name>be4783.agr21.ams03.atlas.cogentco.com</server_name><asn>AS174 Cogent Communications</asn><timestamp>10.7</timestamp><country_code>gb</country_code><meta>Connect here XML metadata</meta></hop><hop>5<host>52.85.201.233</host><hop_ip>130.117.2.242</hop_ip><longitude>8.0</longitude><latitude>47.0</latitude><city /><country>Europe</country><server_name>be2434.ccr41.ams03.atlas.cogentco.com</server_name><asn>AS174 Cogent Communications</asn><timestamp>10.1</timestamp><country_code>eu</country_code><meta>Connect here XML metadata</meta></hop><hop>6<host>52.85.201.233</host><hop_ip>130.117.51.41</hop_ip><longitude>8.0</longitude><latitude>47.0</latitude><city /><country>Europe</country><server_name>be12488.ccr42.lon13.atlas.cogentco.com</server_name><asn>AS174 Cogent Communications</asn><timestamp>9.6</timestamp><country_code>eu</country_code><meta>Connect here XML metadata</meta></hop><hop>7<host>52.85.201.233</host><hop_ip>154.54.60.6</hop_ip><longitude>-97.822</longitude><latitude>37.751</latitude><city /><country>United States</country><server_name>be3487.rcr21.lhr01.atlas.cogentco.com</server_name><asn>AS174 Cogent Communications</asn><timestamp>20.4</timestamp><country_code>us</country_code><meta>Connect here XML metadata</meta></hop><hop>8<host>52.85.201.233</host><hop_ip>149.14.196.218</hop_ip><longitude>37.6156</longitude><latitude>55.7522</latitude><city>Moscow</city><country>Russian Federation</country><server_name>a100-row.demarc.cogentco.com</server_name><asn>AS174 Cogent Communications</asn><timestamp>18.1</timestamp><country_code>ru</country_code><meta>Connect here XML metadata</meta></hop><hop>9<host>52.85.201.233</host><hop_ip>52.95.61.34</hop_ip><longitude>-6.2489</longitude><latitude>53.3331</latitude><city>Dublin</city><country>Ireland</country><server_name>No hostname</server_name><asn /><timestamp>18.5</timestamp><country_code>ie</country_code><meta>Connect here XML metadata</meta></hop><hop>10<host>52.85.201.233</host><hop_ip>52.95.61.53</hop_ip><longitude>-6.2489</longitude><latitude>53.3331</latitude><city>Dublin</city><country>Ireland</country><server_name>No hostname</server_name><asn /><timestamp>29.6</timestamp><country_code>ie</country_code><meta>Connect here XML metadata</meta></hop><hop>11<host>52.85.201.233</host><hop_ip>176.32.106.239</hop_ip><longitude>-6.2489</longitude><latitude>53.3331</latitude><city>Dublin</city><country>Ireland</country><server_name>No hostname</server_name><asn>AS16509 Amazon.com, Inc.</asn><timestamp>27.3</timestamp><country_code>ie</country_code><meta>Connect here XML metadata</meta></hop></travel>

1
Border-Check/hostname.submit

@ -0,0 +1 @@
http://nu.nl

9
Border-Check/main.py

@ -506,7 +506,8 @@ class bc(object):
self.url=url[0] self.url=url[0]
else: else:
# starting a hostname.submit with a default value (ex: http://bordercheck.org) # starting a hostname.submit with a default value (ex: http://bordercheck.org)
bc = "http://bordercheck.org" # EDIT: website is down, so make the page/script hang/lag/break
bc = "http://nu.nl"
if self.options.debug >= 1: if self.options.debug >= 1:
print "hostname.submit not found..." print "hostname.submit not found..."
with open('hostname.submit', 'w') as fout: with open('hostname.submit', 'w') as fout:
@ -906,7 +907,7 @@ class bc(object):
lib_biplist_required = True lib_biplist_required = True
print "\nChecking for correct version of lft required..." print "\nChecking for correct version of lft required..."
proc = subprocess.check_output([self.options.lft_path+' -v'], stderr=subprocess.STDOUT, shell=True) proc = subprocess.check_output([self.options.lft_path+' -v'], stderr=subprocess.STDOUT, shell=True)
if "3.73" in proc: if "3.79" in proc: #EDIT > cheated lft version check
print "\n+ Is correct lft (~3.73v) version installed?... YES" print "\n+ Is correct lft (~3.73v) version installed?... YES"
else: else:
print "\n+ Is correct lft (~3.73v) version installed?... NO" print "\n+ Is correct lft (~3.73v) version installed?... NO"
@ -1022,9 +1023,9 @@ class bc(object):
options = self.options options = self.options
if self.options.lft_path == None: if self.options.lft_path == None:
try: try:
self.options.lft_path = "./bin/lft.linux" # try patched lft self.options.lft_path = "/usr/local/bin/lft" # try lft from system
except: except:
self.options.lft_path = "/usr/local/bin/lft" # try lft from system self.options.lft_path = "/usr/local/bin/lft" # try lft from system
p = self.optionParser p = self.optionParser
# banner # banner
print('='*75) print('='*75)

BIN
Border-Check/main.pyc

Binary file not shown.

BIN
Border-Check/maps/GeoIPASNum.dat

Binary file not shown.

BIN
Border-Check/maps/GeoIPASNum.dat.gz

Binary file not shown.

BIN
Border-Check/maps/GeoLiteCity.dat

Binary file not shown.

BIN
Border-Check/maps/GeoLiteCity.dat.gz

Binary file not shown.

BIN
Border-Check/options.pyc

Binary file not shown.

BIN
Border-Check/web/__init__.pyc

Binary file not shown.

2
Border-Check/web/js/bc.js

@ -11,7 +11,7 @@ function initMap () {
// attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors' // attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
// }) // })
// osm_quest = L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png') // osm_quest = L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.png')
osm_sat = L.tileLayer('http://otile1.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.png') osm_sat = L.tileLayer('https://a.tile.openstreetmap.org/{z}/{x}/{y}.png')
// streets = L.tileLayer('http://api.tiles.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoicmxsZmZmIiwiYSI6IkZyVmt4bUUifQ.R--ZDzdb-672Dx1E3suO9A') // streets = L.tileLayer('http://api.tiles.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoicmxsZmZmIiwiYSI6IkZyVmt4bUUifQ.R--ZDzdb-672Dx1E3suO9A')
// light = L.tileLayer('http://api.tiles.mapbox.com/v4/mapbox.light/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoicmxsZmZmIiwiYSI6IkZyVmt4bUUifQ.R--ZDzdb-672Dx1E3suO9A') // light = L.tileLayer('http://api.tiles.mapbox.com/v4/mapbox.light/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoicmxsZmZmIiwiYSI6IkZyVmt4bUUifQ.R--ZDzdb-672Dx1E3suO9A')
dark = L.tileLayer('http://api.tiles.mapbox.com/v4/mapbox.dark/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoicmxsZmZmIiwiYSI6IkZyVmt4bUUifQ.R--ZDzdb-672Dx1E3suO9A') dark = L.tileLayer('http://api.tiles.mapbox.com/v4/mapbox.dark/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoicmxsZmZmIiwiYSI6IkZyVmt4bUUifQ.R--ZDzdb-672Dx1E3suO9A')

BIN
Border-Check/webserver.pyc

Binary file not shown.

BIN
Border-Check/xml_exporter.pyc

Binary file not shown.

37
README.md

@ -1,3 +1,15 @@
Border Check v0.2018 - 2018
========================
CHANGES:
* made code work again in 2018 on OSX 10.10.2
* links to resources updated (bordercheck.org, GeoIP databases)
* various OSX specific instructions added to readme.
* corrected broken OSM tile server [link](https://wiki.openstreetmap.org/wiki/Tile_servers) (mapbox blank map is broken).
* added legacy geoip databases (needs updating)
Border Check v0.2 - 2015 Border Check v0.2 - 2015
======================== ========================
@ -24,6 +36,7 @@ Border Check has the following dependencies:
### Python: ### Python:
* [libpcap](https://pypi.org/project/libpcap/)
* [pygeoip](https://pypi.python.org/pypi/pygeoip/0.2.7) * [pygeoip](https://pypi.python.org/pypi/pygeoip/0.2.7)
* [lxml](https://pypi.python.org/pypi/lxml/3.2.3) * [lxml](https://pypi.python.org/pypi/lxml/3.2.3)
* [biplist](https://pypi.python.org/pypi/biplist/0.5) (if you plan to use Safari) * [biplist](https://pypi.python.org/pypi/biplist/0.5) (if you plan to use Safari)
@ -32,9 +45,10 @@ For **Debian**-based systems (ex: Ubuntu), first run:
`sudo apt-get install python-pip` to install [pip](https://pypi.python.org/pypi/pip/), python's super usefull package manager. `sudo apt-get install python-pip` to install [pip](https://pypi.python.org/pypi/pip/), python's super usefull package manager.
If you already have pip: `pip install lxml` and `pip install pygeoip` If you already have pip: `pip install lxml` and `pip install pygeoip`.
On **OSX** it's recommended you install [Homebrew](http://brew.sh/) first and use that to get [python + pip + easy_install](https://github.com/mxcl/homebrew/wiki/Homebrew-and-Python).
On **OSX** it's recommended you install [Homebrew](http://brew.sh/) first and use that to get [python + pip](https://github.com/mxcl/homebrew/wiki/Homebrew-and-Python).
### LFT ### LFT
@ -45,7 +59,8 @@ On **Debian** and **Ubuntu** it needs to be built from source and requires libpc
To make this process more easy, BC (v0.2 2015) provides you a binary with the source. It is called `lft.linux` and is on folder `bin`. To make this process more easy, BC (v0.2 2015) provides you a binary with the source. It is called `lft.linux` and is on folder `bin`.
On **OSX** you can use Homebrew: `brew install lft` which will automatically download and build the package. On **OSX** you can use Homebrew: `brew install lft` which will automatically download and build the package.
(to install python-libpcap on **OSX**: `sudo easy_install pypcap` (and maybe: sudo easy_install pycap ....needs testing!))
#### Note on provided LFT binary #### Note on provided LFT binary
@ -60,6 +75,18 @@ BC will automatically unpack the newest geoip databases on the first run.
Javascript mapping libraries are included in the package. Javascript mapping libraries are included in the package.
If not (for example on OSX 10.10.2), manually install the GeoIP databases:
Download the Binary / gzip legacy maps via http://dev.maxmind.com/geoip/legacy/geolite/ or below:
[direct link GeoLiteCity](http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz)
[direct link GeoLiteASN](http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz)
Unpack the databses in the folder `maps`, so the path is `Border-Check/maps/GeoIPASNum.dat` and `Border-Check/maps/GeoLiteCity.dat`
## Options and features: ## Options and features:
@ -85,6 +112,10 @@ Normal BC run:
`$ python bc` `$ python bc`
**OSX**:
`$ sudo python bc`
Debug mode: Debug mode:
`$ python bc --debug` `$ python bc --debug`

Loading…
Cancel
Save