diff --git a/c2/templates/client.html.tera b/c2/templates/client.html.tera index faa21e3a7bd804f379ae6866d0cebb1aa9310447..d99ceea9797ff9af2ddf11bae54a4c5c0eec1421 100644 --- a/c2/templates/client.html.tera +++ b/c2/templates/client.html.tera @@ -1,41 +1,48 @@ {% extends "base" %} {% block content %} - <a href="/newcommand/{{id}}"> Commands </a> - <div> - <h3>Info from client @ {{client}}</h3> - <div class="card"> - <ul class="list-group list-group-flush"> - <li class="list-group-item"><b>Adresse :</b> {{info.socket_addr}}</li> - <li class="list-group-item"><b>Username :</b> {{info.username}}</li> - <li class="list-group-item"><b>Hostname :</b> {{info.hostname}}</li> - <li class="list-group-item"><b>OS :</b> {{info.distrib}}</li> - <li class="list-group-item"><b>Kernel :</b> {{info.kernel}}</li> - </ul> - </div> - <h3>Open Ports</h3> - <div> - <table class="table" id="ports" name="ports"> - <thead> - <tr> - <th scope="col">Port</th> - <th scope="col">Protocol</th> - </tr> - </thead> - <tbody> - {% for port in ports %} - <tr> - <th scope="row">{{port.port}}</th> - <td class="mw-20">{{port.protocol}}</td> - </tr> - {% endfor %} - </tbody> - </table> + <div class="mt-4" style="text-align:center"> + <h2>Info from client @ {{client}}</h3> + <a href="/newcommand/{{id}}" class="m-2 mb-4 text-center btn btn-secondary active" role="button" aria-pressed="true" > Commands </a> + </div> + <div class="mx-auto w-75 border p-5" > + <div class="row"> + <div class="col"> + <h3 style="margin-bottom:90px">System Info</h3> + <div class="card" > + <ul class="list-group list-group-flush"> + <li class="list-group-item"><b>Adresse :</b> {{info.socket_addr}}</li> + <li class="list-group-item"><b>Username :</b> {{info.username}}</li> + <li class="list-group-item"><b>Hostname :</b> {{info.hostname}}</li> + <li class="list-group-item"><b>OS :</b> {{info.distrib}}</li> + <li class="list-group-item"><b>Kernel :</b> {{info.kernel}}</li> + </ul> + </div> + </div> + <div class="col"> + <h3>Open Ports</h3> + <table class="table" id="ports" name="ports"> + <thead> + <tr> + <th scope="col">Port</th> + <th scope="col">Protocol</th> + </tr> + </thead> + <tbody> + {% for port in ports %} + <tr> + <th scope="row">{{port.port}}</th> + <td class="mw-20">{{port.protocol}}</td> + </tr> + {% endfor %} + </tbody> + </table> + </div> </div> </div> - <h3>Data sent</h3> - <div> - <table class="table"> + <h3 class="mt-5" style="text-align:center">Data sent</h3> + <div class="w-75 mx-auto mt-2"> + <table class="table" id="data"> <thead> <tr> <th scope="col">Id</th> @@ -60,5 +67,6 @@ <script src="/static/datatables/datatables.min.js"></script> <script> new DataTable('#ports'); + new DataTable('#data'); </script> {% endblock scripts %} \ No newline at end of file diff --git a/c2/templates/clients.html.tera b/c2/templates/clients.html.tera index 9898d3dc258294722dd111ca7791136ef4b53d65..223ada518d9e01e6655bb646557ebb01d8fb1b9d 100644 --- a/c2/templates/clients.html.tera +++ b/c2/templates/clients.html.tera @@ -1,8 +1,8 @@ {% extends "base" %} {% block content %} - <h2>Registered clients</h2> - <div> - <table class="table"> + <h2 class="m-4">Registered clients</h2> + <div class="w-75 mx-auto mt-5"> + <table class="table border"> <thead> <tr> <th scope="col">Id</th> @@ -16,20 +16,9 @@ <tr> <th scope="row">{{client.id}}</th> <td>{{client.address}}</td> - <td><a href="client/{{client.id}}"> Data </a></td> + <td><a href="client/{{client.id}}" class="btn btn-secondary active" role="button" aria-pressed="true"> Data </a></td> <td> - <form action="/newcommand" method="post"> - <label for="command">Choose a command :</label> - <select id="command" name="command"> - {% for c in commands %} - <option value="{{loop.index}}">{{c}}</option> - {% endfor %} - </select> - <input type="text" placeholder="Option" name=option/> - <input name="client_id" type="hidden" value={{client.id}} /> - <input type="submit" /> - </form> - <a href="/newcommand/{{client.id}}"> Commands </a> + <a href="/newcommand/{{client.id}}" class="btn btn-secondary active" role="button" aria-pressed="true"> Commands </a> </td> </tr> {% endfor %} diff --git a/rat/src/errors.rs b/rat/src/errors.rs index 27f04b0a350cdf47211736fdcb44d176d1cf1feb..1b6647c4b9e8d3eff7bd5c600e916c62804332cb 100644 --- a/rat/src/errors.rs +++ b/rat/src/errors.rs @@ -35,7 +35,6 @@ impl fmt::Display for ClientError { Self::InvalidHeader(e) => write!(f,"Error setting custom header : {:?}", e), Self::SysinfoError(e) => write!(f, "Error sending data : cannot get info from system : {}", e), Self::OtherError => write!(f, "Error sending data : not specified") - } }