我正在尝试使用 vuejs 和 typescript 在我的项目中实现加密。我在 .vue 文件中成功实现了它,但是当我尝试将加密写入打字稿类时,摩卡测试会运行它,但是当我尝试在浏览器中编译并打开它时,我在控制台中收到 JavaScript 错误:
app.js:128620 Uncaught ReferenceError: require is not defined
at Object.crypto (app.js:128620)
at __webpack_require__ (app.js:20)
at Object../resources/ts/Classes/Model/Crypter.ts (app.js:125233)
at __webpack_require__ (app.js:20)
at Object../resources/ts/Controller/AuthController.ts (app.js:125924)
at __webpack_require__ (app.js:20)
at Object../node_modules/babel-loader/lib/index.js?!./node_modules/babel-
loader/lib/index.js!./node_modules/vue-
loader/lib/index.js?!./resources/js/Components/Includes/Login.vue?
vue&type=script&lang=js& (app.js:3308)
at __webpack_require__ (app.js:20)
at Module../resources/js/Components/Includes/Login.vue?
vue&type=script&lang=js& (app.js:124322)
at __webpack_require__ (app.js:20)
Run Code Online (Sandbox Code Playgroud)
app.js 中标记的行是:
module.exports = require("crypto");
Run Code Online (Sandbox Code Playgroud)
我已经在打字稿文件中尝试了不同的导入“策略”,例如:
import * as crypto from "crypto";
import crypto from "crypto";
var crypto = require("crypto");
Run Code Online (Sandbox Code Playgroud)
并将其添加到 webpack.mix.js 中
"node": {
fs: "empty",
crypto: true,
http: …Run Code Online (Sandbox Code Playgroud) 我在私有VM上尝试了SQL注入并使用了sqlmap.不知怎的命令:
sqlmap -u http://link/index.html?page=blog&title=Blog&id=5 --random-agent
Run Code Online (Sandbox Code Playgroud)
给我:
[2] 16
[3] 17
-bash: --random-agent: command not found
[1] Done sqlmap -u http://link/index.html?page=blog
[3]+ Done title=Blog
Run Code Online (Sandbox Code Playgroud)
但是首先把--random-agent和-u第二个以某种方式工作但是然后sqlmap问我:
[20:29:29] [CRITICAL] heuristics detected that the target is protected by some kind of WAF/IPS/IDS
do you want sqlmap to try to detect backend WAF/IPS/IDS? [y/N] y
-bash: y: command not found
[1]+ Stopped sqlmap --random-agent -u http://link/index.html?page=blog
[2] Done title=Blog
Run Code Online (Sandbox Code Playgroud)
为什么我不能输入y,为什么我必须在-u前面添加选项
更新,升级和重新安装不起作用.