Skip to content

Commit

Permalink
add shady link regex for check url with ips
Browse files Browse the repository at this point in the history
  • Loading branch information
sairuss7 committed Apr 22, 2024
1 parent f1095a1 commit 5597a42
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/probes/isLiteral.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { Hex } from "@nodesecure/sec-literal";
// CONSTANTS
const kNodeDeps = new Set(builtinModules);
const kShadyLinkRegExps = [
/^(https?:\/\/)(?!127\.)((?!0{2,3}\.)(?!0{1,3}\.0{1,3}\.)(?!25[6-9]\.)(?!25[6-9]\.25[6-9]\.)(?!25[6-9]\.25[6-9]\.25[6-9])((?:\d{1,2}|1\d{2}|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d{2}|2[0-4]\d|25[0-5]))(\/[^\s]*)?$/,
/^(https?:\/\/)((?!\[::1\])(?!.*:[a-fA-F\d]+:[a-fA-F\d]+:[a-fA-F\d]+:[a-fA-F\d]+:[a-fA-F\d]+:[a-fA-F\d]+:[a-fA-F\d]+)(?:(?:[a-fA-F\d]{1,4}:){7}[a-fA-F\d]{1,4}))(\/[^\s]*)?$/,
/(http[s]?:\/\/bit\.ly.*)$/,
/(http[s]?:\/\/.*\.(link|xyz|tk|ml|ga|cf|gq|pw|top|club|mw|bd|ke|am|sbs|date|quest|cd|bid|cd|ws|icu|cam|uno|email|stream))$/
];
Expand Down

0 comments on commit 5597a42

Please sign in to comment.