Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nessus web targets are not parsed into URLs #24

Open
sciguy16 opened this issue Sep 28, 2020 · 1 comment
Open

Nessus web targets are not parsed into URLs #24

sciguy16 opened this issue Sep 28, 2020 · 1 comment

Comments

@sciguy16
Copy link
Member

list.web_targets.push(Target::Address(target));

The web capture code expects to be given a Target::Url, but this currently parses into a Target::Address

@sciguy16
Copy link
Member Author

Hacky bodge fix for now:

diff --git a/Cargo.toml b/Cargo.toml
index 02714dc..3e59fc4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -27,7 +27,7 @@ failure = "0.1"
 askama = "0.9"
 socks = "0.3"
 vnc = "0.4"
-nessus_xml_parser = "0.1"
+nessus_xml_parser = { "git" = "https://github.com/sciguy16/nessus_xml_parser-rs", "branch" = "main" }
 ctrlc = "3.1"

 [package.metadata.deb]
diff --git a/src/parsing/mod.rs b/src/parsing/mod.rs
index ce8f00e..d7117d5 100644
--- a/src/parsing/mod.rs
+++ b/src/parsing/mod.rs
@@ -801,7 +801,23 @@ fn lists_from_nessus(
                 if mode.selected(Mode::Web) =>
             {
                 debug!("Identified Web");
-                list.web_targets.push(Target::Address(target));
+ let target_string = match target {
+                        SocketAddr::V6(target) => {
+                            trace!("address: {:?}", target);
+                            format!("[{}]:{}", target, port.id)
+                        }
+                        SocketAddr::V4(target) => {
+                            trace!("legacy address: {:?}", target);
+                            format!("{}", target)
+                        }
+                        /*Address::MacAddr(a) => {
+                            trace!("Ignoring MAC address {}", a);
+                            // Ignore the MAC address and move on
+                        }*/
+                    };
+               list.web_targets.push(Target::Url(Url::parse(&format!("http://{}", target_string)).unwrap()));
+               list.web_targets.push(Target::Url(Url::parse(&format!("https://{}", target_string)).unwrap()));
+                //list.web_targets.push(Target::Address(target));
             }
             (5900, _) | (5901, _) | (5902, _) | (5903, _) | (_, "vnc")
                 if mode.selected(Mode::Vnc) =>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant