Bug - "Ops unable to add some targets” #443

Closed
viyatb opened this Issue May 1, 2015 · 3 comments

Comments

Projects
None yet
3 participants
@viyatb
Member

viyatb commented May 1, 2015

@7a :

NOTE:

Happens when you are trying to add a target twice within a (potentially) huge list of targets :)

When trying to add 20+ targets to an initial scope, I saw UI error like “Oops unable to add some targets :P”. This is VERY unhelpful because:

  • It does not tell me which are the ones that could not be added (on the UI)
  • It stops on the 1st error and does not add any other target, so I have to dig the original order in which the targets were added so that I have a list to copy-paste

Error on the CLI:
http://target.com already present in Target DB & session

@viyatb viyatb added the Bug label May 1, 2015

@viyatb

This comment has been minimized.

Show comment
Hide comment
@viyatb

viyatb May 14, 2015

Member

I think we can have a function such as

function unique(r)
{
    var n = {};
    for(var i = 0; i < r.length; i++)
    {
        if (!n[r[i]])
        {
            n[r[i]] = true;
            r.push(r[i]);
        }
    }
    return r;
}

which takes an array, here targetURLs (https://github.com/owtf/owtf/blob/develop/framework/interface/templates/target_manager.html#L315) and outputs a array with only unique elements (see @ line https://github.com/owtf/owtf/blob/develop/framework/interface/templates/target_manager.html#L330).

Also that this is a hash-map method --> one of the fastest option, so there is little overhead.

This resolves any error due to addition of duplicate targets IMO.

Member

viyatb commented May 14, 2015

I think we can have a function such as

function unique(r)
{
    var n = {};
    for(var i = 0; i < r.length; i++)
    {
        if (!n[r[i]])
        {
            n[r[i]] = true;
            r.push(r[i]);
        }
    }
    return r;
}

which takes an array, here targetURLs (https://github.com/owtf/owtf/blob/develop/framework/interface/templates/target_manager.html#L315) and outputs a array with only unique elements (see @ line https://github.com/owtf/owtf/blob/develop/framework/interface/templates/target_manager.html#L330).

Also that this is a hash-map method --> one of the fastest option, so there is little overhead.

This resolves any error due to addition of duplicate targets IMO.

tunnelshade added a commit that referenced this issue May 19, 2015

Fixed #443
+ Now multiple requests are fired for multiple targets
+ Position of export targets button is changed
@tunnelshade

This comment has been minimized.

Show comment
Hide comment
@tunnelshade

tunnelshade May 19, 2015

Member

Solved in a peculiar way

Member

tunnelshade commented May 19, 2015

Solved in a peculiar way

@7a

This comment has been minimized.

Show comment
Hide comment
@7a

7a May 19, 2015

Member

Ok from me :)
On 14 May 2015 11:04, "Viyat Bhalodia" notifications@github.com wrote:

I think we can have a function such as

function unique(r)
{
var n = {};
for(var i = 0; i < r.length; i++)
{
if (!n[r[i]])
{
n[r[i]] = true;
r.push(r[i]);
}
}
return r;
}

which takes an array, here targetURLs (
https://github.com/owtf/owtf/blob/develop/framework/interface/templates/target_manager.html#L315)
and outputs a array with only unique elements (see @ line
https://github.com/owtf/owtf/blob/develop/framework/interface/templates/target_manager.html#L330
).

This resolves any error due to addition of duplicate targets IMO.


Reply to this email directly or view it on GitHub
#443 (comment).

Member

7a commented May 19, 2015

Ok from me :)
On 14 May 2015 11:04, "Viyat Bhalodia" notifications@github.com wrote:

I think we can have a function such as

function unique(r)
{
var n = {};
for(var i = 0; i < r.length; i++)
{
if (!n[r[i]])
{
n[r[i]] = true;
r.push(r[i]);
}
}
return r;
}

which takes an array, here targetURLs (
https://github.com/owtf/owtf/blob/develop/framework/interface/templates/target_manager.html#L315)
and outputs a array with only unique elements (see @ line
https://github.com/owtf/owtf/blob/develop/framework/interface/templates/target_manager.html#L330
).

This resolves any error due to addition of duplicate targets IMO.


Reply to this email directly or view it on GitHub
#443 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment