Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Fix: nops `generate` '-s' option ignored #12467

Merged
merged 2 commits into from Oct 25, 2019

Conversation

@nil0x42
Copy link
Contributor

nil0x42 commented Oct 18, 2019

This error was trying to parse the contents of undefined '-c' option instead of '-s'.
Making impossible the definition of SaveRegisters from the console.

Step to reproduce:
msfconsole -q -x 'use nop/x86/single_byte; generate -s esp 10; exit' | grep -v '0m' | tr -d '\n\\x+ ";' | rasm2 -b 32 -D -

0x00000000   1                       0e  push cs
0x00000001   1                       d6  salc
0x00000002   1                       54  push esp
0x00000003   1                       f8  clc
0x00000004   1                       43  inc ebx
0x00000005   1                       56  push esi
0x00000006   1                       5a  pop edx
0x00000007   1                       56  push esi
0x00000008   1                       5a  pop edx
0x00000009   1                       44  inc esp

As we can see, 'inc esp', and some 'push/pop' instructions have been generated although having explicitly asked to save esp register through generate command.

This commit addresses this issue

This error was trying to parse the contents of undefined '-c' option instead of '-s'.
Making impossible the definition of SaveRegisters from the console.

Step to reproduce:
`msfconsole -q -x 'use nop/x86/single_byte; generate -s esp 10; exit' | grep -v '0m' | tr -d '\n\\x+ ";' | rasm2 -b 32 -D -`
```asm
0x00000000   1                       0e  push cs
0x00000001   1                       d6  salc
0x00000002   1                       54  push esp
0x00000003   1                       f8  clc
0x00000004   1                       43  inc ebx
0x00000005   1                       56  push esi
0x00000006   1                       5a  pop edx
0x00000007   1                       56  push esi
0x00000008   1                       5a  pop edx
0x00000009   1                       44  inc esp
```
As we can see, 'inc esp', and some 'push/pop' instructions have been generated although having explicitly asked to save `esp` register through `generate` command.

This commit addresses this issue
@bwatters-r7

This comment has been minimized.

Copy link
Contributor

bwatters-r7 commented Oct 21, 2019

It looks like sanity testing got stopped halfway through.....
@msjenkins-r7 test this please

Co-Authored-By: Brendan <bwatters@rapid7.com>
@bwatters-r7 bwatters-r7 self-assigned this Oct 25, 2019
bwatters-r7 added a commit that referenced this pull request Oct 25, 2019
Merge branch 'land-12467' into upstream-master
@bwatters-r7 bwatters-r7 merged commit d7b629c into rapid7:master Oct 25, 2019
3 checks passed
3 checks passed
Metasploit Automation - Sanity Test Execution Successfully completed all tests.
Details
Metasploit Automation - Test Execution Successfully completed all tests.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@bwatters-r7

This comment has been minimized.

Copy link
Contributor

bwatters-r7 commented Oct 25, 2019

Release Notes

This PR fixes a bug where the flag to save the integrity of a register was the wrong character.

@busterb busterb added the msf5 label Oct 25, 2019
@nil0x42 nil0x42 deleted the nil0x42:patch-1 branch Oct 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.