Skip to content

Commit

Permalink
mosint 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
alpkeskin committed Jan 22, 2023
1 parent 79600a8 commit fe60d09
Show file tree
Hide file tree
Showing 30 changed files with 1,120 additions and 890 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: goreleaser

on:
push:
tags:
- "*"

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Fetch all tags
run: git fetch --force --tags
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: ${{ env.GITHUB_REF_NAME }}
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}

33 changes: 33 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
builds:
- binary: mosint
goos:
- darwin
- linux
goarch:
- amd64
- arm64
env:
- CGO_ENABLED=0
flags:
- -mod=vendor

release:
prerelease: auto

universal_binary:
- replace: true

brews:
-
name: mosint
description: An automated e-mail OSINT tool
homepage: https://github.com/alpkeskin/mosint
tap:
owner: alpkeskin
name: homebrew-mosint
commit_author:
name: alpkeskin
email: [email protected]

checksum:
name_template: 'checksums.txt'
Binary file removed banner2-2.png
Binary file not shown.
Binary file added banner2-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 0 additions & 51 deletions cmd/breachdirectory.go

This file was deleted.

40 changes: 40 additions & 0 deletions cmd/controllers/breachdirectory.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// mosint v2.3
// Author: Alp Keskin
// Github: github.com/alpkeskin
// Linkedin: linkedin.com/in/alpkeskin

package controllers

import (
"encoding/json"
"io"
"net/http"

"github.com/alpkeskin/mosint/cmd/utils"
)

func BreachDirectory(email string) {
defer utils.ProgressBar.Add(10)
var key string = utils.GetAPIKey("Breachdirectory")
if key == "" {
return
}
url := utils.BreachDirectoryAPI + email

req, err := http.NewRequest("GET", url, nil)
if err != nil {
panic(err)
}

req.Header.Add("x-rapidapi-host", "breachdirectory.p.rapidapi.com")
req.Header.Add("x-rapidapi-key", key)

res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
json.Unmarshal(body, &utils.Breachdirectory_result)
}
29 changes: 29 additions & 0 deletions cmd/controllers/emailrep.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// mosint v2.3
// Author: Alp Keskin
// Github: github.com/alpkeskin
// Linkedin: linkedin.com/in/alpkeskin

package controllers

import (
"encoding/json"
"io"
"net/http"

"github.com/alpkeskin/mosint/cmd/utils"
)

func EmailRep(email string) {
defer utils.ProgressBar.Add(10)
var key string = utils.GetAPIKey("Emailrep")
if key == "" {
return
}
client := &http.Client{}
req, _ := http.NewRequest("GET", utils.EmailrepURL+email, nil)
req.Header.Set("Key", key)
req.Header.Set("User-Agent", "mosint")
resp, _ := client.Do(req)
body, _ := io.ReadAll(resp.Body)
json.Unmarshal(body, &utils.Emailrep_result)
}
13 changes: 6 additions & 7 deletions cmd/googling.go → cmd/controllers/googling.go
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
// mosint v2.2
// mosint v2.3
// Author: Alp Keskin
// Github: github.com/alpkeskin
// Linkedin: linkedin.com/in/alpkeskin

package cmd
package controllers

import (
"sync"

"github.com/alpkeskin/mosint/cmd/utils"
googlesearch "github.com/rocketlaunchr/google-search"
)

