Package org.owasp.webscarab.model

Examples of org.owasp.webscarab.model.HttpUrl


    }

    private NamedValue[] getParameters(Request request) {
        String method = request.getMethod();
        if ("GET".equals(method)) {
            HttpUrl httpUrl = request.getURL();
            String query = httpUrl.getQuery();
            if (null == query) {
                return null;
            }
            NamedValue[] values = NamedValue.splitNamedValues(query, "&", "=");
            return values;
View Full Code Here


    }
   
    public Signature(String signature) throws MalformedURLException {
        String[] parts = signature.split(" ");
        _method = parts[0];
        _url = new HttpUrl(parts[1]);
        _contentType = parts[2].substring(1, parts[2].length()-1);
        if (_contentType.equals("null"))
            _contentType = null;
        List<Parameter> parameters = new ArrayList<Parameter>();
        for (int i=3; i<parts.length; i++) {
View Full Code Here

    private void updateParameters(NamedValue[] values, List additionalParameters, Request request) {
        String method = request.getMethod();
        if ("GET".equals(method)) {
            try {
                HttpUrl httpUrl = request.getURL();
                setNewUrl(httpUrl, values, additionalParameters, request);
            } catch (MalformedURLException ex) {
                Logger.getLogger(OpenIdHTTPClient.class.getName()).log(Level.SEVERE, null, ex);
            }
        } else {
View Full Code Here

                stringBuffer.append(namedValue.getName());
                stringBuffer.append("=");
                stringBuffer.append(namedValue.getValue());
            }
        }
        request.setURL(new HttpUrl(httpUrl.getSHPP() + stringBuffer.toString()));
    }
View Full Code Here

   
    @Override
    public void analyse(ConversationID id, Request request, Response response, String origin) {
        String method = request.getMethod();
        if ("GET".equals(method)) {
            HttpUrl url = request.getURL();
            String query = url.getQuery();
            if (null != query) {
                NamedValue[] values = NamedValue.splitNamedValues(query, "&", "=");
                for (int i = 0; i < values.length; i++) {
                    String name = values[i].getName();
                    String value = Encoding.urlDecode(values[i].getValue());
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

                    _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<String> baseline = tokenize(baseBytes);
                    _diff = new LevenshteinDistance<String>(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

        List parameters = new LinkedList();
        Request request = this.model.getRequest(id);
        NamedValue[] values = null;
        String method = request.getMethod();
        if ("GET".equals(method)) {
            HttpUrl url = request.getURL();
            String query = url.getQuery();
            if (null != query) {
                values = NamedValue.splitNamedValues(query, "&", "=");
            }
        } else if ("POST".equals(method)) {
            byte[] requestContent = request.getContent();
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.