Skip to content

Instantly share code, notes, and snippets.

View wilpig's full-sized avatar

Wilbur Longwisch wilpig

View GitHub Profile
<?php
// Here's some data
$fields=array( "Height" => "5",
"Cabinet" => "76",
"Label" => "Test_Api",
"DeviceType" => "Chassis",
"Owner" => "23",
"Position" => "5"
);
test test test test adding a public gist wtf
Vulnerability
Upon visiting /workorder.php (which has no access controls), if you set your cookie (which any attacker has arbitrary control over):
https://github.com/samilliken/openDCIM/blob/f7658f8bb0a0f1d0bf229bcc8bb234f7ffcc179e/workorder.php#L15-L22
Pay special attention to line 18.
https://github.com/samilliken/openDCIM/blob/f7658f8bb0a0f1d0bf229bcc8bb234f7ffcc179e/workorder.php#L31-L32
https://github.com/samilliken/openDCIM/blob/f7658f8bb0a0f1d0bf229bcc8bb234f7ffcc179e/workorder.php#L41-L42
You can specify (via cookie) the data that will be loaded into the spreadsheet.
case "SupplyBin":
case "Supplies":
case "BinContents":
$log->ObjectID=$object->BinID;
$log->ChildID=$object->SupplyID;
break;
case "Config":
static function findFirstPort( $DeviceID ) {
if(!$dev=SwitchInfo::BasicTests($DeviceID)){
return false;
}
$x=array();
foreach(self::OSS_SNMP_Lookup($dev,"names") as $index => $portdesc ) {
if ( preg_match( "/([0-9]\:|bond|\"[A-Z]|swp|eth|Ethernet|Port-Channel|\/)[01]$/", $portdesc )) {
$x[$index] = $portdesc;
} // Find lines that end with /1
@wilpig
wilpig / pivot table
Last active March 23, 2017 01:47
SQL for a pivot table to join the custom attributes to the primary device row.
SET @sql = NULL;
SELECT
GROUP_CONCAT(DISTINCT
CONCAT(
'MAX(IF(AttributeID = ''',
AttributeID,
''', Value, NULL)) AS ',
Label
)
) INTO @sql
10.in-addr.arpa. 600 IN SOA ns0.vumc.org. dns-admin.vumc.org. 2553545296 10800 3600 2419200 900
10.in-addr.arpa. 600 IN SOA ns0.vumc.org. dns-admin.vumc.org. 2553545296 10800 3600 2419200 900
10.in-addr.arpa. 600 IN SOA ns0.vumc.org. dns-admin.vumc.org. 2553545296 10800 3600 2419200 900
9.134.100.10.in-addr.arpa. 600 IN PTR img1023wp.hs.it.vumc.io.
100.136.100.10.in-addr.arpa. 600 IN PTR adm1001lp.hs.it.vumc.io.
194.208.100.10.in-addr.arpa. 600 IN PTR ces1001wp.hs.it.vumc.io.
197.208.100.10.in-addr.arpa. 600 IN PTR ces1004wp.hs.it.vumc.io.
198.208.100.10.in-addr.arpa. 600 IN PTR ces1005wp.hs.it.vumc.io.
200.208.100.10.in-addr.arpa. 600 IN PTR ces1007wp.hs.it.vumc.io.
203.208.100.10.in-addr.arpa. 600 IN PTR ces1010wp.hs.it.vumc.io.
# Use this to install elasticsearch
#
# Optional Parameters:
#
#
#
# USAGE EXAMPLES
#
# Simple
#
---
extends: default
rules:
braces:
level: warning
max-spaces-inside: 1
brackets:
level: warning
- hosts: all
gather_facts: yes
vars:
ad_user: samiam
ad_pass: samspassword
tasks:
- name: Copy EPEL8 GPG Key
copy:
src: 'files/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8'