{"issue":{"created_at":"2011-12-05T09:25:27Z","state":"closed","updated_at":"2011-12-05T09:25:48Z","user":{"gravatar_id":"5ba9f77b20f8ee7f7bab04ca792a5ea7","id":306256,"url":"https://api.github.com/users/passbe","avatar_url":"https://secure.gravatar.com/avatar/5ba9f77b20f8ee7f7bab04ca792a5ea7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"passbe"},"comments":4,"body":"<pre>I think though, that we maybe need a new constuct/function within\nbeefjs whereby a module can specify a &quot;lock&quot; such that it doesn't\nexecute twice?\n\nIn both the detect_tor and the vtiger module I've *hacked* this by\ncreating a non-existant image DOM element. When the module first\nexecutes it checks for that image, if it's present it stops running.\nEverywhere in the code where it sends back using beef.net.sendback\nI've also put in relevant code to remove that DOM element such that\nthe module can run again in the future.\n\nI think this process should probably be built into the framework, but\nI'm not entirely sure, and I'm not entirely sure if the image tag is\nthe best way for it to work?\n\nThe method I've used:\n\nSetup lock:\n 13         if (document.getElementById('vtigerimg')) {\n 14                 return &quot;Exploit running already&quot;;\n 15         }\n 16\n 17         var img = new Image();\n 18         img.setAttribute(&quot;style&quot;,&quot;visibility:hidden&quot;);\n 19         img.setAttribute(&quot;width&quot;,&quot;0&quot;);\n 20         img.setAttribute(&quot;height&quot;,&quot;0&quot;);\n 21         img.id = 'vtigerimg';\n 22\n 23         document.body.appendChild(img);\n\nRemove lock:\n 127       document.body.removeChild(document.getElementById('vtigerimg'));</pre><br>Original link: http://code.google.com/p/beef/issues/detail?id=186","assignee":null,"id":2447120,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"labels":[{"name":"imported","color":"ededed","url":"https://api.github.com/repos/passbe/beef-migration-test-2/labels/imported"},{"name":"Milestone-Release-0.4.2.1","color":"ededed","url":"https://api.github.com/repos/passbe/beef-migration-test-2/labels/Milestone-Release-0.4.2.1"},{"name":"Priority-Critical","color":"ededed","url":"https://api.github.com/repos/passbe/beef-migration-test-2/labels/Priority-Critical"},{"name":"Type-Defect","color":"ededed","url":"https://api.github.com/repos/passbe/beef-migration-test-2/labels/Type-Defect"}],"number":209,"title":"Module code should only run once (Module Lock)","html_url":"https://github.com/passbe/beef-migration-test-2/issues/209","closed_at":"2011-12-05T09:25:31Z","url":"https://api.github.com/repos/passbe/beef-migration-test-2/issues/209","milestone":null},"action":"created","comment":{"created_at":"2011-12-05T09:25:48Z","updated_at":"2011-12-05T09:25:48Z","user":{"gravatar_id":"5ba9f77b20f8ee7f7bab04ca792a5ea7","id":306256,"url":"https://api.github.com/users/passbe","avatar_url":"https://secure.gravatar.com/avatar/5ba9f77b20f8ee7f7bab04ca792a5ea7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"passbe"},"body":"wade@bindshell.net on January 17, 2011 11:13:45:<br><pre>Issue 50 has been merged into this issue.</pre><br>Original link: http://code.google.com/p/beef/issues/detail?id=186#c4","id":3013926,"url":"https://api.github.com/repos/passbe/beef-migration-test-2/issues/comments/3013926"}}