func Googling(wg *sync.WaitGroup, email string) {
defer wg.Done()
func Googling(email string) {
defer utils.ProgressBar.Add(10)
q := "intext:" + string('"') + email + string('"')
res, err := googlesearch.Search(nil, q)
if err != nil {
panic(err)
}
size := len(res)
for i := 0; i < size; i++ {
googling_result = append(googling_result, res[i].URL)
utils.Googling_result = append(utils.Googling_result, res[i].URL)
}
}
29 changes: 29 additions & 0 deletions cmd/controllers/hunter.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// mosint v2.3
// Author: Alp Keskin
// Github: github.com/alpkeskin
// Linkedin: linkedin.com/in/alpkeskin

package controllers

import (
"encoding/json"
"io"
"net/http"
"strings"

"github.com/alpkeskin/mosint/cmd/utils"
)

func Hunter(email string) {
defer utils.ProgressBar.Add(10)
key := utils.GetAPIKey("Hunter")
if key == "" {
return
}
client := &http.Client{}
req, _ := http.NewRequest("GET", utils.HunterAPI+strings.Split(email, "@")[1]+"&api_key="+key, nil)
req.Header.Set("User-Agent", "mosint")
resp, _ := client.Do(req)
body, _ := io.ReadAll(resp.Body)
json.Unmarshal(body, &utils.Hunter_result)
}
23 changes: 10 additions & 13 deletions cmd/intelx.go → cmd/controllers/intelx.go
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
// mosint v2.2
// mosint v2.3
// Author: Alp Keskin
// Github: github.com/alpkeskin
// Linkedin: linkedin.com/in/alpkeskin

package cmd
package controllers

import (
"context"
"fmt"
"sync"

"github.com/IntelligenceX/SDK/Go/ixapi"
"github.com/alpkeskin/mosint/cmd/utils"
)

const defaultMaxResults = 10 // max results to query and show
const frontendBaseURL = "https://intelx.io/"

func Intelx(wg *sync.WaitGroup, email string) {
defer wg.Done()
key := GetAPIKey("Intelx")
func Intelx(email string) {
defer utils.ProgressBar.Add(10)
key := utils.GetAPIKey("Intelx")
if key == "" {
return
}
Expand All @@ -29,7 +26,7 @@ func search(ctx context.Context, Key, Selector string, Sort int) {

search := ixapi.IntelligenceXAPI{}
search.Init("", Key)
results, selectorInvalid, err := search.Search(ctx, Selector, Sort, defaultMaxResults, ixapi.DefaultWaitSortTime, ixapi.DefaultTimeoutGetResults)
results, selectorInvalid, err := search.Search(ctx, Selector, Sort, utils.IntelxDefaultMaxResults, ixapi.DefaultWaitSortTime, ixapi.DefaultTimeoutGetResults)

if err != nil {
fmt.Printf("Error querying results: %s\n", err)
Expand All @@ -45,15 +42,15 @@ func search(ctx context.Context, Key, Selector string, Sort int) {
func generateResultText(ctx context.Context, api *ixapi.IntelligenceXAPI, Records []ixapi.SearchResult) (text string) {

for n, record := range Records {
resultLink := frontendBaseURL + "?did=" + record.SystemID.String()
resultLink := utils.IntelxURL + "?did=" + record.SystemID.String()

title := record.Name
if title == "" {
title = "Untitled Document"
}
intelx_result = append(intelx_result, resultLink)
utils.Intelx_result = append(utils.Intelx_result, resultLink)

if n >= defaultMaxResults-1 {
if n >= utils.IntelxDefaultMaxResults-1 {
break
}
}
Expand Down
36 changes: 36 additions & 0 deletions cmd/controllers/ipapi.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// mosint v2.3
// Author: Alp Keskin
// Github: github.com/alpkeskin
// Linkedin: linkedin.com/in/alpkeskin

package controllers

import (
"encoding/json"
"io"
"net"
"net/http"
"strings"

"github.com/alpkeskin/mosint/cmd/utils"
)

func IPAPI(email string) {
defer utils.ProgressBar.Add(10)
splt := strings.Split(email, "@")
ips, _ := net.LookupIP(splt[1])
ip4api := ""
for _, ip := range ips {
if ipv4 := ip.To4(); ipv4 != nil {
ip4api = ipv4.String()
}
}
if ip4api != "" {
client := &http.Client{}
req, _ := http.NewRequest("GET", utils.IPAPIURL+ip4api+"/json/", nil)
req.Header.Set("User-Agent", "mosint")
resp, _ := client.Do(req)
body, _ := io.ReadAll(resp.Body)
json.Unmarshal(body, &utils.Ipapi_result)
}
}
Loading

0 comments on commit fe60d09

Please sign in to comment.