Author: Steve

Simple network test with client and server

This simple network trace shows the essential elements of a network interaction between a client and a server. For our test, we use the following for the client… import sys, socket, time remote_ip = socket.gethostbyname(socket.gethostname()) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #s.setsockopt(socket.IPPROTO_TCP,…

Spoofed IP network behaviour

In this case, we spoof the IP of our client to 192.168.1.101. When we do this, and send only a SYN packet to the server, we see the SYN on the client… [root@cmhlcarchapp02 ~]# python spoof.py 1 09:37:52.469226 IP 192.168.1.101.49999…

PowerShell for *nix people

PowerShell is becoming (has become) the replacement for VBScript on Microsoft operating systems. It is a fairly robust scripting language that I think most administrators will be happy to see. If you have a supported Microsoft operating system (i.e., not…

Connection Reset – What does it mean?

Generally, it indicates your client successfully connected to the server. A subsequent attempt to use the client connection failed after the server closed the socket, or had been disconnected for any reason. You can prove this with what is below,…

Great writeup on Linux memory management

…especially as it relates to committed memory… http://www.etalabs.net/overcommit.html int main() { void *m = malloc(6000*1024*1024); if (m) printf(“Memory allocation succeeded!\n”); else printf(“Memory allocation failed!\n”); //memset(m,0,2000*1024*1024); sleep(30); return 0; } [root@cmhlcarchapp01 ~]# sysctl -w vm.overcommit_memory=2 [root@cmhlcarchapp01 ~]# ./mem & [1] 7890…

SQL Server – querying active users by database

use master go declare @table table(         spid int,         status varchar(max),         login varchar(max),         hostname varchar(max),         blkby varchar(max),         dbname varchar(max),         command varchar(max),         cputime int,         diskio int,         lastbatch varchar(max),         programname varchar(max),        …