-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
270 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/* cSploit - a simple penetration testing suite | ||
* Copyright (C) 2014 Massimo Dragano aka tux_mind <[email protected]> | ||
* | ||
* cSploit is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* cSploit is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with cSploit. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include <string.h> | ||
#include <regex.h> | ||
|
||
#include "handler.h" | ||
#include "logger.h" | ||
#include "fusemounts.h" | ||
#include "message.h" | ||
#include "str_array.h" | ||
|
||
handler handler_info = { | ||
NULL, // next | ||
7, // handler id | ||
0, // have_stdin | ||
1, // have_stdout | ||
1, // enabled | ||
NULL, // raw_output_parser | ||
&fusemounts_output_parser, // output_parser | ||
NULL, // input_parser | ||
"tools/fusemounts/fusemounts", // argv[0] | ||
NULL, // workdir | ||
"fusemounts" // handler name | ||
}; | ||
|
||
/** | ||
* @brief extract fusemount source and destination from fusemounts output | ||
* @param line the line to parse | ||
* @returns a message to send or NULL | ||
*/ | ||
message *fusemounts_output_parser(char *line) { | ||
message *m; | ||
char *dst, *ptr; | ||
|
||
if(!*line) { | ||
return NULL; | ||
} | ||
|
||
for(dst=line;*dst!=' ' && *dst!='\0';dst++); | ||
|
||
if(*dst) { | ||
*dst='\0'; | ||
dst++; | ||
} | ||
|
||
for(;*dst==' ';dst++); | ||
|
||
if(!*dst) | ||
return NULL; | ||
|
||
for(ptr=dst;*ptr!=' ' && *ptr!='\0';ptr++); | ||
*ptr='\0'; | ||
|
||
m = create_message(0, sizeof(struct fusemount_bind_info), 0); | ||
|
||
if(!m) { | ||
print(ERROR, "cannot create messages"); | ||
return NULL; | ||
} | ||
|
||
m->data[0] = FUSEMOUNT_BIND; | ||
|
||
if(string_array_add(m, offsetof(struct fusemount_bind_info, data), line)) { | ||
print( ERROR, "cannot append string to message" ); | ||
goto error; | ||
} | ||
|
||
if(string_array_add(m, offsetof(struct fusemount_bind_info, data), dst)) { | ||
print( ERROR, "cannot append string to message" ); | ||
goto error; | ||
} | ||
|
||
return m; | ||
|
||
error: | ||
free_message(m); | ||
|
||
return NULL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* cSploit - a simple penetration testing suite | ||
* Copyright (C) 2014 Massimo Dragano aka tux_mind <[email protected]> | ||
* | ||
* cSploit is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* cSploit is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with cSploit. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* | ||
*/ | ||
#ifndef HANDLERS_FUSEMOUNTS_H | ||
#define HANDLERS_FUSEMOUNTS_H | ||
|
||
enum fusemount_action { | ||
FUSEMOUNT_BIND | ||
}; | ||
|
||
struct fusemount_bind_info { | ||
char fusemount_action; ///< must be set to ::FUSEMOUNT_BIND | ||
/** | ||
* @brief string array containing mount source and destination | ||
* | ||
* data[0] is the source path | ||
* data[1] is the destination path | ||
*/ | ||
char data[]; | ||
}; | ||
|
||
message *fusemounts_output_parser(char *); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.csploit.android.events; | ||
|
||
/** | ||
* a new fuse mountpoint has been found | ||
*/ | ||
public class FuseBind implements Event { | ||
public final String source, mountpoint; | ||
|
||
public FuseBind(String source, String mountpoint) { | ||
this.source = source; | ||
this.mountpoint = mountpoint; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return String.format("FuseBind: { source='%s', mountpoint='%s' }", this.source, this.mountpoint); | ||
} | ||
} |
Oops, something went wrong.