Skip to content

Instantly share code, notes, and snippets.

View passbe's full-sized avatar

Ben Passmore passbe

View GitHub Profile
@passbe
passbe / jquery-conflict-hack.js
Created July 5, 2011 22:33
JavaScript hack to intercept jQuery and stop it being included.
jQuery.noConflict = function() { return $; };
var h = document.getElementsByTagName('head').item(0);
h.appendChild = function(w) {
return function(obj) {
if (obj.src && !obj.src.match(/jquery-\d\.\d\.\d\.min\.js/gi)) {
w.apply(this, arguments);
}
}
}(h.appendChild);
@passbe
passbe / jquery-conflict-solution.js
Created July 6, 2011 01:33
Changing the jQuery source to bind to a different variable other than window.$ or window.jQuery
});
// Expose jQuery to the global object
//window.jQuery = window.$ = jQuery;
window.$your_var = jQuery;
})(window);
@passbe
passbe / beef-config.yaml
Created July 11, 2011 22:07
BeEF's configuration file layout.
beef:
module:
coldfusion_dir_traversal_exploit:
enable: true
autorun: false
category: "Network"
name: "ColdFusion Directory Traversal Exploit"
description: "ColdFusion 9.0, 8.0.1, 9.0 and 9.0.1 are vulnerable to directory traversal that leads to arbitrary file retrieval from the ColdFusion server (CVE-2010-2861)"
references: ["http://www.example.com/exploit", "http://www.google.com"]
authors:
@passbe
passbe / svn-special-commit
Created August 2, 2011 02:00
Commit all files without a matching "configuration" or "tmp"
svn status | cut -c 2- | egrep -v "configuration|tmp" | xargs svn commit -m "my commit message"
@passbe
passbe / count-keyword-list
Created October 5, 2011 00:26
Count total occurances of KEYWORD inside a LIST of files (excludes .svn directories)
grep --exclude-dir=*.svn -irc '[KEYWORD]' `cat [LIST_OF_FILES]` > out && awk -F : '{total += $2} END { print "Total:", total }' [OUTPUT_FILE]
@passbe
passbe / php-synatx-files
Created October 5, 2011 00:27
Check PHP synatx of LIST of files
IFS=$'\n'; for line in `cat [LIST_OF_FILES]`; do php -l $line; done
@passbe
passbe / svn-add-all
Created October 5, 2011 00:29
Add all non-versioned files inside a svn repo
svn status | grep '?' | sed 's/^.* /svn add /' | bash
@passbe
passbe / svn-force-revert
Created October 5, 2011 00:30
Revert entire svn repo + remove non-versioned files (warning rm -r)
svn revert -R * && svn status | grep '?' | sed 's/^.* /rm -r /' | bash
@passbe
passbe / svn-rev-to-rev
Created October 5, 2011 00:31
Show created or modified files from REVISION to REVISION|HEAD in svn
svn diff -r REVNO:HEAD --summarize
@passbe
passbe / svn-rev-patch
Created October 5, 2011 00:32
Create a svn REVISION patch file
svn diff -r REVO:HEAD --summarize | cut -c 9- | xargs zip -9 [FILENAME].zip