Network Diagnostic Tool

Overview

Build Status Go Report Card Gitter GORef

IMAGE

myLG, Command line Network Diagnostic Tool

myLG is an open source software utility which combines the functions of the different network probes in one network diagnostic tool.

Features

  • Popular looking glasses (ping/trace/bgp): Telia, Level3, NTT, Cogent, KPN
  • More than 200 countries DNS Lookup information
  • Local ping and real-time trace route
  • Packet analyzer - TCP/IP and other packets
  • Quick NMS (network management system)
  • Local HTTP/HTTPS ping (GET, POST, HEAD)
  • RIPE information (ASN, IP/CIDR)
  • PeeringDB information
  • Port scanning
  • Network LAN Discovery
  • Internet Speed Test
  • Web dashboard
  • Configurable options
  • Direct access to commands from shell
  • Support vi and emacs mode, almost all basic features
  • CLI auto complete and history features

Demo

IMAGE Demo

IMAGE ALT TEXT HERE IMAGE ALT TEXT HERE IMAGE ALT TEXT HERE IMAGE ALT TEXT HERE

Usage

=================================================
                          _    ___
                _ __ _  _| |  / __|
               | '  \ || | |_| (_ |
               |_|_|_\_, |____\___|
                      |__/

                 My Looking Glass
           Free Network Diagnostic Tool
             www.facebook.com/mylg.io
                  http://mylg.io
================== myLG v0.2.6 ==================

local> hping https://www.google.com -trace -c 4
HPING www.google.com (216.58.194.196), Method: HEAD, DNSLookup: 17.2923 ms
HTTP Response seq=0, proto=HTTP/1.1, status=200, time=183.097 ms, connection=34.789 ms, first byte read=148.167 ms
HTTP Response seq=1, proto=HTTP/1.1, status=200, time=164.960 ms, connection=27.764 ms, first byte read=137.096 ms
HTTP Response seq=2, proto=HTTP/1.1, status=200, time=153.559 ms, connection=27.881 ms, first byte read=125.526 ms
HTTP Response seq=3, proto=HTTP/1.1, status=200, time=164.309 ms, connection=28.904 ms, first byte read=135.296 ms

--- www.google.com HTTP ping statistics --- 
4 requests transmitted, 4 replies received, 0% requests failed
HTTP Round-trip min/avg/max = 153.56/164.05/183.10 ms
HTTP Code [200] responses : [████████████████████] 100.00% 
 
local> whois 577
BACOM - Bell Canada, CA
+--------------------+-----------+
|      LOCATION      | COVERED % |
+--------------------+-----------+
| Canada - ON        |   61.3703 |
| Canada             |   36.2616 |
| Canada - QC        |    1.3461 |
| United States - MA |    0.7160 |
| Canada - BC        |    0.1766 |
| Canada - AB        |    0.0811 |
| United States      |    0.0195 |
| United States - NJ |    0.0143 |
| Belgium            |    0.0048 |
| United States - NC |    0.0048 |
| United States - TX |    0.0048 |
| Canada - NB        |    0.0000 |
| Canada - NS        |    0.0000 |
+--------------------+-----------+

local> scan www.google.com -p 1-500
+----------+------+--------+-------------+
| PROTOCOL | PORT | STATUS | DESCRIPTION |
+----------+------+--------+-------------+
| TCP      |   80 | Open   |             |
| TCP      |  443 | Open   |             |
+----------+------+--------+-------------+
Scan done: 2 opened port(s) found in 5.605 seconds

lg/telia/los angeles> bgp 8.8.8.0/24
Telia Carrier Looking Glass - show route protocol bgp 8.8.8.0/24 table inet.0

Router: Los Angeles

Command: show route protocol bgp 8.8.8.0/24 table inet.0

inet.0: 661498 destinations, 5564401 routes (657234 active, 509 holddown, 194799 hidden)
+ = Active Route, - = Last Active, * = Both

8.8.8.0/24         *[BGP/170] 33w0d 01:36:06, MED 0, localpref 200
                      AS path: 15169 I, validation-state: unverified
                    > to 62.115.36.170 via ae4.0
                    [BGP/170] 8w3d 11:19:40, MED 0, localpref 200, from 80.91.255.95
                      AS path: 15169 I, validation-state: unverified
                      to 62.115.119.84 via xe-1/1/0.0
                      to 62.115.119.88 via xe-1/2/0.0
                      to 62.115.119.90 via xe-11/0/3.0
                      to 62.115.119.102 via xe-9/0/0.0
                      to 62.115.119.92 via xe-9/0/2.0
                    > to 62.115.119.86 via xe-9/1/2.0
                      to 62.115.119.98 via xe-9/2/2.0
                      to 62.115.119.100 via xe-9/2/3.0
                      to 62.115.119.94 via xe-9/3/1.0
                      to 62.115.119.96 via xe-9/3/3.0

ns/united states/redwood city> dig yahoo.com
Trying to query server: 204.152.184.76 united states redwood city
;; opcode: QUERY, status: NOERROR, id: 19850
;; flags: qr rd ra;
yahoo.com.	728	IN	MX	1 mta6.am0.yahoodns.net.
yahoo.com.	728	IN	MX	1 mta5.am0.yahoodns.net.
yahoo.com.	728	IN	MX	1 mta7.am0.yahoodns.net.
yahoo.com.	143013	IN	NS	ns4.yahoo.com.
yahoo.com.	143013	IN	NS	ns6.yahoo.com.
yahoo.com.	143013	IN	NS	ns2.yahoo.com.
yahoo.com.	143013	IN	NS	ns5.yahoo.com.
yahoo.com.	143013	IN	NS	ns1.yahoo.com.
yahoo.com.	143013	IN	NS	ns3.yahoo.com.

