summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHåkon Nessjøen <haakon.nessjoen@gmail.com>2010-09-26 21:28:30 +0200
committerHåkon Nessjøen <haakon.nessjoen@gmail.com>2010-09-26 21:28:30 +0200
commitdb4ec3f49051dbd35e2274a0cd1c93193d4511ae (patch)
tree5039099edcccd2ce909e5c2b53049df1069fa391
parent52ac09faa8fdd5d25b02f310ca6b2c497b45806d (diff)
downloadMAC-Telnet-db4ec3f49051dbd35e2274a0cd1c93193d4511ae.tar.gz
MAC-Telnet-db4ec3f49051dbd35e2274a0cd1c93193d4511ae.zip
Command line control of mac, user and pass... main() should be rewritten, and should autodetect src mac/ip address, or let you specify
-rw-r--r--main.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/main.c b/main.c
index 0e54cb0..5bc0180 100644
--- a/main.c
+++ b/main.c
@@ -34,8 +34,11 @@ int counter=0;
int outcounter=0;
int sessionkey=0;
unsigned char *src = "00:e0:81:b5:ac:8e";
-unsigned char *dst = "00:0c:42:43:58:a4";
+unsigned char dstmem[] = "00:0c:42:43:58:a4";
+unsigned char *dst = &dstmem;
unsigned char encryptionkey[128];
+unsigned char username[255];
+unsigned char password[255];
void handlePacket(unsigned char *data, int data_len) {
struct mt_mactelnet_hdr pkthdr;
@@ -74,7 +77,7 @@ void handlePacket(unsigned char *data, int data_len) {
memcpy(encryptionkey, cpkt.data, cpkt.length);
md5data[0] = 0;
- strcpy(md5data+1, "password");
+ strcpy(md5data+1, password);
strncat(md5data+1, encryptionkey, 16);
MD5_Init(&c);
@@ -82,7 +85,7 @@ void handlePacket(unsigned char *data, int data_len) {
MD5_Final(md5sum+1, &c);
md5sum[0] = 0;
- sendAuthData("admin", md5sum);
+ sendAuthData(username, md5sum);
if (DEBUG)
printf("Received encryption key of %d characters\n", cpkt.length);
@@ -130,6 +133,15 @@ int main (int argc, char **argv) {
char buff[1500];
int plen = 0;
+ if (argc < 3) {
+ fprintf(stderr, "Usage: %s <MAC> <username> <password>\n", argv[0]);
+ return 1;
+ }
+
+ strncpy(dst, argv[1], 17);
+ strncpy(username, argv[2], 254);
+ strncpy(password, argv[3], 254);
+
srand(time(NULL));
// Transmit raw packets with this socket