BSD ADSL SIP spoofing tweak **SPOED**

Pagina: 1
Acties:
  • 341 views sinds 30-01-2008
  • Reageer

Acties:
  • 0 Henk 'm!

  • SvMp
  • Registratie: September 2000
  • Niet online
Gezien de onstabiliteit van PPTP onder FreeBSD heb ik de SIP Spoof tweak uitgevoerd op mijn Alcatel Speedtouch ADSL modem.
Ging allemaal perfect, maar het laatste stukje ging mis :(

Hier wat meer over SIP spoofing voor als je niet weet wat het is: [topic=430049/1/25]

Hier een berichtje daarover: http://www.bruring.com/nuke/modules.php?op=modload&name=News&file=article&sid=6&mode=thread&order=0&thold=0

Er zijn 2 howto's voor SIP spoofing:

http://www.jelmerbarhorst.com/mxstream.html (vooral op Windows gericht)
http://jp.dhs.org/~jp/ (vooral op Linux gericht)


Het probleem is de laatste stap. Het zijn howto's voor Linux en Windows. Je moet routes aanmaken, maar dat gaat onder BSD iets anders. De howto's werken dus niet helemaal voor BSD. Ondanks het feit dat ik geen newbie ben met FreeBSD kwam ik er niet uit :(
Met als gevolg dat mijn internetverbinding nu niet werkt en ik elders dit berichtje zit te typen |:(
Ik wil echter niet terug naar pptp :r dat er op willekeurige momenten mee op houdt.

Kan een BSD diehard mij uitleggen hoe het onder BSD gaat?
Of kan iemand die dit onder BSD al heeft gedaan even haar fijn de laatste stappen uitleggen?
Er is spoed bij nodig, want anders moet ik of weer naar de oude situatie (kost weer uren tijd) of ik moet het onder Windows doen maar wat heb ik dan aan een FreeBSD server? Dus ik hoop eigenlijk dat als ik thuis kom dat het verlossende antwoord hier staat :)

De laatste stappen.

Uit de http://jp.dhs.org/~jp/ howto:
Dan even op je linux box je netwerkkaart waar je modem aan zit down zetten ('ifdown eth0' of 'ifconfig eth0 down', waar 'eth0' de netwerkkaart is waar je modem aan zit) en eventueel je dhcp client stoppen en/of de-installeren. De netwerk kaart start je dan zo (waar eth0 de interface is waar je modem aan zit, a.b.c.d je MXstream IP en w.x.y.z het IP van de modem is):
ifconfig eth0 pointopoint a.b.c.d netmask 255.255.255.255 broadcast 255.255.255.255
route add w.x.y.z dev eth0
route add default gw w.x.y.z

Tada! ADSL verbinding zonder PPTP en DHCP :-)
Die route add werkt niet onder FreeBSD zoals die hierbovne staat. Iets andere syntaxis waarschijnlijk. Ik heb zelf wat geprobeer, maar uiteindelijk was 10.0.0.138 niet te bereiken, dus had ik ook weinig aan de gateway. Kon ik niet aan de praat krijgen.

Deze howto vond ik iets duidelijker, http://www.jelmerbarhorst.com/mxstream.html
Linux
Tot zover de configuratie van het modem, nu de instellingen van je OS. Eerst zal ik Linux behandelen en daarna Windows 2000 en XP. Doe het volgende als root:
ifconfig eth0 a.b.c.d netmask 255.255.255.255
route add 10.0.0.138 dev eth0
route add default gw 10.0.0.138
Ook hier moet je a.b.c.d weer vervangen door je externe ip. Zorg ook dat je de juiste interface opgeeft, ik zelf heb het modem rechtstreeks op een tweede NIC hangen (eth1).Let hier dus goed op. Voor meer instellingen voor Linux, en dan metname voor Debian GNU/Linux, verwijs ik je naar http://jp.dhs.org/~jp/.
Ongeveer hetzelfde als die andere howto. Ook niet werkend te krijgen onder BSD.
eth0 is op mijn BSD machine dc1. Maar ook route add 10.0.0.138 dev dc1 werkte niet, gaf foutmelding. Commando route werkt waarschijnlijk iets anders.
Ik hoop dat hier een BSD-er zit die de FreeBSD equivalenten kan geven van bovenstaande commando's.

Jelmer (zit hier ook op GoT): Als ik het onder FreeBSD werkend heb, doneer ik een stukje howto over BSD zodat niemand anders hoeft mee te maken wat ik nu heb :(

Acties:
  • 0 Henk 'm!

Verwijderd

Lukt het wel als je je netwerkkaart via /stand/sysinstall configureert ?

Ik weet uit mijn korte FreeBSD ervaring dat je in /etc/rc.conf een defaultgateway en defaultrouter kan zetten.

Iets als : DefaultGateway="10.0.0.138"
DefaultRouter="10.0.0.138"

En anders: route add 10.0.0.138 -interface dc1

Hopelijk heb je er wat aan.

Acties:
  • 0 Henk 'm!

Verwijderd

Hier nog even de man page van het commando route onder FreeBSD:

ROUTE(8)FreeBSD System Manager's Manual ROUTE(8)

NAME
route - manually manipulate the routing tables

SYNOPSIS
route [-dnqtv] command [[modifiers] args]

DESCRIPTION
Route is a utility used to manually manipulate the network routing
tables. It normally is not needed, as a system routing table management
daemon such as routed(8), should tend to this task.

The route utility supports a limited number of general options, but a
rich command language, enabling the user to specify any arbitrary request
that could be delivered via the programmatic interface discussed in
route(4).

The following options are available:

-n Bypass attempts to print host and network names symbolically when
reporting actions. (The process of translating between symbolic
names and numerical equivalents can be quite time consuming, and
may require correct operation of the network; thus it may be
expedient to forget this, especially when attempting to repair
networking operations).

-v (verbose) Print additional details.

-q Suppress all output.

The route utility provides six commands:

add Add a route.
flush Remove all routes.
delete Delete a specific route.
change Change aspects of a route (such as its gateway).
get Lookup and display the route for a destination.
monitor Continuously report any changes to the routing information
base, routing lookup misses, or suspected network partition­
ings.

The monitor command has the syntax:

route [-n] monitor

The flush command has the syntax:

route [-n] flush [family]

If the flush command is specified, route will ``flush'' the routing
tables of all gateway entries. When the address family may is specified
by any of the -osi, -xns, -atalk, -inet6, or -inet modifiers, only routes
having destinations with addresses in the delineated family will be
deleted.

The other commands have the following syntax:

route [-n] command [-net | -host] destination gateway [netmask]

where destination is the destination host or network, gateway is the
next-hop intermediary via which packets should be routed.Routes to a
particular host may be distinguished from those to a network by inter­
preting the Internet address specified as the destination argument. The
optional modifiers -net and -host force the destination to be interpreted
as a network or a host, respectively. Otherwise, if the destination has
a ``local address part'' of INADDR_ANY (0.0.0.0), or if the destination
is the symbolic name of a network, then the route is assumed to be to a
network; otherwise, it is presumed to be a route to a host. Optionally,
the destination could also be specified in the net/bits format.

For example, 128.32 is interpreted as -host 128.0.0.32; 128.32.130 is
interpreted as -host 128.32.0.130; -net 128.32 is interpreted as
128.32.0.0; -net 128.32.130 is interpreted as 128.32.130.0; and
192.168.64/20 is interpreted as -net 192.168.64 -netmask 255.255.240.0.

A destination of default is a synonym for -net 0.0.0.0, which is the
default route.

If the destination is directly reachable via an interface requiring no
intermediary system to act as a gateway, the -interface modifier should
be specified; the gateway given is the address of this host on the common
network, indicating the interface to be used for transmission. Alter­
nately, if the interface is point to point the name of the interface
itself may be given, in which case the route remains valid even if the
local or remote addresses change.

The optional modifiers -xns, -osi, -atalk, and -link specify that all
subsequent addresses are in the XNS, OSI, or AppleTalk address families,
or are specified as link-level addresses, and the names must be numeric
specifications rather than symbolic names.

The optional -netmask modifier is intended to achieve the effect of an
OSI ESIS redirect with the netmask option, or to manually add subnet
routes with netmasks different from that of the implied network interface
(as would otherwise be communicated using the OSPF or ISIS routing proto­
cols). One specifies an additional ensuing address parameter (to be
interpreted as a network mask). The implicit network mask generated in
the AF_INET case can be overridden by making sure this option follows the
destination parameter.

For AF_INET6, the -prefixlen qualifier is available instead of the -mask
qualifier because non-continuous masks are not allowed in IPv6. For
example, -prefixlen 32 specifies network mask of
ffff:ffff:0000:0000:0000:0000:0000:0000 to be used. The default value of
prefixlen is 64 to get along with the aggregatable address. But 0 is
assumed if default is specified. Note that the qualifier works only for
AF_INET6 address family.

Routes have associated flags which influence operation of the protocols
when sending to destinations matched by the routes. These flags may be
set (or sometimes cleared) by indicating the following corresponding mod­
ifiers:

-cloningRTF_CLONING - generates a new route on use
-xresolveRTF_XRESOLVE - emit mesg on use (for external lookup)
-iface ~RTF_GATEWAY - destination is directly reachable
-staticRTF_STATIC - manually added route
-nostatic ~RTF_STATIC - pretend route added by kernel or daemon
-rejectRTF_REJECT - emit an ICMP unreachable when matched
-blackhole RTF_BLACKHOLE - silently discard pkts (during updates)
-proto1RTF_PROTO1 - set protocol specific routing flag #1
-proto2RTF_PROTO2 - set protocol specific routing flag #2
-llinfoRTF_LLINFO - validly translates proto addr to link addr

The optional modifiers -rtt, -rttvar, -sendpipe, -recvpipe, -mtu,
-hopcount, -expire, and -ssthresh provide initial values to quantities
maintained in the routing entry by transport level protocols, such as TCP
or TP4. These may be individually locked by preceding each such modifier
to be locked by the -lock meta-modifier, or one can specify that all
ensuing metrics may be locked by the -lockrest meta-modifier.

In a change or add command where the destination and gateway are not suf­
ficient to specify the route (as in the ISO case where several interfaces
may have the same address), the -ifp or -ifa modifiers may be used to
determine the interface or interface address.

The optional -proxy modifier specifies that the RTF_LLINFO routing table
entry is the ``published (proxy-only)'' ARP entry, as reported by arp(8).

All symbolic names specified for a destination or gateway are looked up
first as a host name using gethostbyname(3). If this lookup fails,
getnetbyname(3) is then used to interpret the name as that of a network.

Route uses a routing socket and the new message types RTM_ADD,
RTM_DELETE, RTM_GET, and RTM_CHANGE. As such, only the super-user may
modify the routing tables.

DIAGNOSTICS
add [host | network ] %s: gateway %s flags %x The specified route is
being added to the tables. The values printed are from the routing table
entry supplied in the ioctl(2) call. If the gateway address used was not
the primary address of the gateway (the first one returned by
gethostbyname(3)), the gateway address is printed numerically as well as
symbolically.

delete [ host | network ] %s: gateway %s flags %xAs above, but when
deleting an entry.

%s %s done When the flush command is specified, each routing table entry
deleted is indicated with a message of this form.

Network is unreachable An attempt to add a route failed because the
gateway listed was not on a directly-connected network. The next-hop
gateway must be given.

not in table A delete operation was attempted for an entry which wasn't
present in the tables.

routing table overflow An add operation was attempted, but the system
was low on resources and was unable to allocate memory to create the new
entry.

gateway uses the same route A change operation resulted in a route whose
gateway uses the same route as the one being changed. The next-hop gate­
way should be reachable through a different route.

The route utility exits 0 on success, and >0 if an error occurs.

SEE ALSO
netintro(4), route(4), arp(8), IPXrouted(8), routed(8)

HISTORY
The route command appeared in 4.2BSD.

BUGS
The first paragraph may have slightly exaggerated routed(8)'s abilities.

FreeBSD 4.5 June 8, 2001 FreeBSD 4.5

Acties:
  • 0 Henk 'm!

Verwijderd

kan je niet gewoon je modem tweaken naar router ...? zo gebruik ik hem met freebsd 4.4 en 4.5 zonder problemen (niks geen ppp of pptp

Acties:
  • 0 Henk 'm!

Verwijderd

Maar dan zit je (in mijn geval dan) met dubbele natting. het schijnt mogelijk te zijn om het interne ip adres van de alcatel te veranderen, maar dat heb ik nog niet aan de praat gekregen..
De reden dat dit niet werkt is dat de BSD tcp/ip stack geen route accepteerd, als de destination niet in hetzelfde subnet van het ip van je externe if zit.

/me gaat het oplossen door een pix doos erachter te zetten :9

Acties:
  • 0 Henk 'm!

  • SvMp
  • Registratie: September 2000
  • Niet online
Op woensdag 29 mei 2002 22:22 schreef mdd het volgende:
Lukt het wel als je je netwerkkaart via /stand/sysinstall configureert ?
Nee natuurlijk niet, anders had ik dit topic niet gepost.
Het probleem is dat de router buiten het bereik van het netwerk van het IP ligt, dus het werkt niet zonder een work-around.
Op woensdag 29 mei 2002 22:30 schreef mdd een volkomen nutteloze reply
Alsof ik die manpage zelf niet heb doorgelezen |:(

Ik weet niet eens precies wat er met die route commando's wordt gedaan, hoe kan ik dan ooit die manpage gebruiken.
Ik heb al de hele middag verstierd door naar die manpage te loeren en van alles te proberen |:( |:( |:( |:(
Op woensdag 29 mei 2002 22:36 schreef HAL-9000 het volgende:
kan je niet gewoon je modem tweaken naar router ...? zo gebruik ik hem met freebsd 4.4 en 4.5 zonder problemen (niks geen ppp of pptp
Vind ik een beetje omslachtig.
SIP is dé oplossing. Ik wil namelijk helemaal geen router, de router is die BSD bak namelijk al, het is tevens een server dus offtopic discussies over modem als router of PC als router zijn hier overbodig.
Op woensdag 29 mei 2002 22:46 schreef r3b00t het volgende:
Maar dan zit je (in mijn geval dan) met dubbele natting. het schijnt mogelijk te zijn om het interne ip adres van de alcatel te veranderen, maar dat heb ik nog niet aan de praat gekregen..
De reden dat dit niet werkt is dat de BSD tcp/ip stack geen route accepteerd, als de destination niet in hetzelfde subnet van het ip van je externe if zit.

* SvMp gaat het oplossen door een pix doos erachter te zetten :9
Daar heeft het dus geen donder mee te maken, want ik heb de zooi nu onder Windows 2000 aan de gang. (na reboot :r en nu dus op 1 machine internet en vanaf die machine mijn server onbereikbaar omdat er maar 1 netwerkkaart in zit |:( )
Het is puur het BSD gedeelte dat problemen heeft.
Het lijkt mij sterk dat die route niet wordt geaccepteerd, aangezien het zelfs onder Windows en Linux werkt.


Het resultaat van dit topic valt mij erg tegen.
Er is toch wel een BSD gebruiker die deze SIP tweak heeft uitgevoerd?
Damn..moet het nou zo omslachtig en moeilijk.
Mijn hele dag naar de klote door dit gepruts |:( :r
En waarom moet het nou zo omslachtig met pptp en zo...dat werkt alleen goed voor Windows gebruikers, maar voor de rest om te :r en ik snap niet dat als het modem het zelf kan (de SIP tweak bewijst het) dat KPN en de providers dat niet standaard zo leveren |:(

Acties:
  • 0 Henk 'm!

  • SvMp
  • Registratie: September 2000
  • Niet online
Uit ander topic:
Op woensdag 17 april 2002 07:31 schreef dystopia het volgende:
Yeah, ik gebruik ook SIP en het werkt, ook icm. 4 IP's. Je moet dan alleen wat spelen met de routing tabbelen van je modem. Het werkt stabieler dan de PPTP of DHCP methodes en werkte binnen 5 tellen op m'n OpenBSD router.

:)

Behalve dat het even moeite kost zie ik niet in waarom je deze methode niet zou willen gebruiken.
Het kan dus wel...

Acties:
  • 0 Henk 'm!

  • AVL
  • Registratie: Januari 2000
  • Laatst online: 25-09-2022

AVL

OHMSS

Met Google vond ik deze link. Hier staat een stap-voor-stap uitleg van iemand die het zo werkend kreeg. Ik hoop dat het helpt.

"I'd rather have a bottle in front of me than a frontal lobotomy."


Acties:
  • 0 Henk 'm!

  • Jelmer
  • Registratie: Maart 2000
  • Laatst online: 22:10
Nou ik zal dat laatste ook maar meteen in de howto van mij opnemen, want dat lijkt me wel erg handig voor alle andere (Free)BSD mensen :)

Acties:
  • 0 Henk 'm!

  • SvMp
  • Registratie: September 2000
  • Niet online
Het werkt!!!!! :) :)

Ik heb GoTter dystopia gesproken via ICQ, en hij gaf de commando lines die hij heeft gebruikt

De werkende oplossing:
code:
1
2
3
ifconfig extern_nic0 inet extern_ip netmask 255.255.255.255 broadcast 255.255.255.255
route add 10.0.0.0/24 extern_ip -interface
route add default 10.0.0.138

Bedankt dystopia!!!
Op woensdag 29 mei 2002 23:41 schreef AVL het volgende:
Met Google vond ik deze link. Hier staat een stap-voor-stap uitleg van iemand die het zo werkend kreeg. Ik hoop dat het helpt.
Coole reply :)
Toch is de manier van dystopia anders, maar het kan blijkbaar op meerdere manieren.
Op woensdag 29 mei 2002 23:58 schreef Jelmer Barhorst het volgende:
Nou ik zal dat laatste ook maar meteen in de howto van mij opnemen, want dat lijkt me wel erg handig voor alle andere BSD mensen :)
Inderdaad..zodra je niet 100% begrijp wat er bij deze truuc gebeurt (ik snap de basisprincipes wel, maar dat routeringgebeuren begrijp ik niet tot in de details) dan is het heel moeilijk om die Linux route commando's om te zetten naar commando-regels die op een BSD werken. Ik zat er met mijn verspilde uren gepruts van vanmiddag (dag vrije middag) heel dicht bij, maar toch bleek de werkende oplossing (van dystopia) toch net iets anders te zijn en zo kun je uren bezig zijn wat echt frustrerend is, want je kunt tussentijds niet ff internet op om verder te zoeken (behalve dan met je modem)

Zeer nuttig dus voor je howto, al zal ik als ik jou was de regels van dystopia omdat die imho wat simpeler zijn. (je houdt gewoon 10.0.0.138 op je modem, in plaats van het vage IP dat in die nieuwsgroup-post wordt gebruikt)

Ik denk dat je zo iets aan je howto moet toevoegen:
FreeBSD/OpenBSD
Tot zover de configuratie van het modem, nu de instellingen van je OS. Voor FreeBSD en OpenBSD gaat dit als volgt...

Doe het volgende als root:
ifconfig dc1 inet a.b.c.d netmask 255.255.255.255 broadcast 255.255.255.255
route add 10.0.0.0/24 a.b.c.d -interface
route add default 10.0.0.138

Ook hier moet je a.b.c.d weer vervangen door je externe ip. Zorg ook dat je de juiste interface opgeeft, ik zelf heb het modem rechtstreeks op een tweede NIC hangen (dc1). Vervang dc1 dus voor de interface waar jij het modem aan hebt hangen.
Pagina: 1