Ncrack just do nothing after launching command - nmap

I am pentesting my host using ncrack
I use such command ncrack -U login.txt -P pass.txt -iL ipList.txt -p 3389
After launching it shows me that ncrack has started and nothing happens.
What is the problem please help

This question should be on Security Stackexchange. Anyway, try to change 3389 for rdp.
You can try too removing the list using only one ip to test:
ncrack -vv -U login.txt -P pass.txt x.x.x.x:3389 where x.x.x.x is one of the ips of your list. With -vv you will see more verbose output to find out the error.
Are you sure your ips and/or hostnames on ipList.txt are accesible by network on tcp port 3389?
If not, it is a network problem.

Related

How to use port 5434 on main server for postgresql streaming replication

I am trying to do streaming replication between two postgresql servers. Main server is listening on port 5434 and I have to keep it so. When I run "pg_basebackup -h (main server ip) -D /var/lib/postgresql/13/main/ -U replicator -P -v -R -X stream -C -S slaveslot1" on replica server I get the follwing error:
"pg_basebackup: error: could not connect to server: Connection refused. Is the server running on host (main server ip) and accepting TCP/IP connections on port 5432?"
Almost all similar questions that I found in the web are dealing with some other problems as their main server is already using port 5432.
So, could you please let me know how I can keep port 5434 on main server and still run the above command for replication? Thanks in advance!
I was expecting the command to run normally and ask me for password.
I have changed the port to 5432 and in that case it works, so the command itself doesn't have mistakes in it.
But I don't know what/how I can do it if I am keeping port 5434.
You can either use the -p option of pg_basebackup, or you can set the PGPORT environment variable, or you can use the -d option with a connection string that contains port=5434.

Connect to postgresql server on OpenBSD

Hi I've been hitting my head against the wall for a while on this one and can't figure it out.
I'm trying to set up a postgresql server on my OpenBSD box and can't connect from outside.
Currently I've updated the following:
Added the following line to pg_hba.conf:
host all all 0.0.0.0/0 md5
Updated postgresql.conf listen addresses listenaddresses = '*'
Successfully restarted postgresql
Added the following line to pf.conf then restarted pf:
pass in on em0 proto tcp to any port 5432
Then to test I ran pg_isready -h 10.0.0.236 -p 5432. The response says 10.0.0.236:5432 - no response. My local address of my server on the network is 10.0.0.236. If I run pg_isready -h 127.0.0.1 -p 5432 it says accepting connections.
Could someone please help, I'm really confused here.
The issue was mistakenly editing /var/postgresql/postgresql/data/postgresql.conf over /var/postgresql/data/postgresql.conf. The previous was not the configured path, so all changes did not apply.

Memcached error: address already in use

When I run:
memcached -u nobody -l 0.0.0.0:11211,0.0.0.0:11212
it gives me the error:
Failed to listen on TCP port 11211: Address already in use
Any help would be appreciated.
Please try using 127.0.0.1 instead of using 0.0.0.0 as the IP address for accessing memcache
Try
memcached -u nobody -l 0.0.0.0:11211 && memcached -u nobody -l 0.0.0.0:11212

Unable to Bootstrap node using Chef

I've set up a basic Chef infrastructure that contains a workstation, a hosted Chef Server and an Ubuntu Server to serve as a node. I'm using this setup at my workplace and therefore a proxy is required for internet connections. I've made the necessary proxy settings in both knife.rb and the Ubuntu Server. Both the workstation and the node are properly connected to the internet.
Here's the problem - When I try to bootstrap this node using knife, I get the following error:
<My Node's IP> --2014-02-12 10:29:05-- https://www.opscode.com/chef/install.sh
<My Node's IP> Resolving www.opscode.com (www.opscode.com)... 184.106.28.91
<My Node's IP> Connecting to www.opscode.com (www.opscode.com)|184.106.28.91|:443... failed: Connection refused.
<My Node's IP> bash: line 83: chef-client: command not found
Please note that I used the following command to bootstrap the node -
knife bootstrap <My Node's IP> --sudo -x <username> -P <password> -N <name>
Can you please help me with this?
Thanks in advance.
After struggling on this for a long time I have finally found the answer.
In knife.rb another entry for bootstrap-proxy has to made as well.
knife[:bootstrap_proxy] = "http://username:password#proxy:port"
After doing this, run the following bootstrap command -
knife bootstrap <My Node's IP> --sudo -x <username> -P <password> -N <name>
This worked for me!
I have encountered the same problem. You just need to type the same thing with some extra commands:
knife bootstrap <My Node's IP> --sudo -x <username> -P <password> -N <name> --bootstrap-wget-options --no-check-certificate
It will work always.
In my case, I didn't added the server in client's hosts file entry. for example,
I got this error "Connection refused - Connection refused connecting to https://server.com/organizations/sample/nodes/node1"
I simple made an entry in "/etc/hosts" file with my server's IP and name i.e "server.com" and it worked for me.
vi /etc/hosts
192.168.159.100 server.com

How do I see if memcached is already running on my chosen port?

I am having some problems with memcached and one idea I am having is that perhaps it is already running on the port I am trying to run it on, started by some other user on our network. Is there a way to tell what memcached ports are currently in use?
To see if it is running you could also try telnetting into the port:
telnet localhost 11211
If this works you will see the following (telling you that the given port is open):
Connected to localhost.
Escape character is '^]'.
Now if memcached IS running you can see some basic stats by issuing the given command:
stats
If this fails you will know that memcached is not running.
Try
netstat -ap | grep TheChosenPort#
and see if anything is listening on those TCP or UDP ports.
netstat
In Linux, check via netstat, e.g.
$ sudo netstat -nap | grep memcached
tcp 0 0 127.0.0.1:11211 0.0.0.0:* LISTEN 5067/memcached
ps
Use ps to filter the processes:
$ ps wuax | grep memcache
497 5067 0.0 1.3 384824 53928 ? Ssl Apr11 1:28 memcached -d -p 11211 -u memcached -m 64 -c 1024 -P /var/run/memcached/memcached.pid -l 127.0.0.1
The port can be found next to -p, e.g. -p 11211. If port hasn't been specified, default is 11211.
Bash
You can send stats command to the given port and see if the memcached responds, e.g.
exec 3<>/dev/tcp/localhost/11211; printf "stats\nquit\n" >&3; cat <&3
Telnet
Use telnet to connect to the host and run stats (as above), e.g.
$ telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
stats
STAT pid 23669
STAT uptime 433859
Then hit Ctrl-] and Ctrl-D to finish.
Use the following command
ps -U user | grep -v grep | grep memcached
You can check memcached status
service memcached status
You will see a line like this at the bottom:
└─1560 /usr/bin/memcached -vv -m 64 -p 11211 -u memcache -l 127.0.0.1 -P /var/run/memcached/memcached.pid
The -p 11211 is what port it's running on.
If you're asking this question, it sounds like you're running a really old version. If you did this on a recent version, you'd see this:
% ./memcached
failed to listen on TCP port 11211: Address already in use