Warning: UPDATE command denied to user 'decalaged'@'10.0.95.186' for table 'cache' query: UPDATE cache SET data = 'a:181:{s:13:\"theme_default\";s:7:\"garland\";s:13:\"filter_html_1\";i:1;s:18:\"node_options_forum\";a:1:{i:0;s:6:\"status\";}s:27:\"menu_secondary_links_source\";s:13:\"primary-links\";s:20:\"freelinking_nodetype\";s:4:\"book\";s:15:\"install_profile\";s:7:\"default\";s:17:\"node_options_page\";a:2:{i:0;s:6:\"status\";i:1;s:7:\"promote\";}s:12:\"comment_page\";s:1:\"2\";s:18:\"drupal_private_key\";s:64:\"5ee87c350e7817c1b567a72fe25b8f8100c218a6f384611866c69facc5d9dd5a\";s:19:\"file_directory_temp\";s:4:\"/tmp\";s:13:\"user_register\";s:1:\"0\";s:9:\"clean_url\";s:1:\"1\";s:21:\"filter_default_format\";i:1;s:19:\"filter_ in /homez.14/decalaged/www/drupal/includes/database.mysql.inc on line 128

Warning: INSERT command denied to user 'decalaged'@'10.0.95.186' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:1023:\"UPDATE command denied to user 'decalaged'@'10.0.95.186' for table 'cache_filter'\nquery: UPDATE cache_filter SET data = '<p>pyxswf is a script to detect, extract and analyze Flash objects (SWF files) that may be embedded in files such as MS Office documents (e.g. Word, Excel) and RTF, which is especially useful for malware analysis. It is part of the <a href=\\"oletools\\">oletools </a>package. pyxswf is an extension of <a href=\\"http://hooked-on-mnemonics.blogs in /homez.14/decalaged/www/drupal/includes/database.mysql.inc on line 128

Warning: INSERT command denied to user 'decalaged'@'10.0.95.186' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:7:\"warning\";s:8:\"%message\";s:97:\"array_map() [<a href=\'function.array-map\'>function.array-map</a>]: Argument #2 should be an array\";s:5:\"%file\";s:59:\"/homez.14/decalaged/www/drupal/modules/system/system.module\";s:5:\"%line\";i:1015;}', 3, '', 'http://www.decalage.info/en/comment/reply/80', '', '50.17.109.248', 1369380908) in /homez.14/decalaged/www/drupal/includes/database.mysql.inc on line 128

Warning: INSERT command denied to user 'decalaged'@'10.0.95.186' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:7:\"warning\";s:8:\"%message\";s:107:\"array_keys() [<a href=\'function.array-keys\'>function.array-keys</a>]: The first argument should be an array\";s:5:\"%file\";s:49:\"/homez.14/decalaged/www/drupal/includes/theme.inc\";s:5:\"%line\";i:1817;}', 3, '', 'http://www.decalage.info/en/comment/reply/80', '', '50.17.109.248', 1369380908) in /homez.14/decalaged/www/drupal/includes/database.mysql.inc on line 128

Warning: INSERT command denied to user 'decalaged'@'10.0.95.186' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:7:\"warning\";s:8:\"%message\";s:39:\"Invalid argument supplied for foreach()\";s:5:\"%file\";s:49:\"/homez.14/decalaged/www/drupal/includes/theme.inc\";s:5:\"%line\";i:1817;}', 3, '', 'http://www.decalage.info/en/comment/reply/80', '', '50.17.109.248', 1369380908) in /homez.14/decalaged/www/drupal/includes/database.mysql.inc on line 128
Reply to comment | Decalage

