<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; OFF: Проверка состояния портов удаленного компьютера]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=7589&amp;type=atom" />
	<updated>2012-09-19T05:46:29Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=7589</id>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Проверка состояния портов удаленного компьютера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63978#p63978" />
			<content type="html"><![CDATA[<p><span style="color: green">1. Один вопрос — одна тема.<br />2. См. <a href="http://forum.script-coding.com/rules.html#2.9.">Правила форума, п.2.9</a>.</span></p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2012-09-19T05:46:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63978#p63978</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Проверка состояния портов удаленного компьютера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63977#p63977" />
			<content type="html"><![CDATA[<p>извините за тупой вопрос, но все же. где скачать визуал С? <img src="//forum.script-coding.com/img/smilies/sad.png" width="15" height="15" /> поисковик выдает только С++ и С#</p>]]></content>
			<author>
				<name><![CDATA[BlackRay]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28669</uri>
			</author>
			<updated>2012-09-19T05:40:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63977#p63977</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Проверка состояния портов удаленного компьютера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63976#p63976" />
			<content type="html"><![CDATA[<p>спасибо большое. даже не ожидал что так быстро помогут )</p>]]></content>
			<author>
				<name><![CDATA[BlackRay]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28669</uri>
			</author>
			<updated>2012-09-19T04:31:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63976#p63976</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Проверка состояния портов удаленного компьютера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63957#p63957" />
			<content type="html"><![CDATA[<p>В дистрибутивы Windows входит Support Tools, где есть portqry.exe<br /></p><div class="codebox"><pre><code>MsgBox WshShell.Run(&quot;portqry.exe -n pop.mail.ru -e 110 -q&quot;, 0, True)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[smaharbA]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=2911</uri>
			</author>
			<updated>2012-09-18T14:22:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63957#p63957</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Проверка состояния портов удаленного компьютера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63955#p63955" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>BlackRay пишет:</cite><blockquote><p>можно. просто у меня пока плохо получается писать скриптовые оболочки для екзешников</p></blockquote></div><p>В приложении исполняемый файл вот с таким исходным кодом(Visual C):<br /></p><div class="codebox"><pre><code>#define WIN32_LEAN_AND_MEAN
#include &lt;Windows.h&gt;
#include &lt;WinSock2.h&gt;
#include &lt;stdio.h&gt;
#pragma comment(lib, &quot;Ws2_32.lib&quot;)

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	WSADATA wsaData;
	sockaddr_in service;
	SOCKET Socket;
	DWORD ip[5] = {0};
	if(WSAStartup(MAKEWORD(2, 2), &amp;wsaData))
	{
		WSACleanup();
		return -2;
	}
	Socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
	sscanf(lpCmdLine, &quot;%u.%u.%u.%u:%u&quot;, ip, ip+1, ip+2, ip+3, ip+4);
	service.sin_family = AF_INET;
	service.sin_addr.S_un.S_un_b.s_b1 = (BYTE)ip[0];
	service.sin_addr.S_un.S_un_b.s_b2 = (BYTE)ip[1];
	service.sin_addr.S_un.S_un_b.s_b3 = (BYTE)ip[2];
	service.sin_addr.S_un.S_un_b.s_b4 = (BYTE)ip[3];
	service.sin_port = htons((WORD)ip[4]);
	if(connect(Socket, (SOCKADDR *)&amp;service, sizeof(service))==SOCKET_ERROR)
	{
		WSACleanup();
		int err = WSAGetLastError();
		if(!err)
			return -1;
		return err;
	}
	closesocket(Socket);
	WSACleanup();
	return 0;
}</code></pre></div><p>Пример использования скриптом:<br /></p><div class="codebox"><pre><code>Set WshShell = CreateObject(&quot;WScript.Shell&quot;)
MsgBox WshShell.Run(&quot;temp.exe 85.254.12.12:25565&quot;, 0, 1)</code></pre></div><p>Должен возвращать -1 если порт закрыт и 0 если открыт. любое другое значение говорит о том, что проверка не удалась.</p>]]></content>
			<author>
				<name><![CDATA[Александр_]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24888</uri>
			</author>
			<updated>2012-09-18T12:20:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63955#p63955</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Проверка состояния портов удаленного компьютера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63953#p63953" />
			<content type="html"><![CDATA[<p>можно. просто у меня пока плохо получается писать скриптовые оболочки для екзешников</p>]]></content>
			<author>
				<name><![CDATA[BlackRay]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28669</uri>
			</author>
			<updated>2012-09-18T11:06:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63953#p63953</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Проверка состояния портов удаленного компьютера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63949#p63949" />
			<content type="html"><![CDATA[<p>А нельзя использовать что-нибудь с возможностью вызова WinAPI, например AHK или сторонний экзешник?</p>]]></content>
			<author>
				<name><![CDATA[Александр_]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24888</uri>
			</author>
			<updated>2012-09-18T09:50:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63949#p63949</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Проверка состояния портов удаленного компьютера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63942#p63942" />
			<content type="html"><![CDATA[<p>не знаю. вот по этому и создал тему. вдруг помогут</p>]]></content>
			<author>
				<name><![CDATA[BlackRay]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28669</uri>
			</author>
			<updated>2012-09-18T06:49:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63942#p63942</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: OFF: Проверка состояния портов удаленного компьютера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63938#p63938" />
			<content type="html"><![CDATA[<p>telnet.exe устанавливает код возврата для команды?</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2012-09-18T05:55:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63938#p63938</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[OFF: Проверка состояния портов удаленного компьютера]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=63936#p63936" />
			<content type="html"><![CDATA[<p>задача состоит в том что бы автоматизировать проспотр порта на удаленном компьютере. пробовал следующий код:</p><div class="codebox"><pre><code>Set WshShell = CreateObject(&quot;WScript.Shell&quot;)
Set ECode = WshShell.exec(&quot;telnet.exe 85.254.12.12 25565&quot;)
WScript.Sleep 2000
MsgBox ECode.ExitCode</code></pre></div><p>но у меня не получается записать в переменную ExitCode выполнения программы.</p><p>сразу говорю что это не для взлома сервера, а для доброго дела</p>]]></content>
			<author>
				<name><![CDATA[BlackRay]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28669</uri>
			</author>
			<updated>2012-09-18T04:57:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=63936#p63936</id>
		</entry>
</feed>
