Skip to content

Instantly share code, notes, and snippets.

View aniketp's full-sized avatar
🤠

Aniket Pandey aniketp

🤠
View GitHub Profile
@aniketp
aniketp / filename-to-key.go
Last active February 12, 2019 12:03
Code snippet which can be used as a conversion from "filename" to "key" in key-value DataStore
type PrivateKey = userlib.PrivateKey
type User_r struct {
User struct {
Username string
Password string
Privkey PrivateKey
A2ksalt string // To be used as a salt for Argon KDF
}
Signature []byte
@aniketp
aniketp / cliff-clavin.py
Last active July 13, 2018 16:18
A script for the performance benchmarking of CLIFF-CLAVIN tool. Developed for RTE-2018
import sys, csv, json, time, requests
from urllib.parse import urlencode, quote_plus
url = 'http://[SECRET]:8080/'
cliff_version = 'CLIFF-2.3.0'
malformed = 0
with open("data1.txt", "r") as file, open("hackcave2.csv", "w+") as csvf:
csvfile = csv.writer(csvf)
csvfile.writerow(['Index', 'Response time', 'Computation Time', 'Malformed'])
from multiprocessing import Process, Manager
from fasttext import FastVector
# Returns a sample fastVector object
def createFastVector():
# Create for English vector-wiki
en_dict = FastVector(vector_file='wiki.en.vec')
return en_dict
def serverFunc(vector):
import json
import time
import requests
from urllib.parse import urlencode, quote_plus
url = 'http://[SECRET]:8080/'
cliff_version = 'CLIFF-2.3.0'
text = 'There is an ongoing match at the Wembley Stadium in Britain for USA'
payload = {'q': text}
@aniketp
aniketp / clang-format
Created June 3, 2018 21:45 — forked from shivansh/clang-format
clang-format based on FreeBSD's style(9)
BasedOnStyle: LLVM
IndentWidth: 8
UseTab: Always
BreakBeforeBraces: Linux
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
ColumnLimit: 0
AlignTrailingComments: true
SpacesBeforeTrailingComments: 2
@aniketp
aniketp / Report3.md
Last active April 30, 2018 09:54
Report 3: Creating a stand-alone test program using atf-c(3) for Kyua

Report 3: Kyua test program for mkdir(2)

Explicit System Call Testing

The test application would trigger all Syscalls one by one, evaluating that the audit record contains all the expected parameters, e.g the arguments, valid argument types, return values etc. The testing will be done for various success and failure modes, with cross checking for appropriate error codes in case of failure mode.

Repository

AuditTestSuite

The Problem

@aniketp
aniketp / Report2.md
Last active March 25, 2018 01:06
Report 2: File-read System Call testing for FreeBSD Audit Framework

Report 2: File-read System Call testing

Explicit System Call Testing

The test application would trigger all Syscalls one by one, evaluating that the audit record contains all the expected parameters, e.g the arguments, valid argument types, return values etc. The testing will be done for various success and failure modes, with cross checking for appropriate error codes in case of failure mode.

Repository

AuditTestSuite

Directory Structure

@aniketp
aniketp / Report1.md
Last active February 25, 2018 06:31
Report 1: Network System Call testing for FreeBSD Audit Framework

Report 1: Network System Call testing

Explicit System Call Testing

The test application would trigger all Syscalls one by one, evaluating that the audit record contains all the expected parameters, e.g the arguments, valid argument types, return values etc. The testing will be done for various success and failure modes, with cross checking for appropriate error codes in case of failure mode.

Repository

AuditTestSuite

Directory Structure