-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.php
48 lines (34 loc) · 1.03 KB
/
run.php
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
<?php
//load library
require_once('./include/simple_html_dom.php');
require_once('./include/url_to_absolute.php');
$url = "http://127.0.0.1/index.php";
$html = file_get_html($url);
$count = 0;
$found = 0;
while(true){
//load it twice the first time.. sloppy yeah.
$html = file_get_html($url);
foreach($html->find('img[src$=.jpg]') as $image){
$image = url_to_absolute($url, $image -> src);
//echo $image, "\n";
//save image.
copy($image, 'test.jpg');
$checksum = md5_file('test.jpg');
//checksum of d835884373f4d6c8f24742ceabe74946 means file is missing.
if($checksum != 'd835884373f4d6c8f24742ceabe74946'){
$count++;
$output = shell_exec('stegdetect test.jpg');
//check if stegdetect worked
$star_count = substr_count($output, '***');
$camo_count = substr_count($output, 'camouflage');
if(($star_count > 0) || ($camo_count > 0)){
$found++;
$actual_name = substr($image,19,27);
shell_exec('mv test.jpg data/hits/'.$actual_name);
}
}
}
echo 'FOUND: '.$found.'//'.$count;
}
?>