Commit Graph

30 Commits (ef97b20cb7d8df9a7a2c69530efcbf902fbaf047)

Author SHA1 Message Date
HD Moore d656e3185f Mark all libraries as defaulting to 8-bit strings 2012-06-29 00:18:28 -05:00
Tom Samstag 7b7413d85e Bash format for msfencode/msfvenom
This patch adds a Bash output format for msfencode and msfvenom. This is especially useful for local exploitation with shellcode in an environment variable.
Example output:

$ echo 'this is a test' | ./msfvenom -f bash
[-] Using X86 architecture and Windows platform for stdin payload to change use -a and --platform
export buf=\
$'\x74\x68\x69\x73\x20\x69\x73\x20\x61\x20\x74\x65\x73\x74'\
$'\x0a'

It adds unit tests for the new format and also fixes a unit test that was broken (assert_equal 'AAAAAAAAA', Rex::Text.pattern_create(9,['A'])) due to a bug in the shortcut in pattern_create.
2011-11-11 00:13:17 -08:00
Tod Beardsley f7bb3b82de Fixes #2952. Instead of raising an error when we hit the end of all possibles in converge_sets, just return what's left in the buffer, since it happens to be right anyway.
The associated test cases demonstrate that this doesn't cause any trouble (even with silly values) and nothing uses converged_sets except for pattern_create.



