Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split config into *.example files & added config files to .gitignore. #48

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,22 @@ pombo-*.conf
gnu-linux/*.tar.gz
mac/*.tar.gz
windows/Output/
output
/dist
/build
/*.spec
htmlcov/
.mypy_cache/
.tox/
.venv
index.php
pombo.conf
.vscode
auto_py_to_exe*json

# Pombo Portable (IP file & log file)
pombo
pombo.log

# GUI
gui/bin/
Expand Down
4 changes: 4 additions & 0 deletions index.php.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
$PASSWORD = 'mysecret'; // The same value as in pombo.conf
$CHECKFILE = '.stolen'; // The same value as in pombo.conf
require 'pombo.php';
300 changes: 150 additions & 150 deletions pombo.conf → pombo.conf.example
Original file line number Diff line number Diff line change
@@ -1,150 +1,150 @@
; Pombo configuration file
[General]
;
; General parameters ---------------------------------------------------
;
; Public keyID.
; [NOT recommended] Set it to "i_dont_wanna_use_encryption_and_i_assume"
; to disable report encryption.
gpgkeyid=BAADF00D
; Password which must be the same as in pombo.php.
password=mysecret
; Server URL. If several servers, separate them with a "|".
; Example: http://myserver.com/pombo.php
; Example: http://myserver.com/pombo.php|http://myserver2.com/pombo.php
server_url=
; File to check on one server to tell pombo the computer was stolen.
; If file exists, pombo will send reports each 5 minutes.
; Must be the same as in pombo.php.
check_file=.stolen
; Time between each report (in minutes).
; When stolen, time between each report is this option divided by 3:
; if time_limit=15, when stolen it will be 15/3 = 5 min.
; On GNU/Linux, think to adapt /etc/cron/pombo.
; On Mac OSX, think to adapt /etc/crontab.
time_limit=15
; Email ID to send report as attached file.
; Leave it blank if you do not want to use this feature.
email_id=
; If True, pombo will check and send report only when IP is not
; the same as the first run.
; This option does not have effect for stolen computer.
; You could add several IP by using "add" option or use add-ip.bat
; on Windows.
only_on_ip_change=no
; Enable informations logging (not recommended, only for debug/dev purpose)
enable_log=no
; Authentification settings --------------------------------------------
; Proxy
use_proxy=no
; Prefer environment variables?
use_env=no
; Proxy URL
; Example: http://proxyurl:proxyport
; Example with auth: http://username:password@proxyurl:proxyport
http_proxy=
https_proxy=
; .htaccess authentification for one server
; For auth_server, only specify the domain, example:
; if serverurl=http://myserver.com/pombo.php, auth_server=myserver.com
auth_server=
auth_user=
auth_pswd=
[Commands]
;
; ####################################################################
; # #
; # /!\ For GNU/Linux & Mac OSX users /!\ #
; # #
; # Use the tool's full path #
; # You can try the 'which' command to know where they are situated. #
; # Example: which ifconfig #
; # #
; ####################################################################
;
; To disable a command, blank it (for example, camshot=).
;
; Examples are formated as:
; [OS] <command>
; W = Windows
; L = GNU/Linux
; M = Mac OSX
;
; Complete path of GnuPG binary. Not needed if encryption is not used.
; [W] C:\\pombo\\bin\\gpg.exe
; [L] /usr/bin/gpg
; [M] /usr/local/bin/gpg
gpg_binary=C:\\pombo\\bin\\gpg.exe
; Get the current TCP/IP network interfaces.
; [W] ipconfig /all
; [L] /sbin/ip a
; [L] /sbin/ifconfig -a (deprecated)
; [M] /sbin/ifconfig -a
network_config=ipconfig /all
; Get the list of Access Points and Ad-Hoc cells in range, and
; optionally a whole bunch of information about them (ESSID, Qual-
; ity, Frequency, Mode ...).
; [W] wlan-dump.bat (only for Windows XP, installed since Pombo 0.0.10)
; [W] netsh wlan show all (note available on Windows XP)
; [L] /sbin/iwlist scanning
; [M] /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -s
wifi_access_points=netsh wlan show all
; Get the route over the network between two systems, listing all the
; intermediate routers a connection must pass through to get to its
; destination.
; [W] tracert -d www.example.org
; [L] /usr/bin/traceroute -q1 www.example.com
; [M] /usr/sbin/traceroute -q1 www.example.com
traceroute=tracert -d www.example.org
; Get network connections (both incoming and outgoing), routing tables,
; and a number of network interface statistics.
; [W] netstat -n
; [L] /bin/ss -putn
; [L] /bin/netstat -putn (deprecated)
; [M] /usr/sbin/netstat -utn
network_trafic=netstat -n
; Take screen shot?
; [M,L,W] yes or no
screenshot=yes
; Take webcam shot?
; <filepath> will be replaced by a filename, do not customize (required).
; [W] yes or no
; [L] /usr/bin/streamer -q -t 1 -r 2 -o <filepath>
; [L] /usr/bin/streamer -q -t 1 -r 2 -j 100 -s 640x480 -o <filepath>
; [L] /usr/bin/streamer -q -w 3 -o <filepath>
; [L] /usr/bin/streamer -q -j 100 -w 3 -s 640x480 -o <filepath>
; [L] /usr/bin/gst-launch -q v4l2src num_buffers=1 decimate=70 ! pngenc ! filesink location=<filepath>
; [M] /usr/local/bin/imagesnap -q -w 3.00 <filepath>
camshot=yes
; A try to fix most of webcam shot errors is to specify the picture
; extension to feet with your software/hardware.
; Try yourself into a console to find the good one.
; Few possible extensions are: png, jpeg, ppm, bmp, tiff.
; JPEG has the best ratio compression/quality.
; If PPM is chosen, it will be converted to JPEG using /usr/bin/convert.
; [W] not used
; [L,M] png, jpeg, ppm, bmp or tiff
camshot_filetype=jpeg
; Pombo configuration file

[General]
;
; General parameters ---------------------------------------------------
;

; Public keyID.
; [NOT recommended] Set it to "i_dont_wanna_use_encryption_and_i_assume"
; to disable report encryption.
gpgkeyid=BAADF00D

; Password which must be the same as in pombo.php.
password=mysecret

; Server URL. If several servers, separate them with a "|".
; Example: http://myserver.com/pombo.php
; Example: http://myserver.com/pombo.php|http://myserver2.com/pombo.php
server_url=

; File to check on one server to tell pombo the computer was stolen.
; If file exists, pombo will send reports each 5 minutes.
; Must be the same as in pombo.php.
check_file=.stolen

; Time between each report (in minutes).
; When stolen, time between each report is this option divided by 3:
; if time_limit=15, when stolen it will be 15/3 = 5 min.
; On GNU/Linux, think to adapt /etc/cron/pombo.
; On Mac OSX, think to adapt /etc/crontab.
time_limit=15

; Email ID to send report as attached file.
; Leave it blank if you do not want to use this feature.
email_id=

; If True, pombo will check and send report only when IP is not
; the same as the first run.
; This option does not have effect for stolen computer.
; You could add several IP by using "add" option or use add-ip.bat
; on Windows.
only_on_ip_change=no

; Enable informations logging (not recommended, only for debug/dev purpose)
enable_log=no

; Authentification settings --------------------------------------------
; Proxy
use_proxy=no

; Prefer environment variables?
use_env=no

; Proxy URL
; Example: http://proxyurl:proxyport
; Example with auth: http://username:password@proxyurl:proxyport
http_proxy=
https_proxy=

; .htaccess authentification for one server
; For auth_server, only specify the domain, example:
; if serverurl=http://myserver.com/pombo.php, auth_server=myserver.com
auth_server=
auth_user=
auth_pswd=


[Commands]
;
; ####################################################################
; # #
; # /!\ For GNU/Linux & Mac OSX users /!\ #
; # #
; # Use the tool's full path #
; # You can try the 'which' command to know where they are situated. #
; # Example: which ifconfig #
; # #
; ####################################################################
;
; To disable a command, blank it (for example, camshot=).
;
; Examples are formated as:
; [OS] <command>
; W = Windows
; L = GNU/Linux
; M = Mac OSX
;

; Complete path of GnuPG binary. Not needed if encryption is not used.
; [W] C:\\pombo\\bin\\gpg.exe
; [L] /usr/bin/gpg
; [M] /usr/local/bin/gpg
gpg_binary=C:\\pombo\\bin\\gpg.exe

; Get the current TCP/IP network interfaces.
; [W] ipconfig /all
; [L] /sbin/ip a
; [L] /sbin/ifconfig -a (deprecated)
; [M] /sbin/ifconfig -a
network_config=ipconfig /all

; Get the list of Access Points and Ad-Hoc cells in range, and
; optionally a whole bunch of information about them (ESSID, Qual-
; ity, Frequency, Mode ...).
; [W] wlan-dump.bat (only for Windows XP, installed since Pombo 0.0.10)
; [W] netsh wlan show all (note available on Windows XP)
; [L] /sbin/iwlist scanning
; [M] /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -s
wifi_access_points=netsh wlan show all

; Get the route over the network between two systems, listing all the
; intermediate routers a connection must pass through to get to its
; destination.
; [W] tracert -d www.example.org
; [L] /usr/bin/traceroute -q1 www.example.com
; [M] /usr/sbin/traceroute -q1 www.example.com
traceroute=tracert -d www.example.org

; Get network connections (both incoming and outgoing), routing tables,
; and a number of network interface statistics.
; [W] netstat -n
; [L] /bin/ss -putn
; [L] /bin/netstat -putn (deprecated)
; [M] /usr/sbin/netstat -utn
network_trafic=netstat -n

; Take screen shot?
; [M,L,W] yes or no
screenshot=yes

; Take webcam shot?
; <filepath> will be replaced by a filename, do not customize (required).
; [W] yes or (blank to disable)
; [L] /usr/bin/streamer -q -t 1 -r 2 -o <filepath>
; [L] /usr/bin/streamer -q -t 1 -r 2 -j 100 -s 640x480 -o <filepath>
; [L] /usr/bin/streamer -q -w 3 -o <filepath>
; [L] /usr/bin/streamer -q -j 100 -w 3 -s 640x480 -o <filepath>
; [L] /usr/bin/gst-launch -q v4l2src num_buffers=1 decimate=70 ! pngenc ! filesink location=<filepath>
; [M] /usr/local/bin/imagesnap -q -w 3.00 <filepath>
camshot=yes

; A try to fix most of webcam shot errors is to specify the picture
; extension to feet with your software/hardware.
; Try yourself into a console to find the good one.
; Few possible extensions are: png, jpeg, ppm, bmp, tiff.
; JPEG has the best ratio compression/quality.
; If PPM is chosen, it will be converted to JPEG using /usr/bin/convert.
; [W] not used
; [L,M] png, jpeg, ppm, bmp or tiff
camshot_filetype=jpeg
5 changes: 0 additions & 5 deletions pombo.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
* require '../pombo.php';
* ?>
*/
if ( !isset($PASSWORD) )
$PASSWORD = '<The same value as in pombo.conf.>';
if ( !isset($CHECKFILE) )
$CHECKFILE = '<The same value as in pombo.conf.>';

