4 Commits
v1.2 ... v1.3

Author SHA1 Message Date
9d03c6f567 Version 1.3: Allow disabling header 2021-02-19 23:24:10 +00:00
e15b6d702c Update README.md 2021-02-09 12:06:08 +00:00
d96a91f161 Copy README from ltipinfo 2021-02-09 12:05:20 +00:00
3efe3882c1 Create LICENSE.md 2021-01-17 20:05:16 +00:00
3 changed files with 58 additions and 4 deletions

21
LICENSE.md Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Luke Tainton
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

21
Main.go
View File

@@ -7,15 +7,28 @@ import (
) )
func main() { func main() {
printHeader()
var input string var input string
var wantPrefixes bool var wantPrefixes bool
var wantHeader bool
flag.StringVar(&input, "i", "", "IP address or domain")
flag.BoolVar(&wantPrefixes, "p", false, "print BGP prefixes")
flag.BoolVar(&wantHeader, "b", true, "enable/disable header")
flag.Usage = func() {
fmt.Printf("Usage of iPilot: \n")
fmt.Printf(" -b bool enable/disable header (default true)\n")
fmt.Printf(" -h bool view help\n")
fmt.Printf(" -i string IP address or domain\n")
fmt.Printf(" -p bool print BGP prefixes (default false)\n")
}
flag.StringVar(&input, "i", "", "Specify IP address or domain name.")
flag.BoolVar(&wantPrefixes, "p", false, "Enable printing of advertised BGP prefixes.")
flag.Parse() flag.Parse()
if wantHeader {
printHeader()
}
if input == "" { if input == "" {
fmt.Println("FATAL: No IP address or domain name was specified.") fmt.Println("FATAL: No IP address or domain name was specified.")
os.Exit(1) os.Exit(1)

20
README.md Normal file
View File

@@ -0,0 +1,20 @@
# IP Information Lookup Tool (iPilot)
This Go application takes an IP address or domain name and gathers the following information:
- Location
- Timezone
- Internet Service Provider
- Autonomous System
- Advertised Prefixes
## Running the script
Here are some ways that you can run the script:
| Command | Description |
| ---------------------- | ---------------------------------------- |
| `./iPilot -i me` | Run against your own connection |
| `./iPilot -i 1.1.1.1` | Run against the IP address `1.1.1.1` |
| `./iPilot -i google.com` | Run against the domain name `google.com` |
| `./iPilot -i google.com -p` | Run against the domain name `google.com` and lists BGP prefixes |
## Credits
This script runs thanks to the APIs provided by [IP-API](http://ip-api.com) and [HackerTarget](https://hackertarget.com/as-ip-lookup).