Reply to comment

  • user warning: UPDATE command denied to user 'decalaged'@'10.0.95.186' for table 'cache_filter' query: UPDATE cache_filter SET data = '<p>pyxswf is a script to detect, extract and analyze Flash objects (SWF files) that may be embedded in files such as MS Office documents (e.g. Word, Excel) and RTF, which is especially useful for malware analysis. It is part of the <a href=\"oletools\">oletools </a>package. pyxswf is an extension of <a href=\"http://hooked-on-mnemonics.blogspot.nl/2011/12/xxxswfpy.html\">xxxswf.py</a> published by Alexander Hanel.</p>\n<p>See the <a href=\"oletools\">oletools </a>page for more info.</p>\n<h2>pyxswf and xxxswf</h2>\n<p>pyxswf is an extension of <a href=\"http://hooked-on-mnemonics.blogspot.nl/2011/12/xxxswfpy.html\">xxxswf.py</a> published by Alexander Hanel. Compared to xxxswf, it can extract streams from MS Office documents by in /homez.14/decalaged/www/drupal/includes/cache.inc on line 109.
  • warning: array_map() [function.array-map]: Argument #2 should be an array in /homez.14/decalaged/www/drupal/modules/system/system.module on line 1015.
  • warning: array_keys() [function.array-keys]: The first argument should be an array in /homez.14/decalaged/www/drupal/includes/theme.inc on line 1817.
  • warning: Invalid argument supplied for foreach() in /homez.14/decalaged/www/drupal/includes/theme.inc on line 1817.

pyxswf - a python tool to extract SWF (Flash) objects from documents (improved xxxswf)

pyxswf is a script to detect, extract and analyze Flash objects (SWF files) that may be embedded in files such as MS Office documents (e.g. Word, Excel) and RTF, which is especially useful for malware analysis. It is part of the oletools package. pyxswf is an extension of xxxswf.py published by Alexander Hanel.

See the oletools page for more info.

pyxswf and xxxswf

pyxswf is an extension of xxxswf.py published by Alexander Hanel. Compared to xxxswf, it can extract streams from MS Office documents by parsing their OLE structure properly, which is necessary when streams are fragmented. Stream fragmentation is a known obfuscation technique, as explained on http://www.breakingpointsystems.com/resources/blog/evasion-with-ole2-fragmentation/

It can also extract Flash objects from RTF documents, by parsing embedded objects encoded in hexadecimal format (-f option).

For this, simply add the -o option to work on OLE streams rather than raw files, or the -f option to work on RTF files.

News

  • 2012-11-09 v0.02: Improved pyxswf to extract Flash objects from RTF (-f option)
  • 2012-10-09: Initial version of olebrowse and pyxswf
  • see changelog in source code for more info.

Download:

The archive is available on the project page.

Usage

Usage: pyxswf.py [options] <file.bad>

Options:
  -o, --ole             Parse an OLE file (e.g. Word, Excel) to look for SWF
                        in each stream
  -f, --rtf             Parse an RTF file to look for SWF in each embedded
                        object
  -x, --extract         Extracts the embedded SWF(s), names it MD5HASH.swf &
                        saves it in the working dir. No addition args needed
  -h, --help            show this help message and exit
  -y, --yara            Scans the SWF(s) with yara. If the SWF(s) is
                        compressed it will be deflated. No addition args
                        needed
  -s, --md5scan         Scans the SWF(s) for MD5 signatures. Please see func
                        checkMD5 to define hashes. No addition args needed
  -H, --header          Displays the SWFs file header. No addition args needed
  -d, --decompress      Deflates compressed SWFS(s)
  -r PATH, --recdir=PATH
                        Will recursively scan a directory for files that
                        contain SWFs. Must provide path in quotes
  -c, --compress        Compresses the SWF using Zlib

Examples

Example 1 - detecting and extracting a SWF file from a Word document on Windows:

C:\oletools>pyxswf.py -o word_flash.doc
OLE stream: 'Contents'
[SUMMARY] 1 SWF(s) in MD5:993664cc86f60d52d671b6610813cfd1:Contents
        [ADDR] SWF 1 at 0x8  - FWS Header

