{"action":"created","issue":{"url":"https://api.github.com/repos/viper-framework/viper/issues/406","labels_url":"https://api.github.com/repos/viper-framework/viper/issues/406/labels{/name}","comments_url":"https://api.github.com/repos/viper-framework/viper/issues/406/comments","events_url":"https://api.github.com/repos/viper-framework/viper/issues/406/events","html_url":"https://github.com/viper-framework/viper/pull/406","id":129011326,"number":406,"title":"Added 'ls' command and opening files by id","user":{"login":"vadimkotov","id":11969390,"avatar_url":"https://avatars.githubusercontent.com/u/11969390?v=3","gravatar_id":"","url":"https://api.github.com/users/vadimkotov","html_url":"https://github.com/vadimkotov","followers_url":"https://api.github.com/users/vadimkotov/followers","following_url":"https://api.github.com/users/vadimkotov/following{/other_user}","gists_url":"https://api.github.com/users/vadimkotov/gists{/gist_id}","starred_url":"https://api.github.com/users/vadimkotov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vadimkotov/subscriptions","organizations_url":"https://api.github.com/users/vadimkotov/orgs","repos_url":"https://api.github.com/users/vadimkotov/repos","events_url":"https://api.github.com/users/vadimkotov/events{/privacy}","received_events_url":"https://api.github.com/users/vadimkotov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-01-27T02:47:32Z","updated_at":"2016-02-02T15:19:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/viper-framework/viper/pulls/406","html_url":"https://github.com/viper-framework/viper/pull/406","diff_url":"https://github.com/viper-framework/viper/pull/406.diff","patch_url":"https://github.com/viper-framework/viper/pull/406.patch"},"body":"ls - allows you to list all the samples, it should be faster than 'find all' as it doesn't loop through the rows, but renders the table directly from the SQL rows.The point of this command is to view all the files stored including the file id. As a result I had  to also implement opening files by id. For people mostly working in console it should be  easier than copy-pasting hashes. \r\nIf needed I can re-do this pull and split it into several simpler requests as I know many people hate several features in one request."},"comment":{"url":"https://api.github.com/repos/viper-framework/viper/issues/comments/178629392","html_url":"https://github.com/viper-framework/viper/pull/406#issuecomment-178629392","issue_url":"https://api.github.com/repos/viper-framework/viper/issues/406","id":178629392,"user":{"login":"botherder","id":1032671,"avatar_url":"https://avatars.githubusercontent.com/u/1032671?v=3","gravatar_id":"","url":"https://api.github.com/users/botherder","html_url":"https://github.com/botherder","followers_url":"https://api.github.com/users/botherder/followers","following_url":"https://api.github.com/users/botherder/following{/other_user}","gists_url":"https://api.github.com/users/botherder/gists{/gist_id}","starred_url":"https://api.github.com/users/botherder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/botherder/subscriptions","organizations_url":"https://api.github.com/users/botherder/orgs","repos_url":"https://api.github.com/users/botherder/repos","events_url":"https://api.github.com/users/botherder/events{/privacy}","received_events_url":"https://api.github.com/users/botherder/received_events","type":"User","site_admin":false},"created_at":"2016-02-02T15:19:51Z","updated_at":"2016-02-02T15:19:51Z","body":"Actually, you can also open files by doing something like:\r\n\r\n```\r\nviper > find all\r\n+---+---------------------+-----------------------+----------------------------------+------+\r\n| # | Name                | Mime                  | MD5                              | Tags |\r\n+---+---------------------+-----------------------+----------------------------------+------+\r\n| 1 | kelihos.exe         | application/x-dosexec | e15e7d8f793aaaae40947e92cb57642b |      |\r\n| 2 | kelihos_recent2.exe | application/x-dosexec | bef5752a9159a169bc554b862435e07d |      |\r\n| 3 | kelihos_recent.exe  | application/x-dosexec | c0d1c2988c244ddb98505bbf2ba451e9 |      |\r\n+---+---------------------+-----------------------+----------------------------------+------+\r\nviper > open --last 1\r\n[*] Session opened on /home/nex/.viper/binaries/6/a/e/c/6aec74fb27b315fa04fc3621e0f4f858e68c2fe1d27724bd0514093b8ba2f703\r\nviper kelihos.exe >\r\n``` \r\n\r\nIn this case, it isn't properly the ID with which the file is stored in the database, but the Viper sessions maintains a list of all the entries from the results of the last `find` command, and with `open --last 1` you open the first entry from such results.\r\n"}}