writing a network discovery tool in Objective-C [closed] - objective-c

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I want to embark on a project for a CS class.
Can anyone provide insight on how to write a tool that will map out a network and state device info, IP info, open ports, etc.
I will be using OS X.

There's a few things you can use to discover the nodes on a network.
SNMP will help detect a few different network devices. Broadcasting an SNMP get request for sysName.0 will give you results from anything that responds to SNMP (even if they do not have a value for the OID). Some may be printers, some may be servers, some may be NAS etc. sysDescr.0 can also be used although for many network devices (in my experience) it returns the same value as sysName.0. Mac OS X comes with the NetSNMP libraries. Once you have received responses from SNMP agents, you can then send extra SNMP requests to further determine details about the device. There are human readable files that explain these in detail in /usr/share/snmp/mibs.
You can use a broadcast ping (your application will require root privileges to give you raw access to the Internet Protocol for constructing a broadcast ping packet, or a ping packet in general). Just broadcast a few packets and wait for replies. The source code to BSD's ping utility used in Mac OS X can be found at Apple's website. The ping executable is usually installed with owner root and with the setuid bit, meaning that the ping executable is run as root even when invoked by a non-root user (this is why non-root users can use ping). You'll notice though that in ping's source code it only creates the socket as root and then immediately drops its root privileges.
Zeroconf/Bonjour will also help. Have a look at Core Foundation's CFNetServices or Foundation's NSNetServices. Mac systems can be configured to publish themselves very easily. There are also Windows and Linux implementations but of course, these need to actually be running on the network devices before you can detect them with your program.
In order to determine what ports are open, you can simply run a loop over the desired port range and attempt to make a connection. Keep in mind though that many servers consider this an attack and will drop packets and perhaps even permanently blacklist your IP. Once you have made a successful TCP connection, you can look up the port number in the /etc/services file to determine the name of the service. This can be done using the POSIX function getnameinfo.

Related

