Package org.owasp.webscarab.model

Examples of org.owasp.webscarab.model.HttpUrl


        _columnListener = new ColumnDataListener<HttpUrl>() {
            public void dataChanged(ColumnDataEvent<HttpUrl> cde) {
                Object column = cde.getSource();
                int col = _columns.indexOf(column);
                if (col < 0) return;
                HttpUrl key = cde.getKey();
                if (key == null) {
                    fireStructureChanged();
                } else {
                    firePathChanged(urlTreePath(key));
                }
View Full Code Here


    /**
     * Returns the value of the particular column.
     */
    public Object getValueAt(Object node, int column) {
        if (! (node instanceof HttpUrl)) return null;
        HttpUrl url = (HttpUrl) node;
        if (column == 0) return url;
        return _columns.get(column-1).getValue(url);
    }
View Full Code Here

        }
        if (request == null) {
            _logger.severe("Asked to fetch a null request");
            return null;
        }
        HttpUrl url = request.getURL();
        if (url == null) {
            _logger.severe("Asked to fetch a request with a null URL");
            return null;
        }

        // if the previous auth method was not "Basic", force a new connection
        if (_authCreds != null && !_authCreds.startsWith("Basic"))
            _lastRequestTime = 0;
        if (_proxyAuthCreds != null && !_proxyAuthCreds.startsWith("Basic"))
            _lastRequestTime = 0;

        // Get any provided credentials from the request
        _authCreds = request.getHeader("Authorization");
        _proxyAuthCreds = request.getHeader("Proxy-Authorization");
        String keyFingerprint = request.getHeader("X-SSLClientCertificate");
        request.deleteHeader("X-SSLClientCertificate");
        if (keyFingerprint == null && _keyFingerprint == null) {
            // no problem
        } else if (keyFingerprint != null && _keyFingerprint != null && keyFingerprint.equals(_keyFingerprint)) {
            // no problem
        } else {
            // force a new connection, and change the fingerprint
            _keyFingerprint = keyFingerprint;
            _lastRequestTime = 0;
        }

        String status;

        String oldProxyAuthHeader = null;
        if (_proxyAuthCreds == null && _authenticator!= null && useProxy(url))
            _proxyAuthCreds = _authenticator.getProxyCredentials(url.toString().startsWith("https") ? _httpsProxy : _httpProxy, null);
        String proxyAuthHeader = constructAuthenticationHeader(null, _proxyAuthCreds);

        String oldAuthHeader = null;
        if (_authCreds == null && _authenticator!= null)
            _authCreds = _authenticator.getCredentials(url, null);
View Full Code Here

   
    private void startButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startButtonActionPerformed
        try {
            String address = addressTextField.getText();
            int port = Integer.parseInt(portTextField.getText().trim());
            HttpUrl base = null;
            if (!baseTextField.getText().equals("")) {
                base = new HttpUrl(baseTextField.getText());
            }
            boolean primary = primaryCheckBox.isSelected();
            ListenerSpec spec = new ListenerSpec(address, port, base, primary);
            spec.verifyAvailable();
            _proxy.addListener(spec);
View Full Code Here

        return samlMessage;
    }

    public ConversationID findCorrespondingHTMLFormConversation(ConversationID samlId) {
        ConversationModel conversationModel = this.model.getConversationModel();
        HttpUrl samlHttpUrl = conversationModel.getRequestUrl(samlId);
        int samlConversationIndex = conversationModel.getIndexOfConversation(samlId);
        for (int conversationIndex = samlConversationIndex - 1; conversationIndex >= 0; conversationIndex--) {
            ConversationID id = conversationModel.getConversationAt(conversationIndex);
            Response response = conversationModel.getResponse(id);
            HttpUrl httpUrl = conversationModel.getRequestUrl(id);
            Object parsedContent = Parser.parse(httpUrl, response);
            if (null == parsedContent) {
                continue;
            }
            if (false == parsedContent instanceof org.htmlparser.util.NodeList) {
                continue;
            }
            org.htmlparser.util.NodeList htmlNodeList = (org.htmlparser.util.NodeList) parsedContent;
            org.htmlparser.util.NodeList forms = htmlNodeList.searchFor(FormTag.class);
            try {
                for (NodeIterator ni = forms.elements(); ni.hasMoreNodes();) {
                    FormTag form = (FormTag) ni.nextNode();
                    String formAction = form.getAttribute("action");
                    HttpUrl formActionHttpUrl = new HttpUrl(formAction);
                    if (samlHttpUrl.equals(formActionHttpUrl)) {
                        return id;
                    }
                }
            } catch (ParserException ex) {
View Full Code Here

        return content;
    }

    public boolean isOverSSL(ConversationID id) {
        ConversationModel conversationModel = this.model.getConversationModel();
        HttpUrl httpUrl = conversationModel.getRequestUrl(id);
        String scheme = httpUrl.getScheme();
        if ("https".equals(scheme)) {
            return true;
        }
        return false;
    }
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

    public int getTotalRequests() {
        return _totalRequests;
    }
   
    public void addSignature(Signature signature) {
        HttpUrl url = signature.getUrl();
        _model.addUrlProperty(url, "SIGNATURE", signature.toString());
    }
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.