Changeset 32df925


Ignore:
Timestamp:
Dec 10, 2015 1:09:33 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
393b5937
Parents:
9b2bbe0
Message:

More Sybil tool tweaks

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/SybilRenderer.java

    r9b2bbe0 r32df925  
    5454    // multiplied by size - 1
    5555    private static final double POINTS16 = 0.25;
     56    private static final double POINTS_US32 = 25.0;
     57    private static final double POINTS_US24 = 25.0;
     58    private static final double POINTS_US16 = 10.0;
    5659    private static final double POINTS_FAMILY = -2.0;
    5760    private static final double MIN_CLOSE = 242.0;
     
    177180        // IP analysis
    178181        renderIPGroupsFamily(out, buf, ris, points);
     182        renderIPGroupsUs(out, buf, ris, points);
    179183        renderIPGroups32(out, buf, ris, points);
    180184        renderIPGroups24(out, buf, ris, points);
     
    296300                renderRouterInfo(buf, p.r2, null, false, false);
    297301            }
     302            String b2 = p.r2.getHash().toBase64();
    298303            addPoints(points, p.r1.getHash(), point, "Very close (" + fmt.format(distance) +
    299                           ") to other floodfill " + p.r2.getHash().toBase64());
     304                          ") to other floodfill <a href=\"netdb?r=" + b2 + "\">" + b2 + "</a>");
     305            String b1 = p.r1.getHash().toBase64();
    300306            addPoints(points, p.r2.getHash(), point, "Very close (" + fmt.format(distance) +
    301                           ") to other floodfill " + p.r1.getHash().toBase64());
     307                          ") to other floodfill <a href=\"netdb?r=" + b1 + "\">" + b1 + "</a>");
    302308        }
    303309        out.write(buf.toString());
     
    352358    }
    353359
     360    private void renderIPGroupsUs(Writer out, StringBuilder buf, List<RouterInfo> ris, Map<Hash, Points> points) throws IOException {
     361        RouterInfo us = _context.router().getRouterInfo();
     362        byte[] ourIP = getIP(us);
     363        if (ourIP == null)
     364            return;
     365        buf.append("<h3>Floodfills close to Our IP</h3>");
     366        boolean found = false;
     367        for (RouterInfo info : ris) {
     368            byte[] ip = getIP(info);
     369            if (ip == null)
     370                continue;
     371            if (ip[0] == ourIP[0] && ip[1] == ourIP[1]) {
     372                buf.append("<p><b>");
     373                if (ip[2] == ourIP[2]) {
     374                    if (ip[3] == ourIP[3]) {
     375                        buf.append("Same IP as us");
     376                        addPoints(points, info.getHash(), POINTS_US32, "Same IP as us");
     377                    } else {
     378                        buf.append("Same /24 as us");
     379                        addPoints(points, info.getHash(), POINTS_US24, "Same /24 as us");
     380                    }
     381                } else {
     382                    buf.append("Same /16 as us");
     383                    addPoints(points, info.getHash(), POINTS_US16, "Same /16 as us");
     384                }
     385                buf.append(":</b></p>");
     386                renderRouterInfo(buf, info, null, false, false);
     387                found = true;
     388            }
     389        }
     390        if (!found)
     391            buf.append("<p>None</p>");
     392        out.write(buf.toString());
     393        out.flush();
     394        buf.setLength(0);
     395    }
     396
    354397    private void renderIPGroups32(Writer out, StringBuilder buf, List<RouterInfo> ris, Map<Hash, Points> points) throws IOException {
    355398        buf.append("<h3>Floodfills with the Same IP</h3>");
    356         int sz = ris.size();
    357399        ObjectCounter<Integer> oc = new ObjectCounter<Integer>();
    358400        for (RouterInfo info : ris) {
     
    409451    private void renderIPGroups24(Writer out, StringBuilder buf, List<RouterInfo> ris, Map<Hash, Points> points) throws IOException {
    410452        buf.append("<h3>Floodfills in the Same /24 (2 minimum)</h3>");
    411         int sz = ris.size();
    412453        ObjectCounter<Integer> oc = new ObjectCounter<Integer>();
    413454        for (RouterInfo info : ris) {
     
    460501    private void renderIPGroups16(Writer out, StringBuilder buf, List<RouterInfo> ris, Map<Hash, Points> points) throws IOException {
    461502        buf.append("<h3>Floodfills in the Same /16 (4 minimum)</h3>");
    462         int sz = ris.size();
    463503        ObjectCounter<Integer> oc = new ObjectCounter<Integer>();
    464504        for (RouterInfo info : ris) {
     
    509549    private void renderIPGroupsFamily(Writer out, StringBuilder buf, List<RouterInfo> ris, Map<Hash, Points> points) throws IOException {
    510550        buf.append("<h3>Floodfills in the Same Declared Family</h3>");
    511         int sz = ris.size();
    512551        ObjectCounter<String> oc = new ObjectCounter<String>();
    513552        for (RouterInfo info : ris) {
     
    649688        String fam = info.getOption("family");
    650689        if (fam != null)
    651             buf.append("<b>Family: </b>").append(DataHelper.stripHTML(fam)).append("<br>\n");
     690            buf.append("<b>Family: ").append(DataHelper.escapeHTML(fam)).append("</b><br>\n");
    652691        String kls = info.getOption("netdb.knownLeaseSets");
    653692        if (kls != null)
  • history.txt

    r9b2bbe0 r32df925  
     12015-12-10 zzz
     2 * Router:
     3   - Change addCapabilities() to getCapabilities()
     4   - Add netdb family sign/verify utility (ticket #1510)
     5 * RouterInfo:
     6   - Remove addCapability() and delCapability()
     7 * StatPublisher:
     8   - Remove Service interface, not required
     9   - Consolidate getCapabilities() and network ID here
     10   - Add family signatures
     11
    1122015-12-08 str4d
    213 * Core: Fill in basic datastructure length tests
     
    516   - Add more unit tests
    617   - Separate out integration tests
     18
     192015-12-08 zzz
     20 * Crypto: Consolidate certificate import methods
    721
    8222015-12-06 zzz
  • router/java/src/net/i2p/router/RouterVersion.java

    r9b2bbe0 r32df925  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 10;
     21    public final static long BUILD = 11;
    2222
    2323    /** for example "-test" */
Note: See TracChangeset for help on using the changeset viewer.