Package org.owasp.webscarab.model

Examples of org.owasp.webscarab.model.HttpUrl


   
    public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
        Component comp = super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
        if (value instanceof HttpUrl && comp instanceof JLabel) {
            JLabel label = (JLabel) comp;
            HttpUrl url = (HttpUrl) value;
            if (url.getParameters() != null) {
                label.setText(url.getParameters());
            } else if (url.getPath().length()>1) {
                String path = url.getPath();
                int pos = path.lastIndexOf("/", path.length()-2);
                label.setText(path.substring(pos+1));
            }
        }
        return comp;
View Full Code Here


        _model.setRunning(false);
        return ! _model.isRunning();
    }
   
    public void analyse(ConversationID id, Request request, Response response, String origin) {
        HttpUrl url = request.getURL();
        Object parsed = Parser.parse(url, response);
        if (parsed != null && parsed instanceof NodeList) {
            NodeList nodes = (NodeList) parsed;
            try {
                NodeList comments = nodes.searchFor(RemarkNode.class);
View Full Code Here

            new ColumnDataModel() {
                public String getColumnName() {
                    return "Possible Injection";
                }
                public Object getValue(Object key) {
                    HttpUrl url = (HttpUrl) key;
                    return _model.isSuspected(url) ? Boolean.TRUE :  Boolean.FALSE;
                }
                public Class getColumnClass() {
                    return Boolean.class;
                }
            },
            new ColumnDataModel() {
                public String getColumnName() {
                    return "Injection";
                }
                public Object getValue(Object key) {
                    HttpUrl url = (HttpUrl) key;
                    return _model.isXSSVulnerable(url) || _model.isCRLFVulnerable(url)? Boolean.TRUE :  Boolean.FALSE;
                }
                public Class getColumnClass() {
                    return Boolean.class;
                }
View Full Code Here

    }

    public void run() {
        _model.setRunning(true);
        Request newReq;
        HttpUrl origUrl;

        _model.setStatus("Started");
        _model.setStopping(false);

        // start the fetchers
        _fetcherQueue = new FetcherQueue(getPluginName(), this, _threads, _delay);

        //try {
            _model.setRunning(true);
            while (!_model.isStopping()) {
                origUrl = _model.dequeueURL();               
                if (origUrl == null) {                   
                    continue;
                }
                String[] exts;
                if (origUrl.getPath().endsWith("/")) {
                    exts = _model.getDirectoryExtensions();
                    if (origUrl.getPath().length() < 2) {
                        continue;
                    }
                } else {
                    exts = _model.getFileExtensions();                   
                }
View Full Code Here

        if (links.size() == max) return;
       
        UrlModel urlModel = _model.getUrlModel();       
        int count = urlModel.getChildCount(url);
        for (int i=0; i<count; i++) {
            HttpUrl child = urlModel.getChildAt(url, i);
            queueLinksUnder(child, links, max);
            if (links.size() == max) return;
        }
    }
View Full Code Here

            req.setVersion("HTTP/1.0");
            if (url.getPath().endsWith("/")) {
                path = url.getPath();
                path = path.substring(0, path.length() - 1);
            }
            req.setURL(new HttpUrl(url.getScheme() + "://" + url.getHost() + ":" + url.getPort() + path + ext));               
            req.setHeader("Host", url.getHost() + ":" + url.getPort());
            req.setHeader("Connection", "Close");
        }
        catch (java.net.MalformedURLException e) {
            return null;
View Full Code Here

            if (_spider.isBusy()) {
                _logger.warning("Spider is still busy, please wait");
                JOptionPane.showMessageDialog(SpiderPanel.this, "Spider is still busy, please wait");
                return;
            }
            HttpUrl url = (HttpUrl) selection[0].getLastPathComponent();
            _spider.requestLinksUnder(url);
        } else {
            _logger.info("Cannot fetch a tree if there are 0 or many paths selected!");
            JOptionPane.showMessageDialog(SpiderPanel.this, "Cannot fetch a tree if there are 0 or many paths selected!");
        }
View Full Code Here

        }
       
        public void actionPerformed(java.awt.event.ActionEvent e) {
            Object o = getValue("URL");
            if (o == null || !(o instanceof HttpUrl)) return;
            HttpUrl url = (HttpUrl) o;
            if (! _spider.isBusy()) {
                _spider.requestLinksUnder(url);
            } else {
                _logger.warning("Spider is still busy, please wait");
                JOptionPane.showMessageDialog(SpiderPanel.this, "Spider is still busy, please wait");
View Full Code Here

                    _lock.wait();
                }
                if (id != _selected) {
                    id = _selected;
                    _model.setBusy(true);
                    HttpUrl baseUrl = cmodel.getRequestUrl(id);
                    if (baseUrl.getQuery() != null)
                      baseUrl = baseUrl.getParentUrl();
                    Response baseResponse = cmodel.getResponse(id);
                    byte[] baseBytes = baseResponse.getContent();
                    String type = baseResponse.getHeader("Content-Type");
                    if (type == null || !type.startsWith("text")) {
                        _logger.warning("Base response is not text, skipping!");
                        return;
                    }
                    List baseline = tokenize(baseBytes);
                    _diff = new LevenshteinDistance(baseline);
                   
                    count = cmodel.getConversationCount();
                    _logger.info("Checking " + count + " conversaitons");
                    for (int i=0; i<count; i++) {
                        ConversationID cid = cmodel.getConversationAt(i);
                        HttpUrl curl = cmodel.getRequestUrl(cid);
                        if (curl.getQuery() != null)
                          curl = curl.getParentUrl();
                        if (!curl.equals(baseUrl))
                          continue;
                        _logger.info("Checking conversation " + i + " == " + cid);
                        if (cid.equals(id)) {
                            _model.setDistance(cid, 0);
                        } else {
View Full Code Here

    public Response getResponse(ConversationID id) {
        return _model.getResponse(id);
    }

    private boolean isTested(Request req, String vulnParam) {
        HttpUrl url = req.getURL();
        return testedURLandParameterpairs.contains(url.getSHPP()+vulnParam);
    }
View Full Code Here

TOP

Related Classes of org.owasp.webscarab.model.HttpUrl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.