Skip to content

Conversation

youngyangyang04
Copy link
Contributor

@youngyangyang04 youngyangyang04 commented May 21, 2016

operator ''>'' should be replace with ''>=' in 157 line number in nsmmongo.py
Describtion when user select a database to steal, there is a bug if user enter database number equal to the account of database plus one
leak test:
1-local
2-VASTTEST
3-admin
Select a database to steal: 56
Invalid selection.
Select a database to steal: 23
Invalid selection.
Select a database to steal: 4
Does this database require credentials (y/n)?

4 is a invalid number, but system accept it

Describtion when user select a database to steal, there is a bug if user enter database number equal to the account of database plus one
leak test:
1-local
2-VASTTEST
3-admin
Select a database to steal: 56
Invalid selection.
Select a database to steal: 23
Invalid selection.
Select a database to steal: 4
Does this database require credentials (y/n)?

4 is a invalid number, but system accept it
…)" out of the "if" statements, because if don't do this, the code in line number 174 will be not executed if user select the option that require credentials.

lead test:
Exception e is "local variable 'myDBConn' referenced before assignment". It indicates the code in line number 174 will be not executed if user select the option that require credentials.

After modification
Exception e is "command SON([('copydb', 1), ('username', 'youngyangyang04'), ('nonce', u'b9d5887c5f7cc17c'), ('fromdb', u'admin'), ('todb', u'admin_stolen'), ('key', u'dcfd7214988466b2f620809fd27015b4'), ('fromhost', '128.95.1.27')]) failed: unable to login { code: 18, ok: 0.0, errmsg: "auth fails” }"
So the code in line number 174 works
Because variable "myIP" should be set
@tcstool tcstool merged commit 0ff71dc into codingo:0.5 Jun 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants