tag:support.arachni-scanner.com,2012-07-01:/discussions/questions/12622-recovering-a-scan-that-was-deleted-in-web-uiArachni: Discussion 2015-10-24T15:28:07Ztag:support.arachni-scanner.com,2012-07-01:Comment/382816102015-10-23T19:30:35Z2015-10-23T19:30:35ZRecovering a scan that was deleted in Web UI<div><p>Are you trying to import scans (like from AFR reports) or the
previous DB?</p>
<p>If it's the latter you can try removing these <a href="https://github.com/Arachni/arachni-ui-web/blob/master/script/import#L10-L11">
2 lines</a> from the script at
<code>system/arachni-ui-web/script/import</code>.</p></div>Tasos Laskostag:support.arachni-scanner.com,2012-07-01:Comment/382816102015-10-23T20:20:51Z2015-10-23T20:20:53ZRecovering a scan that was deleted in Web UI<div><p>The latter - trying to import the previous DB of scans into an
updated instance. I tried your recommendation, but I don't see the
old scans in the new console.</p>
<p>What about recovering an accidentally deleted scan, is it
possible in any way? (even at the file system level?)</p></div>Alessandro Di Giuseppetag:support.arachni-scanner.com,2012-07-01:Comment/382816102015-10-24T02:18:11Z2015-10-24T02:18:11ZRecovering a scan that was deleted in Web UI<div><p>No unfortunately not, everything is in the DB.</p></div>Tasos Laskostag:support.arachni-scanner.com,2012-07-01:Comment/382816102015-10-24T02:28:57Z2015-10-24T02:28:57ZRecovering a scan that was deleted in Web UI<div><p>Bummer about deleted scans being unrecoverable.</p>
<p>Also, the previous DB import no longer throws the error, but it
doesn't seem to accomplish the task - the previous scans don't
appear in the new instance.</p>
<p>Thanks for the prompt responses!</p></div>Alessandro Di Giuseppetag:support.arachni-scanner.com,2012-07-01:Comment/382816102015-10-24T02:29:43Z2015-10-24T02:29:43ZRecovering a scan that was deleted in Web UI<div><p>Were you using PG or the default SQLite?</p></div>Tasos Laskostag:support.arachni-scanner.com,2012-07-01:Comment/382816102015-10-24T14:31:11Z2015-10-24T14:31:11ZRecovering a scan that was deleted in Web UI<div><p>Default SQlite DB; is there a log file generated by the import
script that might explain what is happening?</p>
<p>For the deleted scans, I tried browsing the DB with SQLite
Browser, but you're right, those scan entries are gone now. (I was
hoping they had just been removed from the index and that the data
entries would still be there)</p></div>Alessandro Di Giuseppetag:support.arachni-scanner.com,2012-07-01:Comment/382816102015-10-24T14:34:45Z2015-10-24T14:34:45ZRecovering a scan that was deleted in Web UI<div><p>No there's not, what output does it print?</p></div>Tasos Laskostag:support.arachni-scanner.com,2012-07-01:Comment/382816102015-10-24T14:46:19Z2015-10-24T14:46:20ZRecovering a scan that was deleted in Web UI<div><p>See <code>arachni_web_scan_import</code> script output
below:</p>
<pre>
<code>root@kali:/opt/arachni/bin# ./arachni_web_scan_import ../../arachni-1.3.1/
DEPRECATION WARNING: The configuration option `config.serve_static_assets` has been renamed to `config.serve_static_files` to clarify its role (it merely enables serving everything in the `public` folder and is unrelated to the asset pipeline). The `serve_static_assets` alias will be removed in Rails 5.0. Please migrate your configuration files accordingly. (called from block in <top (required)> at /opt/arachni/system/arachni-ui-web/config/environments/production.rb:22)
DEPRECATION WARNING: You did not specify a `log_level` in `production.rb`. Currently, the default value for `log_level` is `:info` for the production environment and `:debug` in all other environments. In Rails 5 the default value will be unified to `:debug` across all environments. To preserve the current setting, add the following line to your `production.rb`:
config.log_level = :info
. (called from block in tsort_each at /opt/arachni/system/usr/lib/ruby/2.2.0/tsort.rb:226)
Owner not specified.
root@kali:/opt/arachni/bin#</code>
</pre>
<p><strong>N.B.</strong> Afterwards, I ran the
<code>arachni_web_import</code> after this to import all settings,
and it seems to have fixed it. Originally, I wanted to import the
scans only, but it seems by importing all the settings, the scan
import issue was fixed in the process. (Fulfilled
pre-requisites/dependencies, I guess?)</p></div>Alessandro Di Giuseppetag:support.arachni-scanner.com,2012-07-01:Comment/382816102015-10-24T14:48:33Z2015-10-24T14:48:33ZRecovering a scan that was deleted in Web UI<div><p>No, <code>arachni_web_scan_import</code> imports a scan from an
AFR file, <code>arachni_web_import</code> imports the DB of the
package you specified.</p></div>Tasos Laskostag:support.arachni-scanner.com,2012-07-01:Comment/382816102015-10-24T15:00:13Z2015-10-24T15:00:14ZRecovering a scan that was deleted in Web UI<div><p>OK, my mistake; I thought it only imported the scan portion of
the DB, rather that the whole DB.</p>
<p>I see now on the GitHub page it's described clearly. I didn't
see anything at the CLI about AFR files when I was trying it
though.</p>
<p>Will RTFM more carefully next time.</p></div>Alessandro Di Giuseppetag:support.arachni-scanner.com,2012-07-01:Comment/382816102015-10-24T15:28:06Z2015-10-24T15:28:06ZRecovering a scan that was deleted in Web UI<div><p>No worries, it happens.</p>
<p>Cheers</p></div>Tasos Laskos