GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Python/check_for_sqlite_files.py at master · Forspillways/Python

Expand file tree

/

check_for_sqlite_files.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
42 lines (33 loc) · 1.3 KB
/

check_for_sqlite_files.py

Copy path

File metadata and controls

42 lines (33 loc) · 1.3 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
# Script Name : check_for_sqlite_files.py
# Author : Craig Richards
# Created : 07 June 2013
# Last Modified : 14 February 2016
# Version : 1.0.1
# Modifications : 1.0.1 - Remove unecessary line and variable on Line 21
# Description : Scans directories to check if there are any sqlite files in there
from __future__ import print_function
import os
def isSQLite3(filename):
from os.path import isfile, getsize
if not isfile(filename):
return False
if getsize(filename) < 100: # SQLite database file header is 100 bytes
return False
else:
fd = open(filename, 'rb')
header = fd.read(100)
fd.close()
if header[0:16] == 'SQLite format 3\000':
return True
else:
return False
log = open('sqlite_audit.txt', 'w')
for r, d, f in os.walk(r'.'):
for files in f:
if isSQLite3(files):
print(files)
print("[+] '%s' **** is a SQLITE database file **** " % os.path.join(r, files))
log.write("[+] '%s' **** is a SQLITE database file **** " % files + '\n')
else:
log.write("[-] '%s' is NOT a sqlite database file" % os.path.join(r, files) + '\n')
log.write("[-] '%s' is NOT a sqlite database file" % files + '\n')
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.