Package org.owasp.webscarab.model

Examples of org.owasp.webscarab.model.HttpUrl


        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

        _framework = framework;
        _model = new XSSCRLFModel(framework.getModel());       
    }
   
    public void analyse(ConversationID id, Request request, Response response, String origin) {  
        HttpUrl url = request.getURL();
       
        if (_framework.getModel().getConversationOrigin(id).equals(getPluginName())) return;
       
        // is this something we should check?
        String contentType = response.getHeader("Content-Type");
View Full Code Here

            }
            if (i < params.length-1) buf.append("&");
        }
       
        try {
            return new HttpUrl(url.getSHPP() + buf.toString());
        } catch (MalformedURLException e) {
            _logger.info("Exception: "+e);
            return null;
        }
    }
View Full Code Here

     * @param url the url
     * @throws MalformedURLException if the url is malformed
     * @return the number of child URLs
     */   
    public int getChildCount(String url) throws MalformedURLException {
        HttpUrl myUrl = null;
        if (url != null) myUrl = new HttpUrl(url);
        return _model.getUrlModel().getChildCount(myUrl);
    }
View Full Code Here

     * @param index the index of the desired child
     * @throws MalformedURLException if the url is malformed
     * @return the url of the indicated child
     */   
    public HttpUrl getChildAt(String url, int index) throws MalformedURLException {
        HttpUrl myUrl = null;
        if (url != null) myUrl = new HttpUrl(url);
        return _model.getUrlModel().getChildAt(myUrl, index);
    }
View Full Code Here

     * @param property
     * @throws MalformedURLException
     * @return
     */   
    public String getUrlProperty(String url, String property) throws MalformedURLException {
        HttpUrl myUrl = null;
        if (url != null) myUrl = new HttpUrl(url);
        return _model.getUrlProperty(myUrl, property);
    }
View Full Code Here

        Request request = response.getRequest();
        if (request == null) {
            System.out.println("Request was null?");
            return ids;
        }
        HttpUrl url = request.getURL();
        Date date = new Date();
        NamedValue[] headers = response.getHeaders();
        if (name != null && !name.equals("") && regex != null) {
            String location = response.getHeader("Location");
            if (location != null) {
View Full Code Here

    public boolean isRunning() {
        return _model.isRunning();
    }
   
    public void analyse(ConversationID id, Request request, Response response, String origin) {
        HttpUrl url = request.getURL();
        String cookie = request.getHeader("Cookie");
        if (cookie != null) _model.addRequestCookie(id, cookie);
        String[] setCookie = response.getHeaders("Set-Cookie");
        if (setCookie != null) {
            for (int i=0; i<setCookie.length; i++) {
View Full Code Here

            }
        }
        if (path != null) url = url + "/" + path;
        if (fragment != null) url = url + ";" + fragment;
        if (query != null) url = url + "?" + query;
        request.setURL(new HttpUrl(url));
        if (cookie != null) request.addHeader("Cookie", cookie);
        if (content != null) {
            request.setHeader("Content-Length", Integer.toString(content.size()));
            request.setContent(content.toByteArray());
        } else if (request.getMethod().equals("POST")) {
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.