;; ADDITIONAL SECTION:
ns1.yahoo.com.	561456	IN	A	68.180.131.16
ns2.yahoo.com.	27934	IN	A	68.142.255.16
ns3.yahoo.com.	532599	IN	A	203.84.221.53
ns4.yahoo.com.	532599	IN	A	98.138.11.157
ns5.yahoo.com.	532599	IN	A	119.160.247.124
ns6.yahoo.com.	143291	IN	A	121.101.144.139
ns1.yahoo.com.	51624	IN	AAAA	2001:4998:130::1001
ns2.yahoo.com.	51624	IN	AAAA	2001:4998:140::1002
ns3.yahoo.com.	51624	IN	AAAA	2406:8600:b8:fe03::1003
ns6.yahoo.com.	143291	IN	AAAA	2406:2000:108:4::1006
;; Query time: 1204 ms

;; CHAOS CLASS BIND
version.bind.	0	CH	TXT	"9.10.4-P1"
hostname.bind.	0	CH	TXT	"fred.isc.org"

local> peering 6327
The data provided from www.peeringdb.com
+-------------------+---------------+---------------+--------------------+------+
|       NAME        |    TRAFFIC    |     TYPE      |      WEB SITE      | NOTE |
+-------------------+---------------+---------------+--------------------+------+
| Shaw Cablesystems | 500-1000 Gbps | Cable/DSL/ISP | http://www.shaw.ca |      |
+-------------------+---------------+---------------+--------------------+------+
+------------------+--------+--------+-----------------+-------------------------+
|       NAME       | STATUS | SPEED  |    IPV4 ADDR    |        IPV6 ADDR        |
+------------------+--------+--------+-----------------+-------------------------+
| Equinix Ashburn  | ok     |  20000 | 206.126.236.20  | 2001:504:0:2::6327:1    |
| Equinix Ashburn  | ok     |  20000 | 206.223.115.20  |                         |
| Equinix Chicago  | ok     |  30000 | 206.223.119.20  | 2001:504:0:4::6327:1    |
| Equinix San Jose | ok     |  30000 | 206.223.116.20  | 2001:504:0:1::6327:1    |
| Equinix Seattle  | ok     |  20000 | 198.32.134.4    | 2001:504:12::4          |
| Equinix New York | ok     |  10000 | 198.32.118.16   | 2001:504:f::10          |
| SIX Seattle      | ok     | 100000 | 206.81.80.54    | 2001:504:16::18b7       |
| NYIIX            | ok     |  20000 | 198.32.160.86   | 2001:504:1::a500:6327:1 |
| TorIX            | ok     |  10000 | 206.108.34.12   |                         |
| PIX Vancouver    | ok     |  10000 | 206.223.127.2   |                         |
| PIX Toronto      | ok     |   1000 | 206.223.127.132 |                         |
| Equinix Toronto  | ok     |  10000 | 198.32.181.50   | 2001:504:d:80::6327:1   |
+------------------+--------+--------+-----------------+-------------------------+

local> disc
Network LAN Discovery
+--------------+-------------------+------+-----------+-------------------+
|      IP      |        MAC        | HOST | INTERFACE | ORGANIZATION NAME |
+--------------+-------------------+------+-----------+-------------------+
| 172.16.0.0   | ff:ff:ff:ff:ff:ff | NA   | en0       | NA                |
| 172.16.1.1   | e4:8d:8c:7a:66:26 | NA   | en0       | Routerboard.com   |
| 172.16.1.10  | ac:bc:32:b4:33:23 | NA   | en0       | Apple, Inc.       |
| 172.16.1.205 | 74:e5:b:97:11:28  | NA   | en0       | NA                |
| 172.16.1.254 | 54:4a:0:33:b4:2f  | NA   | en0       | NA                |
| 172.16.2.12  | d4:f4:6f:7b:8f:cf | NA   | en0       | Apple, Inc.       |
| 172.16.2.13  | 5c:ad:cf:23:7:f9  | NA   | en0       | Apple, Inc.       |
| 172.16.2.111 | d0:a6:37:72:cf:2d | NA   | en0       | Apple, Inc.       |
| 192.168.33.0 | ff:ff:ff:ff:ff:ff | NA   | vboxnet0  | NA                |
| 192.168.33.1 | a:0:27:0:0:0      | NA   | vboxnet0  | NA                |
| 224.0.0.251  | 1:0:5e:0:0:fb     | NA   | en0       | NA                |
+--------------+-------------------+------+-----------+-------------------+
11 host(s) has been found

local> whois 8.8.8.8
+------------+-------+--------------------------+
|   PREFIX   |  ASN  |          HOLDER          |
+------------+-------+--------------------------+
| 8.8.8.0/24 | 15169 | GOOGLE - Google Inc., US |
+------------+-------+--------------------------+

local> dump -d
+----------+-------------------+--------+-------+--------------------------------+-----------+-----------+--------------+----------+
|   NAME   |        MAC        | STATUS |  MTU  |          IP ADDRESSES          | MULTICAST | BROADCAST | POINTTOPOINT | LOOPBACK |
+----------+-------------------+--------+-------+--------------------------------+-----------+-----------+--------------+----------+
| lo0      |                   | UP     | 16384 | 127.0.0.1/8 ::1/128 fe80::1/64 | ✓         |           |              | ✓        |
| gif0     |                   | DOWN   |  1280 |                                | ✓         |           | ✓            |          |
| stf0     |                   | DOWN   |  1280 |                                |           |           |              |          |
| en0      | ac:bc:32:b4:33:23 | UP     |  1500 | fe80::181b:3d55:e9a2:e3df/64   | ✓         | ✓         |              |          |
|          |                   |        |       | 192.168.0.103/24               |           |           |              |          |
| p2p0     | 0e:bc:32:b4:33:23 | UP     |  2304 |                                | ✓         | ✓         |              |          |
| awdl0    | ee:3a:98:da:44:5c | UP     |  1484 | fe80::ec3a:98ff:feda:445c/64   | ✓         | ✓         |              |          |
| en1      | 4a:00:03:9c:8d:60 | UP     |  1500 |                                |           | ✓         |              |          |
| en2      | 4a:00:03:9c:8d:61 | UP     |  1500 |                                |           | ✓         |              |          |
| bridge0  | 4a:00:03:9c:8d:60 | UP     |  1500 |                                | ✓         | ✓         |              |          |
| utun0    |                   | UP     |  2000 | fe80::ec23:f621:ae74:5271/64   | ✓         |           | ✓            |          |
| utun1    |                   | UP     |  1380 | fe80::d187:7734:49d9:9d84/64   | ✓         |           | ✓            |          |
| vboxnet0 | 0a:00:27:00:00:00 | DOWN   |  1500 |                                | ✓         | ✓         |              |          |
+----------+-------------------+--------+-------+--------------------------------+-----------+-----------+--------------+----------+

