Projects STRLCPY metabigor Commits a56a625a
🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■ ■
    cmd/net.go
    skipped 82 lines
    83 83   options.Net.Asn = input
    84 84   var data []string
    85 85   var wg sync.WaitGroup
    86  - wg.Add(1)
    87  - go func() {
    88  - data = append(data, modules.ASNBgpDotNet(options)...)
    89  - wg.Done()
    90  - }()
     86 + 
     87 + //wg.Add(1)
     88 + //go func() {
     89 + // data = append(data, modules.ASNBgpDotNet(options)...)
     90 + // wg.Done()
     91 + //}()
    91 92   
    92 93   wg.Add(1)
    93 94   go func() {
    skipped 65 lines
  • ■ ■ ■ ■
    cmd/root.go
    skipped 35 lines
    36 36   RootCmd.PersistentFlags().StringVar(&options.Scan.TmpOutput, "tmp", "", "Temp Output folder")
    37 37   RootCmd.PersistentFlags().StringVar(&options.Proxy, "proxy", "", "Proxy for doing request")
    38 38   RootCmd.PersistentFlags().IntVarP(&options.Concurrency, "concurrency", "c", 5, "concurrency")
    39  - RootCmd.PersistentFlags().IntVar(&options.Timeout, "timeout", 15, "timeout")
     39 + RootCmd.PersistentFlags().IntVar(&options.Timeout, "timeout", 20, "timeout")
    40 40   RootCmd.PersistentFlags().StringVarP(&options.Input, "input", "i", "-", "input as a string, file or from stdin")
    41 41   RootCmd.PersistentFlags().StringVarP(&options.Output, "output", "o", "out.txt", "output name")
    42 42   RootCmd.PersistentFlags().BoolVar(&options.Debug, "debug", false, "Debug")
    skipped 41 lines
  • ■ ■ ■ ■ ■ ■
    core/request.go
    skipped 3 lines
    4 4   "context"
    5 5   "crypto/tls"
    6 6   "fmt"
     7 + "github.com/j3ssie/osmedeus/utils"
    7 8   "log"
    8 9   "os"
    9 10   "path"
    skipped 7 lines
    17 18  )
    18 19   
    19 20  // RequestWithChrome Do request with real browser
    20  -func RequestWithChrome(url string, contentID string) string {
     21 +func RequestWithChrome(url string, contentID string, timeout int) string {
    21 22   // prepare the chrome options
    22 23   opts := append(chromedp.DefaultExecAllocatorOptions[:],
    23 24   chromedp.Flag("headless", true),
    skipped 11 lines
    35 36   defer bcancel()
    36 37   
    37 38   ctx, cancel := chromedp.NewContext(allocCtx, chromedp.WithLogf(log.Printf))
    38  - ctx, cancel = context.WithTimeout(ctx, 10*time.Second)
     39 + ctx, cancel = context.WithTimeout(ctx, time.Duration(timeout)*time.Second)
    39 40   defer cancel()
    40 41   
    41 42   // run task list
    skipped 2 lines
    44 45   chromedp.Navigate(url),
    45 46   chromedp.OuterHTML(contentID, &data, chromedp.NodeVisible, chromedp.ByID),
    46 47   )
     48 + utils.DebugF(data)
    47 49   
    48 50   // clean chromedp-runner folder
    49 51   cleanUp()
    50 52   
    51 53   if err != nil {
     54 + utils.InforF("[ERRR] %v", err)
    52 55   return ""
    53 56   }
    54 57   return data
    skipped 132 lines
  • ■ ■ ■ ■ ■ ■
    modules/netblock.go
    skipped 22 lines
    23 23   url := fmt.Sprintf(`https://ipinfo.io/AS%v`, asn)
    24 24   var result []string
    25 25   core.InforF("Get data from: %v", url)
    26  - content := core.RequestWithChrome(url, "ipTabContent")
     26 + content := core.RequestWithChrome(url, "ipTabContent", options.Timeout)
    27 27   doc, err := goquery.NewDocumentFromReader(strings.NewReader(content))
    28 28   if err != nil {
    29 29   return result
    skipped 70 lines
    100 100   url := fmt.Sprintf(`https://bgp.he.net/AS%v#_prefixes`, asn)
    101 101   core.InforF("Get data from: %v", url)
    102 102   var result []string
    103  - content := core.RequestWithChrome(url, "prefixes")
     103 + content := core.RequestWithChrome(url, "prefixes", options.Timeout * 4)
    104 104   doc, err := goquery.NewDocumentFromReader(strings.NewReader(content))
    105 105   if err != nil {
    106 106   return result
    skipped 17 lines
    124 124   url := fmt.Sprintf(`https://spyse.com/target/as/%v#c-domain__anchor--3--%v`, asn, asn)
    125 125   var result []string
    126 126   core.InforF("Get data from: %v", url)
    127  - content := core.RequestWithChrome(url, "asn-ipv4-ranges")
     127 + content := core.RequestWithChrome(url, "asn-ipv4-ranges", options.Timeout)
    128 128   doc, err := goquery.NewDocumentFromReader(strings.NewReader(content))
    129 129   if err != nil {
    130 130   return result
    skipped 20 lines
    151 151   url := fmt.Sprintf(`https://bgp.he.net/search?search%%5Bsearch%%5D=%v&commit=Search`, org)
    152 152   core.InforF("Get data from: %v", url)
    153 153   var result []string
    154  - content := core.RequestWithChrome(url, "search")
     154 + content := core.RequestWithChrome(url, "search", options.Timeout)
    155 155   doc, err := goquery.NewDocumentFromReader(strings.NewReader(content))
    156 156   if err != nil {
    157 157   return result
    skipped 20 lines
    178 178   url := fmt.Sprintf(`https://bgpview.io/search/%v`, org)
    179 179   core.InforF("Get data from: %v", url)
    180 180   var result []string
    181  - content := core.RequestWithChrome(url, "results-tabs")
     181 + content := core.RequestWithChrome(url, "results-tabs", options.Timeout)
    182 182   doc, err := goquery.NewDocumentFromReader(strings.NewReader(content))
    183 183   if err != nil {
    184 184   return result
    skipped 36 lines
  • ■ ■ ■ ■ ■ ■
    modules/search.go
    skipped 29 lines
    30 30  // FoFaSearch doing searching on FoFa
    31 31  func FoFaSearch(options core.Options) []string {
    32 32   var result []string
    33  - result = append(result, singleFoFaSearch(options.Search.Query)...)
     33 + result = append(result, singleFoFaSearch(options.Search.Query, options)...)
    34 34   
    35 35   if !options.Search.Optimize {
    36 36   return result
    skipped 7 lines
    44 44   wg.Add(1)
    45 45   go func(query string) {
    46 46   defer wg.Done()
    47  - result = append(result, singleFoFaSearch(query)...)
     47 + result = append(result, singleFoFaSearch(query, options)...)
    48 48   }(moreQuery)
    49 49   // limit the pool
    50 50   count++
    skipped 7 lines
    58 58   return result
    59 59  }
    60 60   
    61  -func singleFoFaSearch(query string) []string {
     61 +func singleFoFaSearch(query string, options core.Options) []string {
    62 62   core.InforF("Fofa Query: %v", query)
    63 63   query = core.Base64Encode(query)
    64 64   url := fmt.Sprintf(`https://fofa.so/result?qbase64=%v`, query)
    65 65   core.DebugF("Get data from: %v", url)
    66 66   var result []string
    67 67   
    68  - content := core.RequestWithChrome(url, "ajax_content")
     68 + content := core.RequestWithChrome(url, "ajax_content", options.Timeout)
    69 69   doc, err := goquery.NewDocumentFromReader(strings.NewReader(content))
    70 70   if err != nil {
    71 71   return result
    skipped 63 lines
Please wait...
Page is in error, reload to recover