Skip to content

Instantly share code, notes, and snippets.

@xntrik
xntrik / gist:1906441
Created February 25, 2012 04:24
beef talks
OWASP AppSec APAC - Australia - April
AthCon2012 - Greece - May 3-4
HackPra - Prague? - ?
Just4Meeting - Lisbon - July 6-8
Hacktivity - ? - ?
@xntrik
xntrik / gist:1856698
Created February 18, 2012 01:14
beefjs matches
Searching 470 files for "beefjs"
/Users/xian/beef/beef/core/core.rb:
48 require 'core/main/server'
49
50: require 'core/main/handlers/modules/beefjs'
51 require 'core/main/handlers/modules/command'
52
/Users/xian/beef/beef/core/main/command.rb:
@xntrik
xntrik / gist:1619394
Created January 16, 2012 06:27
ruby file to print out a sequence of dates .. laaazy
#!/usr/bin/ruby
require 'date'
sd = Date.parse('2011-06-8')
ed = Date.parse('2011-06-15')
sd.upto(ed) { |date|
(0..23).each do |hour|
printf("%s:%02d\n",date.strftime('%d/%b/%Y'),hour)
end
}
@xntrik
xntrik / gist:1593429
Created January 11, 2012 06:47
Writing Ruby Scripts That Respect Pipelines
http://jstorimer.com/2011/12/12/writing-ruby-scripts-that-respect-pipelines.html
@xntrik
xntrik / gist:1587088
Created January 10, 2012 05:04
Sometimes you need to unzip a bunch of files looking for junk
#!/bin/bash
echo "Clearing output_dir/"
rm -rf output_dir/
FILES=*.tar.gz
for f in $FILES
do
echo -ne "Processing $f.."
tar -zxvf $f >/dev/null 2>&1
@xntrik
xntrik / gist:1543216
Created December 31, 2011 07:18
Remove all your gems
gem list | cut -d" " -f1 | xargs gem uninstall -aIx
(from http://geekystuff.net/2009/01/14/remove-all-ruby-gems/)
xian@Ulysses~/beef/beef$ rake
(in /Users/xian/beef/beef)
cd test/msf-test;git pull
remote: Counting objects: 184, done.
remote: Compressing objects: 100% (46/46), done.
remote: Total 100 (delta 70), reused 82 (delta 54)
Receiving objects: 100% (100/100), 105.48 KiB | 77 KiB/s, done.
Resolving deltas: 100% (70/70), completed with 35 local objects.
From https://github.com/rapid7/metasploit-framework
* [new branch] kbchecker -> origin/kbchecker
xian@Ulysses~/beef/beef$ gem install msfrpc-client
Fetching: msgpack-0.4.6.gem (100%)
Building native extensions. This could take a while...
Fetching: msfrpc-client-1.0.1.gem (100%)
Successfully installed msgpack-0.4.6
Successfully installed msfrpc-client-1.0.1
2 gems installed
Installing ri documentation for msgpack-0.4.6...
Installing ri documentation for msfrpc-client-1.0.1...
Installing RDoc documentation for msgpack-0.4.6...
xian@Ulysses~/beef/beef$ rake quick_unit_tests
(in /Users/xian/beef/beef)
cd test/unit/;ruby ts_beef.rb
/Users/xian/.rvm/gems/ruby-1.9.2-p290/gems/curb-0.7.16/lib/curb_core.bundle: warning: already initialized constant CURL_SSLVERSION_DEFAULT
Loaded suite BeEF TestSuite
Started
...........................F
Failure:
test_api_create(TC_Metasploit) [/Users/xian/beef/beef/test/unit/extensions/tc_metasploit.rb:67]:
@xntrik
xntrik / gist:1437344
Created December 6, 2011 08:21
MSF on Amazon's AMI EC2
sudo yum install make gcc openssl openssl-devel svn git
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
exit
rvm pkg install openssl
rvm install 1.9.2 --with-openssl-dir=$rvm_path/usr
svn co https://www.metasploit.com/svn/framework3/trunk/
cd trunk
rvm use 1.9.2
rvmsudo ruby -v