-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathanalyze_payload.php
More file actions
58 lines (49 loc) · 1.64 KB
/
Copy pathanalyze_payload.php
File metadata and controls
58 lines (49 loc) · 1.64 KB
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
<?php
$dbPath = __DIR__ . '/public/downloads.28.sqlitedb';
if (!file_exists($dbPath)) {
die("Arquivo não encontrado: $dbPath\n");
}
echo "=== ANÁLISE DO PAYLOAD ===\n";
echo "Arquivo: " . basename($dbPath) . "\n";
echo "Tamanho: " . filesize($dbPath) . " bytes\n";
echo "MD5: " . md5_file($dbPath) . "\n\n";
$db = new SQLite3($dbPath);
// Listar tabelas
echo "=== TABELAS ===\n";
$result = $db->query("SELECT name FROM sqlite_master WHERE type='table'");
$tables = [];
while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
$tables[] = $row['name'];
echo "- " . $row['name'] . "\n";
}
echo "\n";
// Analisar cada tabela principal
foreach ($tables as $table) {
echo "=== TABELA: $table ===\n";
// Contar linhas
$countResult = $db->querySingle("SELECT COUNT(*) FROM $table");
echo "Linhas: $countResult\n";
// Mostrar estrutura
$schemaResult = $db->query("PRAGMA table_info($table)");
echo "Colunas:\n";
while ($col = $schemaResult->fetchArray(SQLITE3_ASSOC)) {
echo " - {$col['name']} ({$col['type']})\n";
}
// Amostrar dados
if ($countResult > 0) {
echo "Dados (amostra):\n";
$dataResult = $db->query("SELECT * FROM $table LIMIT 1");
if ($row = $dataResult->fetchArray(SQLITE3_ASSOC)) {
foreach ($row as $key => $value) {
if (is_string($value) && strlen($value) > 100) {
echo " $key: [BINÁRIO/LONGO - " . strlen($value) . " bytes]\n";
} else {
echo " $key: " . substr((string)$value, 0, 100) . "\n";
}
}
}
}
echo "\n";
}
$db->close();
?>