This repository has been archived by the owner on Aug 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* tries to detect password and username input fields * fills in credentials on single match of credentials and input fields
- Loading branch information
Showing
17 changed files
with
156 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/builds |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,26 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<array> | ||
<dict> | ||
<key>Key</key> | ||
<string>hostname</string> | ||
<key>Secure</key> | ||
<true/> | ||
<key>Title</key> | ||
<string>Hostname</string> | ||
<key>Type</key> | ||
<string>TextField</string> | ||
</dict> | ||
<dict> | ||
<key>Key</key> | ||
<string>port</string> | ||
<key>Secure</key> | ||
<true/> | ||
<key>Title</key> | ||
<string>Port</string> | ||
<key>Type</key> | ||
<string>TextField</string> | ||
</dict> | ||
</array> | ||
</plist> |
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 |
---|---|---|
@@ -1 +1,82 @@ | ||
console.log('passafari: end.js'); | ||
console.log('passafari: end.js'); | ||
|
||
var passafari_injected_end; | ||
|
||
function passafari_injected_message_handler(event) { | ||
var name = event.name; | ||
var data = event.message; | ||
|
||
console.log("passafari_injected_message_handler: " + name); | ||
|
||
if(name === "credentials") { | ||
passafari_injected_credentials_handler(name, data); | ||
} | ||
|
||
return undefined; | ||
}; | ||
|
||
function passafari_injected_credentials_handler(event_name, event_data) { | ||
if(event_data.length === 1) { | ||
var credentials = event_data[0]; | ||
var input_candidates = passafari_input_candidates(); | ||
|
||
if(input_candidates.length === 1) { | ||
var inputs = input_candidates[0]; | ||
|
||
inputs.username.value = credentials.Login; | ||
inputs.password.value = credentials.Password; | ||
} else { | ||
console.log("passafari_injected_credentials_handler: more than one inputs found.") | ||
console.log(inputs); | ||
} | ||
} else { | ||
console.log("passafari_injected_credentials_handler: more than one credentials found.") | ||
console.log(event_data); | ||
} | ||
|
||
return undefined; | ||
} | ||
|
||
if(!passafari_injected_end && window.parent === window) { | ||
console.log('passafari: passafari_injected_end'); | ||
safari.self.addEventListener("message", passafari_injected_message_handler, false); | ||
passafari_injected_end = true; | ||
} | ||
|
||
function passafari_input_candidates() { | ||
var candidates = []; | ||
|
||
for(var form_idx=0; form_idx < document.forms.length; form_idx++) { | ||
var form = document.forms[form_idx]; | ||
|
||
if(form.method.toLowerCase() === "get") { | ||
continue; | ||
} | ||
|
||
var inputs = { "username": undefined, "password": undefined }; | ||
|
||
for(var elem_idx=0; elem_idx < form.elements.length; elem_idx++) { | ||
var elem = form.elements[elem_idx]; | ||
|
||
if(elem.disabled || elem.readOnly) { | ||
continue; | ||
} | ||
|
||
var elem_type = elem.type.toLowerCase(); | ||
|
||
if(elem_type === "password") { | ||
inputs["password"] = elem; | ||
} | ||
else if(elem_type === 'email' || elem_type === 'text') { | ||
inputs["username"] = elem; | ||
} | ||
|
||
if(inputs["username"] && inputs["password"]) { | ||
candidates.push(inputs); | ||
break; | ||
} | ||
} | ||
} | ||
|
||
return candidates; | ||
} |
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 |
---|---|---|
@@ -1 +1,10 @@ | ||
/* | ||
console.log('passafari: start.js'); | ||
var passafari_injected_start; | ||
if(!passafari_injected_start && window.parent === window) { | ||
console.log('passafari: passafari_injected_start'); | ||
passafari_injected_start = true; | ||
} | ||
*/ |