if ( !function_exists('hash_hmac') ) {
//Calculate HMAC-SHA1 according to RFC2104
// http://www.ietf.org/rfc/rfc2104.txt
Expand Down
15 changes: 9 additions & 6 deletions pombo.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@

if sys.platform == "win32": # pragma: no cover
from PIL import Image
from VideoCapture import Device

__version__ = "1.1b1"

Expand Down Expand Up @@ -299,11 +298,11 @@ def get_manufacturer(self):
if len(res) < 3:
manufacturer = "Unknown"
else:
manufacturer = "-".join(
manufacturer = " - ".join(
[
res[1].split("=")[1].strip(),
res[0].split("=")[1].strip(),
res[2].split("=")[1].strip(),
res[1].split("=")[1].strip() if '=' in res[1] else res[1],
res[0].split("=")[1].strip() if '=' in res[0] else res[0],
res[2].split("=")[1].strip() if '=' in res[2] else res[2],
]
)
elif self.is_mac():
Expand Down Expand Up @@ -653,7 +652,7 @@ def snapshot(self, current_ip):
self.log.info("Filename: %s", report_name)
self.log.info("Collecting system info")
filepath = "{}.txt".format(os.path.join(temp, report_name))
with open(filepath, "w") as fileh:
with open(filepath, "w", encoding='utf8') as fileh:
fileh.write(self.system_report(current_ip))
filestozip = [filepath]

Expand Down Expand Up @@ -815,6 +814,9 @@ def webcamshot(self, filename):
self.log.info("Skipping webcamshot.")
return None

if sys.platform == "win32": # pragma: no cover
from VideoCapture import Device

temp = gettempdir()
self.log.info("Taking webcamshot")
if self.is_windows():
Expand Down Expand Up @@ -891,6 +893,7 @@ def work(self):
)
return

runtime = 0
if self.is_windows():
# Cron job like for Windows :s
while True:
Expand Down
Loading