我正在尝试构建一个匿名FTP扫描器,但是我得到了一个调用函数X的错误,我定义了X来接收唯一的1个参数,这是ip地址,如果我不使用循环,一个接一个地发送ip,同样的代码也可以工作。
错误是: X()恰好接受1个参数(给定8个)
from ftplib import FTP
import ipcalc
from threading import Thread
def X (ip):
try:
ftp = FTP(ip)
x = ftp.login()
if 'ogged' in str(x):
p
我的目标是让SQL检查该行是否存在,如果行确实更新,如果没有插入。
FTP_num是第一列的名称。SQL语句是
using (SqlCommand cmd = new SqlCommand("IF NOT EXISTS(SELECT ftp_num from Distributor WHERE fpt_num = FTP_num)"
" insert FTP_Info set IP=@IP, Port=@Port, UN=@UN, PW=@PW, Folder=@Folder where FTP_num = @ftp_num" +
" else"
我想要一个脚本来寻找IP地址等。
我使用以下命令生成列表:
ip -4 neighbor show
但我不知道该怎么看。
command | awk ...
或
for i in command ; do ... done
最后,这似乎是正确的:
LIST=$(the regex of Reda Salih)
for i in $LIST
do
if [ "${i}" == $my_ip]
then
echo found
exit 0
fi
done
echo not found
但还有更优雅的解决方案吗?
我正在执行一个bash脚本,如果ftp连接失败或使用egrep成功,它会返回我,问题是当我试图使用egrep获取单词时,返回0,但如果我手动执行该命令,则返回2。
这是我的代码:
#Create the FTP Connection.
for ip_address in ${IP_ADDRESS[@]}; do
ftp ${ip_address} <<ftp_commands > ${FTP_RESULTS}
user "${USER_ID}" "${USER_PASSWORD}"
pwd
bye
ftp_commands
f
这是我的/etc/apt/sources.list
###### Debian Main Repos
deb http://ftp.us.debian.org/debian/ lenny main contrib non-free
###### Debian Update Repos
deb http://security.debian.org/ lenny/updates main contrib non-free
deb http://ftp.us.debian.org/debian/ lenny-proposed-updates main contrib non-free
当我这么做时
我使用python连接到ftp.rediris.es,在发送数据后没有收到预期的答案。我用代码和答案更好地解释了这一点:这是我的代码(test.py)
#!/usr/bin/env python
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print "Socket Created"
port = 21
host = "ftp.rediris.es"
ip = socket.gethostbyname(host)
print ip
print "i
服务器是ubuntu16.04。我可以按以下方式登录vsftpd:
ftp> open MY_FTP_IP
Connected to MY_FTP_IP.
220 (vsFTPd 3.0.3)
Name (MY_FTP_IP:ACCOUNT_NAME): someftpuser
问题是,ACCOUNT_NAME是我用户的名字,我不想让ftp用户看到它。如何更改或删除该ACCOUNT_NAME?
我希望能够使用单个文件自动连接到ftp服务器。此输入文件包含要在ftp会话中运行的命令。
我能够通过终端连接和登录到ftp服务器,使用:
ftp <IP>
Connected to <IP>.
220 ProFTPD Server (ProFTPD) [<IP>]
Name (<IP>:current_user): USER
331 Password required for USER
Password:
我输入密码,输出是:
230 User USER logged in
Remote system type is UNIX
我有2 ftp服务器集群与负载平衡,并看到一个虚拟ip。
ftp server a : x.x.x.5
ftp server b : x.x.x.6
ftp virtual ip : x.x.x.10
我有两个文件服务器,它也是负载平衡的。我想在iis中添加多个ftp站点,其中有一个ip和一个端口,但是在我的网络中的dns服务器中定义了不同的urls。
但是当我用url添加ftp时,它不会打开,只会用x.10 url打开默认ftp。
我做错了什么?
如何在iis中有一个ip和一个端口的多ftp?
我正在尝试为我的NAS开发一个基于web的FTP客户端。当我尝试获取NAS上所有文件的列表时,脚本将永远加载。如果我尝试通过PHP连接到我的webhost,一切都很好,我可以得到所有文件的列表。如果我在Mac OS中通过终端运行该脚本,那么获取我的NAS上的文件列表是没有问题的。
谁能告诉我为什么我不能检索我的NAS上的文件列表?我连接到我的IP地址(当然不是本地IP:-),并且我的端口不是默认的21而是2121,这有关系吗?
下面是我的脚本。
// Set IP and port
define("FTP_CONNECT_IP", "");
define(
我想从远程NAS服务器下载文件,我无法强制下载到客户端。我正在使用这个函数:
public function download(){
// Set IP and port
define("FTP_CONNECT_IP", "xxx");
define("CONNECT_PORT", "21");
// Set username and password
define("FTP_LOGIN_USER", "username");
define(
我有一个Debian机器(Linux debian 2.6.32-5-amd64 #1 SMP Fri Feb 15 15:39:52 UTC 2013 x86_64 GNU/Linux)运行在NAT后面,其中有两个端口转发给SSH和Web。我可以访问网页罚款,我也可以做DNS查询罚款。
我的sources.list的内容
deb http://ftp.br.debian.org/debian squeeze main
deb-src http://ftp.br.debian.org/debian squeeze main
deb http://ftp.br.debian.org/debia
我有一个传入的FTP请求。我想要获取传入FTP请求中提到的FTP服务器的IP地址。我必须根据白名单上的FTP服务器来验证这一点。
任何帮助都将不胜感激..
我的代码如下:
try
{
IPHostEntry host;
string localIP = "?";
host = Dns.GetHostEntry(uri);
foreach (IPAddress ip in host.AddressList)
{
// we are only interested in IPV4 Addresses
if (i
我正在尝试上传一个文件到FTP服务器,我想写一个Python脚本来简化这个过程。目前,我通过ftp连接到服务器并执行以下命令:
quote allo file_size_in_bytes
put c:\path\to\file
这就是我到目前为止所拥有的,我无法使用put命令获取要传输的文件。
from ftplib import FTP
import os
import time
from subprocess import call
ip = raw_input('Enter ip address: ') # User
我正在尝试使用ftp.list(parent_path)在我的FTP站点中爬行
每当parent_path变量包含空格时,我就会得到以下错误
Ftp LIST exception: Net::FTPPermError detail: 550 /Download/Dimension: The system cannot find the file specified.
Ftp LIST exception: the parent_path (if present) was : /Download/Dimension Data
下面是我的代码片段
begin
@logger.error(
我一直试图做一些脚本,通过FTP下载文件从我的本地主机Apache在CentOS,我无法使它工作!
我使用的代码就是任何基本ftp请求所使用的代码:
<?php
$ip= FTP_IP_HERE;
$port='21';
$timeout='90';
$un='username';
$pw='password';
// Connect to ftp
$conn_id = ftp_connect($ip,$port,$timeout);
// Open a session to an external ftp site
$
在过去的几天里,我无法在Debian 5.0 (lenny)上更新我们的apt来源。我得到以下错误。
W: Failed to fetch http://ftp.debian.org/debian/dists/lenny/main/binary-amd64/Packages 404 Not Found [IP: 130.89.148.12 80]
W: Failed to fetch http://ftp.debian.org/debian/dists/lenny/contrib/binary-amd64/Packages 404 Not Found [IP: 130.89.148.12
我有文件IP.txt
192.168.69.100
192.168.69.141
我还有文件Ports.txt
open port: 21 on IP: 192.168.69.100 with banner:
220 FTP server ready
open port: 22 on IP: 192.168.69.100 with banner:
SSH-OpenSSH
open port: 21 on IP: 192.168.69.141 with banner:
220 FTP server ready
open port: 22 on IP: 192.168.69.141 with ba