Package org.parosproxy.paros.network

Examples of org.parosproxy.paros.network.HttpMessage


    private long sessionId = 0;
  private int historyType = HistoryReference.TYPE_MANUAL;
  private HttpMessage httpMessage = null;
 
  public RecordHistory() {
      httpMessage = new HttpMessage()
   
  }
View Full Code Here


  public RecordHistory(int historyId, int historyType, long sessionId, long timeSentMillis, int timeElapsedMillis, String reqHeader, String reqBody, String resHeader, String resBody, String tag) throws HttpMalformedHeaderException {
    setHistoryId(historyId);
    setHistoryType(historyType);
        setSessionId(sessionId);
    httpMessage = new HttpMessage(reqHeader, reqBody, resHeader, resBody);
    httpMessage.setTimeSentMillis(timeSentMillis);
    httpMessage.setTimeElapsedMillis(timeElapsedMillis);
        httpMessage.setTag(tag);
  }
View Full Code Here

          public void actionPerformed(java.awt.event.ActionEvent e) {
             
              ManualRequestEditorDialog dialog = extension.getManualRequestEditorDialog();
             
              HttpMessage msg = null;
              Object obj = null;
              obj = extension.getAlertPanel().getTreeAlert().getLastSelectedPathComponent();
              if (obj == null) {
                  return;
              }
View Full Code Here

    /* (non-Javadoc)
     * @see com.proofsecure.paros.core.scanner.Plugin#scan()
     */
    public void scan() {

        HttpMessage msg = getBaseMsg();
    boolean result = false;
   
    if (!msg.getRequestHeader().getSecure()) {
        // no need to if non-secure page;
        return;
    } else if (msg.getRequestHeader().isImage()) {
        // does not bother if image is cached
        return;
    } else if (msg.getResponseBody().length() == 0) {
        return;
    }
   
    if (!matchHeaderPattern(msg, HttpHeader.CACHE_CONTROL, patternNoCache)
            && !matchHeaderPattern(msg, HttpHeader.PRAGMA, patternNoCache)
View Full Code Here

    /* (non-Javadoc)
     * @see com.proofsecure.paros.core.scanner.Plugin#scan()
     */
    public void scan() {
        HttpMessage base = getBaseMsg();
       
        String uri = base.getRequestHeader().getURI().toString();
        Matcher matcher = null;
    String sessionIdValue = null;
    String sessionIdName = null;
    for (int i=0; i<staticSessionIDList.length; i++) {
      matcher = staticSessionIDList[i].matcher(uri);
View Full Code Here

     Test existence of obsolete file with the suffix.
     @param suffix suffix to run scan with.
     @param  replaceSuffix true = replace the suffix for checking.  false = append the suffix.
     */
    private void testSuffix(String suffix, boolean replaceSuffix) throws IOException {
        HttpMessage msg = getNewMsg();
        URI uri = msg.getRequestHeader().getURI();
        String   path   = uri.getPath();
       
        if (path == null || path.equals("")) {
            return;
        }
       
        if (replaceSuffix) {
            int pos = path.lastIndexOf(".");
            if (pos > -1) {
                path = path.substring(0, pos);
            }
        }
       
        path = path + suffix;
       
        uri.setPath(path);
        msg.getRequestHeader().setURI(uri);
       
        sendAndReceive(msg);
       
        if (!isFileExist(msg)) {
            return;
View Full Code Here

    /* (non-Javadoc)
     * @see com.proofsecure.paros.core.scanner.Plugin#scan()
     */
    public void scan() {
       
        HttpMessage msg = getBaseMsg();
    String txtBody = msg.getResponseBody().toString();
    String txtFound = null;
    Matcher matcher = patternPrivateIP.matcher(txtBody);
    while (matcher.find()) {
      txtFound = matcher.group();
      if (txtFound != null) {
View Full Code Here

    public void scan(HttpMessage msg, String param, String value) {

    String bingoQuery = null;
   
    // always try normal query first
    HttpMessage normalMsg = getNewMsg();

    try {
            sendAndReceive(normalMsg);
        } catch (Exception e) {
            return;
        }           

    if (normalMsg.getResponseHeader().getStatusCode() != HttpStatusCode.OK) {
      return;
    }   
   
    for (int i=0; i<PARAM_LIST.length; i++) {
      msg = getNewMsg();
      if (i==0) {
          // remove entire parameter when i=0;
        bingoQuery = setParameter(msg, null, null);         
      } else {
        bingoQuery = setParameter(msg, param, PARAM_LIST[i]);

      }
      try {
                sendAndReceive(msg);
          if (checkResult(msg, bingoQuery, normalMsg.getResponseBody().toString())) {
              return;
          }

            } catch (Exception e) {
            }   
View Full Code Here

 
  protected void processHttp(HttpRequestHeader requestHeader, boolean isSecure) throws IOException {

    HttpBody reqBody = null;
    boolean isFirstRequest = true;
    HttpMessage msg = null;
       
        if (isRecursive(requestHeader)) {
            throw new IOException("Recursive request to proxy itself stopped.");
        }
       
        // reduce socket timeout after first read
        inSocket.setSoTimeout(2500);

    do {

      if (isFirstRequest) {
        isFirstRequest = false;
      } else {
          try {
              requestHeader = httpIn.readRequestHeader(isSecure);

          } catch (SocketTimeoutException e) {
              return;
          }
      }

      msg = new HttpMessage();
      msg.setRequestHeader(requestHeader);
     
      if (msg.getRequestHeader().getContentLength() > 0) {
        reqBody    = httpIn.readBody(requestHeader);
        msg.setRequestBody(reqBody);
      }
           
      modifyHeader(msg);
           
            if (isProcessCache(msg)) {
                continue;
            }
         
//            System.out.println("send required: " + msg.getRequestHeader().getURI().toString());
           
      if (parentServer.isSerialize()) {
          semaphore = semaphoreSingleton;
      } else {
          semaphore = this;
      }
     
      synchronized (semaphore) {
         
          notifyListenerRequestSend(msg);
         
         
          try {

//          bug occur where response cannot be processed by various listener
//              first so streaming feature was disabled           
//          getHttpSender().sendAndReceive(msg, httpOut, buffer);

          getHttpSender().sendAndReceive(msg);
              notifyListenerResponseReceive(msg);
             
              // write out response header and body
              httpOut.write(msg.getResponseHeader());
                httpOut.flush();
             
              if (msg.getResponseBody().length() > 0) {
                  httpOut.write(msg.getResponseBody().getBytes());
                  httpOut.flush();
              }
             
//              notifyWrittenToForwardProxy();
             
View Full Code Here

            return false;
        }
       
        CacheProcessingItem item = (CacheProcessingItem) parentServer.getCacheProcessingList().get(0);
        if (msg.equals(item.message)) {
            HttpMessage newMsg = item.message.cloneAll();
            msg.setResponseHeader(newMsg.getResponseHeader());
            msg.setResponseBody(newMsg.getResponseBody());

            httpOut.write(msg.getResponseHeader());
            httpOut.flush();

            if (msg.getResponseBody().length() > 0) {
View Full Code Here

TOP

Related Classes of org.parosproxy.paros.network.HttpMessage

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.