Hacker's Sandbox
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Hacker's Sandbox

Support and conversations related to playing "The Hacker's Sandbox" as found on Flying Monkey Army.


You are not connected. Please login or register

API: inNetDomain

2 posters

Go down  Message [Page 1 of 1]

1API: inNetDomain Empty API: inNetDomain Wed Mar 18, 2015 6:30 pm

damndam



Hi,

I really like THS. I'm trying to play with your API in order to create a mission pack.

I was interested in the inNetDomain() function, but it seems broken to me, returning true on every run.

Code:

newVM ("area6")
setProperty ({ ip = "1.1.1.1" })
addUser ( "m101", "area6" )
addFile ({ name = "/bin/check", exec="f_checkDomain", acl="777" })

newVM ("target")
setProperty ({ ip = "85.256.68.56", netd="contoso" })

function f_checkDomain()
  print("Your host: "..hostname())
  print(inNetDomain (hostname(), "contoso"))
  print(inNetDomain (hostname(), "foo"))
  print(inNetDomain ("target", "default"))
end

f_checkDomain returns:
Code:

Your host: area6
true
true
true

Is there a bug with this ?
I see the feature was not used in the Destiny pack (or I didn't understand it), can you explain to me the Domain concept you implemented ?

Thank you for game !

2API: inNetDomain Empty Re: API: inNetDomain Thu May 21, 2015 9:37 pm

unix-ninja


Admin

damndam wrote:Hi,
Is there a bug with this ?
I see the feature was not used in the Destiny pack (or I didn't understand it), can you explain to me the Domain concept you implemented ?

Hey, I am really sorry for the late reply. Apparently my notifications for new posts stopped working.

Anyway, thank you for reporting this. It turned out to be a subtle bug in the way the inNetDomain() function was pulling data off the Lua stack. I just patched this and uploaded a version 1.13, so you can test your code on that version and it will work as expected.

So here is the domain concept:
Essentially, a "network domain" in THS is much like a hybrid of subnets and VLANs. It provides isolation and class communication for hosts in the domain.

To illustrate this, let's say you have three hosts,

HostA is on domain "penguin"

HostB is on domains "penguin" and "oxen"

HostC is on domains "oxen" and "bird"

In the background, all of these domains get enumerated in the order that they are referenced (a "default" domain is automatically enumerated as 1). In this example, penguin becomes 2, oxen becomes 3, and bird becomes 4.

Since HostA and HostB are both on penguin, they can talk to each other, regardless of what IP address they are assigned (but they must have an IP address). However, HostA would not be able to talk to HostC.

Likewise, hosts HostB and HostC can talk to each other since they share oxen in common.

Using these domains, you could construct a challenge where the hacker would have to hop through a specific set of machines (potentially in a specific order if you wished) to progress.

Hopefully that helps; let me know if you need anything else!

https://hackersandbox.board-directory.net

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum