Giter VIP home page Giter VIP logo

geo's People

Contributors

atem18 avatar jakewmeyer avatar jhmartin avatar tryforsure avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geo's Issues

Use 'ip' for lan search

The ifconfig command is deprecated on several distributions (such as https://www.archlinux.org/news/deprecation-of-net-tools/), so consider testing for the existence of the newer ip command and use it instead:

$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether b8:27:eb:02:29:6f brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.2/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::ba27:ebff:fe02:296f/64 scope link
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:0f:60:01:e5:a8 brd ff:ff:ff:ff:ff:ff
    inet 172.24.1.1/24 brd 172.14.1.244 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::20f:60ff:fe01:e5a8/64 scope link
       valid_lft forever preferred_lft forever
4: mon.wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UNKNOWN qlen 1000
    link/ieee802.11/radiotap 00:0f:60:01:e5:a8 brd ff:ff:ff:ff:ff:ff

Use 'ip' for MAC search

The ifconfig command is deprecated on several distributions (such as https://www.archlinux.org/news/deprecation-of-net-tools/), so consider testing for the existence of the newer ip command and use it instead:

$ ip link show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
    link/ether b8:27:eb:02:29:6f brd ff:ff:ff:ff:ff:ff

Use https for network queries

None of the URLs that are curl'd use https. This is generally bad practice, though in your case because your scripts don't do more than print the output, an attacker could at best print unexpected things to the screen, perhaps tricking the user.

Shellcheck issues

Shellcheck (http://www.shellcheck.net/) finds some potential issues:

In geo line 45:
  if [ "$(uname)" == "Darwin" ]; then
                  ^-- SC2039: In POSIX sh, == in place of = is undefined.

In geo line 57:
  cat /etc/resolv.conf |grep -i nameserver|head -n1|cut -d ' ' -f2
      ^-- SC2002: Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.


In geo line 62:
  ifconfig $MAC | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}'
           ^-- SC2086: Double quote to prevent globbing and word splitting.


In geo line 72:
  if [ $OPTIONS == "all" ]; then
       ^-- SC2086: Double quote to prevent globbing and word splitting.
                ^-- SC2039: In POSIX sh, == in place of = is undefined.

Support long flags

All of geo's flags are in short form. It would be better to provide alternate like --wan for -w, --lan for -l and such.

I know you are using getopts and it doesn't support long flags but still it is possible to implement.

Shellcheck issues

In ./geo line 47:
  elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
            ^-- SC2003: expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].
                        ^-- SC2046: Quote this to prevent word splitting.
                                          ^-- SC2039: In POSIX sh, == in place of = is undefined.

/bin/sh not bash

Shebang should be corrected to
#!/usr/bin/env bash
for portability as /bin/sh might not be bash.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.