Skip to content

Commit 9dddc16

Browse files
committed
Final Update
1 parent 2a5f672 commit 9dddc16

34 files changed

+1002
-106
lines changed

app/Http/Controllers/HomeController.php

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,16 @@ public function index()
3939
}
4040
public function script(Request $request)
4141
{
42+
$xss=0;
43+
$inj=0;
44+
$head=0;
45+
$crs=null;
46+
$sql=null;
4247
$url = $request->get('url');
4348
$save = $request->get('log');
44-
$process = new Process('cd ViPER && python3 viper.py -u '.$url);
49+
$cross = $request->get('xss');
50+
$sqli = $request->get('inj');
51+
$process = new Process('cd ViPER && python3 ViPER.py -u '.$url.' -a');
4552
$process->setTimeout(3600);
4653
$process->run(function ($type, $buffer){
4754
});
@@ -51,15 +58,41 @@ public function script(Request $request)
5158
$user = Auth::user();
5259
$user->scans +=1;
5360
$user->save();
61+
if(strpos ($echo,'200')!=false ){
62+
$head=substr_count($echo, "200");
63+
$head = ($head/6)*100;
64+
}
65+
$xss=substr_count($echo, "Vulnerable to Clickjacking");
66+
$xss = ($xss/1)*100;
67+
$inj=substr_count($echo, "SQL Injection!");
68+
$inj-=4;
69+
$inj = ($inj/4)*100;
5470
if($save){
5571
$log = new Log();
5672
$log->url = $source;
5773
$log->user_id=$user->id;
5874
$log->output=$process->getOutput();
5975
$log->save();
6076
}
77+
if($cross){
78+
$process = new Process('cd ViPER && python3 ViPER.py -u '.$url.' -A3');
79+
$process->setTimeout(3600);
80+
$process->run(function ($type, $buffer){
81+
});
82+
$crs = $process->getOutput();
83+
84+
}
85+
if($sqli){
86+
$process = new Process('cd ViPER && python3 ViPER.py -u '.$url.' -A1');
87+
$process->setTimeout(3600);
88+
$process->run(function ($type, $buffer){
89+
});
90+
$sql = $process->getOutput();
91+
92+
}
6193

62-
return view('results')->withEcho($echo)->withSource($source);
94+
$overall=(($head+$inj+$xss)/300)*100;
95+
return view('results')->withEcho($echo)->withSource($source)->withXss($xss)->withInj($inj)->withHead($head)->withCrs($crs)->withSql($sql)->withOverall($overall);
6396

6497
}
6598
public function delete($id){

public/ViPER/modules/Cookie.py

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#import base64
1+
import base64
22
import requests
3-
#from urllib.parse import urlparse
3+
from termcolor.termcolor import colored, cprint
44

55

66
class Cookie():
@@ -10,21 +10,37 @@ class Cookie():
1010
def __init__(self):
1111
pass
1212

13+
def execute_all_func(self, target):
14+
try:
15+
self.get_cookie(target)
16+
except:
17+
cprint("Errror Getting Cookies", "red")
18+
try:
19+
self.decode_cookie(target)
20+
except:
21+
cprint("Error Decoding Cookies (base64)", "red")
22+
1323
def get_cookie(self, target):
24+
cprint("[*]Getting Cookie", "yellow")
1425
req = requests.get(target)
1526
c = req.cookies
1627
i = c.items()
17-
for name, value in i:
18-
print(name, value)
28+
if i:
29+
for name, value in i:
30+
print(name, value)
31+
else:
32+
cprint("No cookies found", "red")
1933

20-
""" def decode_cookie(self, target):
34+
def decode_cookie(self, target):
35+
cprint("")
36+
cprint("[*]Decoding Cookie", "yellow")
2137
req = requests.get(target)
2238
c = req.cookies
2339
i = c.items()
2440
for name, value in i:
25-
rep = ""
26-
b64 = ""
27-
rep = value.replace("%3D", "=")
28-
b64 = base64.b64decode(rep)
29-
print(b64)
30-
"""
41+
b64 = value.replace("%3D", "=")
42+
try:
43+
b64 = base64.b64decode(b64).decode('ascii')
44+
except:
45+
print("")
46+
print(name, b64)

public/ViPER/modules/Cookie.pyc

40 Bytes
Binary file not shown.

public/ViPER/modules/__init__.pyc

25 Bytes
Binary file not shown.
943 Bytes
Binary file not shown.
-3 Bytes
Binary file not shown.
115 Bytes
Binary file not shown.
93 Bytes
Binary file not shown.
589 Bytes
Binary file not shown.
1.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)