Commit 708a64ec authored by 金枪银矛小霸王's avatar 金枪银矛小霸王 Committed by Medicean

Add English word random variable (#211)

* Add English word random variable

1、新增随机英语单词变量
2、修改 boundary 的生成方法

* Update base.js

解决从数组里取到重复数据的可能

* Update form_data.js

还是改回来吧。突然觉得没什么必要

* Update base.js

更正算法

* Update base.js
parent 1dcd2eed
exports.randomWords = [
"abbreviation",
"abstract",
"abstraction",
"access",
"accumulator",
"activate",
"adapter",
"address",
"algebraic",
"algorithm",
"alias",
"allocate",
"alternative",
"amortized",
"anaphoric",
"annotation",
"anonymous",
"antecedent",
"append",
"application",
"applicative",
"argument",
"arithmetic",
"array",
"artificial",
"assemble",
"assembly",
"assignment",
"associated",
"association",
"atom",
"atomic",
"attribute",
"augmented",
"automatic",
"automatically",
"autometa",
"auxiliary",
"backquote",
"backtrace",
"backward",
"bandwidth",
"base",
"best",
"Bezier",
"bignum",
"binary",
"binding",
"bit",
"black",
"block",
"Blub",
"body",
"boilerplate",
"bookkeeping",
"boolean",
"border",
"bottom-up",
"bound",
"bounds",
"box",
"brace",
"bracket",
"branch",
"breadth-first",
"breakpoint",
"brevity",
"buffer",
"bug",
"building",
"built-in",
"byte",
"bytecode",
"cache",
"call",
"callback",
"CamelCase",
"candidate",
"capture",
"case",
"character",
"checksum",
"child",
"choke",
"chunk",
"circular",
"clarity",
"class",
"client",
"clipboard",
"clone",
"closed",
"closure",
"clutter",
"code",
"collection",
"column",
"column-major",
"comma",
"command-line",
"Common",
"compatible",
"compilation",
"compile",
"compiled",
"compiler",
"complex",
"complexity",
"compliment",
"component",
"composability",
"composition",
"compound",
"compression",
"computation",
"computer",
"concatenation",
"concept",
"concrete",
"concurrency",
"concurrent",
"conditional",
"configuration",
"connection",
"cons",
"consequent",
"consistent",
"constant",
"constraint",
"container",
"content-based",
"context",
"continuation",
"continuous",
"control",
"cooperative",
"copy",
"corollary",
"coroutine",
"corruption",
"crash",
"create",
"crystallize",
"curly",
"curried",
"currying",
"cursor",
"curvy",
"cycle",
"dangling",
"data",
"database",
"data-driven",
"datagram",
"dead",
"debug",
"debugger",
"debugging",
"declaration",
"declarative",
"declarativeness",
"declaring",
"deconstruction",
"deduction",
"default",
"Defense",
"defer",
"deficiency",
"define",
"definition",
"delegate",
"delegation",
"dellocate",
"demarshal",
"deprecated",
"depth-first",
"derived",
"design",
"designator",
"destructive",
"destructuring",
"device",
"dimensions",
"directive",
"directory",
"disk",
"dispatch",
"distributed",
"DLL",
"document",
"dotted",
"dotted-pair",
"duplicate",
"dynamic",
"effect",
"efficiency",
"efficient",
"elaborate",
"elucidating",
"embedded",
"emulate",
"encapsulation",
"enum",
"enumeration",
"enumrators",
"environment",
"equal",
"equality",
"equation",
"equivalence",
"error",
"error-checking",
"escape",
"escaped",
"evaluate",
"evaluation",
"event",
"exception",
"exit",
"expendable",
"explicit",
"exploratory",
"export",
"expression",
"expressive",
"extensibility",
"extent",
"external",
"extreme",
"factorial",
"family",
"feasible",
"feature",
"field",
"file",
"fill",
"fineo-grained",
"firmware",
"first-class",
"fixed-point",
"fixnum",
"flag",
"flash",
"flexibility",
"floating-point",
"flush",
"fold",
"font",
"force",
"form",
"formal",
"forward",
"fractal",
"fractions",
"framework",
"freeware",
"function",
"functional",
"functionality",
"game",
"garbage",
"generalized",
"generate",
"generator",
"generic",
"genrative",
"global",
"glue",
"goto",
"graphical",
"greatest",
"hack",
"hacker",
"handle",
"hard",
"hardware",
"hard-wire",
"hash",
"header",
"heap",
"helper",
"heuristic",
"higher-order",
"high-order",
"hyperlink",
"HyperText",
"identical",
"identifier",
"identity",
"ill",
"illusion",
"imperative",
"implement",
"implementation",
"implicit",
"import",
"incremental",
"indent",
"indentation",
"indented",
"indention",
"infer",
"infinite",
"infix",
"information",
"inheritance",
"initialization",
"initialize",
"inline",
"inner",
"input",
"instances",
"instantiate",
"instructive",
"instrument",
"integer",
"integrate",
"interactive",
"interacts",
"interface",
"intermediate",
"internal",
"internet",
"interpolation",
"interpret",
"interpreter",
"inter-process",
"interrupt",
"intersection",
"invariants",
"invoke",
"item",
"iterate",
"iteration",
"iterative",
"iterator",
"jagged",
"job",
"judicious",
"kernel",
"keyword",
"keywords",
"kludge",
"lambda",
"Language",
"larval",
"laser",
"latitude",
"layout",
"lazy",
"legacy",
"leverage",
"lexical",
"library",
"lifetime",
"linear",
"link",
"linker",
"list",
"literal",
"load",
"loader",
"local",
"locality",
"loop",
"lvalue",
"machine",
"macro",
"mailing",
"mainframes",
"maintain",
"manifest",
"manipulator",
"mapping",
"marshal",
"math",
"member",
"memorizing",
"memory",
"menu",
"message",
"message-passing",
"meta-",
"metacircular",
"meta-programming",
"method",
"micro",
"middleware",
"migration",
"minimal",
"mirror",
"mismatch",
"model",
"modem",
"modifier",
"modularity",
"module",
"monad",
"monkey",
"monomorphic",
"mouse",
"multiple",
"multi-task",
"mutable",
"mutex",
"namespace",
"native",
"natural",
"nested",
"network",
"newline",
"nondeclarative",
"nondestructive",
"non-deterministic",
"non-strict",
"number",
"object",
"object-oriented",
"on",
"online",
"open",
"operand",
"operating",
"operation",
"operator",
"optimization",
"option",
"optional",
"ordinary",
"orthogonality",
"overflow",
"overhead",
"overload",
"override",
"package",
"pair",
"palindrome",
"paradigm",
"parallel",
"param",
"parameter",
"paren-matching",
"parent",
"parentheses",
"parse",
"parser",
"partial",
"particular",
"pass",
"path",
"pattern",
"perform",
"performance",
"performance-critical",
"persistence",
"phrenology",
"physical",
"pipe",
"pixel",
"placeholder",
"planning",
"platform",
"pointer",
"poll",
"polymorphic",
"polymorphism",
"polynomial",
"pool",
"port",
"portable",
"portal",
"positional",
"postfix",
"precedence",
"preceding",
"predicate",
"preemptive",
"premature",
"preprocessor",
"prescribe",
"prime",
"primitive",
"principal",
"print",
"printed",
"printer",
"priority",
"procedure",
"procedurual",
"process",
"productivity",
"profile",
"profiler",
"programmer",
"programming",
"project",
"prompt",
"proper",
"property",
"protocol",
"prototype",
"pseudo",
"purely",
"pushdown",
"qualified",
"qualifier",
"quality",
"query",
"queue",
"quote",
"quoted",
"race",
"radian",
"raise",
"random",
"range",
"rank",
"rapid",
"rational",
"raw",
"read",
"read-evaluate-print",
"read-macro",
"record",
"recursion",
"recursive",
"Reduced",
"Redundant",
"refactor",
"refer",
"reference",
"referential",
"refine",
"reflection",
"register",
"registry",
"regular",
"remote",
"represent",
"request",
"resolution",
"resolve",
"rest",
"return",
"reuse",
"right",
"robust",
"robustness",
"routine",
"routing",
"row-major",
"run-length",
"runtime",
"run-time",
"rvalue",
"save",
"scaffold",
"scalar",
"scan",
"schedule",
"scheduler",
"scope",
"SCREAMING_SNAKE_CASE",
"screen",
"scripting",
"search",
"Secure",
"segment",
"semantics",
"semaphore",
"semicolon",
"sequence",
"sequential",
"serial",
"serialization",
"series",
"server",
"S-expression",
"shadowing",
"sharp",
"sharp-quote",
"shortest",
"SICP",
"side",
"signature",
"simple",
"simulate",
"Single",
"single-segment",
"sketch",
"slash",
"slot",
"smart",
"snake_case",
"snapshot",
"socket",
"software",
"solution",
"source",
"space",
"spaghetti",
"spam",
"spec",
"special",
"specialization",
"specialize",
"specialized",
"specification",
"splitter",
"sprite",
"square",
"squash",
"stack",
"stakeholder",
"standard",
"state",
"statement",
"static",
"status",
"store",
"stream",
"strict",
"string",
"strong",
"structural",
"structured",
"subroutine",
"subset",
"substitution",
"subtype",
"superclass",
"superfluous",
"supertype",
"support",
"suspend",
"swapping",
"symbol",
"symbolic",
"syntax",
"system",
"table",
"tag",
"tail-recursion",
"tail-recursive",
"TAOCP",
"target",
"taxable",
"taxonomy",
"template",
"temporary",
"testing",
"text",
"thread",
"three-valued",
"throw",
"throwaway",
"timestamp",
"token",
"top-down",
"top-level",
"trace",
"trailing",
"transaction",
"transition",
"transparent",
"traverse",
"tree",
"trigger",
"tuple",
"Turing",
"typable",
"type",
"typing",
"unary",
"underflow",
"unification",
"Uniform",
"union",
"universally",
"unqualfied",
"unwinding",
"uptime",
"user",
"utilities",
"validate",
"validator",
"value",
"vaporware",
"variable",
"variadic",
"variant",
"vector",
"venture",
"viable",
"video",
"view",
"virtual",
"volatile",
"vowel",
"warning",
"web",
"weight",
"well",
"wildcard",
"window",
"word",
"wrapper"
]
\ No newline at end of file
/**
* 中国蚁剑::核心模块::基础函数库
* 开写:2016/04/12
* 更新:-
* 更新:2019/09/02 (@Ch1ngg)
* 作者:蚁逅 <https://github.com/antoor>
*/
'use strict';
......@@ -9,6 +9,8 @@
const iconv = require('iconv-lite');
const NodeRSA = require('node-rsa');
const fs = require('fs');
const words = require('../../modules/words');
class Base {
......@@ -82,16 +84,29 @@ class Base {
return key;
}
getRandomVariable(array) {
var tmp = [];
while (tmp.length < 6) {
let v = array[Math.ceil(Math.random() * array.length - 1)];
tmp.indexOf(v) === -1 && tmp.push(v);
}
return tmp;
}
/**
* 返回参数列表
* @return {array} [arg1, arg2, arg3..]
*/
argv() {
// 生成一个随机的变量名
let random = () => `0x${ (Math.random() + Math.random())
.toString(16)
.substr(2)}`;
// 返回六个随机变量名数组
let random;
if(this.__opts__.otherConf["use-random-variable"] == 1){
//random = () => `${words.randomWords[parseInt(Math.random() * words.randomWords.length)]}`;//从word.js随机返回单词
return this.getRandomVariable(words.randomWords);
}else{
random = () => `${(Math.random() + Math.random()).toString(16).substr(2)}`; // 返回六个随机变量名数组
return [
random(),
random(),
......@@ -101,6 +116,7 @@ class Base {
random()
];
}
}
/**
* 字符串格式化处理
......@@ -279,9 +295,7 @@ class Base {
encoding = encoding != "unknown" ?
encoding :
this.__opts__['encode'];
let text = antSword
.Decodes
.decode(buff, encoding);
let text = antSword.Decodes.decode(buff, encoding);
return res({
'encoding': encoding || "",
'text': text,
......@@ -311,6 +325,7 @@ class Base {
chunkStepMin: (this.__opts__['otherConf'] || {})['chunk-step-byte-min'] || 2,
chunkStepMax: (this.__opts__['otherConf'] || {})['chunk-step-byte-max'] || 3,
useMultipart: (this.__opts__['otherConf'] || {})['use-multipart'] === 1,
useRandomVariable: (this.__opts__['otherConf'] || {})['use-random-variable'] === 1,
timeout: parseInt((this.__opts__['otherConf'] || {})['request-timeout']),
headers: (this.__opts__['httpConf'] || {})['headers'] || {},
body: (this.__opts__['httpConf'] || {})['body'] || {}
......@@ -362,6 +377,7 @@ class Base {
chunkStepMin: (this.__opts__['otherConf'] || {})['chunk-step-byte-min'] || 2,
chunkStepMax: (this.__opts__['otherConf'] || {})['chunk-step-byte-max'] || 3,
useMultipart: (this.__opts__['otherConf'] || {})['use-multipart'] === 1,
useRandomVariable: (this.__opts__['otherConf'] || {})['use-random-variable'] === 1,
timeout: parseInt((this.__opts__['otherConf'] || {})['request-timeout']),
headers: (this.__opts__['httpConf'] || {})['headers'] || {},
body: (this.__opts__['httpConf'] || {})['body'] || {}
......
......@@ -176,6 +176,7 @@ module.exports = {
otherConf: {
nohttps: 'Ignore HTTPS certificate',
usemultipart: 'Use Multipart send payload',
userandomvariable:'Use random English word variables',
chunk: {
title: 'Chunked Transfer (Experimentally)',
usechunk: 'Use Chunked send payload.',
......
......@@ -178,6 +178,7 @@ module.exports = {
otherConf: {
nohttps: '忽略HTTPS证书',
usemultipart: '使用 Multipart 发包',
userandomvariable: '使用随机英文单词变量',
chunk: {
title: '分块传输(实验性功能)',
usechunk: '开启分块传输发包',
......
......@@ -177,6 +177,7 @@ module.exports = {
otherConf: {
nohttps: '忽略HTTPS證書',
usemultipart: '使用 Multipart 發包',
userandomvariable: '使用隨機英文單詞變量',
chunk: {
title: '分塊傳輸(實驗性功能)',
usechunk: '開啟分塊傳輸發包',
......
......@@ -177,6 +177,7 @@ module.exports = {
otherConf: {
nohttps: '忽略HTTPS證書',
usemultipart: '使用 Multipart 發包',
userandomvariable:'使用隨機英文單詞變量',
chunk: {
title: '分塊傳輸(實驗性功能)',
usechunk: '開啟分塊傳輸發包',
......
......@@ -445,6 +445,7 @@ class Form {
const opt = Object.assign({}, {
'ignore-https': 0,
'use-multipart': 0,
'use-random-variable': 0,
'use-chunk': 0,
'chunk-step-byte-min': 2,
'chunk-step-byte-max': 3,
......@@ -470,7 +471,12 @@ class Form {
name: 'ignore-https',
label: LANG['list']['otherConf']['nohttps'],
checked: opt['ignore-https'] === 1
}, {
},{
type: "checkbox",
name: 'use-random-variable',
label: LANG['list']['otherConf']['userandomvariable'],
checked: opt['use-random-variable'] === 1
},{
type: "checkbox",
name: 'use-multipart',
label: LANG['list']['otherConf']['usemultipart'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment