This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set number | |
set visualbell | |
set ruler | |
colorscheme desert |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from bson import json_util | |
from bson.objectid import ObjectId | |
import pymongo | |
class MongoDBHandler(): | |
""" | |
Binlex MongoDB Handler | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install docker | |
apt update &&\ | |
apt -y install apt-transport-https ca-certificates curl software-properties-common &&\ | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - &&\ | |
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu jammy stable" &&\ | |
apt-cache policy docker-ce &&\ | |
apt -y install docker-ce | |
# Install docker compose | |
# check https://github.com/docker/compose/releases for version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hxxp[://]moonlabmediacompany[.]com/campaign1/SunLabsPlayer[.]exe | |
32-Bit Executable | |
MD5: afb06a90723fb2f5982ac2937f0d1086 | |
SHA256: 7fc997a8885e7e75855f8865c02ef86b00b51cb8a726c1eb43b1e658c00d1d69 | |
hxxp[://]moonlabmediacompany[.]com/data/data[.]7z | |
7zip Encrypted Archive, downloaded by SunLabsPlayer[.]exe | |
MD5: fc809f01a557d962b12c9da1f108b7fd | |
SHA256: 6a023a89c0d0b1e1e3cacdfd4237eefe5a8071dd0e30d92bb421f4e67b8dc585 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# upgraded and modified from: https://isc.sans.edu/forums/diary/Tracking+Newly+Registered+Domains/23127/ | |
TODAY=`date --date="-1 day" +"%Y-%m-%d"` | |
PARAM=`echo -n "$TODAY.zip" | base64` | |
DESTDIR="/opt/dns/domains" | |
URL="https://whoisds.com/whois-database/newly-registered-domains/$PARAM/nrd" | |
USERAGENT="DataBot/1.0" | |
TEMPFILE=`mktemp /tmp/wget_XXXXXX.zip` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#################### | |
# colors | |
green=`tput setaf 2` | |
reset=`tput sgr0` | |
#################### | |
echo "${green}Switching directory...${reset}" | |
cd /mnt/hgfs/share/offshore/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Using gem aws-sdk for a ror application for uploading images to s3 | |
#Uploading images to a fixed bucket with different folders for each object or application. | |
#The s3 keeps a limitation on the number of buckets creattion whereas there is no | |
#limitation for content inside a bucket. | |
#This code will upload image for a user to s3 using aws-sdk gem. The bucket and the image uploaded are made public | |
#so that the images uploaded are directly accessible. The input it takes is the image complete path | |
#where it is present, folder in which it should be uploaded and user_id for whom it should | |
#be uploaded. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### GraphQL Stuff #### | |
post '/graphql', to: 'graphql#query' | |
if Rails.env.development? | |
mount GraphiQL::Rails::Engine, at: "/graphiql", graphql_path: "/graphql" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create user type | |
UserType = GraphQL::ObjectType.define do | |
name 'User' | |
description 'Our user model/type for GraphQL' | |
# specify what fields this type has | |
field :id, !types.ID | |
field :email, !types.String | |
field :username, !types.String | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GraphqlController < ApplicationController | |
skip_before_action :verify_authenticity_token | |
def query | |
result_hash = Schema.execute(params[:query], variables: params[:variables]) | |
render json: result_hash | |
end | |
end |
NewerOlder