-
Notifications
You must be signed in to change notification settings - Fork 0
/
raw.php
37 lines (29 loc) · 1.01 KB
/
raw.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
<?php
$path_to_bb = '/var/www/bad-behavior';
require_once("$path_to_bb/bad-behavior-generic.php");
session_start();
// Includes the settings from the config file
include("config.php");
include("functions.php");
$ip = ip_address_to_number($_SERVER['REMOTE_ADDR']);
$useragent = $_SERVER['HTTP_USER_AGENT'];
$regex = "/curl|wget|lynx/i";
// Opens database connections
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
mysql_select_db($dbname);
$dumpID = substr(mysql_real_escape_string($_GET['dump']), -2);
$sql = "SELECT * FROM `displaydumps` WHERE SUBSTRING( dumpID, -2 ) = '".$dumpID."' ORDER BY `displaydumps`.`dumpID` DESC LIMIT 0 , 1";
$query = mysql_query($sql);
while($row = mysql_fetch_array($query)) {
if( $row['limitedviewing'] == "1" && $ip != $row['dumpersIP']) {
} else {
if (preg_match($regex, $useragent)) {
# outputs raw data
echo $row['dumpedtext'];
} else {
# displays raw data
echo "<html><PRE>".htmlentities($row['dumpedtext'])."</PRE></html>";
}
}
}
?>