File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ use text_placeholder::Template;
9191static DEFAULT : & str = r#"tags = ["core_approved", "RustScan", "default"]
9292developer = [ "RustScan", "https://github.com/RustScan" ]
9393ports_separator = ","
94- call_format = "nmap -vvv -p {{port}} {{ip}}"
94+ call_format = "nmap -vvv -p {{port}} -{{ipversion}} {{ip}}"
9595"# ;
9696
9797#[ cfg( not( tarpaulin_include) ) ]
@@ -184,12 +184,14 @@ struct ExecPartsScript {
184184 script : String ,
185185 ip : String ,
186186 port : String ,
187+ ipversion : String
187188}
188189
189190#[ derive( Serialize ) ]
190191struct ExecParts {
191192 ip : String ,
192193 port : String ,
194+ ipversion : String
193195}
194196
195197impl Script {
@@ -244,17 +246,24 @@ impl Script {
244246 script : self . path . unwrap ( ) . to_str ( ) . unwrap ( ) . to_string ( ) ,
245247 ip : self . ip . to_string ( ) ,
246248 port : ports_str,
249+ ipversion : match & self . ip {
250+ IpAddr :: V4 ( _) => String :: from ( "4" ) ,
251+ IpAddr :: V6 ( _) => String :: from ( "6" )
252+ }
247253 } ;
248254 to_run = default_template. fill_with_struct ( & exec_parts_script) ?;
249255 } else {
250256 let exec_parts: ExecParts = ExecParts {
251257 ip : self . ip . to_string ( ) ,
252258 port : ports_str,
259+ ipversion : match & self . ip {
260+ IpAddr :: V4 ( _) => String :: from ( "4" ) ,
261+ IpAddr :: V6 ( _) => String :: from ( "6" )
262+ }
253263 } ;
254264 to_run = default_template. fill_with_struct ( & exec_parts) ?;
255265 }
256266 debug ! ( "\n Script format to run {}" , to_run) ;
257-
258267 execute_script ( & to_run)
259268 }
260269}
You can’t perform that action at this time.
0 commit comments