Changes

Jump to navigation Jump to search
999 bytes removed ,  21:14, 8 December 2016
→‎Infecting: fix according to latest git
Line 71: Line 71:  
Infecting the victim with a parasite blob needs some special treatment.
 
Infecting the victim with a parasite blob needs some special treatment.
   −
First, the <code>ctl</code> should be configured with the blob information. Currently there is only one type of blobs, generated by <code>compel hgen</code>. To put this info into ctl, one should call <code>compel_parasite_blob_desc(ctl)</code> to get a pointer on <code>struct parasite_blob_desc</code> and fill in the fields of this strucure:
+
First, the <code>ctl</code> should be configured with the blob information. For that,
 
+
you should call <code>''PREFIX''_setup_c_header()</code> function,
* <code>.parasite_type</code> should be set to <code>COMPEL_BLOB_CHEADER</code>
+
where <code>''PREFIX''</code> is the same as the argument given to
* <code>.hdr.mem</code> should be set to the <code>parasite_blob</code> of hgen
+
<code>-p</code> option to <code>compel hgen</code>.
* <code>.hdr.bsize</code> should be set to the sizeof(this symbol)
  −
* <code>.hdr.nr_gotpcrel</code> should be set to the <code>parasite_nr_gotpcrel</code> of hgen
  −
* The following three offsets should be set to respective offsets generated with the <code>parasite_sym</code> value
  −
** <code>.hdr.parasite_ip_off</code> to <code>COMPEL_H_PARASITE_HEAD(parasite_sym)</code>
  −
** <code>.hdr.addr_cmd_off</code>  to <code>COMPEL_H_PARASITE_CMD(parasite_sym)</code>
  −
** <code>.hdr.addr_arg_off</code>  to <code>COMPEL_H_PARASITE_ARGS(paraste_sym)</code>
  −
* <code>.hdr.relocs</code> should be set to <code>parasite_relocs</code> argument (it's an array)
  −
* <code>.hdr.nr_relocs</code> should be set to a number of elements in this array (<code>sizeof(arr)/sizeof(arr[0])</code>)
      
Second, when infecting a parasite one should specify the amount of threads it will mess with (1, if only the thread leader will be accessed) and the maximum size of the memory area shared between infecting task and parasite used for arguments/result passing.
 
Second, when infecting a parasite one should specify the amount of threads it will mess with (1, if only the thread leader will be accessed) and the maximum size of the memory area shared between infecting task and parasite used for arguments/result passing.

Navigation menu