usb flash drive contents replaced with a single shortcut

659

I successfully removed it a few days back already. Though I just posted this one right now. Here is how I removed the backdoor from my computer.

http://blog.piratelufi.com/2013/02/usb-flash-drive-contents-replaced-with-a-single-shortcut/

Just realized that the question itself is not a very good question. It is something more of a topic for discussion. Thanks for the 'protection' though.

Share:
659
Bhavani Chandra
Author by

Bhavani Chandra

Updated on September 18, 2022

Comments

  • Bhavani Chandra
    Bhavani Chandra almost 2 years

    In this xml, I want to replace the <transfom> node with another node <message> but copy the data.

    Is it possible with xslt, I have used xslt 2.0 to covert the transform node to message node, but it only works for only one flow node.

    <root
        xmlns="http://www.example.com/something">
        <flow>
            <list name="listName"/>
            <router name="router"/>
            <!-- I have some other tags here -->
        </flow>
        <flow>
            <list name="listName"/>
            <console name="console"/>
            <!-- I have some other tags here -->
        </flow>
        <flow>
            <payload name="example"/>
            <transform name="transform">
                <!-- Some DATA here --->
            </transform>
            <!-- I have some other tags here -->
        </flow>
        <flow>
            <payload name="sada"/>
            <transform name="transform1">
                <!-- Some DATA here --->
            </transform>
            <!-- I have some other tags here -->
            <transform name="transform2">
                <!-- Some DATA here --->
            </transform>
        </flow>
    </root>
    

    The <transform> nodes are present in two <flow> nodes. Is there any way to write a generic XSLT, to replace the <transform> with <message> node maintaining the position of the nodes and the data inside the nodes.

    I have used <xsl:for-each> and <xsl:when> and xpath expressions such as preceding, following. But they only convert <transform name="transform node">, but copies all the other xml nodes as is. Please let me know how to resolve this!


    Update

    This is the stylesheet I have used for transforming the xml

    <xsl:stylesheet version="2.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <root>
            <xsl:for-each select="flow">
                <xsl:choose>
                    <xsl:when test="descendant-or-self::transform">
                        <message>
                            <xsl:attribute name="doc:name">
                                <xsl:value-of
                                            select="//transform/@name" />
                            </xsl:attribute>
                            <ee:message>
                                <ee:set-payload>
                                    <xsl:value-of select="payload" />
                                </ee:set-payload>
                            </ee:message>
                        </ee:transform>
                    </xsl:when>
                </xsl:choose>
            </xsl:for-each>
        </root>
    </xsl:stylesheet>
    

    Update 14/04/2019

    How to change the namespaces from the <root> tag? I have bunch of namespaces to change when transforming. How to do that?

    • Admin
      Admin over 11 years
      It is turned on and I am using windows. So as far as I know, hidden files in Linux (.foldername) will still be shown in windows. (like the .Trash-0001 folder)
    • Admin
      Admin over 11 years
      Maybe read up on this - irongeek.com/i.php?page=security/altds
    • Admin
      Admin over 11 years
      If that is the case, won't it be showing in the Explorer like desktop.ini:virus.exe instead of just desktop.ini? (assuming that desktop.ini contains the virus)
    • Admin
      Admin over 11 years
      If you have read the post, I already uploaded it and provided the link.
    • Admin
      Admin over 11 years
      start .\test.txt:note.exe did not work in win 7 it says that there is no program associated to perform the requested action. and indicates an access is denied in the command prompt
    • michael.hor257k
      michael.hor257k about 5 years
      Why don't you post your attempt so we can fix it, instead of having to write your code for you from scratch.
    • Bhavani Chandra
      Bhavani Chandra about 5 years
      @michael.hor257k I have added the stylesheet I did in the question. I'm quite new to xslt, I had experience using xsl:fo for converting xmls to pdf, but not xml to xml, and I'm new to XPath too!
  • deathlock
    deathlock about 11 years
    Damn, so it is a virus? I got this after plugging my flash drivce to a campus computer
  • That Brazilian Guy
    That Brazilian Guy over 10 years
    Please, avoid providing an answer that is just a link.
  • Alejandro
    Alejandro about 5 years
    Sorry but a don't see the benefits from ussing a sequence instead of a node-set, other that transforming a perfectly backward compatible stylesheet into an XSLT 2.0+ only stylesheet.
  • Martin Honnen
    Martin Honnen about 5 years
    Given that the question explicitly mentioned XSLT 2 and I had to use xpath-default-namespace="http://www.example.com/something" anyway I don't see why backwards compatible matters.
  • Alejandro
    Alejandro about 5 years
    Sorry, but xpath-default-namespace it's also not needed. I want to emphasize that overwriting the identity rule is a basic transformation design, thus the new xsl:mode instruction was introduced as you had well answered.
  • Bhavani Chandra
    Bhavani Chandra about 5 years
    @MartinHonnen Can you tell me, how to change the namespaces from the root. In the post I have only give one, but in my xml, I have more than 5 namespaces, along with xsl:schemaLocation.
  • Martin Honnen
    Martin Honnen about 5 years
    @BhavaniChandra, you will need to ask a new, separate question where you provide minimal but complete details of the XML input you have and the transformation result you want, together with the code you have, to demonstrate which issue you have.