Wednesday, November 5, 2014

How to get the tables list in ms sql server that has the data



This query will help to see the data size details in tables of the MS SQL database.

SELECT 
    t.NAME AS TableName,
    s.Name AS SchemaName,
    p.rows AS RowCounts,
    SUM(a.total_pages) * 8 AS TotalSpaceKB, 
    SUM(a.used_pages) * 8 AS UsedSpaceKB, 
    (SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB
FROM 
    sys.tables t
INNER JOIN      
    sys.indexes i ON t.OBJECT_ID = i.object_id
INNER JOIN 
    sys.partitions p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id
INNER JOIN 
    sys.allocation_units a ON p.partition_id = a.container_id
LEFT OUTER JOIN 
    sys.schemas s ON t.schema_id = s.schema_id
WHERE 
    t.NAME NOT LIKE 'dt%' 
    AND t.is_ms_shipped = 0
    AND i.OBJECT_ID > 255 
GROUP BY 
    t.Name, s.Name, p.Rows
ORDER BY 
    t.Name

Retrieving source IP detail in WSO2 ESB and APIM



These properties will retrieve the respective source IP into the properties.


Remote host 

   <property name="client-host" expression="get-property('axis2', 'REMOTE_HOST')" />

Remote address 

   <property name="client-address" expression="get-property('axis2', 'REMOTE_ADDR')" />

X-Forwarded-For

   <property name="xforward-header" expression="$trp:X-Forwarded-For""/> />

Sunday, September 28, 2014

Connecting and monotoring JMX of WSO2 products in EC2 instance

Most of the time current deployments are hosted in EC2 instance as it is very reliable and scalable. When it come to monitoring the WSO2 products via jmx in EC2 instances. You have to add some parameters inorder to connect with it.


add below parameters in /bin/wso2server.sh


    -Dcom.sun.management.jmxremote \
    -Dcom.sun.management.jmxremote.port=XXXX \
    -Dcom.sun.management.jmxremote.ssl=false \
    -Dcom.sun.management.jmxremote.authenticate=false \
    -Djava.rmi.server.hostname=XXX.XXX.XXX.XXX \

Here port should be port that not used any where in the given instance and host-name should be private IP of the EC2 instances.


Access and monitor the server via Jconsole by JMX url connection that has the domain name and the jmx ports define in the carbon.xml  

Tuesday, August 26, 2014

List of "conditional content aware mediators" and "content aware mediators"

I have Listed down set of "conditional content aware mediators" and "content aware mediators"

conditional content aware mediator

fastXSLT
filter
header
log
property
switch

content aware mediators

bean
cache
callout
clone
command
conditional router
dblookup
dbreport
ejb
enrich
event
payloadfactory
script
spring
store
validate
xquery
xslt
iterate


How to log the Content-Type in WSO2 ESB


To identify the Content-Type in the mediation in wso2 esb.
Please refer to configuration given below. I have modified the sample given in the wso2 esb


Tuesday, August 5, 2014

How to search for installed Software in Ubuntu

Very simple way to identify your installed software in  you Ubuntu machine.

List all the installed software


dpkg --get-selections 

Find the specif software


dpkg --get-selections |grep 

Tuesday, July 22, 2014

Check the available Cipher providers and Cipher algorithms in Java Virtual Machine(JVM)

During the penetration test normally the ethical hacker will also evaluate all the aspects of the Java Virtual Machine(JVM). As a part of it they use to check the weak available ciphers out there in JVM.


Therefore, I have create a simple java code to list of all the available ciphers and their providers in the given Java virtual machine. Please find the code below in my Gist