This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:spring2015:unix:projects:udr2 [2015/03/16 14:57] – [Task] wedge | haas:spring2015:unix:projects:udr2 [2015/03/30 16:39] (current) – [Errata] wedge | ||
---|---|---|---|
Line 11: | Line 11: | ||
Typos and bug fixes: | Typos and bug fixes: | ||
- | * no fixes of note | + | * bgrep was giving the address |
+ | * This should not change anything, save for saving you an additional calculation to determine the start of the packet. | ||
+ | * My aforementioned fix did not work, reverted **bgrep** to original version (20150324) | ||
+ | * Implemented new fix: **bgrep** should now be correctly reporting the starting address of the matched pattern -- no change on your part, just start using it (and be aware that the address represents the start of the pattern, and not the end) (20150330) | ||
=====Objective===== | =====Objective===== | ||
Continuing our "1337 haxxing" | Continuing our "1337 haxxing" | ||
Line 266: | Line 268: | ||
* **grep**(1) - can be contorted to cooperate | * **grep**(1) - can be contorted to cooperate | ||
* **date**(1) - might be useful for time/date manipulations | * **date**(1) - might be useful for time/date manipulations | ||
- | * check out provided | + | * **bgrep** |
... along with other tools previously encountered. | ... along with other tools previously encountered. | ||
+ | ====bgrep==== | ||
+ | To assist you with this project, a special " | ||
+ | |||
+ | It supports space-separated (or not) bytes of data, and even allows the use of ' | ||
+ | |||
+ | ===Example Usage=== | ||
+ | Let's say you wanted to search for the consecutive bytes 0x12 and 0x34 within a binary file: | ||
+ | |||
+ | <cli> | ||
+ | $ cat session-201302200614.raw | bgrep '12 34' | ||
+ | 533b:12 34 | ||
+ | 29af3:12 34 | ||
+ | 29dff:12 34 | ||
+ | 29f85:12 34 | ||
+ | 2a8a9:12 34 | ||
+ | 2aa2f:12 34 | ||
+ | 2abb5:12 34 | ||
+ | 2aec1:12 34 | ||
+ | 2b353:12 34 | ||
+ | $ | ||
+ | </ | ||
+ | |||
+ | What you see are the addresses (in hex) that denote the start of this requested pattern (0x12 immediately followed by 0x34). | ||
+ | |||
+ | If you wanted 0x12 followed by anything, followed by 0x34, we'd do: | ||
+ | |||
+ | <cli> | ||
+ | $ cat session-201302200614.raw | bgrep '12 .. 45' | ||
+ | 3326:12 e0 45 | ||
+ | $ | ||
+ | </ | ||
+ | |||
+ | In this case, there is only one such match in the entire file. | ||
+ | |||
+ | The ' | ||
+ | |||
+ | <cli> | ||
+ | $ cat session-201302200614.raw | bgrep '12 e.' | ||
+ | 1cf4:12 ee | ||
+ | 206d:12 e0 | ||
+ | 3325:12 e0 | ||
+ | 3907:12 e0 | ||
+ | 4077:12 e0 | ||
+ | 4795:12 e0 | ||
+ | 50a1:12 e0 | ||
+ | 552b:12 e0 | ||
+ | 5edb:12 e0 | ||
+ | 73e7:12 e0 | ||
+ | 81b9:12 e0 | ||
+ | 8df9:12 e0 | ||
+ | 8fcf:12 e0 | ||
+ | aae3:12 e0 | ||
+ | aae7:12 e0 | ||
+ | b859:12 e0 | ||
+ | 3415c:12 e9 | ||
+ | 4e11f:12 e0 | ||
+ | 6bd5b:12 ed | ||
+ | 796f7:12 e0 | ||
+ | 7b877:12 e0 | ||
+ | 7d3df:12 e0 | ||
+ | 7e7e1:12 e0 | ||
+ | 7e7f5:12 e0 | ||
+ | 7ecf7:12 e0 | ||
+ | $ | ||
+ | </ | ||
+ | |||
+ | We can see variations in the lower 4-bits as it matches our desired pattern. | ||
+ | |||
+ | Finally, upper 4-bits can be anything, lower 4 must be 0xc, followed by 0x23: | ||
+ | |||
+ | <cli> | ||
+ | $ cat session-201302200614.raw | bgrep ' | ||
+ | 91c1:3c 34 | ||
+ | 29029:8c 34 | ||
+ | 297e5:0c 34 | ||
+ | 322d3:ec 34 | ||
+ | 6152b:dc 34 | ||
+ | 6a683:0c 34 | ||
+ | 6ef95:6c 34 | ||
+ | $ | ||
+ | </ | ||
+ | |||
+ | Notice in this last pattern, we opted not to space separate the pattern... it works either way (output will be space-separated regardless). | ||
+ | |||
+ | This will hopefully prove to be a useful tool in your binary analysis endeavors. | ||
=====Submission===== | =====Submission===== | ||
Successful completion will result in the following criteria being met: | Successful completion will result in the following criteria being met: | ||
- | | + | * When all is said and done, you will submit: |
- | * You have completed all weekly exercises (96, I think) before the deadline, being mindful of the intentionally-paced nature of urev. | + | * **udr2.text**, containing |
- | * Bonus opportunity: | + | |
- | | + | |
- | * **udr1.text** | + | |
- | * Append | + | |
- | * your bash script enabling the processing of data.file to produce gizmo | + | |
- | * Be sure to include comments indicating the reasoning behind actions taken | + | |
- | * Your extracted/ | + | |
====Submit==== | ====Submit==== | ||
Please submit as follows: | Please submit as follows: | ||
<cli> | <cli> | ||
- | lab46: | + | lab46: |
- | Submitting unix project "udr1": | + | Submitting unix project "udr2": |
- | -> udr1.text(OK) | + | -> udr2.text(OK) |
- | -> getgizmo.bash(OK) | + | |
- | -> gizmo(OK) | + | |
SUCCESSFULLY SUBMITTED | SUCCESSFULLY SUBMITTED | ||
- | lab46: | + | lab46: |
</ | </ |