Import a folder with files inside into a jailbroken iPhone using vb.net - ios

I am writing an app in VB.NET (Visual Studio 2013) and as a final step, it has two copy a folder (with several files inside) into a certain directory in an iPhone.
The iPhone is jailbroken so it is possible to access every kind of directory and it should also be connected to the PC via USB. Is this even possible?
Thank you in advance!

I suck at visual basic, but I can tell you how you would do this programmatically:
First, you need to tunnel SSH over USB. You can do that by programatically executing itunnel_mux.exe from this zip.(you'll have to extract everything first.) Use it like this:
itunnel_mux.exe --tunnel -iport 22 -lport 2222
Then, you can use SCP (I'd recommend this library) to Copy files over from root#127.0.0.1:2222 (password alpine).
This is some example pseudocode (keep in mind, I don't know VB):
'Extract the exe and dll file from that zip
extract_files()
'I'm making a new variable containing the port number.
Dim port As string = "2222"
'I made up this function. Lets pretend it executes Batch code in the current directory (like a bat file)
execbat("itunnel_mux.exe --tunnel -iport 22 -lport " + port)
Using scp As New Rebex.Net.Scp
' connect to a server
scp.Connect(hostname)
' authenticate (change alpine if you changed your root passwd)
scp.Login("root", "alpine")
' Here, you can use "scp" to upload and download files
scp.PutFile("C:\Users\KevinKZ\Desktop\fileToUpload.jpg", "/var/mobile/Documents/fileToUpload.jpg")
scp.GetFile("/var/mobile/Library/SMS/sms.db", "C:\Users\KevinKZ\Desktop\SMS_Backups\2-1-14.db")
scp.Disconnect()
End Using
This solution is far from elegant. It also requires OpenSSH (I think). If you want something easier and/or more flexible, let me know. You might be better off using libimobiledevice. If you still need help let me know. You can email me at alex#alexhulbert.com

If the directory is accessible from Windows then yes.

Related

Permission error for shutils moving png to path

You see I am making a python gui with pysimplegui for my old qrcode generator script so im using shutils for the user to download the file.
I am using the 'default' thing because i want it to save to my users path not mine, do you know some other way I can do that? because i think this is the reason its not working
I tried making it so the user inputs there username such as 'My laptop' so it adds it to the path
src_path = r"D:\Python\QRcode generator\output.png"
dst_path = r"C:\Users\Default\Pictures"
shutil.move(src_path, dst_path)
The code is correct. It wont give any error if you dont use C drive (Where the operating system is installed)
This is mostly due to C drive is protected for windows stability.
If you are using any code editor (Pycharm, VS Code etc.) or running the code in windows command prompt or any terminal etc. Try and run it with administrator rights
It should work.

How do I make a simple public read-only WebDAV server with SabreDAV?

I recently began looking into WebDAV, as I found it to be an option for letting me play a Blu-ray folder remotely - i.e. without requiring the viewer to download the whole 24gb ISO first.
Add a WebDAV source in Kodi v18 to a Blu-ray folder - and it actually plays! Very awesome.
The server can also be mounted on Windows with
net use m: http://example.com/webdavfolder/
or in Linux with
sudo mount -t davfs http://example.com/webdavfolder/ /mnt/mywebdav
-and should then (in theory) play with any software media players that supports Blu-ray Disc Java (BD-J), such as PowerDVD and VLC.
vlc bluray:///mnt/mywebdav --bluray-menu
PowerDVD.exe AUTOPLAY BD m:
(Unless of course time-out values has been set too low, which seems to be the case for VLC at the moment).
Anyway, all this is great, except I can't figure out how to make my WebDAV server read-only. Currently anyone can delete files as they wish, and that's of course not optimal.
So far I've only experimented with SabreDAV, because afaik that's the only option I have if I want to keep using my existing webhost. Trying with very minimal setups, because I've read that minimal setups should default to a read-only solution. It just doesn't seem to happen.
I initially used the setup from http://sabre.io/dav/gettingstarted/ and tried removing some lines. Also tried calling chmod 0444 MainFolder -R on the webserver. And I can see that everything does get a read-only attribute. But it changes nothing. It's still possible to delete whatever I want. :-(
What am I missing?
Maybe I'm using the wrong technology for what I want to do? Is there some other/better way of offering a Blu-ray folder for remote viewing? (One that includes the whole experience - i.e. full Java menus etc).
I should probably mention that all of this is of course perfectly legal. It is my own Blu-ray project - not copyright material.
Also: Difficult to decide if this belongs on StackOverflow or SuperUser. I ended up posting it on StackOverflow because SabreDAV is about coding, and because there's no sabredav tag on SuperUser.
You have two options:
Create your own file/directory classes for sabre/dav that simply throw an error when trying to delete. You can basically start with a copy of Sabre\DAV\FS\Directory and Sabre\DAV\FS\File and change the methods that do writing.
Since you're considering just using linux file permissions, really the key thing you are missing is that that 'deleting' is not controlled on the file or directory you're trying to delete. To delete a file or directory in unix, all you need is write permissions on the parent directory. However, I wouldn't recommend going this route as doing this will just cause a weird error in sabre/dav, which might leave clients in a confused state. It would result in a 500 error, not the expected 403 error.

Mapped drive letters immediately available?

I am using this to map a drive letter in PowerShell v2, and it works in that the drive letter shows up and is usable in Explorer.
$Network = New-Object -ComObject "Wscript.Network"
$Network.MapNetworkDrive($drive.name, $drive.value, $true)
However, if I then try to use that drive letter to do anything in Powershell, say to create a folder, I get a DriveNotFoundException. But as I said, the drive is there and usable manually. I thought I might need to wait for a bit, or refresh Explorer, or both, but doing so seems not to affect anything. However, if I turn around and rerun the script, which checks in advance to see if the drive is there, and only creates it if not, it will see the drive and not recreate, and a following task will work fine. As if perhaps the drive letter is session based?
I also tried adding
New-PSDrive -name:($drive.name -replace ':', '') -psProvider:FileSystem -root:$drive.value -scope:Global
as well, in the hopes that this would provide a session based drive, but no good.
An additional wrinkle is that the script has to be Run as Administrator, but again, if I do it as two different scripts, one to create the drive and one to use it, it works when both are Run As Administrator. It's only when both tasks are done in the one script that it fails.
One last point, I know PS 3 has a better way to handle mapped drives, but due to things beyond my control I am limited to PS v2.
I don't think what you want is possible in PowerShell v2. To have New-PSDrive create a Windows drive you need to add the parameter -Persist, which isn't available in PowerShell v2.
From the documentation:
-Persist
Creates a Windows mapped network drive. Mapped network drives are saved in Windows on the local computer. They are persistent, not session-specific, and can be viewed and managed in File Explorer and other tools.
I'd say your best option (aside from upgrading to PowerShell v3 or newer) is to use the net command:
& net use $drive.name $drive.value /persistent:yes

Can Rails pass a shell command to the local machine?

I am trying to get rails to select document attachments, then kick off the email client with the documents attached.
I have it working on my development laptop. If I build a string with the appropriate parameters and pass that to system() then it kicks off the email client with the attachments..
The string looks something like
#email_content = "C:\Program Files (x86)\IBM\Lotus\Notes\notes.exe"
"Mailto:?Attach=C:\Users\cm\RubymineProjects\technical_library\public\images\1\8302_printed.pdf
The first part calls the notes exe and the second part starts and email with the attachments. That worked fine on my laptop.
However, when I moved it to the server, it isn't kicking off the email client. I believe that it is because the shell commands are trying to execute on the server, not on the client.
Is it possible to run a shell command on the client machine? I am trying to get this working with Windows first and then the Mac environmemnt. I tried changing the C:\ to the machine name. i.e. \chrislaptop\Program Files (x86)\IBM\Lotus\Notes\notes.exe. but that didn't work.
No, fortunately that is not possible.
Imagine what happens when a request to some random page on the internet could trigger shell scripts on your local computer...
Arbitrary code execution escaping the browser is too invasive-- your app should not have access to the client's machine.
However, some applications may support URIs that open specific applications outside the browser. You generally see this more on mobile devices, but Spotify for example supports links that look like: spotify:artist:5lsC3H1vh9YSRQckyGv0Up which asks the user whether it is ok to open the Spotify application.
https://news.spotify.com/us/2008/01/14/linking-to-spotify/

How Can I get muitiple files selected to the same application launch from a "right click" context menu (windows explorer)

I am able to get a shell registry type context menu function to work , see below . But is there a way to tell windows to send multiple files selected to the same application , perhaps instead of %1 or %L some other parameter . What happens now is that it launches the associated application for each file in the list .
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT*\shell]
[HKEY_CLASSES_ROOT*\shell\sendtomyapp]
#="&Upload to (File*Pics)Mojo"
[HKEY_CLASSES_ROOT*\shell\sendtomyapp\command]
#="c:\Program Files\app_directory\App.exe -n \"%1\""
Is there a way to send an array of names like sys.args in python ?
My guess is to look into DDEExec instead of shell\open\command. http://msdn.microsoft.com/en-us/library/bb165967(VS.80).aspx
Seems like a superuser.com question, but I think these kind of operations require a bit of code. e.g. you write a proxy program that accepts the files, and adds them to an execution queue or batch of another program (like adding several files to a media player) I don't know if what you are looking for is supported inherently in Windows
You will need a full shell extension DLL to do what you want to do here. So the answer is programming even if the question was not.

Resources