Friday, December 11, 2009

curl Usage

Send a POST
curl -u joe:1234 -X POST http://localhost:8000/api/1.0/NU1yWdRM5JBjnZpZX/message/ -d "message=test"

-u = username and password
-d = post parameters
-X = request method

Send a POST using data from standard in:
echo "mykey=myvalue" | curl -X POST -d @-  https://mysite.com/

Show verbose output: 
curl -v http://mysite.com/

Ignore SSL key errors:
curl -k http://mysite.com/

Combining them: 
echo "TEST=1
TEST2=2
" curl -X POST -vk -d @- http://mysite.com/

Tuesday, December 08, 2009

netbios name lookups

Find NetBIOS name from IP
Windows:
netstat -a 192.168.1.22

Linux:
nbtstat 192.168.1.22 # ntbstat separate package

Find IP from NetBIOS name
Windows:
nbtstat -a host.example.com

Linux:
nmblookup host.example.com

http://www.irongeek.com/i.php?page=security/ipinfo