Skip to content

Instantly share code, notes, and snippets.

Daniel Martin etdsoft

Block or report user

Report or block etdsoft

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am etdsoft on github.
  • I am etd (https://keybase.io/etd) on keybase.
  • I have a public key whose fingerprint is CFB8 956C 1BAA BF8D 4239 6927 F3B6 AE59 3355 22C0

To claim this, I am signing this object:

View duo.html.erb
<h1>Duo Web 2FA</h1>
<iframe id="duo_iframe" width="800" height="600" frameborder="0"></iframe>
<script type="text/javascript">
$(function(){
console.log('Duo.init');
Duo.init({
'host': '<%= DUOWEB[:host] %>',
'sig_request': '<%= @sig_request %>',
@etdsoft
etdsoft / fail2ban_notifier.rb
Last active Jul 4, 2019
Simple Fail2banNotifier for exception_notification (will submit a pull request and update gist when accepted).See: https://dradisframework.com/academy/knowledge-base/ruby/ruby-on-rails/protect-rails-application-with-fail2ban.html
View fail2ban_notifier.rb
class Fail2banNotifier
def initialize(options)
@default_options = options
@default_options[:logfile] ||= Rails.root.join('log', 'fail2ban.log')
# Roll over every 30M, keep 10 files
@logger ||= Logger.new(@default_options[:logfile], 10, 30*1024*1024)
end
def call(exception, options={})
@etdsoft
etdsoft / convert.rb
Created Nov 1, 2013
CSV to Textile table
View convert.rb
require 'csv'
if ARGV.count != 1
puts "Usage:\n\t#{$0} <file.csv>"
exit 1
end
file = ARGV.first
if !File.exist?(file)
@etdsoft
etdsoft / mount_luks.sh
Created Oct 9, 2013
Mounting the Dradis Pro LUKS encrypted volume after the appliance has started
View mount_luks.sh
# as root or via sudo
cryptsetup luksOpen /dev/dradispro/data data-open
mount /dev/mapper/data-open /mnt/data
@etdsoft
etdsoft / interface.js
Created Aug 20, 2013
Prompt for a file name when an image is pasted into the browser window (Chrome only)
View interface.js
// ... line 368
$('#fileupload').fileupload({
dropZone: $('#dropzone'),
headers: {
'X-CSRF-Token': csrf_token
},
destroy: function (e, data) {
data.headers = $(this).data('fileupload').options.headers;
$.blueimpUI.fileupload.prototype.options.destroy.call(this, e, data);
View bsides_raffle.rb
$:<< 'lib/'
require 'raffle'
participants = File.read('participants.txt').split
raffle = Raffle.new(participants)
puts "We've got #{raffle.participants.count} participants in the raffle."
puts raffle.pick_a_winner
@etdsoft
etdsoft / projects_controller.rb
Created Apr 18, 2013
Workaround to add per-project authorisation to Dradis Pro (danger! ugly hack ahead) This will restrict access to project 84 to the 81, 85 and 86 users.
View projects_controller.rb
class ProjectsController < AuthenticatedController
before_filter :deny_access, :only => [:show, :destroy, :use]
// ...
protected
def deny_access
if (params[:id].to_i == 84) && ![81,85,86].include?(current_user.id)
redirect_to projects_path, :alert => 'Sorry, but the Force is not sufficiently strong within you to work on that project. Choose another one (and continue your training).'
end
@etdsoft
etdsoft / vulndb_bridge.rb
Created Mar 13, 2012
Move your entries across from VulnDB to VulDB HQ (http://vulndbhq.com)
View vulndb_bridge.rb
#!/bin/env ruby
=begin
Copyright (c) 2012 Daniel Martin - Security Roots Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
@etdsoft
etdsoft / dradis.notes.NoteEditorWindow.js
Created Sep 27, 2011
Create new notes in Dradis and Vuln::DB with default content
View dradis.notes.NoteEditorWindow.js
// <dradispro>/public/javascripts/dx/dradis.notes.NoteEditorWindow.js
// [...]
// replace the clear() function in line #72
clear: function(){
this.fields.editor.setValue('#[Title]#\nNew Page Title\n\n#[Description]#\n \n\n#[Recommendation]#\n \n\n');
this.fields.editor.selectText();
this.fields.preview.clear();
}
You can’t perform that action at this time.