local> dump 
20:29:36.415 IPv4/TCP  ec2-52-73-80-145.compute-1.amazonaws.com.:443(https) > 192.168.0.104:61479 [P.], win 166, len: 33
20:29:36.416 IPv4/TCP  192.168.0.104:61479 > ec2-52-73-80-145.compute-1.amazonaws.com.:443(https) [.], win 4094, len: 0
20:29:36.417 IPv4/TCP  192.168.0.104:61479 > ec2-52-73-80-145.compute-1.amazonaws.com.:443(https) [P.], win 4096, len: 37
20:29:36.977 IPv4/UDP  192.168.0.104:62733 > 192.168.0.1:53(domain) , len: 0
20:29:37.537 IPv4/TCP  ec2-54-86-120-119.compute-1.amazonaws.com.:443(https) > 192.168.0.104:61302 [.], win 124, len: 0
20:29:38.125 IPv4/TCP  192.168.0.104:61304 > ec2-52-23-213-161.compute-1.amazonaws.com.:443(https) [P.], win 4096, len: 85
20:29:38.126 IPv4/TCP  ec2-52-23-213-161.compute-1.amazonaws.com.:443(https) > 192.168.0.104:61304 [.], win 1048, len: 0
20:29:38.760 IPv4/TCP  ec2-54-165-12-100.compute-1.amazonaws.com.:443(https) > 192.168.0.104:61296 [.], win 2085, len: 0
20:29:39.263 IPv4/ICMP 192.168.0.104 > ir1.fp.vip.ne1.yahoo.com.: EchoRequest id 20859, seq 27196, len: 56
20:29:39.265 IPv4/UDP  192.168.0.1:53(domain) > 192.168.0.104:62733 , len: 0

local> dump tcp and port 443 -c 10
23:26:56.026 IPv4/TCP  192.168.0.104:64686 > 192.0.80.242:443(https) [F.], win 8192, len: 0
23:26:56.045 IPv4/TCP  192.168.0.104:64695 > i2.wp.com.:443(https) [F.], win 8192, len: 0
23:26:56.048 IPv4/TCP  i2.wp.com.:443(https) > 192.168.0.104:64695 [F.], win 62, len: 0
23:26:56.081 IPv4/TCP  192.168.0.104:63692 > ec2-54-88-144-213.compute-1.amazonaws.com.:443(https) [P.], win 4096, len: 37
23:26:56.082 IPv4/TCP  192.168.0.104:64695 > i2.wp.com.:443(https) [.], win 8192, len: 0
23:26:56.083 IPv4/TCP  192.0.80.242:443(https) > 192.168.0.104:64686 [.], win 64, len: 0
23:26:56.150 IPv4/TCP  ec2-54-88-144-213.compute-1.amazonaws.com.:443(https) > 192.168.0.104:63692 [.], win 166, len: 0
23:26:56.259 IPv4/TCP  ec2-54-172-56-148.compute-1.amazonaws.com.:443(https) > 192.168.0.104:63623 [P.], win 1316, len: 85
23:26:56.260 IPv4/TCP  192.168.0.104:63623 > ec2-54-172-56-148.compute-1.amazonaws.com.:443(https) [.], win 4093, len: 0
23:26:56.820 IPv4/TCP  192.168.0.104:64691 > 192.30.253.116:443(https) [.], win 4096, len: 0

