Crafting HTTP POSTs that contain XML

February 20th, 2009

An internal developer has been tasked with creating a communication system which will see an agent deployed to every machine enterprise-wide. The part of this system that facilitates communication is a web site running on an internal web server. The agents look to this site for communication addressed to their machine, and users can use the agent to send requests to the site.

At first glance, I wasn’t too concerned with the web site itself, because it didn’t seem there was much that could be done with it. After viewing similar sites, I could see that this was a page automatically generated by the development environment (.net or something?).

The page presents a list of supported operations. In this instance we have CreateRequest, and GetAlert. Clicking on either of these tells you EXACTLY what the site is expecting, in XML input. If only I could submit content without using the in-house developed agent..

At first I tried looking at a few Firefox extensions I’ve been meaning to try out such as HackBar and Tamper Data, but they did not understand XML elements.

Then I found this: http://snippets.dzone.com/posts/show/181
echo 'Some content.' | curl -X POST -H 'Content-type: text/xml' -d @- http://example.com/restapi

Using cURL, I could pipe XML content to it and effectively send this data to the URL that was expecting it. In one command I was able to add a request. In another, I was able to send communication to all hosts on the communication system.

The developer has since added authentication to this system.

Nmap and Ndiff Script

February 20th, 2009

Below is a bash script I made that will perform an nmap scan, compare the scan with the previous one using ndiff, and email the results. Naturally it will have to be run twice in order to get anything useful.

#!/bin/bash

SUBJECT=”Here are your Ndiff Results”
EMAIL=”xxx@blahblahblah.com”

cd /path_to_script_and_results_files/

# create OBSERVED file
date ‘+%Y-%m-%d-%H:%M’ > OBSERVED

# Run nmap
nmap -sS -sV –allports -oA `cat OBSERVED` -m `cat OBSERVED` 192.168.1.0/24

# Run ndiff between baseline and observed
ndiff `cat BASELINE`.xml `cat OBSERVED`.xml > `cat OBSERVED`.ndiff

EMAILMESSAGE=`cat OBSERVED`.ndiff

/usr/bin/mail -s “$SUBJECT” “$EMAIL” < $EMAILMESSAGE

# Create BASELINE file
cat OBSERVED > BASELINE

That’s my first bash script so it’s probably pretty gruesome to look at, but it does the trick.

Ndiff is not currently included in the stable version of nmap, but it is included in the nmap SVN repository. Simply download using the instructions here and call ndiff from the ndiff directory in the nmap SVN directory.

Windows 3.1 VM Loads in 0.5 Seconds

October 4th, 2008

Lack of network connectivity ends this experiment right here

Somewhere I found images of the Windows 3.1 installation floppies, so I decided to see how fast 3.1 loads in a virtual machine.

I thought this would be a simple task, until I realized there wasn’t much I could do with the 3.1 floppies until DOS was installed on something. I located DOS 6.22, installed it in a VM, then installed Windows 3.1 on top.

When the machine was done, Windows loaded in half a second. Lack of network drivers, however, ends the experiment right here.

Are Spammers Even Trying These Days?

September 19th, 2008

i meet and chat with yourwith billions of dollars of profits. None had done better than Im very hot woman, who is looking to meet you, or chat in skype with webcam!
my e-mail for you hot reply: (weird email address removed to protect .. the spammer?)

I want your answer! You bad lady

I’m finding this one really confusing. Is it about sex? Or some kind of financial deal?

Winamp Remote

March 30th, 2008

This year I’ve been really impressed with Nullsoft, makers of Winamp. This week I tried out Winamp Remote, and am now able to stream my audio and video from my computer to anywhere that has an internet connection.

winamptogologo.gif

Winamp Remote appears to be a branded Orb client, but having never tried Orb I can’t be certain. Regardless, it’s an easy way to remotely access audio and video content from your home computer.

An agent runs on your computer, that you will need to point at the location of your audio and video files. Then, from anywhere, login to the Winamp Remote website and browse your media in what appears to be a web-based Winamp client.

Winamp Remote (which is still in beta) supports a plethora of platforms, including the Wii and PS3, and even a mobile phone. After installing it, my PS3 automatically found the Winamp Remote server on my network. The client recognizes whether or not you are connecting from outside your local network, so it won’t use your internet connection if both client and server are in your house.

The streaming portion itself can be configured to stream in the following formats: Windows Media, Real Media (people still USE this?), Quicktime, Winamp, Flash Player. I tried out Windows Media and Flash. With Windows Media I experienced buffering, pixelation, and audio issues. Flash worked much better, and seemed to have better video quality, however seemed a bit too buggy for primetime. Attempting to pull the seek slider to a different part of the video, in either direction, either took too long to work, or didn’t work at all. I had hoped this would work like the YouTube player, as I’ve never seen this work properly using Windows Media or Quicktime streaming.

Regardless of the streaming method, viewing this content on anything but a computer monitor is not recommended, unless you’re really in a bind. The video quality is much like watching something slightly better than a YouTube video in full screen.

These issues aside, this is very easy solution to accessing your media remotely. Since it is beta, I’m wondering if AOL/Nullsoft will charge a fee to use it in the future. Depending on the cost (and my abilities to set something like this up myself) I might just pay for it.

Evil Tim Horton

March 26th, 2008

Overheard in the Tim Horton’s line:

“You know this coffee has nicotine in it??” “That sucks. I hate smokers”

I really have to bite my tongue when I hear obvious urban legends, but I understand how constantly correcting people I don’t know can make me seem like a total asshole. Anyways, this one has been disproved by Snopes.

So it’s all good then, right?

January 2nd, 2008

The SQLSERVERAGENT service depends on the MSSQLSERVER service which failed to start because of the following error:
The operation completed successfully.

Not a happy customer

November 12th, 2007

I found this personal message a user had sent me via our error-log messaging system.

EVENT # 7371689
EVENT LOG System
EVENT TYPE Warning
SOURCE IAS
EVENT ID 2
COMPUTERNAME [REMOVED]
TIME 11/9/2007 10:35:04 AM
MESSAGE User FUCK YOUR INTERNET was denied access.
Fully-Qualified-User-Name = [DOMAIN]\FUCK YOUR INTERNET
NAS-IP-Address = X.X.X.X
NAS-Identifier = [REMOVED]
Called-Station-Identifier = X.X.X.X
Calling-Station-Identifier = X.X.X.X
Client-Friendly-Name = [REMOVED]
Client-IP-Address = X.X.X.X
NAS-Port-Type =
NAS-Port =
Proxy-Policy-Name = [REMOVED]
Authentication-Provider = [REMOVED]
Authentication-Server =
Policy-Name =
Authentication-Type = Unauthenticated
EAP-Type =
Reason-Code = 8
Reason = The specified user account does not exist.
BINARY DATA 0000: 00 00 00 00

Dear User: Your complaint has been received, however due to the lack of technical details, and the inherent physical impossibility, we are unable to process your request. Your comments have been forwarded to the wireless network administrator so we can laugh about it.

This just in: a LOT of snow

December 8th, 2006

For the first time ever, the school is closed because of snow. It’s a good thing, too. It took two hours to dig my car out. It’s 4:45PM, and the plow still hasn’t shown up. I’m stranded in my own house!


That large mass to the right is a BBQ


Our landlord doesn’t shovel the steps


My car is free!

Halloween!

November 11th, 2006

It’s a little late but I thought I’d show off a few previous costumes, starting with the most recent, a banana!

Banana

Next year I plan to paint this costume brown and be a piece of shit.

Read the rest of this entry »