let banned_users_regex = null; functionbuild_banned_users_regex() { let regex_string = "" for (let username of banned_users) { regex_string += "^" + escapeRegExp(username) + "$" + "|" } regex_string = regex_string.substring(0, regex_string.length - 1) banned_users_regex = newRegExp(regex_string, "g") }
//鉴权中间件 functionrequireLogin(req, res, next) { let username = req.body.username let password = req.body.password if (!username || !password) { res.send("用户名或密码不能为空") return } if (typeof username !== "string" || typeof password !== "string") { res.send("用户名或密码不合法") return } // 基于正则技术的封禁用户匹配系统的设计与实现 let test1 = banned_users_regex.test(username) console.log(`使用正则${banned_users_regex}匹配${username}的结果为:${test1}`) if (test1) { console.log("第一个判断匹配到封禁用户:",username) res.send("用户'"+username + "'被封禁,无法鉴权!") return } // 基于in关键字的封禁用户匹配系统的设计与实现 let test2 = (username in banned_users) console.log(`使用in关键字匹配${username}的结果为:${test2}`) if (test2){ console.log("第二个判断匹配到封禁用户:",username) res.send("用户'"+username + "'被封禁,无法鉴权!") return } if (username in users && users[username] === password) { next() return } res.send("用户名或密码错误,鉴权失败!") }
functionregisterUser(username, password) { if (typeof username !== "string" || username.length > 20) { return"用户名不合法" } if (typeof password !== "string" || password.length > 20) { return"密码不合法" } if (username in users) { return"用户已存在" }
for(let existing_user in users){ let existing_user_password = users[existing_user] if (existing_user_password === password){ return`您的密码已经被用户'${existing_user}'使用了,请使用其它的密码` } }
WordPress Security Scanner by the WPScan Team Version 3.8.22 Sponsored by Automattic - https://automattic.com/ @_WPScan_,@ethicalhack3r,@erwan_lr,@firefart _______________________________________________________________
[+] URL: http://124.71.184.68:8012/ [124.71.184.68] [+] Started: Sat Dec 30 17:37:30 2023
[+] WordPress theme in use: twentytwentyfour | Location: http://124.71.184.68:8012/wp-content/themes/twentytwentyfour/ | Readme: http://124.71.184.68:8012/wp-content/themes/twentytwentyfour/readme.txt | Style URL: http://124.71.184.68:8012/wp-content/themes/twentytwentyfour/style.css | | Found By: Urls In Homepage (Passive Detection) | | The version could not be determined.
[+] Enumerating All Plugins (via Passive Methods) [+] Checking Plugin Versions (via Passive and Aggressive Methods)
[i] Plugin(s) Identified:
[+] all-in-one-video-gallery | Location: http://124.71.184.68:8012/wp-content/plugins/all-in-one-video-gallery/ | Last Updated: 2023-09-01T08:47:00.000Z | [!] The version is out of date, the latest version is 3.5.2 | | Found By: Urls In Homepage (Passive Detection) | | [!] 2 vulnerabilities identified: | | [!] Title: All-in-One Video Gallery 2.5.8 - 2.6.0 - Unauthenticated Arbitrary File Download & SSRF | Fixed in: 2.6.1 | References: | - https://wpscan.com/vulnerability/852c257c-929a-4e4e-b85e-064f8dadd994 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-2633 | | [!] Title: Freemius SDK < 2.5.10 - Reflected Cross-Site Scripting | Fixed in: 3.4.3 | References: | - https://wpscan.com/vulnerability/7fd1ad0e-9db9-47b7-9966-d3f5a8771571 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-33999 | | Version: 2.6.0 (80% confidence) | Found By: Readme - Stable Tag (Aggressive Detection) | - http://124.71.184.68:8012/wp-content/plugins/all-in-one-video-gallery/README.txt
[+] contact-form-7 | Location: http://124.71.184.68:8012/wp-content/plugins/contact-form-7/ | Last Updated: 2023-12-19T04:49:00.000Z | [!] The version is out of date, the latest version is 5.8.5 | | Found By: Urls In Homepage (Passive Detection) | | Version: 5.8.4 (90% confidence) | Found By: Query Parameter (Passive Detection) | - http://124.71.184.68:8012/wp-content/plugins/contact-form-7/includes/css/styles.css?ver=5.8.4 | Confirmed By: Readme - Stable Tag (Aggressive Detection) | - http://124.71.184.68:8012/wp-content/plugins/contact-form-7/readme.txt
[+] drag-and-drop-multiple-file-upload-contact-form-7 | Location: http://124.71.184.68:8012/wp-content/plugins/drag-and-drop-multiple-file-upload-contact-form-7/ | Last Updated: 2023-12-05T07:37:00.000Z | [!] The version is out of date, the latest version is 1.3.7.4 | | Found By: Urls In Homepage (Passive Detection) | | [!] 4 vulnerabilities identified: | | [!] Title: Drag and Drop Multiple File Upload - Contact Form 7 < 1.3.6.3 - Unauthenticated Stored XSS | Fixed in: 1.3.6.3 | References: | - https://wpscan.com/vulnerability/1b849957-eaca-47ea-8f84-23a3a98cc8de | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-0595 | - https://plugins.trac.wordpress.org/changeset/2686614 | | [!] Title: Drag and Drop Multiple File Upload < 1.3.6.5 - File Upload Size Limit Bypass | Fixed in: 1.3.6.5 | References: | - https://wpscan.com/vulnerability/035dffef-4b4b-4afb-9776-7f6c5e56452c | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-3282 | | [!] Title: Drag and Drop Multiple File Upload – Contact Form 7 < 1.3.6.6 - File Upload and File deletion via CSRF | Fixed in: 1.3.6.6 | References: | - https://wpscan.com/vulnerability/e6a76476-e086-473d-bc1e-3264c85b2441 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-45364 | | [!] Title: Drag and Drop Multiple File Upload - Contact Form 7 < 1.3.7.4 - Unauthenticated Arbitrary File Upload | Fixed in: 1.3.7.4 | References: | - https://wpscan.com/vulnerability/d758ce63-73fb-46a6-9cc7-c114db2e2512 | - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-5822 | - https://www.wordfence.com/threat-intel/vulnerabilities/id/1b3be300-5b7f-4844-8637-1bb8c939ed4c | | Version: 1.3.6.2 (80% confidence) | Found By: Readme - Stable Tag (Aggressive Detection) | - http://124.71.184.68:8012/wp-content/plugins/drag-and-drop-multiple-file-upload-contact-form-7/readme.txt