In Browser SSH client [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I had the idea for an in-browser ssh client, but i couldnt find any detailed explanation on how to write a SSH client. I tried looking it up but i couldnt find anything(Most results were about Putty or rankings of clients).
One idea would be to write an express app on the server that just executes the command it gets by the URL paramater or something else, but
it wouldnt be very secure i guess
i got curious
I think it works similarly to a websocket. First you send a normal http request or something and then you try to "upgrade" the request to a ssh tunnel
How does http/ssh protocol work? couldnt help
Edit:
Any Keywords or links to articles about how to code your own SSH Client or server would help
Thanks
You may just tunnel your ssh connection through Web Socket.
The problems are how you build the functionality of ssh client if you want ssh connections start from local users.
To develop the client in browser(meanwhile in a site), the most works can only be done by JavaScript.
However, because of secure problems, JavaScript has lots of limits in contrast with normal local programs.
The another way you provide that execute commands on server is surely easy to do, but the problem is : how can I trust the web application and the server as I need to provide my private information?
If I can use mature ssh technology to 100% ensure my security, how do we make people believe that the ssh web application is totally safe and willing to use it?

Can I use a wifi router to connect a client computer software to another local computer without connecting the router to an internet connection? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
good day, may I ask if anyone knows if it's possible to connect two or three computers through a wifi router? It's hard to put it in one sentence so in detailed explanation, I would be making a software (java) in a main computer (I'll call it the server), another computer would then access the server through a client/server type of setup. Basically the computer (connected to the same wifi hot spot as the server) would access the software on the server either through php/jsp and utilize that software in an office setup wherein all the centralized data on the server is accessible to the connecting computer. I would put in a log-in screen first as standard practice to protect access to the server. I was hoping to ask if this is possible (since it's the same setup as using a LAN/wired connection in an office). If it's possible I'll try to research on how to do it (I heard I'll have to read more on sockets programming for this). If you need more detail on the scenario I would gladly provide it. Thank you for answers in advance.
*my next development goal would be to connect the server through a dial-up modem to connect to a remote computer connected to a dial-up modem as well. I'm trying to avoid internet connectivity to increase security problems and to make it more exclusive. Then maybe connect a couple of android tablets as well that is connected to the server for portability. so that would be around 2-3 computers connected to the server and a few portable tablets accessing the data. it would be great if anyone could point me in the direction for the first few steps on connecting the computer to the servers as well... right now I've already developed a java software that is working but it's only on the server and not connected to any router/computer at the moment.
Thanks again.
Yes, this is all perfectly possible. Your question however is in the wrong exchange. Stackoverflow is more for actual programming issues.

Embedded Linux file transfer using serial port (also used for shell) [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I would like to transfer files between my desktop (Ubuntu) and an embedded Linux. The problem is that the only communication between the desktop and the embedded system is using the serial port. This same serial port is used to login from the desktop into the embedded system using sh (over screen or putty).
If it helps, the embedded system is the AT91SAM9G20EK running Angstrom.
I appreciate any suggestions.
you may want to try one of the x/y/z-modem family protocols.
A free package is here:
http://ohse.de/uwe/software/lrzsz.html
And it is very likely that you also have a package for Angstrom.
To transfer a file, when connected to the embedded device you just start the program rz on the embedded linux.
Then, in the terminal on your development machine you start the zmodem protocol and send the file. Once the transfer is done, the rz program on the target machine stops, and you'll find the file in the current directory.
You might use PPP to create a TCP/IP connection over the serial link which will then allow multiple TCP/IP application layer protocols to be used simultaneously and transparently including FTP, Telnet, rsh or ssh

How Much RAM Should I Put On My Virtual Machine? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I am installing virtual box on my window
I will use it for anonymous web browsing and nothing else.
I will also install ccleaner on the VM.
The total Amount is 2GB.
How much ram should I put on my Virtual Machine?
Which version of window is the best for Anonymous Web Browsing?
Is linux a better option for anonymity web browsing?
Though i agree with above comments, it doesn't hurt to add some info. I take that you mean you have 2GB Ram in total.
First, the amount of ram required is proportional to how much you actually use it(VM) for and whether will you be using your primary machine in parallel or not.
For e.g. i have a 64 bit system windows 7 with 8 GB ram. I frequently use 1 linux VM in parallel with my host machine. So i have dedicated 2GB per VM. Though i have multiple VM's, it is almost guaranteed that i don't use two VM's simultaneously. However, i am extensively using VM + host together.
Now if you are going to do a lot of browsing, that probably means a lot of tabs, perhaps including you tube videos and stuff. Since your total is 2GB, i won't recommended allocating more than 512MB to your VM, unless you are willing to sacrifice your host performance for the time you are running VM.
Anonymous browsing has little to do with OS rather more important is browser or intermediate application. The only possible difference is for e.g. if you are using Linux and use an open source application such as
tor
which may or may not be available on windows. [Edit: just verified that tor does exist on windows too]
CCleaner is of no use if you are already using a common feature of FF/Ch/IE "Start private browsing". However, this does not leave any thing in your history and cache.
I also believe you are some what confusing anonymous browsing. Use of VM or CCcleaner refers to anonymity which is local to your machine i.e. if some one else uses your pc, he/she would not be able to track what you have been doing by ordinary means.
However, your real ip and request info is not hidden from your network in general. Using of Tor or some proxies etc. results in network anonymity where you leave no trace on a site which you have visited or perhaps that is blocked in your region.
Another thing is, if you have a 32bit machine / OS which is windows, it doesn't utilize more than 3GB ram in practice.
regarding ram: 0.5 gb should be enough but in any case virtual box recomends those values when you telling it what you about to install on the vm.
Windows 7 is best os I seen comming out from MS house till today especially in security.
IE9 private browsing can do what you ask for without a vm at all.

Access minecraft rcon server via putty [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I would like to manage Minecraft server by using built in rcon.
Problem is that the server doesn't return content.
open putty -> set address -> set port -> select ssh -> click open -> console opens, but its empty & i can't do anything.
The weird thing is that:
1. ports are open
2. in putty log shows this: Connecting to xxx.xxx.xxx.xxx port xxxxx
3. minecraft console inform that im connected to the rcon
so it looks that I'm connected, but nothing shows in putty console.
I tried this query tool and its work fine. If this tool can, why putty can't?
Thnx for any help.
You could try mcrcon which is specifically designed for Minecraft remote connections. Its quite easy to use and it supports bukkit console colors too.
Description from the website :
Description
Mcrcon is powerful IPv6 compliant minecraft rcon client with bukkit coloring support. It is well suited for remote administration and to be used as part of automated server maintenance scripts. Does not trigger "IO: Broken pipe" or "IO: Connection reset" spam bug on server side.
Precompiled binaries available for Windows (x86), Linux (x86) and Mac OS X (x86 / x86-64).
Features
IPv6 support.
Interactive terminal mode.
Support for Bukkit coloring on Windows and sh compatible shells.
Send multiple commands in one command line.
Silent mode. Does not print rcon output.
Does not cause "IO: Connection reset" spam on server side.
Designed to be used as part of the toolchain in server maintenance scipts.
Program homepage on Bukkit forums.
RCON is a specific protocol in the same way that SSH and Telnet are their own protocols. When you open a connection to Minecraft (or any application) running RCON - you need to talk RCON and not SSH / HTTP / Telnet.
You're currently (or were) trying to talk SSH to RCON, which won't work. If you change Putty to RAW mode, you could begin having a dialog with your Minecraft server, if you format your data packet correctly.
The Valve protocol is explained here
Depending on what your end goal is, there are protocol wrappers for various programming languages out there... Java, PHP, .NET - only a Google away