{"id":20772241,"url":"https://github.com/ericneves/findipaddress","last_synced_at":"2026-04-10T21:04:15.922Z","repository":{"id":125583025,"uuid":"600912691","full_name":"EricNeves/findIPAddress","owner":"EricNeves","description":"Find IP address with bash script 🔎","archived":false,"fork":false,"pushed_at":"2023-05-18T15:54:31.000Z","size":913,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-18T07:27:01.393Z","etag":null,"topics":["bash","bash-script","ip","linux","network-programming"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EricNeves.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-13T00:18:00.000Z","updated_at":"2023-04-21T14:35:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"f4682e53-f27c-4837-be9c-f0a7296447fe","html_url":"https://github.com/EricNeves/findIPAddress","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricNeves%2FfindIPAddress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricNeves%2FfindIPAddress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricNeves%2FfindIPAddress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EricNeves%2FfindIPAddress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EricNeves","download_url":"https://codeload.github.com/EricNeves/findIPAddress/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243109753,"owners_count":20237922,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","bash-script","ip","linux","network-programming"],"created_at":"2024-11-17T12:19:51.868Z","updated_at":"2026-04-10T21:04:15.825Z","avatar_url":"https://github.com/EricNeves.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Logo](.github/logo.svg)\n\n### Find IP Address\n\n![Image](https://img.shields.io/github/license/ericneves/FINDIPADDRESS?color=green\u0026style=flat-square\u0026logo=appveyor)\n\n\u003cp\u003eScript escrito em bash, que possui a finalidade de encontrar endereços IP's conectados na rede interna.\u003c/p\u003e\n\n![Logo](.github/result.png)\n\n### Funcionamento\n\n\u003cp\u003eIremos seguir a ordem de execução do script e entender o seu simples e poderoso funcionamento.\u003c/p\u003e\n\n\u003cp\u003ePrimeiro é preciso entender a classe de IP de sua rede interna, no exemplo é utilizado o IP de classe C: \u003cb\u003e192.168.100.{host}\u003c/b\u003e, em que os dispositivos conectados correspodem apenas ao último campo: \u003cb\u003e{host}.\u003c/b\u003e\u003c/p\u003e\n\u003cbr\u003e\n\u003cp\u003eO comando abaixo é um simples \u003cb\u003eping\u003c/b\u003e, enviando apenas uma contagem \u003cb\u003e-c1\u003c/b\u003e. Uma vez que o IP inserido está conectado, é retornado \u003cb\u003e64 bytes\u003c/b\u003e, a partir deste ponto iremos filtrar as informações.\u003c/p\u003e\n\n![Logo](.github/ping.png)\n\n\u003cp\u003eO comando \u003cb\u003egrep \"64 bytes\"\u003c/b\u003e retorna apenas o IP conectado.\u003c/p\u003e\n\u003cp\u003eLembrando que o caracter \u003cb\u003e|\u003c/b\u003e separa um comando por vez.\u003c/p\u003e\n\n![Logo](.github/grep.png)\n\n\u003cp\u003eO comando \u003cb\u003eawk '{print $4}'\u003c/b\u003e retorna o trecho da 4ª coluna.\u003c/p\u003e\n\n![Logo](.github/awk.png)\n\n\u003cp\u003eO comando \u003cb\u003esed 's/://'\u003c/b\u003e retira o caracter \u003cb\u003e':'\u003c/b\u003e, ao invés de \u003cb\u003e192.168.100.1:\u003c/b\u003e, o resultado é \u003cb\u003e192.168.100.1\u003c/b\u003e, e é isso, a lógica está pronta.\u003c/p\u003e\n\n![Logo](.github/sed.png)\n\n\u003cp\u003eAntes de montar o script, o código abaixo retorna uma lista de valores que serão os possíveis hosts conectados na rede. A variavél \u003cb\u003e$i\u003c/b\u003e será inserida de forma dinâmica, por exemplo: \u003cb\u003e192.168.100.$i\u003c/b\u003e, resultando numa lista de IP's.\u003c/p\u003e\n\n![Logo](.github/for.png)\n\n\u003cp\u003eApós entendermos a lógica, vamos criar o script e adicionar a permissão de execução. Sendo que \u003cb\u003enano\u003c/b\u003e foi o editor que escolhi.\u003c/p\u003e\n\n![Logo](.github/chmod.png)\n\n\u003cp\u003eE essa foi a execução e o resultado do script, podendo ser uma ferrament muito útil para diversos contextos.\u003c/p\u003e\n\n![Logo](.github/script.png)\n![Logo](.github/result.png)\n\n### License\n\n![Image](https://img.shields.io/github/license/ericneves/FINDIPADDRESS?color=green\u0026style=flat)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericneves%2Ffindipaddress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericneves%2Ffindipaddress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericneves%2Ffindipaddress/lists"}