This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
B1N4RY's profile picture

Could i release program in Programs?

Started by B1N4RY, 22 April 2015 - 02:53 PM
B1N4RY #1
Posted 22 April 2015 - 04:53 PM
Hello,

i would like to ask if i could release my ComputerCraft program…
It's Remote Administration Tool or Remote Access Trojan simplier RAT.
I don't know if it can be marked as malicious or not so i want to ask…
I have GUI Client to control PCs running that program like rename, upload, download, shell command.
It works on Rednet.

Sincerely,
B1N4RY
Creator #2
Posted 22 April 2015 - 05:19 PM
I guess it is malicious.
SquidDev #3
Posted 22 April 2015 - 05:27 PM
It just sounds like a GUI version of NSH? A way to access computers remotely. I wouldn't say it is malicious. People could use it maliciously, but that is the case for most things.
B1N4RY #4
Posted 22 April 2015 - 05:41 PM
I have to say i made it with malicious idea (don't tell me that anyone could think of this app without thinking about malicious ideas) but it could be even usefull for remote help. I am working on RP Server and i am programming Floppy Disks to sell in electronics shop or black market on that Server.

So well, what could be verdict? Can i release it or is it considered as malicious?

And i would also like to ask if anyone could help me with List Clients… I just tried to do something like this
rednet.broadcast("rat:getList")
	local id,message = rednet.receive()
	if message == "online" then
		if fs.exists("online") == false then
			newFile = fs.open("online","w")
			newFile.close()
		end
		file = fs.open("online", "a")
		stringId = id
		print(stringId)
		file.write(stringId)
		file.close()
		
		local file = fs.open("online", "r")
		if file then
		  local i = 0
		  while file.readLine() do
			i = i + 1
		  end
		  file.close()
		end
	end

Explanation: It sends command rat:getList to computers (all connected) and if they reply back with online:{idofPC} then it writes them to file or just list them + count them. (That's what i tried to do)

This is client side (Receiving command)
elseif string.find(message, "rat:getList") then
			rednet.send(id, "online")
Anavrins #5
Posted 22 April 2015 - 05:44 PM
I have to say i made it with malicious idea (don't tell me that anyone could think of this app without thinking about malicious ideas) but it could be even usefull for remote help. I am working on RP Server and i am programming Floppy Disks to sell in electronics shop or black market on that Server.

So well, what could be verdict? Can i release it or is it considered as malicious?
I would say that, if there are efforts put into making it transparent, obfuscated, unremovable or hidden as much as possible, then it's malicious.
Although if there's a clear indicator that "this computer is being remotely controlled" then I guess it is okay, otherwise I don't think NSH would be available as a disk in CC…
Edited on 22 April 2015 - 03:46 PM
B1N4RY #6
Posted 22 April 2015 - 05:47 PM
Okay @Anavrins, thank you for explaining and also

And i would also like to ask if anyone could help me with List Clients… I just tried to do something like this
rednet.broadcast("rat:getList")
	local id,message = rednet.receive()
	if message == "online" then
		if fs.exists("online") == false then
			newFile = fs.open("online","w")
			newFile.close()
		end
		file = fs.open("online", "a")
		stringId = id
		print(stringId)
		file.write(stringId)
		file.close()
		
		local file = fs.open("online", "r")
		if file then
		  local i = 0
		  while file.readLine() do
			i = i + 1
		  end
		  file.close()
		end
	end

Explanation: It sends command rat:getList to computers (all connected) and if they reply back with online:{idofPC} then it writes them to file or just list them + count them. (That's what i tried to do)

This is client side (Receiving command)
elseif string.find(message, "rat:getList") then
			rednet.send(id, "online")
B1N4RY #7
Posted 22 April 2015 - 06:48 PM
Could anyone help with that code i posted? :(/>
KingofGamesYami #8
Posted 22 April 2015 - 06:58 PM
Well, the main problem I see is that you only receive one message. And you hang indefinitely if no message is received.

Try something along these lines:

local id = os.startTimer( 3 )
while true do
  local event = { os.pullEvent() }
  if event[ 1 ] == "rednet_message" then
    --#handle it
  elseif event[ 1 ] == "timer" and event[ 2 ] == id then
    --#we've waited 3 seconds
    break --#exit the loop
  end
end
B1N4RY #9
Posted 22 April 2015 - 07:20 PM
Wow, thank you so much. I successfully implemented that into my program… I will give you credits for helping me fix my code (if you would like to have credits)

I did thing to receive all clients once but i had problem with it freezing (forgot to break while).
valithor #10
Posted 22 April 2015 - 07:20 PM
Rednet.receive actually accepts a timeout option, so you could just do


rednet.receive(3) -- this will wait for 3 seconds, if it doesn't receive a message in that time it returns nil

If you want to know whether or not it timed out or received something check if the things it returned is nil.


edit:

Nvm I figured out what you were trying to do.
Edited on 22 April 2015 - 06:51 PM
B1N4RY #11
Posted 22 April 2015 - 08:07 PM
I know but it wouldn't help me in my script by any way… Or my other script when it froze