Hack Forums
[Shell] Skype IP "grabber" Batch File - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Shell] Skype IP "grabber" Batch File (/showthread.php?tid=2871616)



Skype IP "grabber" Batch File - shotzinthedark - Sep 17, 2012

I was wondering if you could do "Netstat -nb" and make it only select Skype.exe. Then make it into a neat little batch file that 'grabs' your contacts ips. Maybe even get it to save to a .txt file.

Thanks


* - Johnny Cache - Sep 17, 2012

Maybe if you make something like this...:
Code
@echo off
setlocal enabledelayedexpansion
netstat -nb >>temporary.txt
for /f "delims=" %%i in (temporary.txt) do (
    (findstr?) skype.exe bla bla
)
...
del /q /f temporary.txt



* - shotzinthedark - Sep 17, 2012

(Sep 17, 2012 01:15 PM)Lino126 Wrote:  Maybe if you make something like this...:
Code
@echo off
setlocal enabledelayedexpansion
netstat -nb >>temporary.txt
for /f "delims=" %%i in (temprary.txt) do (
    (findstr?) skype.exe bla bla
)

Okay, thanks. Just the kind of reply I was looking for.


The temporary txt file doesn't contain just the skype.exe processes :/


* - Johnny Cache - Sep 17, 2012

(Sep 17, 2012 01:16 PM)shotzinthedark Wrote:  Okay, thanks. Just the kind of reply I was looking for.


The temporary txt file doesn't contain just the skype.exe processes :/

No, it contains all processes, but that findstr parameter filters all others out. but i dont know the real command in the moment.


* - SkyRider2 - Sep 17, 2012

ah, good luck dude hope you get somewhere with this..


* - Tenacious - Sep 18, 2012

(Sep 17, 2012 01:03 PM)shotzinthedark Wrote:  I was wondering if you could do "Netstat -nb" and make it only select Skype.exe. Then make it into a neat little batch file that 'grabs' your contacts ips. Maybe even get it to save to a .txt file.

Thanks

Skype has about 5 Network Transmissions that simultaneously run as soon as you open skype, plus additionals for chats, and whatever else.

Try Commview, that should suit your needs, however skype is the worst chat application that i've used to grab ip addresses off, based on local connections (Too confusing to see which ip is from who). You might be better off spending like $5 and buying a skype resolver service.


* - Quantum Batch - Sep 18, 2012

(Sep 18, 2012 02:23 AM)Iluminexus Wrote:  Skype has about 5 Network Transmissions that simultaneously run as soon as you open skype, plus additionals for chats, and whatever else.

Try Commview, that should suit your needs, however skype is the worst chat application that i've used to grab ip addresses off, based on local connections (Too confusing to see which ip is from who). You might be better off spending like $5 and buying a skype resolver service.

Well this is the 3rd post I have seen in this section by you, are you staying in this section Mr. HQ?


* - DesuDesuDesuDesu - Sep 18, 2012

It would be nice, but the problem is that it would be really hard to filter the non-Skype IPS form the Skype IPS. I don't know how you could do that. Maybe start by filtering the localhosts first.


* - Five Finger Death Punch - Sep 19, 2012

Ya that would be awesome if someone could make that, i'm looking for something similar.


* - Hopsin - Sep 19, 2012

(Sep 19, 2012 05:49 AM)Byson Wrote:  Ya that would be awesome if someone could make that, i'm looking for something similar.

Are you sure it's possible to do that on an batch file?


* - Johnny Cache - Sep 19, 2012

(Sep 19, 2012 05:50 AM)Hopsin Wrote:  Are you sure it's possible to do that on an batch file?

It wouldnt be easy, but i think it is possible to filter the entries....


* - PrimePr0tocol - Jul 27, 2016

@echo off
echo Send the person a message, or get in a call with them, then press enter . . .
pause>nul
set param=%~1
::When 0, Skype Netstat.
::When 1, it will grab Skype IP's.
set skype=1
setlocal enabledelayedexpansion
::Used to convert PID to process names.
for /f "tokens=1 delims=" %%A in ('tasklist') do call :PID %%A
echo [Program:PID] LocalIP:Port - RemoteIP:Port
echo.
for /f "tokens=1-27 delims=: " %%A in ('netstat -ano') do call :netstat %%A %%B %%C %%D %%E %%F %%G %%H %%I %%J %%K %%L %%M %%N %%O %%P %%Q %%R %%S %%T %%U
if "%param%"=="-log" exit /b
pause>nul
exit /b
:PID
set pid_%2=%1
exit /b
:netstat
set type=%1
set srcIP=%2
set srcPort=%3
set dstIP=%4
set dstPort=%5
set state=%6
set pid=%7
set name=!pid_%pid%!
::Filter local connections away.
if "%state%"=="" exit /b
if not "%type%"=="TCP" exit /b
if "%srcIP%"=="Local" exit /b
if "%dstIP%"=="*" exit /b
if "%srcIP%"=="%dstIP%" exit /b
if "%pid%"=="" exit /b
if "%dstPort%"=="[" (
set state=LISTENING
set srcPort=%dstIP%
set pid=%9
)
if "%dstPort%"=="[" set name=!pid_%pid%!
if "%name%"=="" set name=Unknown
::Skype filter
if "%skype%"=="1" (
if /I not "%name%"=="skype.exe" exit /b
if not "%state%"=="ESTABLISHED" exit /b
if "%dstPort%"=="443" exit /b
if "%dstPort%"=="12350" exit /b)
::Formatting \tabs
set srcPortTab= %srcPort%
set namePidTab=[%name%:%pid%]
set srcIpPortTab=%srcIP%:%srcPort%
set dstIpPortTab=%dstIP%:%dstPort%
set stateTab=%state%
set namePidTab=%namePidTab:~0,20%
set srcIpPortTab=%srcIpPortTab:~0,21%
set dstIpPortTab=%dstIpPortTab:~0,21%
set stateTab=%stateTab:~0,12%
set srcPortTab=%srcPortTab:~-5%
if not "%state%"=="LISTENING" echo.%namePidTab% %srcIPPortTab% %dstIPPortTab% %stateTab%
if "%state%"=="LISTENING" echo.%namePidTab% Listening on: %srcPortTab%
exit /b


Code by: SoulByte


* - DataBuster - Jan 20, 2017

(Sep 17, 2012 01:03 PM)shotzinthedark Wrote:  I was wondering if you could do "Netstat -nb" and make it only select Skype.exe. Then make it into a neat little batch file that 'grabs' your contacts ips. Maybe even get it to save to a .txt file.

Thanks


You could maybe do: findstr <skypeport>

(Sep 19, 2012 05:49 AM)Five Finger Death Punch Wrote:  Ya that would be awesome if someone could make that, i'm looking for something similar.

Yes, definitely possible.