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

[WIP] services: mongodb: add mongodb service #357

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

IllIlIlIlI
Copy link
Contributor

No description provided.

@codecov-io
Copy link

codecov-io commented Jun 29, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@d738016). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #357   +/-   ##
=========================================
  Coverage          ?   41.61%           
=========================================
  Files             ?       78           
  Lines             ?     8810           
  Branches          ?        0           
=========================================
  Hits              ?     3666           
  Misses            ?     4719           
  Partials          ?      425
Impacted Files Coverage Δ
server/honeytrap.go 3.15% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d738016...157fa0a. Read the comment docs.

Copy link
Contributor

@nl5887 nl5887 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also support the mongo --ssl option?


answer := s.MongoDBHandler(port, b)

s.ch.Send(event.New(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you extract specific data in connection request, like username, password, application etc.

[service.mongodb]
type="mongodb"
version="2.5.1"
dbs=[ {Name="My_DB", SizeOnDisk="8192", Empty="false"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allowed usernames and passwords?

@nl5887
Copy link
Contributor

nl5887 commented Jun 29, 2018

When testing this I get:

$ mongo
MongoDB shell version v3.4.9
connecting to: mongodb://127.0.0.1:27017
2018-06-29T16:30:06.725+0200 E QUERY    [thread1] Error: Received a reply message with unexpected opcode: 2013 :
connect@src/mongo/shell/mongo.js:237:13
@(connect):1:6
exception: connect failed

@IllIlIlIlI
Copy link
Contributor Author

--ssl is not implemented yet.

@IllIlIlIlI IllIlIlIlI changed the title services: mongodb: initial commit [WIP] services: mongodb: initial commit Jul 13, 2018
@IllIlIlIlI IllIlIlIlI changed the title [WIP] services: mongodb: initial commit [WIP] services: mongodb: add mongodb service Jul 13, 2018
fn, ok := mapCommands[md.cmd]

if !ok {
log.Error("Error: command not implemented: %s", md.cmd)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to make an event here with the non existing command.

md.port = strconv.Itoa(port)

// ev := make(map[string]interface{})
ev := make(eventLog) // what's the difference?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

difference is that ev is of type eventLog now, otherwise it would be of type map[string]interface{}
This are two different types allthough they do the same.

defer conn.Close()

br := bufio.NewReader(conn)
port := conn.RemoteAddr().(*net.TCPAddr).Port
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could put port in mongodbService then it does not have to be passed around as function argument.

@kounelios13
Copy link

Hi this would be a nice addition to have. Is there anything we can do to get this request merged ?

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.

None yet

5 participants