@@ -22,6 +22,7 @@ var filename string
2222var headers []string
2323var extensions = []string {"php" , "htm" , "html" , "txt" }
2424var enableSpidering bool
25+ var ignoredLengths []int
2526
2627var urlCmd = & cobra.Command {
2728 Use : "url [url]" ,
@@ -80,6 +81,7 @@ var urlCmd = &cobra.Command{
8081
8182 options := []scan.URLOption {
8283 scan .WithPositiveStatusCodes (intStatusCodes ),
84+ scan .WithNegativeLengths (ignoredLengths ),
8385 scan .WithTargetURL (* parsedURL ),
8486 scan .WithResultChan (resultChan ),
8587 scan .WithBusyChan (busyChan ),
@@ -124,7 +126,7 @@ var urlCmd = &cobra.Command{
124126
125127 go func () {
126128 for result := range resultChan {
127- importantOutputChan <- tml .Sprintf ("<blue>[</blue><yellow>%d</yellow><blue>]</blue> % s\n " , result .StatusCode , result .URL .String ())
129+ importantOutputChan <- tml .Sprintf ("<blue>[</blue><yellow>%d</yellow><blue>]</blue> <blue>[</blue><yellow>%d</yellow><blue>]</blue> % s\n " , result .StatusCode , result . Size , result .URL .String ())
128130 }
129131 close (waitChan )
130132 }()
@@ -197,6 +199,7 @@ func init() {
197199 urlCmd .Flags ().StringSliceVarP (& extensions , "extensions" , "x" , extensions , "File extensions to detect." )
198200 urlCmd .Flags ().StringSliceVarP (& headers , "header" , "H" , headers , "Extra header to send with requests (can be specified multiple times)." )
199201 urlCmd .Flags ().BoolVarP (& enableSpidering , "spider" , "s" , enableSpidering , "Spider links within page content" )
202+ urlCmd .Flags ().IntSliceVarP (& ignoredLengths , "hide-lengths" , "l" , ignoredLengths , "Hide results with these content lengths" )
200203
201204 rootCmd .AddCommand (urlCmd )
202205}
0 commit comments