wagiro/BurpBounty

switch (matchtype) 存在bug

a0xpg opened this issue · 5 comments

a0xpg commented

at GenericScan.java line: 241

matchtype = 5;
if (matches != null) break;

but matches == null, go to default

suggest:

                     try {
                            if (matches != null) {
                                issues.add(matches);
                            }
                           break;
                        } catch (Exception e) {
                            continue;              //maybe update to  break?
                        }

Hi!

This break its because I want that only one match by profile, then if there is a match, return the issue.

The code actually is like this in the line 241:

                   try {
                            if (matches != null) {
                                issues.add(matches);
                                break;
                            }
                        } catch (Exception e) {
                            continue;
                        }

Work fine the version that I passed to you?

Thanks!

a0xpg commented

可能是我没有描述清楚,我在测BlindSQLi-TimeBased时,无效的payload也返回了issue,因为matches 为空的时候,程序跳到了default,从而新增了issue,需要matches 为空时break

But if I put a break in Exception, the loop maybe ends before that the all greps are tested:

for (int x = 0; x <= grep_index; x++) {
    if (!greps_final.get(x).isEmpty()) {
        matches = gm.getResponseMatches(requestResponse, payload, greps_final.get(x), issuename, issuedetail, issuebackground, remediationdetail, remediationbackground, charstourlencode, matchtype,
                issueseverity, issueconfidence, notresponse, casesensitive, urlencode, excludeHTTP, onlyHTTP);

        try {
            if (matches != null) {
                issues.add(matches);
                break;
            }
        } catch (Exception e) {
            continue;
        }
    }
}

The extension returns always the issues List, if the List is empty, no issue is showed.

a0xpg commented

maybe

if (matches != null) {
issues.add(matches);
break; // delete
}
break;

如果你不认同那也没办法,测试下BlindSQLi-TimeBased插件就知道了

Hi @a0xpg !

I have seen what you wanted to tell me ... it is the fault of the switch clause, it continued with case 7 and 8 although the matchtype was 5 ... what was changed by if / else.

Could you check that it works well for you?

https://drive.google.com/file/d/1ut65EYzdHFo0MQZxQx7MgiPypKCdZVr-/view?usp=sharing

Thanks!