Hope everyone is aware of SQL Injection attacks. For people who are new, it is something about intruding in to your SQL Server (DB) by passing some commands through a request.
If the following (0x73656C656374206E616D652066726F6D207379732E6461746162617365733B) value is passed to the SQL Query, it will list all the DBs on the server. Something interesting. So whenever you get a request, check for it.
Here you can find wide variety of things about me. A small description about me, a computer programming obsessed guy thinking one day would come up like gates.
Showing posts with label SQL Server. Show all posts
Showing posts with label SQL Server. Show all posts
July 10, 2008
June 17, 2008
Service Broker - An Alternate to Messaging MS SQL Server
1. Enable Service Broker in the DB.
Use Master;
Go
ALTER DATABASE AdventureWorks SET ENABLE_BROKER;
go
2. Create Endpoint to send / receive messages from outside of SQL Server Instance.
- Create Endpoint with Port number and authentication level
Use Master;
go
CREATE ENDPOINT ExampleEndPoint
STATE = STARTED
AS TCP ( LISTENER_PORT = 3133)
FOR SERVICE_BROKER (AUTHENTICATION = WINDOWS KERBEROS);
go
Once Service Broker in STARTED state it will send /receive Messages. To stop either deacticate / pause
Use Master;
Go
ALTER ENDPOINT ExampleEndPoint
STATE = STOPPEDl
Go
To start again
Use Master;
Go
ALTER ENDPOINT ExampleEndPoint
STATE = STARTED
Go
3. TO Forward Message from One instance to another you need to have service endpoint started and follow the below syntax to Enable /disable forwarding. The Size mentioned is in MB
Use Master;
go
ALTER ENDPOINT ExampleEndPoint
FOR SERVICE_BROKER (MESSAGE_FORWARDING = ENABLED, MESSAGE_FORWARD_SIZE = 15);
go
Use Master;
go
ALTER ENDPOINT ExampleEndPoint
FOR SERVICE_BROKER (MESSAGE_FORWARDING = DISABLED);
go
4.Message Transport
BABP (Binary Adjacent Broker Protocol) and Dialog Protocol.
BABP - Basic message Transport, Bi-directional and multiplexed. Role to send messages.
Dialog - handles end to end communication and message ordering as a one-time-only in order delivery system. authenitcation and encryption is responsibility.
Steps to Create SErvice Borker:
1. Define Message Type and Validation
2. Define Contract
3. Create 2 queues sender and receiver
4. Create service and bind them to queue
5. Begin the conversation by sending messages.
Use Master;
Go
ALTER DATABASE AdventureWorks SET ENABLE_BROKER;
go
2. Create Endpoint to send / receive messages from outside of SQL Server Instance.
- Create Endpoint with Port number and authentication level
Use Master;
go
CREATE ENDPOINT ExampleEndPoint
STATE = STARTED
AS TCP ( LISTENER_PORT = 3133)
FOR SERVICE_BROKER (AUTHENTICATION = WINDOWS KERBEROS);
go
Once Service Broker in STARTED state it will send /receive Messages. To stop either deacticate / pause
Use Master;
Go
ALTER ENDPOINT ExampleEndPoint
STATE = STOPPEDl
Go
To start again
Use Master;
Go
ALTER ENDPOINT ExampleEndPoint
STATE = STARTED
Go
3. TO Forward Message from One instance to another you need to have service endpoint started and follow the below syntax to Enable /disable forwarding. The Size mentioned is in MB
Use Master;
go
ALTER ENDPOINT ExampleEndPoint
FOR SERVICE_BROKER (MESSAGE_FORWARDING = ENABLED, MESSAGE_FORWARD_SIZE = 15);
go
Use Master;
go
ALTER ENDPOINT ExampleEndPoint
FOR SERVICE_BROKER (MESSAGE_FORWARDING = DISABLED);
go
4.Message Transport
BABP (Binary Adjacent Broker Protocol) and Dialog Protocol.
BABP - Basic message Transport, Bi-directional and multiplexed. Role to send messages.
Dialog - handles end to end communication and message ordering as a one-time-only in order delivery system. authenitcation and encryption is responsibility.
Steps to Create SErvice Borker:
1. Define Message Type and Validation
2. Define Contract
3. Create 2 queues sender and receiver
4. Create service and bind them to queue
5. Begin the conversation by sending messages.
Subscribe to:
Posts (Atom)