SRL Archive - Jr. Member General Help and Discussion

Simba and the Web


Element17

2015-02-14 17:44:47

Hello!

I am looking to write a script with Simba but I am currently stuck with just my Mac but I am in the planning process and below I will post what I want the script todo. All I'm asking for is are these things going to be possible.


1. Open an array of websites (provided the urls).
2. Find a box to place an account number.
3. Take a picture of the Captcha on the page.
4. Send that picture to a e-mail or phone via sms. (In the US and mobile carrier is Virgin Mobile)
5. Take a response from e-mail or sms and place that in for the Captcha answer.


I know Simba can open webpages and send text. I'm pretty sure I've seen Simba take a screenshot and I think I've seen where someone make a Port Timer that send notifications via SMS. Correct me if I am mistaken anywhere and or if something isn't possible. I will be using this thread to hopefully update my progress.

Brandon

2015-02-14 17:50:36

https://villavu.com/forum/showthread.php?t=110629&p=1313920#post1313920
https://villavu.com/forum/showthread.php?t=108744&p=1304668#post1304668


Sin is the only one that I've seen do text messages in Simba. Demise is the only one I've seen use servers in Simba.

So yes it's possible but it's not "that" simple. There's nothing ready made for you so you'll have to do this stuff manually.

Neither of them seem to be active or around so..

Element17

2015-02-14 18:05:43

Very valid points. I figured Simba probably wouldn't be able to do right off the bat. I will give those threads a deep look over but may consider another language. Perhaps python? Thank you for the threads and information.

grats

2015-02-14 20:48:12

sending vars to a server & having that server send emails, text or whatever is very easy to do..

It's as simple as sending a POST to a webpage from a webpage.. but with simba instead.

That'd be the easiest method imo. and have simba handle all the actual browsing of the sites and pic taking

Brandon

2015-02-14 21:22:28

From: grats
sending vars to a server & having that server send emails, text or whatever is very easy to do..



But that requires you to either already have a server running or to setup one.. To send an email in Simba, you can just setup an SSL/TLS socket and post the data to the SMTP server which is way easier. For text messaging, I think Sin uses Google+ and posted to it.

grats

2015-02-14 21:33:49

From: Brandon
But that requires you to either already have a server running or to setup one.. To send an email in Simba, you can just setup an SSL/TLS socket and post the data to the SMTP server which is way easier. For text messaging, I think Sin uses Google+ and posted to it.


so using someone elses server… requiring a server

you can do the same for text messaging too then I guess

verizon for example is [email]number@vtext.com[/email] to send an email to their phone.. which they receive as a text.

Foundry

2015-02-14 23:58:31

I just modified what I saw on this thread and it seems to be working. It can basically send the Captcha after you have it saved to a file. You would need to check the gmail account but that's it. When I tried to get it to send an attachment to my phone the attachment didn't show up :confused: This is what I use for text notification on another one of my bots.

Basically follow the guide on that thread and set up easyphp the way he has it. Instead of copying and pasting the 2 php files he has, use only this one:
[PHP]<?php
require_once 'lib/swift_required.php';

if (!isset($_GET['message'])) {
// Credit to xdarkshadowx for this. Edited from https://villavu.com/forum/showthread.php?t=94651
$hostname = '{imap.gmail.com:993/imap/ssl}INBOX';
$username = $_GET["user"];
$password = $_GET["pass"];

$inbox = imap_open($hostname,$username,$password);
$emails = imap_search($inbox,"UNSEEN");
if($emails) {
rsort($emails);
foreach($emails as $email_number) {
$overview = imap_fetch_overview($inbox,$email_number,0);
$message = imap_fetchbody($inbox,$email_number,1);

echo $message;
}
}
imap_close($inbox);
exit;
}

$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'ssl')
->setUsername($_GET["user"])
->setPassword($_GET["pass"]);

$message = Swift_Message::newInstance($transport)
->setFrom(array($_GET["user"].'@gmail.com' => 'ABC'))
->setTo(array($_GET["destination"]))
->setBody($_GET["message"]);
if (isset($_GET['attachment'])) {
$message->attach(Swift_Attachment::fromPath($_GET['attachment']));
}

$mailer = Swift_Mailer::newInstance($transport);
$mailer->send($message);
?>[/PHP]

It's basically both of them combined. This is the simba code to use it when the server is running:



// by CynicRus
function WebCode(const Src: string): string;
var
i: Integer;
begin
Result := '';
for i := 1 to Length(Src) do
Result := (Result + '%' + IntToHex(Ord(Src[i])));
end;


type
Communication = record
user, pass, URL, destinationEmail: String;
end;


// URL will be the url of the php script on the server. Mine is
// http://127.0.0.1/wonderful/Captcha.php It all depends on what
// you name the alias and the php file.
procedure Communication.init(_user, _pass, _URL, _destinationEmail: String);
begin
user := _user;
pass := _pass;
URL := _URL;
destinationEmail := _destinationEmail;
end;

// Returns a string of the contents of all unread emails. Since the email will
// be new this shouldn't be an issue.
function Communication.read(): String;
var
strURL: String;
begin
strURL := URL + '?user=' + webCode(user) + '&pass=' + webCode(pass);
result := getPage(strURL);
end;

// Self explanatory, pass the message you want to send.
procedure Communication.sendMessage(message: String);
var
strURL: String;
begin
strURL := URL + '?user=' + webCode(user) + '&pass=' + webCode(pass) +
'&destination=' + webCode(destinationEmail) + '&message=' + webCode(message);
getPage(strURL);
end;

// The attachmentPath variable is the path to the attachment you want to send
// (in your case an image).
procedure Communication.sendMessage(message, attachmentpath: String); overload;
var
strURL: String;
begin
strURL := URL + '?user=' + webCode(user) + '&pass=' + webCode(pass) +
'&destination=' + webCode(destinationEmail) + '&message=' + webCode(message) +
'&attachment=' + webCode(attachmentpath);
//writeLn(strURL);
getPage(strURL);
end;

Let me know if I forgot to credit someone.