Removing deprecated ximcx source

master
sandeep 2021-02-19 20:40:33 +05:30
parent e292927a00
commit ea00521300
2 changed files with 0 additions and 68 deletions

View File

@ -34,7 +34,6 @@ import (
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/threatminer"
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/virustotal"
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/waybackarchive"
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/ximcx"
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/zoomeye"
)
@ -78,7 +77,6 @@ var DefaultRecursiveSources = []string{
"sonarsearch",
"sublist3r",
"virustotal",
"ximcx",
}
// DefaultAllSources contains list of all sources
@ -115,7 +113,6 @@ var DefaultAllSources = []string{
"threatminer",
"virustotal",
"waybackarchive",
"ximcx",
"zoomeye",
}
@ -205,8 +202,6 @@ func (a *Agent) addSources(sources []string) {
a.sources[source] = &virustotal.Source{}
case "waybackarchive":
a.sources[source] = &waybackarchive.Source{}
case "ximcx":
a.sources[source] = &ximcx.Source{}
case "zoomeye":
a.sources[source] = &zoomeye.Source{}
}

View File

@ -1,63 +0,0 @@
package ximcx
import (
"context"
"fmt"
jsoniter "github.com/json-iterator/go"
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping"
)
// Source is the passive scraping agent
type Source struct{}
type domain struct {
Domain string `json:"domain"`
}
type ximcxResponse struct {
Code int64 `json:"code"`
Message string `json:"message"`
Data []domain `json:"data"`
}
// Run function returns all subdomains found with the service
func (s *Source) Run(ctx context.Context, domain string, session *subscraping.Session) <-chan subscraping.Result {
results := make(chan subscraping.Result)
go func() {
defer close(results)
resp, err := session.SimpleGet(ctx, fmt.Sprintf("http://sbd.ximcx.cn/DomainServlet?domain=%s", domain))
if err != nil {
results <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: err}
session.DiscardHTTPResponse(resp)
return
}
var response ximcxResponse
err = jsoniter.NewDecoder(resp.Body).Decode(&response)
if err != nil {
results <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: err}
resp.Body.Close()
return
}
resp.Body.Close()
if response.Code > 0 {
results <- subscraping.Result{Source: s.Name(), Type: subscraping.Error, Error: fmt.Errorf("%d, %s", response.Code, response.Message)}
return
}
for _, result := range response.Data {
results <- subscraping.Result{Source: s.Name(), Type: subscraping.Subdomain, Value: result.Domain}
}
}()
return results
}
// Name returns the name of the source
func (s *Source) Name() string {
return "ximcx"
}