Skip to content

Instantly share code, notes, and snippets.

View dlangille's full-sized avatar

Dan Langille dlangille

View GitHub Profile
@dlangille
dlangille / e8cc50a10937e2df4b591c87217bf3dc6334c6d1
Created March 24, 2023 11:15
SQL injection against FreshSource
[pro03 dan ~] % grep e8cc50a10937e2df4b591c87217bf3dc6334c6d1 freshsource.org-access.log
141.98.83.236 - - [23/Mar/2023:04:26:07 +0000] "GET /commit.php?message_id=e8cc50a10937e2df4b591c87217bf3dc6334c6d1 HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Chrome/4.0.222.12 Safari/532.2"
141.98.83.236 - - [23/Mar/2023:04:26:22 +0000] "GET /commit.php?message_id=e8cc50a10937e2df4b591c87217bf3dc6334c6d1 HTTP/1.1" 200 6506 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Chrome/4.0.222.12 Safari/532.2"
141.98.83.236 - - [23/Mar/2023:04:26:33 +0000] "GET /commit.php?message_id=e8cc50a10937e2df4b591c87217bf3dc6334c6d1&UeCa%3D3347%20AND%201%3D1%20UNION%20ALL%20SELECT%201%2CNULL%2C%27%3Cscript%3Ealert%28%22XSS%22%29%3C%2Fscript%3E%27%2Ctable_name%20FROM%20information_schema.tables%20WHERE%202%3E1--%2F%2A%2A%2F%3B%20EXEC%20xp_cmdshell%28%27cat%20..%2F..%2F..%2Fetc%2Fpasswd%27%29%23 HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Wi
@dlangille
dlangille / gist:7b20809e30d6066f5e5a259e3e67d6d5
Created January 23, 2023 15:00
Building vendor directory for librenms 22.12.0
[empty dan ~/librenms] % ./scripts/composer_wrapper.php install --no-dev 14:57:36
Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/home/dan/librenms/scripts/composer_wrapper.php on line 40
Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/home/dan/librenms/scripts/composer_wrapper.php on line 43
Could not scan for classes inside "vendor/dapphp/radius" which does not appear to be a file nor a folder
> LibreNMS\ComposerHelper::preInstall
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Package operations: 114 installs, 0 updates, 0 removals
[slocum dan ~] % vm list 21:29:05
/usr/local/sbin/vm: ERROR: virtual machines can only be managed by root
[slocum dan ~] % sudo vm list 21:29:06
NAME DATASTORE LOADER CPU MEMORY VNC AUTO STATE
hass default uefi 4 4GB - No Running (72577)
home-assistant default uefi 1 1GB - No Stopped
myguest default bhyveload 1 768M - No Stopped
Dec 26 21:09:17 r720-01 kernel: mps1: mpssas_prepare_remove: Sending reset for target ID 21
Dec 26 21:09:17 r720-01 kernel: da12 at mps1 bus 0 scbus8 target 21 lun 0
Dec 26 21:09:17 r720-01 kernel: da12: <ATA Samsung SSD 850 3B6Q> s/n S3PTNF0JA70159T detached
Dec 26 21:09:17 r720-01 kernel: mps1: No pending commands: starting remove_device
Dec 26 21:09:18 r720-01 kernel: (da12:mps1:0:21:0): Periph destroyed
Dec 26 21:09:18 r720-01 ZFS[67733]: vdev state changed, pool_guid=1975810868733347630 vdev_guid=8716406602783665762
Dec 26 21:09:18 r720-01 ZFS[67737]: vdev is removed, pool_guid=1975810868733347630 vdev_guid=8716406602783665762
Dec 26 21:09:19 r720-01 kernel: da12 at mps1 bus 0 scbus8 target 21 lun 0
Dec 26 21:09:19 r720-01 kernel: da12: <ATA Samsung SSD 850 3B6Q> Fixed Direct Access SPC-4 SCSI device
Dec 26 21:09:19 r720-01 kernel: da12: Serial Number S3PTNF0JA70159T
@dlangille
dlangille / creation
Last active November 29, 2022 13:21
I'm trying to get HomeAssistant working under #bhyve on #FreeBSD. I'm following https://community.home-assistant.io/t/installing-home-assistant-hassos-in-freebsd-bhyve-vm/223492 but I can't get the vm to start. https://twitter.com/DLangille/status/1595794060035457025
vm img https://github.com/home-assistant/operating-system/releases/download/9.3/haos_ova-9.3.qcow2.xz
vm create -t debian -c 4 -m 4GB -s 200G -i haos_ova-9.3.qcow2.xz home-assistant
@dlangille
dlangille / 1 install
Last active November 20, 2022 17:24
trouble installing joe via home brew
[air01 dan ~] % brew install joe 8:55:49
Running `brew update --auto-update`...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/services).
==> New Formulae
bindgen ferium libretls pgsync python@3.11 vhs
btrfs-progs fred libunibreak pinocchio rnr waybackpy
cbindgen gebug license-eye pluto tart xcodes
cdsclient hotbuild llama pomsky textract xq
cloudprober huggingface-cli mariadb@10.8 postgresql@15 trezor-bridge
@dlangille
dlangille / 1 - build failure
Last active November 7, 2022 13:49
Hello, I'm getting a build failure on x11-toolkits/qt5-gui and I'm sure it is because of configuration options ... somewhere, but I'm having trouble tracking it down.
===========================================================================
=======================<phase: package >============================
===> Building package for qt5-gui-5.15.5p165
pkg-static: Unable to access file /wrkdirs/usr/ports/x11-toolkits/qt5-gui/work/stage/usr/local/include/qt5/QtLinuxAccessibilitySupport/5.15.5/QtLinuxAccessibilitySupport/private/application_p.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/x11-toolkits/qt5-gui/work/stage/usr/local/include/qt5/QtLinuxAccessibilitySupport/5.15.5/QtLinuxAccessibilitySupport/private/atspiadaptor_p.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/x11-toolkits/qt5-gui/work/stage/usr/local/include/qt5/QtLinuxAccessibilitySupport/5.15.5/QtLinuxAccessibilitySupport/private/bridge_p.h:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/x11-toolkits/qt5-gui/work/stage/usr/local/include/qt5/QtLinuxAccessibilitySupport/5.15.5/QtLinuxAccessibilitySupport/
@dlangille
dlangille / example
Last active October 8, 2022 13:52
New script for snapshots of iocage jails for backups
This is example output from the script below. I have since amended the script from example, to full functional.
Recents changes mean that umounted datasets will not be backed up.
You should read this in conjunction with https://gist.github.com/dlangille/dac3b6d138bb12874f9a which outlines the Bacula job.
$ zfs list system/iocage/jails
NAME USED AVAIL REFER MOUNTPOINT
system/iocage/jails 31.8G 344G 104K /iocage/jails
The before trigger assumed a port could appear in only one catgory (imagine a directory on disk)
e.g. /usr/ports/category/port/
However, there are virtual categories which group together similar ports in a category which does not exist on disk.
The before trigger grabbed values into local varibles instead of inserting directly into the target table.
The new trigger does a INSERT INTO ... SELECT FROM
@dlangille
dlangille / grep
Created September 11, 2022 14:18
FreeBSD ports which use pkg-desc from another port
root@freshports:/usr/ports # grep --exclude distfiles/ -r pkg-descr * | grep DESCR
Mk/Uses/qt-dist.mk:DESCR?= ${PORTSDIR}/devel/${_QT_RELNAME}/pkg-descr
Mk/bsd.port.mk:DESCR?= ${PKGDIR}/pkg-descr
Mk/bsd.port.mk: @if [ ! -f ${DESCR} ]; then ${ECHO_MSG} "** Missing pkg-descr for ${PKGNAME}."; exit 1; fi
accessibility/linux-c7-atk/Makefile:DESCR= ${.CURDIR}/../${PORTNAME}/pkg-descr
accessibility/linux-c7-at-spi2-core/Makefile:DESCR= ${.CURDIR}/../${PORTNAME}/pkg-descr
accessibility/linux-c7-at-spi2-atk/Makefile:DESCR= ${.CURDIR}/../${PORTNAME}/pkg-descr
archivers/linux-c7-lz4/Makefile:DESCR= ${.CURDIR}/../liblz4/pkg-descr
audio/linux-c7-flac/Makefile:DESCR= ${.CURDIR}/../${PORTNAME}/pkg-descr
audio/linux-c7-pulseaudio-utils/Makefile:DESCR= ${.CURDIR}/../${PORTNAME}/pkg-descr