Skip to content

Instantly share code, notes, and snippets.

View abhaybhargav's full-sized avatar

Abhay Bhargav abhaybhargav

  • we45
  • All over the world
View GitHub Profile
@abhaybhargav
abhaybhargav / react-xss.html
Created May 21, 2020 11:39
React XSS Live Code Example
<html>
<head>
<title>ReactJS Live Code Demo</title>
<script src="https://unpkg.com/react@15/dist/react.js"></script>
<script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script>
<script src="https://unpkg.com/url-parse@1.4.3/dist/url-parse.js"></script>
</head>
<body>
<div id="entities"></div>
<div id="attributes"></div>
@abhaybhargav
abhaybhargav / dompurify-example.html
Created February 16, 2020 03:21
Example of DOMPurify
<html>
<head>
<title>Output Escaping Demo</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/2.0.8/purify.min.js"></script>
</head>
<body>
<script>
//Filter for Anchor HREF
var dirtyHref = 'javascript:alert(1)';
var link = document.createElement('a');
@abhaybhargav
abhaybhargav / attack-simulate.sh
Last active September 29, 2019 03:07
GuardDutyAttack Simulator
#Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license" file accompanying this file. This file is distributed
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
*** Settings ***
Library REST http://${TARGET_URI}/
Library Playbot ${PROJECT} ${TARGET_NAME} ${TP_API}
Library Collections
Library String
*** Variables ***
${TARGET_URI} 157.230.132.204:3000
${PROJECT} demo
${TP_LOGIN} admin@admin.com
{"id":"925ebe3d-65bf-4d48-be3d-dc4bb86a18ce","title":"Steal Customer Info from other Reps","mindmap":{"root":{"id":"c556daf7-9465-4793-959d-d1ddf553788f","parentId":null,"text":{"caption":"Steal Customer Info from other Reps","font":{"style":"normal","weight":"bold","decoration":"none","size":20,"color":"#000000"}},"offset":{"x":0,"y":0},"foldChildren":false,"branchColor":"#000000","children":[{"id":"b6cd1bc9-3a78-4560-b680-a8da3e3c16a3","parentId":"c556daf7-9465-4793-959d-d1ddf553788f","text":{"caption":"Leverage other Rep(s)","font":{"style":"normal","weight":"normal","decoration":"none","size":15,"color":"#000000"}},"offset":{"x":127.96875,"y":-27.4375},"foldChildren":false,"branchColor":"#ad9b69","children":[{"id":"95482943-20c2-46d1-9220-a4b24f833dff","parentId":"b6cd1bc9-3a78-4560-b680-a8da3e3c16a3","text":{"caption":"Threaten other rep","font":{"style":"normal","weight":"normal","decoration":"none","size":15,"color":"#000000"}},"offset":{"x":205.57194010416666,"y":-135.65152994791666},"foldChildren":fa
objectType: Feature
name: create_upload_expense
description: As a user, I am able to create and upload expenses within project limit that have been incurred by me for processing/payment by my manager, so I can get reimbursed
abuse_cases:
- name: manipulate expense information
description: As a malicious user, I will manipulate expense management process to get larger or bogus expenses into the system.
threat_scenarios:
- name: sql injection expense limit bypass
type: repo
description: Perform SQL Injection to compromise the Database, and raise project budget limits or bypass expense controls
objectType: Feature
name: approve_expense
description: As a Project Manager, I would like to approve legitimate expenses from my employees
abuse_cases:
- name: manipulate expense approval
description: As a malicious user, I will manipulate the expense approval process so I can get bogus expense approved
threat_scenarios:
- name: sql injection expense limit bypass
type: repo
description: Perform SQL Injection to compromise the Database, and raise project budget limits or bypass expense controls
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<configuration>
<policy>CustomLight</policy>
<scanner>
<level>LOW</level>
<strength>LOW</strength>
</scanner>
<plugins>
<p6>
<enabled>false</enabled>
@abhaybhargav
abhaybhargav / xss_payloads.js
Created April 20, 2019 11:47
Test XSS payloads
alert(1)
@abhaybhargav
abhaybhargav / sse_example.tf
Created November 12, 2018 09:25
Amazon SSE with KMS
resource "aws_kms_key" "s3_key" {
description = "This key is used to encrypt bucket objects"
deletion_window_in_days = 10
}
resource "random_string" "bucket_name" {
length = 10
special = false
upper = false
}