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

need portscanner in cc

Started by schrolock, 11 September 2012 - 01:35 PM
schrolock #1
Posted 11 September 2012 - 03:35 PM
hey i would join a server where i have to hack into the enemy's system. but i would know which of the enemy systems are connected via rednet or wireless redstone. so it should can
  • option at the beginning if the scan woud be used directly or using a "Repeater"
  • have userdefined inputs for what PCs should be scanned.
  • send a command to the enemy computer and whait max. 4-5 seconds for respond before skipping to next.
  • if getting respond it should check how much acces is granted.
  • at the end it should show which PCs are accesible.
  • then it should save the connectible PCs in a sorted menu at another computer (number should be entered at the beginning) at direction: rom/portscan/accessible

and i need the repeater which can get the scanning options (if its choosed at the beginning) and ask if you would need another repeater or let it scan on itself and send it to the main computer.

at the end i need a system which can read the commands an messages which are send over the enemy PCs.
so it should ask me for the id of the PC which i would scan and then it should read every message/command which is send over it

sorry for the fails in text. its cause i am german and not very good in english.

PS: i know its forbidden to post this kind of skript here. but it would be nice if you give me a download link or send it to me via PM
Kilobyte #2
Posted 11 September 2012 - 05:52 PM
Actually it is not forbidden since you don't attack any computer. you just check which computers are connected to rednet.
i won't give you the exact code here but instead tips how to write it yourself
1. get input:
define a variable for each start and end of the range. then assign values you read from the console.
you can read a number with this code:
targetvariable = tonumber(read())
2. for loop to go thorough all computers within range:
for loops are explained in a very easy way here: http://lua-users.org/wiki/ForTutorial
3. within this loop you need to send some rednet data to the computer that has the same id as the loop counter.
sending data works with
rednet.send(id, data)
4. then you need to wait for an answer. there comes rednet.read() handy. it waits till you receive a rednet message. you can also define an timeout. more about this here: http://www.computercraft.info/wiki/index.php?title=rednet.read
5. output the id if it returned some data. you can either use print() or write(). the difference is that print makes a line break at the end.
6. end the loop.

thats it. reply when you don't understand something and i'll explain. but again i won't give you the solution code yet. you won't learn from that and coding is a lot more fun if you don't just copy others programs but write your own.

cheers, Stiepen aka. Kilobyte