-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
58 lines (51 loc) · 1.54 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env node
/**
* RedirectHunter
* RedirectHunter is a powerful open redirect vulnerability scanner that helps you quickly identify and mitigate potential security risks in your web applications.
*
* @author karthikeyan V (karthithehacker) <https://karthithehacker.com>
*/
//lib and includes section
const help = require('./utils/help');
const fileread = require('./utils/filereader');
const yargs = require('yargs/yargs')
const scan = require('./includes/redirecthunter')
const { hideBin } = require('yargs/helpers')
//variable and object declariation section
const argv = yargs(hideBin(process.argv)).argv
//variable and object declariation section
// used to check the argument parsed data is empty or not
if( argv.h == true ){
help.helpintro();
help.helpmenu();
return;
}
//used to check for valid input data and syntax
if(argv.l != null || argv.list != null){
if(argv.list == true || argv.l == true){
console.log("test")
help.helpintro();
return;
}
else{
help.helpintro();
new fileread.fileread(argv.l || argv.list ,argv.o || argv.output)
return
}
}
if(argv.u == null || argv.u == true ){
if(argv.url == null || argv.url == true){
help.helpintro();
return;
}
}
if(argv.l == null && argv.l == true ){
if(argv.list == null || argv.list == true){
help.helpintro();
return;
}
}
//program execution part and calling the constructor class
help.helpintro();
new scan.engineu(argv.u || argv.url,argv.o || argv.output)
//