I'm surprised there isn't already an answer for this. Maybe it's so obvious no one needs to ask.
This is the issue. I have a web server running on Ubuntu 16.04 on AWS, it takes orders. When an order comes in it has to be printed on a printer located in an office. The printer is a modern enterprise HP printer. So all features are available.
I can set up the printer drivers on a local Ubuntu machine (desktop but tested via ssh command line), then
sudo hp-setup -i
can find the local network printer and configure the drivers. So I can then do
lp some_file.pdf
and it works!!! But...
The remote server on AWS obviously can't find the printer in the office. So plain
sudo hp-setup -i
doesn't work. I've opened up port 9100 on our WAN interface (Draytek), and allowed it to receive connections only from the remote AWS server. But when I try
sudo hp-setup -i my_ip_address
or
sudo hp-setup -i --port=9100 my_ip_address
It returns a stack of errors which scroll off the screen. Starting with
HP Linux Imaging and Printing System (ver. 3.16.3)
Printer/Fax Setup Utility ver. 9.0
Copyright (c) 2001-15 HP Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.
(Note: Defaults for each question are maked with a '*'. Press <enter> to accept the default.)
MIB search path: /home/ubuntu/.snmp/mibs:/usr/share/snmp/mibs:/usr/share/snmp/mibs/iana:/usr/share/snmp/mibs/ietf:/usr/share/mibs/site:/usr/share/snmp/mibs:/usr/share/mibs/iana:/usr/share/mibs/ietf:/usr/share/mibs/netsnmp
Cannot find module (SNMPv2-MIB): At line 0 in (none)
Cannot find module (IF-MIB): At line 0 in (none)
Cannot find module (IP-MIB): At line 0 in (none)
Cannot find module (TCP-MIB): At line 0 in (none)
Cannot find module (UDP-MIB): At line 0 in (none)
Cannot find module (HOST-RESOURCES-MIB): At line 0 in (none)
and so on.....
I'm pretty sure this is a common issue, but I can't find a similar question with the answer.
Please don't say 'use HP Eprint' or 'Use Google Cloud Print'. We're already using HP Eprint and it's very very unreliable, which is why I'm researching alternatives. Google Cloud Print is not easy to configure to print from a command line or from within a web app.
I need to know how to configure things so the remote AWS server can talk to the office printer.
Related
This is related to this question: How to Capture Remote System network traffic?
I would like to be able to export live traffic captured on a Linux server and to view that in real time on my Windows machine.
Please do not suggest SPAN or RSPAN because it does not apply to my needs. This is about internal traffic (VM traffic) that tshark can see without any problems, I would just like to watch the traffic on my desk (Windows machine) with Wireshark
You should use the tool rpcapd in the machine (A) that you want to capture the traffic:
rpcapd -n -p <port>
With -n is launched without authentication
Finally, in the other machine (B) go to Wireshark > Capture > Interfaces > Options > Manage Interfaces > Remote Interfaces
And you should see the traffic of Machine (A)
I think that the only viable way to do it is to use Wireshark with X11 remote desktop. VNC may also work but you don't really use the Windows System resources to display the results, everything is still processed on the Linux server.
I have a server and I know that there is an Informix installed on it, but I don't know who installed it. There is closed source client connecting to this server but I cannot get anything about it apart from username and password. I have no idea how to connect it, I don't know what would be the port number and server name of it. I have downloaded SQuirreL with JDBC Informix drivers.
How can I connect to JDBC Informix server without knowing the port and server name?
In short, you will need the port number, server name (and database name as well) to connect to Informix.
Assuming that you have permissions to hunt around on the box where Informix is installed, there are a few places where the details about your Informix server are likely to be found. Since I don't see any details as to the platform on which IDS (Informix) is installed in your case, I'll try to provide info for both Unix and Windows platforms. But first, a bit of background:
There are not too many parameters needed to set up a connection to Informix. Typically, all you would need are:
username
password
Server IP Address
Port
Server Name (the name of the Informix instance)
Database Name (the name of the db on [Server Name] to which you want to connect)
It sounds like you need to find out the last three.
Linux:
On a Linux platform (as well as Windows, I believe), there are environment variables that point the way to where on your system Informix is installed. The most important of these is %INFORMIXDIR%, which points to the root directory of your Informix installation. A lot of the time however, Informix is installed in /opt, so try there.
In %INFORMIXDIR%/etc on typical installs is a file called sqlhosts (it may have a suffix for your specific server instance, but it'll start with sqlhosts). In this file is the server name, and possibly the port number. %INFORMIXDIR%/etc/sqlhosts contains plaintext data in the following format:
ServerName NetType HostName Port/ServicesName
The first value is the server name you seek. The fourth value (Port/ServicesName) is either the port number, or the name of the entry in /etc/services which references the port number. If you don't see a port number, look in /etc/services.
For example, sqlhosts will probably contain something like this:
myservername onsoctcp informix.mydomain.com 12345
In this case, your server name is "myservername" and the port is 12345
Alternatively, it could look like this:
myservername onsoctcp informix.mydomain.com informixservice
in which case you would have to go look in /etc/services for a line that says
informixservice 12345/tcp
which will tell you the port.
Windows
Caveat: I've never dealt with Informix servers installed on Windows, however based on the IBM documentation, it doesn't seem much different in regards to the task at hand.
Instead of the file %INFORMIXDIR/etc/sqlhosts, the information you seek is contained in the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\INFORMIX\SQLHOSTS
Use regedit.exe to read the values stored in this entry.
If you don't find a port number in that reg key, the Windows equivalent of Unix's /etc/services file is
C:\Windows\System32\drivers\etc\services
Examine this file with a text editor (notepad works fine).
Hopefully this helps. Good luck.
*Short answer: You can not .*
This kind of situation involves security issues , so , the database doesn't "publish" it self at your network for everyone knows it's there.
If you need discovery without contact the administrator of your (your?) environment, will need to use hackers techniques (nmap utility already help here) to discover some informations (IP, Port) and you still missing informations like servername, protocol ,username and password.
Just caution, because attempt of connection at Informix database listener will be logged.
Now, if you have access at the server where the database is you can look for sqlhosts file and get all this.
Another alternative, more reasonable is just ask to your DBA/Admin the configurations justifying why you want the access.
You CAN find servers on a host:
onstat -g dis
will listed servers even if they are offline (or potentially decommissioned).
Server information is in /INFORMIXTMP on UNIX/Linux and I would expect a simlar folder under C:\ in Windows.
You should add more information about working environment: what platform your client is, what platform your server is, do you have access to server machine etc.
If you know that something from your computer connects to other machine then you can use netstat to discover it. If you work on Linux then there is -p option that shows pid and application name to each connection.
At first we have to discover pid of closed source client:
[root#test1 ~]# ps aux | grep my_app
root 12457 0.0 3.2 3342440 333336 ? Sl Mar06 21:01 java -cp /usr/local/bin/my_app...
Now when I know pid I can use netstat:
[root#test1 ~]# netstat -tnp | grep 12457
tcp 0 0 ::ffff:169.0.1.71:55850 ::ffff:169.0.1.74:9088 ESTABLISHED 12457/java
From this output I can see that Infomix probably works on port 9088 of 169.0.1.74 machine.
On Windows you can use TCPView from SysInternals to see similar things.
On Windows you can also check ODBC Data Source Administrator (both 32 and 64 bit) to see if there is Informix driver in use.
I've been using Wireshark for a while now to analyze a few programs. Is there a way that I can limit Wireshark to sniff only one program? Or is there another program that does something like this?
tracedump is an open source packet sniffer available for Linux, which can do exactly what was asked in the original question; it's free.
Using Wireshark you can filter by destination port number or IP address. For example, Mail clients usually use ports 25 and 110 for sending and receiving emails.
If you are sniffing a web application, you should try to use HttpFox, which is a Firefox plugin. It only show net traffic from the current website.
Are you looking for Windows or mac...?
If Windows then the answer is yes.You can use Microsoft Network Monitoring tool..
But for mac i did not find any useful tool yet...am still searching...
In mac OS X you can use the following command and that will give you the list of ports used by the application.
lsof -i |grep firefox|grep Established|awk -F "[ :]*" '{print $10}' |cut -c 1-5 >>/Users/..../Desktop/name.txt
Use these ports to filter the wireshark pcap...
Done...!
Alright, I was tasked to develop a Windows Service that listens to a directory for files that are dropped in it, read them, delete them and print out a report.
I installed the service on my work laptop (Win 7 x86) and a test machine (XP x86) under a User account at first. It would do everything as it should except the print the report. No errors, nothing. Then I made it run under Local System and it produced a "No printers found" exception.
Converting the app to a Console Application and running on these machines gave the desired result. OK, so now I was assuming that there are security "stuff" involved.
Then I installed the service on a Server 2008 x64 machine (under Local System) and it just worked. Can anybody explain to me why this is happening? Why does the service allow printing from Server OS but not from a Desktop OS or am I missing something very obvious?
I'm guessing that the printers are installed locally on the server but installed as network printers on the desktop. Local System only have access to local printers.
I am investigating a production system where there are several Windows services communicating with each other through TCP/IP sockets. I'm trying to figure out which executable is listening to which IP address and which port on a given machine.
Other than rummaging through each windows service's obscure configuration files, is there a system tool that can more easily give me the details I want?
As already mentioned TCPView by SysInternals (i.e. Microsoft) is a great tool.
But on production systems you may not be allowed to install additional software, so I think you may want to try out netstat.exe, which is typically located at C:\WINNT\system32\netstat.exe .
A help page is available with
netstat -?
Examples are:
netstat -a
Lists all local TCP connections and listening ports together with remote TCP endpoint.
netstat -o
Adds the process ID to the output.
netstat -b
Gives you the name of the executable wich was involved in establishing this connection/port.
http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx
SysInternals TCPView is great
Give this a whirl.
netstat -abn
Command line netstat tool might help you. To learn available parameters run it with /?: netstat /?
Or there is a better GUI alternative: SysInternals TcpView (freely downloadable from ms site)
Thanks everyone. Very helpful indeed. A friend also introduced me to a freeware utility called "Active Ports" from DeviceLock: http://www.devicelock.com/freeware.html/