git-svn-id: file:///home/svn/framework3/trunk@10696 4d416f70-5f16-0410-b530-b9f4589650da
2010-10-15 19:40:33 +00:00
Tod Beardsley 832960b6df Whoops forgot the x.
git-svn-id: file:///home/svn/framework3/trunk@10216 4d416f70-5f16-0410-b530-b9f4589650da
2010-09-01 23:26:35 +00:00
Tod Beardsley 1d1805306e Adds xml_char_encode. Like html_encode, but allows xml-safe character through.
git-svn-id: file:///home/svn/framework3/trunk@10214 4d416f70-5f16-0410-b530-b9f4589650da
2010-09-01 22:40:07 +00:00
Tod Beardsley e67e231659 Adds Rex::Text.to_hex_ascii(), replaces the gsub on the banner checks to use it.
git-svn-id: file:///home/svn/framework3/trunk@9804 4d416f70-5f16-0410-b530-b9f4589650da
2010-07-13 18:52:27 +00:00
Tod Beardsley 5087ae25f7 Fixed test_gzip. Both strings happen to work, but this gets rid of the assert_equal error.
git-svn-id: file:///home/svn/framework3/trunk@8235 4d416f70-5f16-0410-b530-b9f4589650da
2010-01-26 02:50:10 +00:00
Tod Beardsley d817ac11b4 Adding a convenience method for generating random hexadecimal characters.
git-svn-id: file:///home/svn/framework3/trunk@8233 4d416f70-5f16-0410-b530-b9f4589650da
2010-01-26 02:35:13 +00:00
James Lee 934d08bde2 fix unit tests to reflect new output
git-svn-id: file:///home/svn/framework3/trunk@6325 4d416f70-5f16-0410-b530-b9f4589650da
2009-03-09 05:19:26 +00:00
Ramon de C Valle f124597a56 Code cleanups
git-svn-id: file:///home/svn/framework3/trunk@5773 4d416f70-5f16-0410-b530-b9f4589650da
2008-10-19 21:03:39 +00:00
bmc 5e23a54296 * uhwtfms_half - half-width encoding ( http://www.kb.cert.org/vuls/id/739224 )
git-svn-id: file:///home/svn/framework3/trunk@4910 4d416f70-5f16-0410-b530-b9f4589650da
2007-05-14 20:49:35 +00:00
bmc 5b319613ab * add html encoding
git-svn-id: file:///home/svn/framework3/trunk@3755 4d416f70-5f16-0410-b530-b9f4589650da
2006-07-24 19:25:59 +00:00
bmc 71fc4bd219 * random states
* random hostnames


git-svn-id: file:///home/svn/incoming/trunk@3605 4d416f70-5f16-0410-b530-b9f4589650da
2006-04-21 03:59:07 +00:00
bmc d631902fc1 text.rb
git-svn-id: file:///home/svn/incoming/trunk@3575 4d416f70-5f16-0410-b530-b9f4589650da
2006-03-29 18:39:42 +00:00
bmc 9d54b40c63 * blah. rex exceptions
git-svn-id: file:///home/svn/incoming/trunk@3559 4d416f70-5f16-0410-b530-b9f4589650da
2006-03-08 17:25:40 +00:00
bmc 53dfa3c83d * forgot the 'none' encoding in the test
git-svn-id: file:///home/svn/incoming/trunk@3545 4d416f70-5f16-0410-b530-b9f4589650da
2006-02-27 19:53:36 +00:00
bmc 64c7a2063f * add uri encoding as a text modifier
* add multibyte hex encoding.  useful for %u


git-svn-id: file:///home/svn/incoming/trunk@3544 4d416f70-5f16-0410-b530-b9f4589650da
2006-02-27 19:51:17 +00:00
bmc 59f16d0a1b * add MS's widechar encoding support, named uhwtfms :P (note, to use in something like a URI, it needs to be cleaned up... since you have to send %uXXXX instead of just 2 bytes raw encoded)
git-svn-id: file:///home/svn/incoming/trunk@3541 4d416f70-5f16-0410-b530-b9f4589650da
2006-02-22 23:29:34 +00:00
bmc 8422da47dd * verify we get all of the random entries we expect on a few of iterations
git-svn-id: file:///home/svn/incoming/trunk@3529 4d416f70-5f16-0410-b530-b9f4589650da
2006-02-14 01:04:29 +00:00
bmc bce161e622 * add utf-8 support, with overlong and invalid overlong encodings
* update utf-7 support to a mode to specify "all"


git-svn-id: file:///home/svn/incoming/trunk@3526 4d416f70-5f16-0410-b530-b9f4589650da
2006-02-13 22:52:01 +00:00
bmc b091a21f2b * to_unicode now supports more than just utf-16le, which is still the default.
* add tests for all of the unicode variations.


git-svn-id: file:///home/svn/incoming/trunk@3524 4d416f70-5f16-0410-b530-b9f4589650da
2006-02-10 17:30:41 +00:00
bmc 6c8f513e47 * add "good" char list as well, since well... otherwise its painful.
git-svn-id: file:///home/svn/incoming/trunk@3485 4d416f70-5f16-0410-b530-b9f4589650da
2006-01-31 22:25:55 +00:00
HD Moore b4ad4a5d75 Tabs vs Spaces
git-svn-id: file:///home/svn/incoming/trunk@3453 4d416f70-5f16-0410-b530-b9f4589650da
2006-01-27 05:33:08 +00:00
Matt Miller cd7f1d1979 patch for unicode/to_hex/other changes from bmc
git-svn-id: file:///home/svn/incoming/trunk@3408 4d416f70-5f16-0410-b530-b9f4589650da
2006-01-19 15:12:22 +00:00
HD Moore 88658064df /usr/bin/ruby vs /usr/bin/env ruby
git-svn-id: file:///home/svn/incoming/trunk@3242 4d416f70-5f16-0410-b530-b9f4589650da
2005-12-17 06:46:23 +00:00
Matt Miller 3b79fa0658 move string utils into text
git-svn-id: file:///home/svn/incoming/trunk@3020 4d416f70-5f16-0410-b530-b9f4589650da
2005-11-09 04:18:08 +00:00
Matt Miller aeb6e66e67 md5 and base64
git-svn-id: file:///home/svn/incoming/trunk@2922 4d416f70-5f16-0410-b530-b9f4589650da
2005-09-30 06:48:52 +00:00
Matt Miller d62566a68f lots of changes, making the simple wrapper better, lots of improvements
git-svn-id: file:///home/svn/incoming/trunk@2750 4d416f70-5f16-0410-b530-b9f4589650da
2005-07-14 06:34:58 +00:00
Matt Miller 26a28807eb oops
git-svn-id: file:///home/svn/incoming/trunk@2704 4d416f70-5f16-0410-b530-b9f4589650da
2005-07-10 07:27:50 +00:00
Matt Miller 01aff25bd0 how you like me now, gold teef when I smile
git-svn-id: file:///home/svn/incoming/trunk@2703 4d416f70-5f16-0410-b530-b9f4589650da
2005-07-10 07:15:20 +00:00