Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3405306
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:29:22+00:00 2026-05-18T05:29:22+00:00

I have a very basic Linux server running on an IP camera (Busybox). I’d

  • 0

I have a very basic Linux server running on an IP camera (Busybox). I’d like to get the public IP of that camera, which is located behind a router.
It has no “wget” nor “traceroute”, and “ping” is just answering “alive” or “not alive”…

The only one available is a basic “netcat” :

nc
BusyBox v1.1.3 (2009.12.07-16:16+0000) multi-call binary
Usage: nc [OPTIONS] [IP] [port]
Netcat opens a pipe to IP:port
Options:
        -l              listen mode, for inbound connects
        -p PORT         local port number
        -i SECS         delay interval for lines sent
        -w SECS         timeout for connects and final net reads
        -4              Use IPv4 (default)
        -6              Use IPv6
        -D DSCP         set IP DSCP field
        -P PRIO         set VLAN user-priority

Provided my ISP allows outgoing HTTP, is it possible to use netcat in order to get the public IP response from a site like http://www.obtainip.com or similar ?

GREAT and many thanks to both of you guys as I did not feel comfortable with nc at all.

Here are the 2 working ways :

echo "GET /automation/n09230945.asp HTTP/1.0" > http_req2.txt
echo "Host: www.whatismyip.com" >> http_req2.txt
echo "" >> http_req2.txt
echo "" >> http_req2.txt
IP2=$(cat http_req2.txt | nc www.whatismyip.com 80 | tail -n 1)
echo $IP2
YEAH !

and more strange but… it also works :

echo "GET / HTTP/1.0" > http_request.txt
echo "Host: www.whatismyip.com" >> http_request.txt
echo "User-Agent: netcat" >> http_request.txt
echo "Referer: http://www.whatismyip.com/" >> http_request.txt
echo "" >> http_request.txt
echo "" >> http_request.txt
IP=$(cat http_request.txt | nc www.whatismyipaddress.com 80 | tail -n 1)
echo $IP
YEAH again!

EDIT
Of course, this can be scripted better like suggested :

echo -e "GET /automation/n09230945.asp HTTP/1.0\n"Host: www.whatismyip.com\n\n" | nc www.whatismyipaddress.com 80 | tail -n 1
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T05:29:23+00:00Added an answer on May 18, 2026 at 5:29 am

    create a file called ‘script’

    put this in the contents

    GET /automation/n09230945.asp HTTP/1.0
    Host: www.whatismyip.com
    

    Make sure there are 2 empty linefeeds on the bottom (this editor wont show them)

    then run

    cat script | nc www.whatismyip.com 80 | tail -1
    

    There is your ip… you can put it in a variable like

    IP=`cat script | nc www.whatismyip.com 80 | tail -1`
    echo $IP
    

    This will return just the ip address, no fuss

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently upgraded VS 2005 to VS 2008. Unfortunately I have a very basic
I am implementing a very simple file database. I have 2 basic operations: void
We have very strange problem, one of our applications is continually querying server by
i have very simple problem. I need to create model, that represent element of
I have very simple select like this: SELECT * FROM table WHERE column1 IN
I have a very simple problem which requires a very quick and simple solution
I have a very simple WPF application in which I am using data binding
I have a very large code base that contains extensive unit tests (using CppUnit).
I have very little experience building software for Windows, and zero experience using the
I have a very strange problem. Under some elusive circumstances I fail to apply

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.