mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-13 21:21:03 +00:00
Update lib/http.js, lib/system.js
This commit is contained in:
parent
6ac790ec1d
commit
dbec582041
41
lib/http.js
41
lib/http.js
|
@ -1,7 +1,7 @@
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
// HTTP API
|
// HTTP API
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
var SYS = require("lib/sys");
|
var SYS = require("lib/system");
|
||||||
var FILE = require("lib/file");
|
var FILE = require("lib/file");
|
||||||
var SHELL = require("lib/shell");
|
var SHELL = require("lib/shell");
|
||||||
var RAND = require("lib/rand");
|
var RAND = require("lib/rand");
|
||||||
|
@ -60,6 +60,8 @@ var HTTPObject = function(engine) {
|
||||||
this.isLoggingCookie = false;
|
this.isLoggingCookie = false;
|
||||||
this.debuggingText = '';
|
this.debuggingText = '';
|
||||||
|
|
||||||
|
this.curlOptions = [];
|
||||||
|
|
||||||
this.create = function() {
|
this.create = function() {
|
||||||
if (this.engine == "MSXML") {
|
if (this.engine == "MSXML") {
|
||||||
this.interface = CreateObject([
|
this.interface = CreateObject([
|
||||||
|
@ -475,6 +477,11 @@ var HTTPObject = function(engine) {
|
||||||
cmd.push("-o");
|
cmd.push("-o");
|
||||||
cmd.push(this.saveTo);
|
cmd.push(this.saveTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if the count of this.curlOptions greater than 0
|
||||||
|
if (this.curlOptions.length > 0) {
|
||||||
|
cmd = cmd.concat(this.curlOptions);
|
||||||
|
}
|
||||||
|
|
||||||
// set the URL
|
// set the URL
|
||||||
cmd.push(state.url);
|
cmd.push(state.url);
|
||||||
|
@ -745,6 +752,18 @@ var HTTPObject = function(engine) {
|
||||||
|
|
||||||
switch(_debugger) {
|
switch(_debugger) {
|
||||||
case "FIDDLER":
|
case "FIDDLER":
|
||||||
|
this.proxy = {
|
||||||
|
"enabled": true,
|
||||||
|
"protocol": "http",
|
||||||
|
"host": "127.0.0.1",
|
||||||
|
"port": 8888,
|
||||||
|
"credential": null
|
||||||
|
};
|
||||||
|
this.curlOptions.push("-k");
|
||||||
|
this.curlOptions.push("--ssl-no-revoke");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "FIDDLER2":
|
||||||
this.proxy = {
|
this.proxy = {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"protocol": "http",
|
"protocol": "http",
|
||||||
|
@ -752,8 +771,10 @@ var HTTPObject = function(engine) {
|
||||||
"port": 8866,
|
"port": 8866,
|
||||||
"credential": null
|
"credential": null
|
||||||
};
|
};
|
||||||
|
this.curlOptions.push("-k");
|
||||||
|
this.curlOptions.push("--ssl-no-revoke");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "MITMPROXY":
|
case "MITMPROXY":
|
||||||
this.proxy = {
|
this.proxy = {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
|
@ -763,6 +784,18 @@ var HTTPObject = function(engine) {
|
||||||
"credential": null
|
"credential": null
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "BURPSUITE":
|
||||||
|
this.proxy = {
|
||||||
|
"enabled": true,
|
||||||
|
"protocol": "http",
|
||||||
|
"host": "127.0.0.1",
|
||||||
|
"port": 8080,
|
||||||
|
"credential": null
|
||||||
|
};
|
||||||
|
this.curlOptions.push("-k");
|
||||||
|
this.curlOptions.push("--ssl-no-revoke");
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
this.proxy = {
|
this.proxy = {
|
||||||
|
@ -793,6 +826,6 @@ exports.get = function(url, data, headers) {
|
||||||
return (new HTTPObject()).setHeaders(headers).setParameters(data).setUseCache(false).get(url).responseBody;
|
return (new HTTPObject()).setHeaders(headers).setParameters(data).setUseCache(false).get(url).responseBody;
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.VERSIONINFO = "HTTP Lib (http.js) version 0.7.1";
|
exports.VERSIONINFO = "HTTP Lib (http.js) version 0.7.2";
|
||||||
exports.global = global;
|
exports.global = global;
|
||||||
exports.require = global.require;
|
exports.require = global.require;
|
|
@ -50,7 +50,7 @@ exports.isElevated = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.getOS = function() {
|
exports.getOS = function() {
|
||||||
return WMI.execQuery("SELECT * FROM Win32_OperatingSystem").fetch().get("Caption").rtrim();
|
return WMI.execQuery("SELECT * FROM Win32_OperatingSystem").fetch().get("Caption").trim();
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.getDCName = function() {
|
exports.getDCName = function() {
|
||||||
|
@ -71,7 +71,7 @@ exports.getUUID = function() {
|
||||||
|
|
||||||
exports.getCurrentWorkingDirectory = function() {
|
exports.getCurrentWorkingDirectory = function() {
|
||||||
try {
|
try {
|
||||||
cwd = SHELL.exec("cd", "cwd.txt").rtrim();
|
cwd = SHELL.exec("cd", "cwd.txt").trim();
|
||||||
return cwd;
|
return cwd;
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user