C:\oletools>pyxswf.py -xo word_flash.doc
OLE stream: 'Contents'
[SUMMARY] 1 SWF(s) in MD5:993664cc86f60d52d671b6610813cfd1:Contents
        [ADDR] SWF 1 at 0x8  - FWS Header
                [FILE] Carved SWF MD5: 2498e9c0701dc0e461ab4358f9102bc5.swf

Example 2 - detecting and extracting a SWF file from a RTF document on Windows:

C:\oletools>pyxswf.py -xf "rtf_flash.rtf"
RTF embedded object size 1498557 at index 000036DD
[SUMMARY] 1 SWF(s) in MD5:46a110548007e04f4043785ac4184558:RTF_embedded_object_0
00036DD
        [ADDR] SWF 1 at 0xc40  - FWS Header
                [FILE] Carved SWF MD5: 2498e9c0701dc0e461ab4358f9102bc5.swf

See also the article How to Extract Flash Objects From Malicious MS Office Documents, which shows how to use xxxswf.py in practice. You may simply use "pyxswf.py -o" instead of xxxswf.py.

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <b> <address> <blockquote> <br> <caption> <center> <code> <dd> <del> <div> <dl> <dt> <em> <font> <h2> <h3> <h4> <h5> <h6> <hr> <i> <img> <li> <ol> <p> <pre> <span> <strong> <sub> <sup> <table> <tbody> <td> <tfoot> <th> <thead> <tr> <u> <ul> <tr>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo].
  • Use [toc list: ol; title: Table of Contents; minlevel: 2; maxlevel: 3; attachments: yes;] to insert a mediawiki style collapsible table of contents. All the arguments are optional.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.

Warning: INSERT command denied to user 'decalaged'@'10.0.95.186' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:0:\"\";s:5:\"%file\";s:49:\"/homez.14/decalaged/www/drupal/includes/cache.inc\";s:5:\"%line\";i:109;}', 3, '', 'http://www.decalage.info/en/comment/reply/80', '', '50.17.109.248', 1369380908) in /homez.14/decalaged/www/drupal/includes/database.mysql.inc on line 128

Warning: INSERT command denied to user 'decalaged'@'10.0.95.186' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:368:\"INSERT command denied to user &#039;decalaged&#039;@&#039;10.0.95.186&#039; for table &#039;accesslog&#039;\nquery: INSERT INTO accesslog (title, path, url, hostname, uid, sid, timer, timestamp) values(&#039;Reply to comment&#039;, &#039;comment/reply/80&#039;, &#039;&#039;, &#039;50.17.109.248&#039;, 0, &#039;230276947a747dc8056ea673a38681c3&#039;, 1084, 1369380908)\";s:5:\"%file\";s:67:\"/homez.14/decalaged/www/drupal/modules/statistics/statistics.module\";s:5:\"%line\";i:64;}', 3, '', in /homez.14/decalaged/www/drupal/includes/database.mysql.inc on line 128

Warning: INSERT command denied to user 'decalaged'@'10.0.95.186' for table 'watchdog' query: INSERT INTO watchdog (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '%message in %file on line %line.', 'a:4:{s:6:\"%error\";s:12:\"user warning\";s:8:\"%message\";s:999:\"UPDATE command denied to user &#039;decalaged&#039;@&#039;10.0.95.186&#039; for table &#039;sessions&#039;\nquery: UPDATE sessions SET uid = 0, cache = 0, hostname = &#039;50.17.109.248&#039;, session = &#039;messages|a:1:{s:5:\\&quot;error\\&quot;;a:2:{i:0;s:80:\\&quot;user warning: in /homez.14/decalaged/www/drupal/includes/cache.inc on line 109.\\&quot;;i:1;s:465:\\&quot;user warning: INSERT command denied to user &amp;#039;decalaged&amp;#039;@&amp;#039;10.0.95.186&amp;#039; for table &amp;#039;accesslog&amp;#039;\\nq in /homez.14/decalaged/www/drupal/includes/database.mysql.inc on line 128