local> dump -s http -x
22:10:15.770 IPv4/TCP  151.101.44.143:443(https) > 10.0.9.9:50771 [P.], win 59, len: 156
00000000  16 03 03 00 64 02 00 00  60 03 03 a2 32 19 4b 78  |....d...`...2.Kx|
00000010  77 ed 40 75 f6 4c 55 74  43 1d b7 6c f2 59 f8 d8  |[email protected]|
00000020  09 8a 3e 03 62 56 38 45  d2 bc 02 20 bd 52 8a 42  |..>.bV8E... .R.B|
00000030  5b 01 33 7d 2b 0b 41 da  eb 38 87 79 f1 37 62 5c  |[.3}+.A..8.y.7b\|
00000040  f3 ed 5a 7c 07 6c e9 28  9b fe fa 76 c0 2f 00 00  |..Z|.l.(...v./..|
00000050  18 ff 01 00 01 00 00 05  00 00 00 10 00 0b 00 09  |................|
00000060  08 68 74 74 70 2f 31 2e  31 14 03 03 00 01 01 16  |.http/1.1.......|
00000070  03 03 00 28 fc 20 2d 6f  1a 94 78 53 55 0f 8c 05  |...(. -o..xSU...|
00000080  3e ae 12 34 79 af d2 a9  bd 22 e5 3f b1 2b f5 36  |>..4y....".?.+.6|
00000090  ba 51 31 37 f5 0b e6 d2  40 fb 88 a5              |[email protected]    |

local> dump !udp -w /home/user1/mypcap -c 100000

local> ping google.com -6
PING google.com (2607:f8b0:400b:80a::200e): 56 data bytes
64 bytes from 2607:f8b0:400b:80a::200e icmp_seq=0 time=23.193988 ms
64 bytes from 2607:f8b0:400b:80a::200e icmp_seq=1 time=21.265492 ms
64 bytes from 2607:f8b0:400b:80a::200e icmp_seq=2 time=24.521306 ms
64 bytes from 2607:f8b0:400b:80a::200e icmp_seq=3 time=25.313072 ms

local> trace google.com
trace route to google.com (172.217.4.142), 30 hops max
1  192.168.0.1 4.705 ms 1.236 ms 0.941 ms 
2  142.254.236.25 [ASN 20001/ROADRUNNER-WEST] 13.941 ms 13.504 ms 12.303 ms 
3  agg59.snmncaby01h.socal.rr.com. (76.167.31.241) [ASN 20001/ROADRUNNER-WEST] 14.834 ms 11.625 ms 13.050 ms 
4  agg20.lamrcadq01r.socal.rr.com. (72.129.10.128) [ASN 20001/ROADRUNNER-WEST] 17.617 ms 18.064 ms 15.612 ms 
5  agg28.lsancarc01r.socal.rr.com. (72.129.9.0) [ASN 20001/ROADRUNNER-WEST] 16.291 ms 24.079 ms 20.456 ms 
6  bu-ether26.lsancarc0yw-bcr00.tbone.rr.com. (66.109.3.230) [ASN 7843/TWCABLE-BACKBONE] 18.339 ms 23.278 ms 23.434 ms 
7  216.0.6.25 [ASN 2828/XO-AS15] 19.842 ms 21.025 ms 35.105 ms 
8  216.0.6.42 [ASN 2828/XO-AS15] 16.666 ms 18.252 ms 18.872 ms 
9  209.85.245.199 [ASN 15169/GOOGLE] 14.358 ms 17.478 ms 
   209.85.246.125 [ASN 15169/GOOGLE] 18.593 ms 
10 72.14.239.121 [ASN 15169/GOOGLE] 21.635 ms 
   72.14.238.213 [ASN 15169/GOOGLE] 16.133 ms 
   72.14.239.121 [ASN 15169/GOOGLE] 21.541 ms 
11 lax17s14-in-f14.1e100.net. (172.217.4.142) [ASN 15169/GOOGLE] 18.127 ms 17.151 ms 18.892 ms 

local> show config 
set ping     timeout    2s
set ping     interval   1s
set ping     count      4
set hping    timeout    2s
set hping    method     HEAD
set hping    data       mylg
set hping    count      5
set web      port       8080
set web      address    127.0.0.1
set scan     port       1-1024

local> set hping count 10

sh-3.2# mylg peering 577
The data provided from www.peeringdb.com
+----------------------+---------+------+--------------------+------+
|         NAME         | TRAFFIC | TYPE |      WEB SITE      | NOTE |
+----------------------+---------+------+--------------------+------+
| Bell Canada Backbone |         | NSP  | http://www.bell.ca |      |
+----------------------+---------+------+--------------------+------+
+-------------------+--------+-------+-----------------+------------------------+
|       NAME        | STATUS | SPEED |    IPV4 ADDR    |       IPV6 ADDR        |
+-------------------+--------+-------+-----------------+------------------------+
| Equinix Ashburn   | ok     | 20000 | 206.126.236.203 | 2001:504:0:2::577:1    |
| Equinix Chicago   | ok     | 20000 | 206.223.119.66  | 2001:504:0:4::577:1    |
| Equinix Palo Alto | ok     | 10000 | 198.32.176.94   | 2001:504:d::5e         |
| Equinix New York  | ok     | 10000 | 198.32.118.113  | 2001:504:f::577:1      |
| SIX Seattle       | ok     | 10000 | 206.81.80.217   | 2001:504:16::241       |
| NYIIX             | ok     | 10000 | 198.32.160.36   | 2001:504:1::a500:577:1 |
+-------------------+--------+-------+-----------------+------------------------+

local> nms
nms> connect core1-sjc
Connected: Juniper Networks, Inc. qfx10008 Ethernet Switch, kernel JUNOS 15.1X53 ...
nms/core1-sjc> show interface xe-.*
15 interfaces has been found
+--------------+---------+---------------------------------+------------+-------------+------------+-------------+------------+-------------+----------+-----------+
|  INTERFACE   | STATUS  |           DESCRIPTION           | TRAFFIC IN | TRAFFIC OUT | PACKETS IN | PACKETS OUT | DISCARD IN | DISCARD OUT | ERROR IN | ERROR OUT |
+--------------+---------+---------------------------------+------------+-------------+------------+-------------+------------+-------------+----------+-----------+
| xe-7/0/0:1   | Up      | RSW011-01-SJC-002               | 192.58 K   | 75.72 K     | 64.60      | 56.60       | 0.00       | 0.00        | 0.00     | 0.00      |
| xe-7/0/0:2   | Down    |                                 | 0.00       | 0.00        | 0.00       | 0.00        | 0.00       | 0.00        | 0.00     | 0.00      |
| xe-7/0/0:3   | Down    |                                 | 0.00       | 0.00        | 0.00       | 0.00        | 0.00       | 0.00        | 0.00     | 0.00      |
| xe-7/0/0:0   | Up      | RSW012-01-SJC-001               | 61.40 K    | 10.04 K     | 8.60       | 5.00        | 0.00       | 0.00        | 0.00     | 0.00      |
| xe-6/0/0:0   | Down    | CORE1-SAN-XE-2/2/0-AGGIPER40GLR | 0.00       | 0.00        | 0.00       | 0.00        | 0.00       | 0.00        | 0.00     | 0.00      |
| xe-6/0/0:1   | Down    |                                 | 0.00       | 0.00        | 0.00       | 0.00        | 0.00       | 0.00        | 0.00     | 0.00      |
| xe-6/0/0:2   | Down    |                                 | 0.00       | 0.00        | 0.00       | 0.00        | 0.00       | 0.00        | 0.00     | 0.00      |
| xe-6/0/0:3   | Down    |                                 | 0.00       | 0.00        | 0.00       | 0.00        | 0.00       | 0.00        | 0.00     | 0.00      |
| xe-6/0/1:0   | Up      | CORE1-SAN-XE-10/3/1-10GTEK      | 11.79 M    | 1.39 M      | 1.82 K     | 1.02 K      | 0.00       | 0.00        | 0.00     | 0.00      |
| xe-6/0/1:1   | Down    |                                 | 0.00       | 0.00        | 0.00       | 0.00        | 0.00       | 0.00        | 0.00     | 0.00      |
| xe-6/0/1:2   | Down    |                                 | 0.00       | 0.00        | 0.00       | 0.00        | 0.00       | 0.00        | 0.00     | 0.00      |
| xe-6/0/1:3   | Down    |                                 | 0.00       | 0.00        | 0.00       | 0.00        | 0.00       | 0.00        | 0.00     | 0.00      |
| xe-6/0/2:0   | Up      | CORE2-SJC-XE-1/2/0-AGG59        | 5.25 K     | 409.60      | 0.20       | 0.01        | 0.00       | 0.00        | 0.00     | 0.00      |
| xe-6/0/2:1   | Up      | CORE3-SJC-XE-1/3/0-AGG31        | 5.44 K     | 0.00        | 0.31       | 0.00        | 0.00       | 0.00        | 0.00     | 0.00      |
| xe-6/0/3:0   | Down    | CORE3-SJC-XE-1/0/0-40GTEK       | 0.00       | 0.00        | 0.00       | 0.00        | 0.00       | 0.00        | 0.00     | 0.00      |
+--------------+---------+---------------------------------+------------+-------------+------------+-------------+------------+-------------+----------+-----------+
* units per seconds

Build

It can be built for Linux and Darwin. there is libpcap dependency:

- LINUX
apt-get install libpcap-dev
- OSX
brew install homebrew/dupes/libpcap

Given that the Go Language compiler (version 1.7 or greater is required) is installed, you can build it with:

go get github.com/mehrdadrad/mylg
cd $GOPATH/src/github.com/mehrdadrad/mylg/
go build mylg.go

License

This project is licensed under MIT license. Please read the LICENSE file.

Contribute

Welcomes any kind of contribution, please follow the next steps:

  • Fork the project on github.com.
  • Create a new branch.
  • Commit changes to the new branch.
  • Send a pull request.
Issues
  • accuracy with scan

    accuracy with scan

    Hi,

    When using the scan section of the tool, I noticed the results are not that accurate.

    local> scan github.com
    +----------+------+--------+-------------+
    | PROTOCOL | PORT | STATUS | DESCRIPTION |
    +----------+------+--------+-------------+
    +----------+------+--------+-------------+
    there isn't any opened port
    
    local> scan github.com -p 1-500
    0+----------+------+--------+-------------+
    | PROTOCOL | PORT | STATUS | DESCRIPTION |
    +----------+------+--------+-------------+
    +----------+------+--------+-------------+
    there isn't any opened port
    

    With nmap it takes a bit longer but the results are accurate:

    > nmap -sT github.com
    
    Starting Nmap 7.31SVN ( https://nmap.org ) at 2016-11-14 22:47 PST
    Nmap scan report for github.com (192.30.253.113)
    Host is up (0.077s latency).
    Other addresses for github.com (not scanned): 192.30.253.112
    Not shown: 996 filtered ports
    PORT     STATE SERVICE
    22/tcp   open  ssh
    80/tcp   open  http
    443/tcp  open  https
    9418/tcp open  git
    
    Nmap done: 1 IP address (1 host up) scanned in 84.02 seconds
    
    enhancement 
    opened by jungle-boogie 28
  • ping range

    ping range

    Hi All,

    when pinging 192.168.0.0/24, a result is duplicated:

    % sudo /usr/bin/time mylg ping 192.168.0.0/24 | ack alive
    Password:
    192.168.0.1 is alive (1.3574 ms)
    192.168.0.3 is alive (0.4098 ms)
    192.168.0.4 is alive (10.5379 ms)
    192.168.0.5 is alive (2.4246 ms)
    192.168.0.6 is alive (0.3861 ms)
    192.168.0.7 is alive (83.5629 ms)
    192.168.0.8 is alive (14.9203 ms)
    192.168.0.11 is alive (4.3422 ms)
    192.168.0.12 is alive (9.0886 ms)
    192.168.0.13 is alive (0.2380 ms)
    192.168.0.15 is alive (0.0939 ms)
    192.168.0.17 is alive (0.4137 ms)
    192.168.0.20 is alive (12.5586 ms)
    192.168.0.22 is alive (0.4163 ms)
    192.168.0.26 is alive (0.4149 ms)
    192.168.0.100 is alive (0.9317 ms)
    192.168.0.137 is alive (0.6224 ms)
    192.168.0.140 is alive (0.4299 ms)
    192.168.0.15 is alive (0.0967 ms)
          477.88 real         0.71 user         0.05 sys
    

    Notice 192.168.0.15 in listed twice. 192.168.0.15 is the machine I'm running mylg from.

    bug 
    opened by jungle-boogie 17
  • hping with ipv6

    hping with ipv6

    Hi,

    From looking at the hping options, it doesn't seem there's an option to connect via ipv6:

        usage:
              hping url [options]
    
        options:
              -c   count        Send 'count' requests (default: 5)
              -t   timeout      Set a time limit for requests in ms/s (default: 2s)
              -i   interval     Set a wait time between sending each request in ms/s (default: 1s)
              -m   method       HTTP methods: GET/POST/HEAD (default: head)
              -d   data         Sending the given data (text/json) (default: "mylg")
              -u   user agent   Set user agent
              -q                Quiet reqular output
              -k                Enable keep alive
              -dc               Disable compression
              -nc               Don_t check the server certificate
              -trace            Provides the events within client requests
              -json             Export statistics as json format
    
        Proxy:
            hping parses environment variables HTTP(S)_PROXY to determine which/if any
            proxies should be used.
    
    opened by jungle-boogie 15
  • discovery: show ipv6?

    discovery: show ipv6?

    Hi,

    Can disc display the ipv6 of hosts it finds?

    example of what it currently displays:

    +---------------+-------------------+--------------------------+-----------+------------------------------+
    |      IP       |        MAC        |           HOST           | INTERFACE |      ORGANIZATION NAME       |
    +---------------+-------------------+--------------------------+-----------+------------------------------+
    | 192.168.0.8   | 00:04:f2:35:c9:68 | NA                       | bge0      | Polycom                      | 
    +---------------+-------------------+--------------------------+-----------+------------------------------+ 
    
    enhancement 
    opened by jungle-boogie 14
  • Inconceivable result in concurrent-mtr jobs

    Inconceivable result in concurrent-mtr jobs

    I used your code and compared with linux mtr, the result is same, very good!

    but when I run more than 10 mtr jobs concurrently, the result is inconceivable,

    Look, the first picture is concurrent-mtr test, the second picture is single-mtr test.

    Lets compare the same target 183.131.7.137, the first result is mostly different with the second one. In fact, the second result is expected.

    And there isn't this problem of linux mtr.

    Thx!

    question 
    opened by gogoods 10
  • Index out a few seconds after launching any mylg command

    Index out a few seconds after launching any mylg command

    [email protected]:~$ mylg trace us7.wormax.io
    trace route to us7.wormax.io (144.217.254.199), 30 hops max
    1  192.168.1.2 6.783 ms 1.418 ms 4.268 ms
    2  192.168.0.1 1.387 ms 1.389 ms 1.312 ms
    3  96.120.88.121 [ASN 7922/COMCAST-7922] 11.204 ms 10.470 ms 11.854 ms
    4  be-10001-sur03.pinole.ca.sfba.comcast.net. (68.85.100.77) [ASN 7922/COMCAST-7922] 12.258 ms 11.932 ms 14.548 ms
    5  be-224-rar01.pinole.ca.sfba.comcast.net. (162.151.78.185) [ASN 7922/COMCAST-7922] 12.167 ms 13.476 ms 12.566 ms
    6  hu-0-1-0-3-ar01.santaclara.ca.sfba.comcast.net. (68.85.154.45) [ASN 7922/COMCAST-7922] 76.399 ms 15.721 ms 15.345 ms
    7  be-33651-cr02.sunnyvale.ca.ibone.comcast.net. (68.86.90.93) [ASN 7922/COMCAST-7922] 307.349 ms 17.319 ms 18.846 ms
    8  be-11021-cr02.1601milehigh.co.ibone.comcast.net. (68.86.86.66) [ASN 7922/COMCAST-7922] 41.864 ms 45.102 ms 41.049 ms
    9  be-11721-cr02.denver.co.ibone.comcast.net. (68.86.86.77) [ASN 7922/COMCAST-7922] 43.513 ms 38.890 ms 46.868 ms
    10 be-10517-cr02.350ecermak.il.ibone.comcast.net. (68.86.85.169) [ASN 7922/COMCAST-7922] 70.580 ms 65.817 ms 66.156 ms
    panic: runtime error: index out of range
    
    goroutine 10 [running]:
    panic(0x4516280, 0xc4200100e0)
            /usr/local/go/src/runtime/panic.go:500 +0x1a1
    github.com/mehrdadrad/mylg/ns.fetchNSHosts(0x0, 0x0, 0x0)
            /Users/mehrdad/golang/src/github.com/mehrdadrad/mylg/ns/ns.go:357 +0x98d
    github.com/mehrdadrad/mylg/ns.(*Request).Init(0xc42010c460)
            /Users/mehrdad/golang/src/github.com/mehrdadrad/mylg/ns/ns.go:99 +0x7f
    created by main.init.1
            /Users/mehrdad/golang/src/github.com/mehrdadrad/myLG/mylg.go:104 +0x125
    
    opened by lahwran 9
  • ping time regression?

    ping time regression?

    Hi,

    I have two machines running mylg. One I just updated to test #39 and another built on the 14th of November.

    Even though the response time for each ping is around 55ms, the whole ping request took about 30 seconds to complete the whole request:

    % /usr/bin/time sudo mylg ping yahoo.com
    PING yahoo.com (2001:4998:c:a06::2:4008): 56 data bytes
    64 bytes from 2001:4998:c:a06::2:4008 icmp_seq=0 time=58.901061 ms
    64 bytes from 2001:4998:c:a06::2:4008 icmp_seq=1 time=63.529582 ms
    64 bytes from 2001:4998:c:a06::2:4008 icmp_seq=2 time=59.052757 ms
    64 bytes from 2001:4998:c:a06::2:4008 icmp_seq=3 time=54.948603 ms
    64 bytes from 2001:4998:c:a06::2:4008 icmp_seq=4 time=56.835715 ms
    64 bytes from 2001:4998:c:a06::2:4008 icmp_seq=5 time=56.326712 ms
    
    --- yahoo.com ping statistics ---
    6 packets transmitted,  6 packets received, 0% packet loss
    round-trip min/avg/max = 54.949/56.758/63.530 ms
           31.74 real         0.44 user         0.03 sys
    

    from the build on the 14th:

    % /usr/bin/time sudo mylg ping -c 6 yahoo.com
    PING yahoo.com (2001:4998:c:a06::2:4008): 56 data bytes
    64 bytes from 2001:4998:c:a06::2:4008 icmp_seq=0 time=42.963146 ms
    64 bytes from 2001:4998:c:a06::2:4008 icmp_seq=1 time=50.286668 ms
    64 bytes from 2001:4998:c:a06::2:4008 icmp_seq=2 time=42.983244 ms
    64 bytes from 2001:4998:c:a06::2:4008 icmp_seq=3 time=44.244642 ms
    64 bytes from 2001:4998:c:a06::2:4008 icmp_seq=4 time=42.963250 ms
    64 bytes from 2001:4998:c:a06::2:4008 icmp_seq=5 time=42.910109 ms
    
    --- yahoo.com ping statistics ---
    6 packets transmitted,  6 packets received, 0% packet loss
    round-trip min/avg/max = 42.910/43.327/50.287 ms
            5.86 real         0.48 user         0.00 sys
    

    I'll update the 14th build to the most recent and see what occurs.

    opened by jungle-boogie 8
  • error while waiting for command turns off echo

    error while waiting for command turns off echo

    Reproduction instructions

    1. Run mylg as unprivileged user.
    2. Type 'web'
    3. Ping something in the web interface.
    4. mylg gives this error: local> 2016/08/30 13:19:21 listen err, listen ip4:icmp : socket: operation not permitted

    Result

    Terminal stops echoing input until you type stty echo

    Expected

    mylg should clean up if it exits unexpectedly.

    Note: this doesn't happen if you type a command that triggers an error, like ping as an unprivileged user.

    bug 
    opened by nickodell 8
  • hping display port

    hping display port

    Hi,

    I think it would be really useful to have hping support an option for a destination port.

    local> hping http://192.168.0.17:8080 -c 1
    HPING 192.168.0.17 (192.168.0.17), Method: HEAD, DNSLookup: 0.0207 ms
    HTTP Response seq=0, proto=HTTP/1.0, status=404, time=8.066 ms
    
    --- 192.168.0.17 HTTP ping statistics ---
    1 requests transmitted, 1 replies received, 0% requests failed
    HTTP Round-trip min/avg/max = 8.07/8.07/8.07 ms
    HTTP Code [404] responses : [████████████████████] 100.00%
    
    enhancement 
    opened by jungle-boogie 7
  • Build error invalid argument r.snaplen (type uint32) for len

    Build error invalid argument r.snaplen (type uint32) for len

    Happens when running go get or go build.

    Debian 8.5 x64

    # github.com/google/gopacket/pcapgo
    ../../google/gopacket/pcapgo/read.go:124: invalid argument r.snaplen (type uint32) for len
    
    opened by looterz 7
  • change config path: PR #66

    change config path: PR #66

    Hi All,

    This is regarding pull request https://github.com/mehrdadrad/mylg/pull/66

    There's discussion on the table to move ~/.mylg.config to ~/.config/mylg/mylg.config and how to handle this on existing mylg installs.

    opened by jungle-boogie 6
  • bind.socket: operation not permitted

    bind.socket: operation not permitted

    on my laptop:macbook pro 2021, M1, macOS 12.1

    almost every command returns bind.socket: operation not permitted.

    # mylg trace 8.8.8.8
    bind.socket: operation not permitted
    
    # sudo mylg trace 8.8.8.8
    open /var/root/.mylg.config: permission denied
    unexpected end of JSON input
    bind.socket: operation not permitted
    
    # mylg ping 8.8.8.8
    PING 8.8.8.8 (8.8.8.8): 56 data bytes
    listen ip4:icmp : socket: operation not permitted icmp_seq=0
    listen ip4:icmp : socket: operation not permitted icmp_seq=0
    listen ip4:icmp : socket: operation not permitted icmp_seq=0
    listen ip4:icmp : socket: operation not permitted icmp_seq=0
    
    --- 8.8.8.8 ping statistics ---
    4 packets transmitted,  0 packets received, 100% packet loss
    
    # sudo mylg ping 8.8.8.8
    open /var/root/.mylg.config: permission denied
    unexpected end of JSON input
    PING 8.8.8.8 (8.8.8.8): 56 data bytes
    listen ip4:icmp : socket: operation not permitted icmp_seq=0
    listen ip4:icmp : socket: operation not permitted icmp_seq=0
    listen ip4:icmp : socket: operation not permitted icmp_seq=0
    listen ip4:icmp : socket: operation not permitted icmp_seq=0
    
    --- 8.8.8.8 ping statistics ---
    4 packets transmitted,  0 packets received, 100% packet loss
    
    opened by sbilly 0
  • Build fails using provided instructions (CentOS 7/go 1.8.3)

    Build fails using provided instructions (CentOS 7/go 1.8.3)

    On CentOS 7:

    $ go version
    go version go1.8.3 linux/amd64
    
    $ go get github.com/mehrdadrad/mylg
    # github.com/gizak/termui
    go/src/github.com/gizak/termui/render.go:107: not enough arguments in call to stack.ParseDump
            have (*bytes.Reader, *os.File)
            want (io.Reader, io.Writer, bool)
    go/src/github.com/gizak/termui/render.go:112: undefined: stack.Palette
    go/src/github.com/gizak/termui/render.go:113: undefined: stack.SortBuckets
    go/src/github.com/gizak/termui/render.go:113: undefined: stack.Bucketize
    go/src/github.com/gizak/termui/render.go:114: undefined: stack.CalcLengths
    
    $ cd $GOPATH/src/github.com/mehrdadrad/mylg/
    $ go build mylg.go
    # github.com/gizak/termui
    ../../gizak/termui/render.go:107: not enough arguments in call to stack.ParseDump
            have (*bytes.Reader, *os.File)
            want (io.Reader, io.Writer, bool)
    ../../gizak/termui/render.go:112: undefined: stack.Palette
    ../../gizak/termui/render.go:113: undefined: stack.SortBuckets
    ../../gizak/termui/render.go:113: undefined: stack.Bucketize
    ../../gizak/termui/render.go:114: undefined: stack.CalcLengths
    
    opened by elfchief 2
  • homebrew/dupes/libpcap deprecated

    homebrew/dupes/libpcap deprecated

    brew install homebrew/dupes/libpcap in the README for macOS installation should now be brew install libpcap (I think as I don't know what the original dupes/libpcap version was). Homebrew migrated dupes tap to core.

    opened by Jahhein 0
  • Panic Error

    Panic Error

    Hello.

    Anyone with this error? Just logged in and i have error.

    ================================================= _ ___ _ __ _ | | / __| | ' \ || | || (_ | |||_, |__| |__/

                 My Looking Glass
           Free Network Diagnostic Tool
                  http://mylg.io
    

    ================== myLG v0.2.6 ================== local> local> local> panic: runtime error: index out of range

    goroutine 7 [running]: panic(0x905420, 0xc42000c0d0) /usr/local/go/src/runtime/panic.go:500 +0x1a1 github.com/mehrdadrad/mylg/ns.fetchNSHosts(0x0, 0x0, 0x0) /home/vagrant/golang/src/github.com/mehrdadrad/mylg/ns/ns.go:357 +0x98d github.com/mehrdadrad/mylg/ns.(*Request).Init(0xc42004a770) /home/vagrant/golang/src/github.com/mehrdadrad/mylg/ns/ns.go:99 +0x7f created by main.init.1 /home/vagrant/golang/src/github.com/mehrdadrad/mylg/mylg.go:104 +0x125 [email protected]:~/pacotes$

    Regards, Leandro de Lima Camargo

    opened by bacherol 12
  • May want to update installation instructions

    May want to update installation instructions

    You may want to add a note to define (if it isn't already) GOPATH prior to running 'go get ...'. If its not defined you will get an error:

    $ go get github.com/mehrdadrad/mylg package github.com/mehrdadrad/mylg: cannot download, $GOPATH not set. For more details see: go help gopath

    Great tool thanks for writing it!

    opened by Matty9191 0
Releases(v0.2.6)
Owner
Mehrdad Arshad Rad
Sr. Principal Software Engineer. Cloud, Automation, Network, Go and Open Source enthusiast.
Mehrdad Arshad Rad
Magma is an open-source software platform that gives network operators an open, flexible and extendable mobile core network solution.

Connecting the Next Billion People Magma is an open-source software platform that gives network operators an open, flexible and extendable mobile core

Magma 1.3k Jul 1, 2022
Optimize Windows's network/NIC driver settings for NewTek's NDI(Network-Device-Interface).

windows-ndi-optimizer[WIP] Optimize Windows's network/NIC driver settings for NewTek's NDI(Network-Device-Interface). How it works This is batchfile d

Nil Hiiragi 3 Apr 15, 2022
A simple network analyzer that capture http network traffic

httpcap A simple network analyzer that captures http network traffic. support Windows/MacOS/Linux/OpenWrt(x64) https only capture clienthello colorful

null 1 Nov 24, 2021
Zero Trust Network Communication Sentinel provides peer-to-peer, multi-protocol, automatic networking, cross-CDN and other features for network communication.

Thank you for your interest in ZASentinel ZASentinel helps organizations improve information security by providing a better and simpler way to protect

ZTALAB 5 May 25, 2022
Tool for monitoring network devices (mainly using SNMP) - monitoring check plugin

Thola Description A tool for monitoring network devices written in Go. It features a check mode which complies with the monitoring plugins development

inexio 246 Jun 12, 2022
Ethr is a Comprehensive Network Measurement Tool for TCP, UDP & ICMP.

Ethr Ethr is a cross platform network performance measurement tool written in golang. The goal of this project is to provide a native tool for compreh

Microsoft 5.4k Jun 22, 2022
TCPProbe is a modern TCP tool and service for network performance observability.

TCPProbe is a modern TCP tool and service for network performance observability. It exposes information about socket’s underlying TCP session, TLS and HTTP (more than 60 metrics). you can run it through command line or as a service. the request is highly customizable and you can integrate it with your application through gRPC. it runs in a Kubernetes cluster as cloud native application and by adding annotations on pods allow a fine control of the probing process.

Mehrdad Arshad Rad 322 May 11, 2022
LNC is a lightning network capital management tool built for routing nodes.

LNC is a lightning network capital management tool built for routing nodes.

LN.capital 5 Dec 21, 2021
A tool based on eBPF, prometheus and grafana to monitor network connectivity.

Connectivity Monitor Tracks the connectivity of a kubernetes cluster to its api server and exposes meaningful connectivity metrics. Uses ebpf to obser

Gardener 20 Jun 2, 2022
A small tool used to correspond to the IP address according to the name, id, and network alias of the docker container, which can be run as a DNS server

A small tool used to correspond to the IP address according to the name, id, and network alias of the docker container, which can be run as a DNS server

Swift 5 Apr 4, 2022
Proxtor - A simple tool to connect to the network using Tor

Proxtor A simple tool to connect to the network using Tor. Installing Go to rele

null 1 Jan 1, 2022
SSH file upload/download tool in weak network environment

RSCP 弱网环境下的ssh文件上传/下载工具 SSH file upload/download tool in weak network environment USAGE -b int each block size (bytes) -c string c

null 1 Jan 14, 2022
🚀Gev is a lightweight, fast non-blocking TCP network library based on Reactor mode. Support custom protocols to quickly and easily build high-performance servers.

gev 中文 | English gev is a lightweight, fast non-blocking TCP network library based on Reactor mode. Support custom protocols to quickly and easily bui

徐旭 1.4k Jun 26, 2022
gNXI Tools - gRPC Network Management/Operations Interface Tools

gNxI Tools gNMI - gRPC Network Management Interface gNOI - gRPC Network Operations Interface A collection of tools for Network Management that use the

Google 213 Jun 12, 2022
Simulate network link speed

linkio linkio provides an io.Reader and io.Writer that simulate a network connection of a certain speed, e.g. to simulate a mobile connection. Quick s

Ian Kent 51 Mar 31, 2022
NFF-Go -Network Function Framework for GO (former YANFF)

Network Function Framework for Go (former YANFF) Wonderful news : we are now supporting AF_XDP and supporting(almost) getting packets directly from Li

Intel Go Team 1.2k Jun 26, 2022
Send network packets over a TCP or UDP connection.

Packet is the main class representing a single network message. It has a byte code indicating the type of the message and a []byte type payload.

Aero 70 Jun 26, 2022
A cloud native distributed streaming network telemetry.

Panoptes Streaming Panoptes Streaming is a cloud native distributed streaming network telemetry. It can be installed as a single binary or clustered n

Yahoo 34 Apr 19, 2022
Package raw enables reading and writing data at the device driver level for a network interface. MIT Licensed.

raw Package raw enables reading and writing data at the device driver level for a network interface. MIT Licensed. For more information about using ra

Matt Layher 421 Jun 15, 2022